target-print-1.c 253 B

1234567891011121314151617
  1. /* Ensure that printf on the offload device works. */
  2. /* { dg-do run } */
  3. /* { dg-output "The answer is 42(\n|\r\n|\r)+" } */
  4. #include <stdio.h>
  5. int var = 42;
  6. int
  7. main ()
  8. {
  9. #pragma omp target
  10. {
  11. printf ("The answer is %d\n", var);
  12. }
  13. }