| 1 |
/* { dg-skip-if "" { *-*-* } } */ |
| 2 |
/* Used by target-same-name-2.c */ |
| 3 |
|
| 4 |
#include <complex> |
| 5 |
|
| 6 |
template<typename T> |
| 7 |
int |
| 8 |
test_map () |
| 9 |
{ |
| 10 |
std::complex<T> a(2, 1), a_check; |
| 11 |
#pragma omp target map(from : a_check) |
| 12 |
{ |
| 13 |
a_check = a; |
| 14 |
} |
| 15 |
if (a == a_check) |
| 16 |
return 42; |
| 17 |
return 0; |
| 18 |
} |
| 19 |
|
| 20 |
template<typename T> |
| 21 |
static int |
| 22 |
test_map_static () |
| 23 |
{ |
| 24 |
std::complex<T> a(-4, 5), a_check; |
| 25 |
#pragma omp target map(from : a_check) |
| 26 |
{ |
| 27 |
a_check = a; |
| 28 |
} |
| 29 |
if (a == a_check) |
| 30 |
return 441; |
| 31 |
return 0; |
| 32 |
} |
| 33 |
|
| 34 |
int |
| 35 |
test_a () |
| 36 |
{ |
| 37 |
int res = test_map<float>(); |
| 38 |
if (res != 42) |
| 39 |
__builtin_abort (); |
| 40 |
return res; |
| 41 |
} |
| 42 |
|
| 43 |
int |
| 44 |
test_a2 () |
| 45 |
{ |
| 46 |
int res = test_map_static<float>(); |
| 47 |
if (res != 441) |
| 48 |
__builtin_abort (); |
| 49 |
return res; |
| 50 |
} |