Debian Codegraph @

libgomp/testsuite/libgomp.oacc-fortran/declare-3.f90

raw
1 ! { dg-do run }
2 ! { dg-skip-if "" { *-*-* } { "-DACC_MEM_SHARED=1" } }
3
4 module globalvars
5 implicit none
6 real b
7 !$acc declare link (b)
8 end module globalvars
9
10 program test
11 use openacc
12 use globalvars
13 implicit none
14
15 real a
16 real c
17 !$acc declare link (c)
18
19 if (acc_is_present (b) .neqv. .false.) STOP 1
20 if (acc_is_present (c) .neqv. .false.) STOP 2
21
22 a = 0.0
23 b = 1.0
24
25 !$acc parallel copy (a) copyin (b)
26 b = b + 4.0
27 a = b
28 !$acc end parallel
29
30 if (a .ne. 5.0) STOP 3
31
32 if (acc_is_present (b) .neqv. .false.) STOP 4
33
34 a = 0.0
35
36 !$acc parallel copy (a) create (b)
37 b = 4.0
38 a = b
39 !$acc end parallel
40
41 if (a .ne. 4.0) STOP 5
42
43 if (acc_is_present (b) .neqv. .false.) STOP 6
44
45 a = 0.0
46
47 !$acc parallel copy (a) copy (b)
48 b = 4.0
49 a = b
50 !$acc end parallel
51
52 if (a .ne. 4.0) STOP 7
53 if (b .ne. 4.0) STOP 8
54
55 if (acc_is_present (b) .neqv. .false.) STOP 9
56
57 a = 0.0
58
59 !$acc parallel copy (a) copy (b) copy (c)
60 b = 4.0
61 c = b
62 a = c
63 !$acc end parallel
64
65 if (a .ne. 4.0) STOP 10
66
67 if (acc_is_present (b) .neqv. .false.) STOP 11
68
69 end program test