gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c

28 lines
518 B
C
Raw Normal View History

Also test -O0 for OpenACC C, C++ offloading test cases libgomp/ * testsuite/libgomp.oacc-c++/c++.exp: Set up torture testing, use gcc-dg-runtest. * testsuite/libgomp.oacc-c/c.exp: Likewise. * testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c: Specify -fno-builtin-acc_on_device instead of -O0. * testsuite/libgomp.oacc-c-c++-common/acc-on-device.c: Skip for -O0. * testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-g-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-g-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-v-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-w-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/routine-g-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/routine-v-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/routine-w-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c: Don't specify -O2. * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c: Likewise. From-SVN: r234471
2016-03-24 22:29:55 +01:00
/* { dg-additional-options "-fipa-pta" } */
#include <stdlib.h>
#define N 2
int
main (void)
{
unsigned int *a = (unsigned int *)malloc (N * sizeof (unsigned int));
unsigned int *b = (unsigned int *)malloc (N * sizeof (unsigned int));
unsigned int *c = (unsigned int *)malloc (N * sizeof (unsigned int));
#pragma acc kernels pcopyout (a[0:N], b[0:N], c[0:N])
{
a[0] = 0;
b[0] = 1;
c[0] = a[0];
}
if (a[0] != 0 || b[0] != 1 || c[0] != 0)
abort ();
free (a);
free (b);
free (c);
}