summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-06-18 18:39:26 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-06-18 18:39:26 +0000
commit8557d1ac98847565d706e19a426d044504b9a1aa (patch)
treea9c51d6e9f1cb19c9c87f5991776a6dcfe4b3c0f /clang/test
parent5bef886cd8e541cca299a479068f36c567cbf401 (diff)
downloadbcm5719-llvm-8557d1ac98847565d706e19a426d044504b9a1aa.tar.gz
bcm5719-llvm-8557d1ac98847565d706e19a426d044504b9a1aa.zip
[OPENMP]Use host's long double when compiling the code for device.
The device code must use the same long double type as the host. Otherwise the code cannot be linked and executed properly. Patch adds only basic support and checks for supporting of the host long double double on the device. llvm-svn: 363717
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/OpenMP/nvptx_unsupported_type_messages.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/clang/test/OpenMP/nvptx_unsupported_type_messages.cpp b/clang/test/OpenMP/nvptx_unsupported_type_messages.cpp
index 6e0fa3b1d5b..67f2e41ac4a 100644
--- a/clang/test/OpenMP/nvptx_unsupported_type_messages.cpp
+++ b/clang/test/OpenMP/nvptx_unsupported_type_messages.cpp
@@ -1,13 +1,24 @@
// Test target codegen - host bc file has to be created first.
// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-linux -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-host.bc
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -fsyntax-only
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple x86_64-unknown-linux -fopenmp-targets=nvptx64-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -fsyntax-only
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-linux-gnu -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-host.bc
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-linux-gnu -fopenmp-targets=nvptx64-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -fsyntax-only
struct T {
char a;
+#ifndef _ARCH_PPC
__float128 f;
+#else
+ long double f;
+#endif
char c;
T() : a(12), f(15) {}
- T &operator+(T &b) { f += b.a; return *this;} // expected-error {{'__float128' is not supported on this target}}
+#ifndef _ARCH_PPC
+// expected-error@+4 {{'__float128' is not supported on this target}}
+#else
+// expected-error@+2 {{'long double' is not supported on this target}}
+#endif
+ T &operator+(T &b) { f += b.a; return *this;}
};
struct T1 {
OpenPOWER on IntegriCloud