Files
clang-p2996/clang/test/OpenMP/amdgcn_ldbl_check.cpp
Qiu Chaofan 0195f8621f [Clang] Fix long double availability check
fae0dfa changed code to check 128-bit float availability, since it
introduced a new 128-bit double type on PowerPC. However, there're other
long float types besides IEEE float128 and PPC double-double requiring
this feature.

Reviewed By: ronlieb

Differential Revision: https://reviews.llvm.org/D109943
2021-09-17 15:24:06 +08:00

28 lines
648 B
C++

// REQUIRES: amdgpu-registered-target
// 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
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -aux-triple x86_64-mingw64 -fsyntax-only -target-cpu gfx900 -fopenmp -fopenmp-is-device -fopenmp-host-ir-file-path %t.bc -x c++ %s
// expected-no-diagnostics
void print(double);
constexpr double operator"" _X (long double a)
{
return (double)a;
}
int main()
{
auto a = 1._X;
print(a);
#pragma omp target map(tofrom: a)
{
#pragma omp teams num_teams(1) thread_limit(4)
{
a += 1._X;
}
}
print(a);
return 0;
}