Retro68/gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/atomic_rw-1.c
2017-04-10 13:32:00 +02:00

35 lines
347 B
C

/* { dg-do run } */
#include <stdlib.h>
int
main(int argc, char **argv)
{
int v1, v2;
int x;
x = 99;
#pragma acc parallel copy (v1, v2, x)
{
#pragma acc atomic read
v1 = x;
#pragma acc atomic write
x = 32;
#pragma acc atomic read
v2 = x;
}
if (v1 != 99)
abort ();
if (v2 != 32)
abort ();
return 0;
}