LLVM OpenMP
21.0.0git
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
c
d
e
g
h
i
m
n
p
r
s
t
u
Functions
c
d
e
g
i
m
n
p
r
s
u
Variables
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
w
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
Enumerations
Enumerator
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Typedefs
_
a
b
c
d
e
i
k
l
m
n
o
p
r
t
u
Enumerations
_
b
c
d
f
k
l
n
o
s
t
Enumerator
_
a
b
c
d
e
f
k
l
n
o
p
r
s
t
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
runtime
test
worksharing
sections
omp_section_firstprivate.c
Go to the documentation of this file.
1
// RUN: %libomp-compile-and-run
2
#include <stdio.h>
3
#include "
omp_testsuite.h
"
4
5
int
test_omp_section_firstprivate
()
6
{
7
int
sum
;
8
int
sum0
;
9
int
known_sum;
10
11
sum0
= 11;
12
sum
= 7;
13
#pragma omp parallel
14
{
15
#pragma omp sections firstprivate(sum0)
16
{
17
#pragma omp section
18
{
19
#pragma omp critical
20
{
21
sum
=
sum
+
sum0
;
22
}
23
}
24
#pragma omp section
25
{
26
#pragma omp critical
27
{
28
sum
=
sum
+
sum0
;
29
}
30
}
31
#pragma omp section
32
{
33
#pragma omp critical
34
{
35
sum
=
sum
+
sum0
;
36
}
37
}
38
}
39
}
40
known_sum = 11 * 3 + 7;
41
return
(known_sum ==
sum
);
42
}
/* end of check_section_firstprivate*/
43
44
int
main
()
45
{
46
int
i
;
47
int
num_failed=0;
48
49
for
(
i
= 0;
i
<
REPETITIONS
;
i
++) {
50
if
(!
test_omp_section_firstprivate
()) {
51
num_failed++;
52
}
53
}
54
return
num_failed;
55
}
i
#define i
Definition:
kmp_stub.cpp:87
sum
int sum
Definition:
omp_for_schedule_runtime.c:19
test_omp_section_firstprivate
int test_omp_section_firstprivate()
Definition:
omp_section_firstprivate.c:5
main
int main()
Definition:
omp_section_firstprivate.c:44
omp_testsuite.h
REPETITIONS
#define REPETITIONS
Definition:
omp_testsuite.h:13
sum0
static int sum0
Definition:
omp_threadprivate.c:14
Generated on Thu Aug 14 2025 14:11:32 for LLVM OpenMP by
1.9.6