Retro68/gcc/libgomp/testsuite/libgomp.c++/target-this-5.C
2022-10-27 20:55:19 +02:00

31 lines
416 B
C

extern "C" void abort ();
template<typename T>
struct S
{
T a, b, c, d;
T sum (void)
{
T val = 0;
val += a + b + this->c + this->d;
return val;
}
T sum_offload (void)
{
T val = 0;
#pragma omp target map(val)
val += a + b + this->c + this->d;
return val;
}
};
int main (void)
{
S<int> s = { 1, 2, 3, 4 };
if (s.sum () != s.sum_offload ())
abort ();
return 0;
}