summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/ubsan/lit_tests/Integer/div-zero.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-11-29 23:03:58 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-11-29 23:03:58 +0000
commit57000c38fc80c9d292e729186342253f32ee88da (patch)
tree0c6653ab76fef03c832fc1a4d6a48e6e10467f03 /compiler-rt/lib/ubsan/lit_tests/Integer/div-zero.cpp
parent2b14712ecadb68da8db0449d0017e9376aa5bca6 (diff)
downloadbcm5719-llvm-57000c38fc80c9d292e729186342253f32ee88da.tar.gz
bcm5719-llvm-57000c38fc80c9d292e729186342253f32ee88da.zip
ubsan: Disable __int128 tests if the host Clang does not support it. These
tests will still fail if compiler-rt was built with a compiler without __int128 support, but the host compiler has __int128 support. llvm-svn: 168955
Diffstat (limited to 'compiler-rt/lib/ubsan/lit_tests/Integer/div-zero.cpp')
-rw-r--r--compiler-rt/lib/ubsan/lit_tests/Integer/div-zero.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler-rt/lib/ubsan/lit_tests/Integer/div-zero.cpp b/compiler-rt/lib/ubsan/lit_tests/Integer/div-zero.cpp
index f024835ff83..b9aed51232f 100644
--- a/compiler-rt/lib/ubsan/lit_tests/Integer/div-zero.cpp
+++ b/compiler-rt/lib/ubsan/lit_tests/Integer/div-zero.cpp
@@ -1,9 +1,15 @@
// RUN: %clang -fsanitize=integer-divide-by-zero -DDIVIDEND=0 %s -o %t && %t 2>&1 | FileCheck %s
// RUN: %clang -fsanitize=integer-divide-by-zero -DDIVIDEND=1U %s -o %t && %t 2>&1 | FileCheck %s
// RUN: %clang -fsanitize=float-divide-by-zero -DDIVIDEND=1.5 %s -o %t && %t 2>&1 | FileCheck %s
-// RUN: %clang -fsanitize=integer-divide-by-zero -DDIVIDEND='__int128(123)' %s -o %t && %t 2>&1 | FileCheck %s
+// RUN: %clang -fsanitize=integer-divide-by-zero -DDIVIDEND='intmax(123)' %s -o %t && %t 2>&1 | FileCheck %s
+
+#ifdef __SIZEOF_INT128__
+typedef __int128 intmax;
+#else
+typedef long long intmax;
+#endif
int main() {
- // CHECK: div-zero.cpp:8:12: fatal error: division by zero
+ // CHECK: div-zero.cpp:[[@LINE+1]]:12: fatal error: division by zero
DIVIDEND / 0;
}
OpenPOWER on IntegriCloud