Debian Codegraph @

libgomp/testsuite/libgomp.fortran/combined-directive-splitting-1.f90

raw
1 module m
2 integer :: a = 1
3 !$omp declare target enter(a)
4 end module m
5
6 module m2
7 contains
8 subroutine bar()
9 use m
10 implicit none
11 !$omp declare target
12 a = a + 5
13 end subroutine bar
14 end module m2
15
16 program p
17 use m
18 use m2
19 implicit none
20 integer :: b, i
21
22 !$omp target parallel do map(always, tofrom: a) firstprivate(a)
23 do i = 1, 1
24 a = 7
25 call bar()
26 if (a /= 7) error stop 1
27 a = a + 8
28 end do
29 if (a /= 6) error stop 2
30
31 b = 3
32 !$omp target parallel do map(always, tofrom: a) firstprivate(b)
33 do i = 1, 1
34 a = 3
35 call bar ()
36 if (a /= 8) error stop 3
37 a = a + b
38 end do
39 if (a /= 11) error stop 4
40 end program p
41