Debian Codegraph @

libgomp/testsuite/libgomp.fortran/target-firstprivate-1.f90

raw
1 ! PR fortran/104949
2
3 implicit none (type,external)
4 integer, allocatable :: A(:)
5 A = [1,2,3,4,5,6]
6
7 !$omp parallel firstprivate(A)
8 !$omp master
9 if (any (A /= [1,2,3,4,5])) error stop
10 A(:) = [99,88,77,66,55]
11 !$omp end master
12 !$omp end parallel
13
14 !$omp target firstprivate(A)
15 if (any (A /= [1,2,3,4,5])) error stop
16 A(:) = [99,88,77,66,55]
17 !$omp end target
18 if (any (A /= [1,2,3,4,5])) error stop
19
20 !$omp parallel default(firstprivate)
21 !$omp master
22 if (any (A /= [1,2,3,4,5])) error stop
23 A(:) = [99,88,77,66,55]
24 !$omp end master
25 !$omp end parallel
26 if (any (A /= [1,2,3,4,5])) error stop
27
28 !$omp target defaultmap(firstprivate)
29 if (any (A /= [1,2,3,4,5])) error stop
30 A(:) = [99,88,77,66,55]
31 !$omp end target
32 if (any (A /= [1,2,3,4,5])) error stop
33 end