1 extern "C" void abort (void);
2 struct S { int e, f; };
5 foo (int *&p, int (&s)[5], int &t, S &u, int n)
7 int a[4] = { 7, 8, 9, 10 }, b[n], c[3] = { 20, 21, 22 };
8 int *r = a + 1, *q = p - 1, i, err;
11 for (i = 0; i < n; i++)
13 #pragma omp target data map(to:a) use_device_ptr(r) map(from:err)
14 #pragma omp target is_device_ptr(r) private(i) map(from:err)
17 for (i = 0; i < 4; i++)
18 if (r[i - 1] != 7 + i)
23 #pragma omp target data use_device_ptr(p) map(from:err) map(to:q[:4])
24 #pragma omp target is_device_ptr(p) private(i) map(from:err)
27 for (i = 0; i < 4; i++)
33 #pragma omp target data map(to:b) use_device_addr(b) map(from:err)
34 #pragma omp target is_device_ptr(b) private(i) map(from:err)
37 for (i = 0; i < n; i++)
43 #pragma omp target data use_device_addr(c) map(to:c) map(from:err)
44 #pragma omp target is_device_ptr(c) private(i) map(from:err)
47 for (i = 0; i < 3; i++)
53 #pragma omp target data map(to:s[:5]) use_device_addr(s) map(from:err)
54 #pragma omp target is_device_ptr(s) private(i) map(from:err)
57 for (i = 0; i < 5; i++)
63 #pragma omp target data use_device_addr (v) map(to: v) map(to:u) use_device_addr (u) map(from:err)
67 #pragma omp target is_device_ptr (z, x) map(from:err)
70 if (*z != 27 || x->e != 25 || x->f != 26)
76 #pragma omp target data map(to: t) use_device_addr (t, w) map (to: w) map(from:err)
80 #pragma omp target is_device_ptr (z) is_device_ptr (x) map(from:err)
83 if (*z != 24 || x->e != 28 || x->f != 29)
94 int a[4] = { 0, 1, 2, 3 }, b[5] = { 17, 18, 19, 20, 21 };