1 extern void abort (void);
6 int a
= 1, b
= 2, c
= 4, d
[7];
9 #pragma omp target enter data nowait map (to: a, b, c) depend(out: d[0])
10 #pragma omp target nowait map (alloc: a, b) depend(in: d[0]) depend(out: d[1])
12 #pragma omp atomic update
14 #pragma omp atomic update
17 #pragma omp target nowait map (alloc: a, c) depend(in: d[0]) depend(out: d[2])
19 #pragma omp atomic update
21 #pragma omp atomic update
24 #pragma omp target exit data nowait map (from: a, b, c) depend(in: d[1], d[2])
26 if (a
!= 21 || b
!= 10 || c
!= 36)
28 #pragma omp target map (tofrom: a, b) nowait
33 #pragma omp target map (tofrom: c) nowait
38 if (a
!= 5 || b
!= 8 || c
!= 44)
40 #pragma omp target map (tofrom: a, b) nowait
45 #pragma omp target map (tofrom: c) nowait
50 if (a
!= 37 || b
!= 12 || c
!= 40)
52 #pragma omp target nowait map (tofrom: a, b) depend(out: d[3])
54 #pragma omp atomic update
58 #pragma omp target nowait map (tofrom: a, c) depend(out: d[4])
60 #pragma omp atomic update
64 #pragma omp task if (0) depend (in: d[3], d[4]) shared (a, b, c)
65 if (a
!= 50 || b
!= 4 || c
!= 20)
67 #pragma omp task shared (a)
69 #pragma omp target nowait map (tofrom: b)
71 #pragma omp target map (tofrom: c) nowait
74 if (a
!= 100 || b
!= 5 || c
!= 19)
76 #pragma omp target map (tofrom: a) nowait depend(out: d[5])
78 #pragma omp target map (tofrom: b) nowait depend(out: d[6])
80 #pragma omp target map (tofrom: a, b) depend(in: d[5], d[6])
82 if (a
!= 101 || b
!= 6)
90 if (a
!= 24 || b
!= 38)