libgomp/testsuite/libgomp.c-c++-common/target-41.c
raw| 1 | /* PR libgomp/100573 */ |
| 2 | |
| 3 | int |
| 4 | foo (int a) |
| 5 | { |
| 6 | if (a == 0) |
| 7 | { |
| 8 | int c; |
| 9 | a++; |
| 10 | #pragma omp target map(tofrom:a) |
| 11 | a = foo (a); |
| 12 | #pragma omp target data map(tofrom:a) |
| 13 | c = a != 2; |
| 14 | if (c) |
| 15 | return -1; |
| 16 | #pragma omp target enter data map(to:a) |
| 17 | #pragma omp target exit data map(from:a) |
| 18 | } |
| 19 | return a + 1; |
| 20 | } |
| 21 | |
| 22 | int |
| 23 | main () |
| 24 | { |
| 25 | if (foo (0) != 3) |
| 26 | __builtin_abort (); |
| 27 | return 0; |
| 28 | } |