Retro68/gcc/libgomp/testsuite/libgomp.c++/declare_target-1.C

39 lines
474 B
C++
Raw Normal View History

2015-08-28 15:33:40 +00:00
// { dg-do run }
2017-04-10 11:32:00 +00:00
// { dg-require-effective-target offload_device_shared_as }
2015-08-28 15:33:40 +00:00
#include <stdlib.h>
struct typeX
{
int a;
};
class typeY
{
public:
int foo () { return a^0x01; }
int a;
};
#pragma omp declare target
struct typeX varX;
class typeY varY;
#pragma omp end declare target
int main ()
{
varX.a = 0;
varY.a = 0;
#pragma omp target
{
varX.a = 100;
varY.a = 100;
}
if (varX.a != 100 || varY.a != 100)
abort ();
return 0;
}