| 1 |
/* PR libgomp/93515 */ |
| 2 |
|
| 3 |
#include <omp.h> |
| 4 |
#include <stdlib.h> |
| 5 |
|
| 6 |
int |
| 7 |
main () |
| 8 |
{ |
| 9 |
int i; |
| 10 |
int a = 42; |
| 11 |
#pragma omp target teams distribute parallel for defaultmap(tofrom: scalar) |
| 12 |
for (i = 0; i < 64; ++i) |
| 13 |
if (omp_get_team_num () == 0) |
| 14 |
if (omp_get_thread_num () == 0) |
| 15 |
a = 142; |
| 16 |
if (a != 142) |
| 17 |
__builtin_abort (); |
| 18 |
a = 42; |
| 19 |
#pragma omp target parallel for defaultmap(tofrom: scalar) |
| 20 |
for (i = 0; i < 64; ++i) |
| 21 |
if (omp_get_thread_num () == 0) |
| 22 |
a = 143; |
| 23 |
if (a != 143) |
| 24 |
__builtin_abort (); |
| 25 |
a = 42; |
| 26 |
#pragma omp target firstprivate(a) |
| 27 |
{ |
| 28 |
#pragma omp parallel for |
| 29 |
for (i = 0; i < 64; ++i) |
| 30 |
if (omp_get_thread_num () == 0) |
| 31 |
a = 144; |
| 32 |
if (a != 144) |
| 33 |
abort (); |
| 34 |
} |
| 35 |
return 0; |
| 36 |
} |