aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-c/print-1.c
blob: 593885b5c2cd86043167754d19463b49c3a3cb40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Ensure that printf on the offload device works.  */

/* { dg-do run } */
/* { dg-output "The answer is 42(\n|\r\n|\r)+" } */

#include <stdio.h>

int var = 42;

int
main ()
{
#pragma acc parallel
    {
      printf ("The answer is %d\n", var);
    }
}