| 1 |
// REQUIRES: amdgpu-registered-target |
| 2 |
|
| 3 |
// RUN: %clang_cc1 -triple x86_64-mingw64 -emit-llvm-bc -target-cpu x86-64 -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -o %t.bc -x c++ %s |
| 4 |
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -aux-triple x86_64-mingw64 -fsyntax-only -target-cpu gfx900 -fopenmp -fopenmp-is-target-device -fopenmp-host-ir-file-path %t.bc -x c++ %s |
| 5 |
// expected-no-diagnostics |
| 6 |
|
| 7 |
void print(double); |
| 8 |
|
| 9 |
constexpr double operator"" _X (long double a) |
| 10 |
{ |
| 11 |
return (double)a; |
| 12 |
} |
| 13 |
|
| 14 |
int main() |
| 15 |
{ |
| 16 |
auto a = 1._X; |
| 17 |
print(a); |
| 18 |
#pragma omp target map(tofrom: a) |
| 19 |
{ |
| 20 |
#pragma omp teams num_teams(1) thread_limit(4) |
| 21 |
{ |
| 22 |
a += 1._X; |
| 23 |
} |
| 24 |
} |
| 25 |
print(a); |
| 26 |
return 0; |
| 27 |
} |