diff options
Diffstat (limited to 'libgomp/testsuite/libgomp.c/examples-4/e.56.3.c')
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/e.56.3.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.56.3.c b/libgomp/testsuite/libgomp.c/examples-4/e.56.3.c new file mode 100644 index 00000000000..4f4649ae244 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/examples-4/e.56.3.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ + +#include <stdlib.h> + +void foo () +{ + int A[30], *p; + #pragma omp target data map(A[0:4]) + { + p = &A[0]; + #pragma omp target map(p[7:20]) map(A[0:4]) + { + A[2] = 777; + p[8] = 777; + } + } + + if (A[2] != 777 || A[8] != 777) + abort (); +} + +int main () +{ + foo (); + return 0; +} |