target-42.c 713 B

1234567891011121314151617181920212223242526
  1. /* PR libgomp/100573 */
  2. int
  3. foo (int a)
  4. {
  5. #pragma omp target firstprivate(a)
  6. if (a == 0)
  7. {
  8. a++;
  9. #pragma omp target map(tofrom:a) /* { dg-warning "'target' construct inside of 'target' region" } */
  10. a = foo (a);
  11. #pragma omp target data map(tofrom:a) /* { dg-warning "'target data' construct inside of 'target' region" } */
  12. a++;
  13. #pragma omp target enter data map(to:a) /* { dg-warning "'target enter data' construct inside of 'target' region" } */
  14. #pragma omp target exit data map(from:a) /* { dg-warning "'target exit data' construct inside of 'target' region" } */
  15. }
  16. return a + 1;
  17. }
  18. int
  19. main ()
  20. {
  21. if (foo (1) != 2)
  22. __builtin_abort ();
  23. return 0;
  24. }