diff options
Diffstat (limited to 'libgomp/testsuite/libgomp.hsa.c/pr82416.c')
-rw-r--r-- | libgomp/testsuite/libgomp.hsa.c/pr82416.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.hsa.c/pr82416.c b/libgomp/testsuite/libgomp.hsa.c/pr82416.c new file mode 100644 index 0000000..b89d421 --- /dev/null +++ b/libgomp/testsuite/libgomp.hsa.c/pr82416.c @@ -0,0 +1,37 @@ +char __attribute__ ((noipa)) +toup (char X) +{ + if (X >= 97 && X <= 122) + return X - 32; + else + return X; +} + +char __attribute__ ((noipa)) +target_toup (char X) +{ + char r; +#pragma omp target map(to:X) map(from:r) + { + if (X >= 97 && X <= 122) + r = X - 32; + else + r = X; + } + return r; +} + +int main (int argc, char **argv) +{ + char a = 'a'; + if (toup (a) != target_toup (a)) + __builtin_abort (); + a = 'Z'; + if (toup (a) != target_toup (a)) + __builtin_abort (); + a = 5; + if (toup (a) != target_toup (a)) + __builtin_abort (); + + return 0; +} |