gcc/libgomp/testsuite/libgomp.oacc-c/print-1.c
Andrew Stubbs 8916ba874d Add tests for print from offload target.
2019-11-15  Andrew Stubbs  <ams@codesourcery.com>

	libgomp/
	* testsuite/libgomp.c/target-print-1.c: New file.
	* testsuite/libgomp.fortran/target-print-1.f90: New file.
	* testsuite/libgomp.oacc-c/print-1.c: New file.
	* testsuite/libgomp.oacc-fortran/print-1.f90: New file.

From-SVN: r278284
2019-11-15 10:49:10 +00:00

18 lines
255 B
C

/* 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);
}
}