summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/ubsan/lit_tests/Integer/shift.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-11-14 12:30:09 +0000
committerAlexey Samsonov <samsonov@google.com>2013-11-14 12:30:09 +0000
commit164841036d94ab2a7770cefba0995922f1e462bf (patch)
tree7f5f5ba1dea75eb3723f01f3a613c7a90383d798 /compiler-rt/lib/ubsan/lit_tests/Integer/shift.cpp
parent585813e33dda3dc396e12a01ffc3e47fc39895e9 (diff)
downloadbcm5719-llvm-164841036d94ab2a7770cefba0995922f1e462bf.tar.gz
bcm5719-llvm-164841036d94ab2a7770cefba0995922f1e462bf.zip
[UBSan] Make sure ASan and UBSan interact properly by running each test from UBSan test suite with and without ASan
llvm-svn: 194698
Diffstat (limited to 'compiler-rt/lib/ubsan/lit_tests/Integer/shift.cpp')
-rw-r--r--compiler-rt/lib/ubsan/lit_tests/Integer/shift.cpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/compiler-rt/lib/ubsan/lit_tests/Integer/shift.cpp b/compiler-rt/lib/ubsan/lit_tests/Integer/shift.cpp
deleted file mode 100644
index f35fa1f959a..00000000000
--- a/compiler-rt/lib/ubsan/lit_tests/Integer/shift.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-// RUN: %clangxx -DLSH_OVERFLOW -DOP='<<' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=CHECK-LSH_OVERFLOW
-// RUN: %clangxx -DLSH_OVERFLOW -DOP='<<=' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=CHECK-LSH_OVERFLOW
-// RUN: %clangxx -DTOO_LOW -DOP='<<' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_LOW
-// RUN: %clangxx -DTOO_LOW -DOP='>>' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_LOW
-// RUN: %clangxx -DTOO_LOW -DOP='<<=' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_LOW
-// RUN: %clangxx -DTOO_LOW -DOP='>>=' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_LOW
-// RUN: %clangxx -DTOO_HIGH -DOP='<<' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_HIGH
-// RUN: %clangxx -DTOO_HIGH -DOP='>>' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_HIGH
-// RUN: %clangxx -DTOO_HIGH -DOP='<<=' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_HIGH
-// RUN: %clangxx -DTOO_HIGH -DOP='>>=' -fsanitize=shift %s -o %t && %t 2>&1 | FileCheck %s --check-prefix=CHECK-TOO_HIGH
-
-#include <stdint.h>
-
-int main() {
- int a = 1;
- unsigned b = 1;
-
- a <<= 31; // ok in C++11, not ok in C99/C11
- b <<= 31; // ok
- b <<= 1; // still ok, unsigned
-
-#ifdef LSH_OVERFLOW
- // CHECK-LSH_OVERFLOW: shift.cpp:24:5: runtime error: left shift of negative value -2147483648
- a OP 1;
-#endif
-
-#ifdef TOO_LOW
- // CHECK-TOO_LOW: shift.cpp:29:5: runtime error: shift exponent -3 is negative
- a OP (-3);
-#endif
-
-#ifdef TOO_HIGH
- a = 0;
- // CHECK-TOO_HIGH: shift.cpp:35:5: runtime error: shift exponent 32 is too large for 32-bit type 'int'
- a OP 32;
-#endif
-}
OpenPOWER on IntegriCloud