summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorStefan Pintilie <stefanp@ca.ibm.com>2018-06-13 16:05:05 +0000
committerStefan Pintilie <stefanp@ca.ibm.com>2018-06-13 16:05:05 +0000
commita6ce3fe72b5cd32bf5e3a139b3cc6844bf0cc715 (patch)
tree14c38705f824baf9886eebd8a88aab1affb2be60 /clang/test
parentcffb235afe4144b392229de54d357ebb9dc3059a (diff)
downloadbcm5719-llvm-a6ce3fe72b5cd32bf5e3a139b3cc6844bf0cc715.tar.gz
bcm5719-llvm-a6ce3fe72b5cd32bf5e3a139b3cc6844bf0cc715.zip
[PowerPC] The __float128 type should only be available on Power9
Diasble the use of the type __float128 for PPC machines older than Power9. The use of -mfloat128 for PPC machine older than Power9 will result in an error. Differential Revision: https://reviews.llvm.org/D48088 llvm-svn: 334613
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Driver/ppc-f128-support-check.c20
-rw-r--r--clang/test/Preprocessor/init.c2
-rw-r--r--clang/test/Sema/float128-ld-incompatibility.cpp2
3 files changed, 22 insertions, 2 deletions
diff --git a/clang/test/Driver/ppc-f128-support-check.c b/clang/test/Driver/ppc-f128-support-check.c
new file mode 100644
index 00000000000..24748905612
--- /dev/null
+++ b/clang/test/Driver/ppc-f128-support-check.c
@@ -0,0 +1,20 @@
+// RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \
+// RUN: -mcpu=pwr9 -mfloat128 %s 2>&1 | FileCheck %s --check-prefix=HASF128
+// RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \
+// RUN: -mcpu=power9 -mfloat128 %s 2>&1 | FileCheck %s --check-prefix=HASF128
+
+// RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \
+// RUN: -mcpu=pwr8 -mfloat128 %s 2>&1 | FileCheck %s --check-prefix=NOF128
+// RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \
+// RUN: -mcpu=pwr7 -mfloat128 %s 2>&1 | FileCheck %s --check-prefix=NOF128
+// RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \
+// RUN: -mfloat128 %s 2>&1 | FileCheck %s --check-prefix=NOF128
+
+#ifdef __FLOAT128__
+static_assert(false, "__float128 enabled");
+#endif
+
+// HASF128: __float128 enabled
+// HASF128-NOT: option '-mfloat128' cannot be specified with
+// NOF128: option '-mfloat128' cannot be specified with
+
diff --git a/clang/test/Preprocessor/init.c b/clang/test/Preprocessor/init.c
index 4adbcfce2e9..6dedf26a24f 100644
--- a/clang/test/Preprocessor/init.c
+++ b/clang/test/Preprocessor/init.c
@@ -6370,7 +6370,7 @@
// PPCPOWER9:#define _ARCH_PWR7 1
// PPCPOWER9:#define _ARCH_PWR9 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-feature +float128 -target-cpu power8 -fno-signed-char < /dev/null | FileCheck -check-prefix PPC-FLOAT128 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-feature +float128 -target-cpu power9 -fno-signed-char < /dev/null | FileCheck -check-prefix PPC-FLOAT128 %s
// PPC-FLOAT128:#define __FLOAT128__ 1
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-linux-gnu -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-LINUX %s
diff --git a/clang/test/Sema/float128-ld-incompatibility.cpp b/clang/test/Sema/float128-ld-incompatibility.cpp
index 13f5b6d5d10..369b14a87e3 100644
--- a/clang/test/Sema/float128-ld-incompatibility.cpp
+++ b/clang/test/Sema/float128-ld-incompatibility.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 \
-// RUN: -triple powerpc64le-unknown-linux-gnu -target-cpu pwr8 \
+// RUN: -triple powerpc64le-unknown-linux-gnu -target-cpu pwr9 \
// RUN: -target-feature +float128 %s
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -triple x86_64-unknown-linux-gnu -Wno-unused-value -Wno-parentheses %s
OpenPOWER on IntegriCloud