summaryrefslogtreecommitdiff
path: root/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-summary.cpp
diff options
context:
space:
mode:
authorJordan Rupprecht <rupprecht@google.com>2018-12-19 02:24:12 +0000
committerJordan Rupprecht <rupprecht@google.com>2018-12-19 02:24:12 +0000
commit6fc0ad0a5de45f80140620e2dd606f65d547362a (patch)
tree70c48eb656ed8eaa179a465c30efe4433a7a7494 /test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-summary.cpp
parentf8f9fdb8560e9d0abac7edaa5ca40e9bed881695 (diff)
parentcd24f2f94f4edc9a636d02ee841b5a729b2b2ec3 (diff)
downloadcompiler-rt-6fc0ad0a5de45f80140620e2dd606f65d547362a.tar.gz
Creating branches/google/stable and tags/google/stable/2018-12-18 from r349201
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/google/stable@349597 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-summary.cpp')
-rw-r--r--test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-summary.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-summary.cpp b/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-summary.cpp
new file mode 100644
index 000000000..13eaef274
--- /dev/null
+++ b/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-summary.cpp
@@ -0,0 +1,13 @@
+// RUN: %clangxx -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change %s -o %t
+// RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOTYPE
+// RUN: %env_ubsan_opts=report_error_type=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-TYPE
+// REQUIRES: !ubsan-standalone && !ubsan-standalone-static
+
+#include <stdint.h>
+
+int main() {
+ int8_t t0 = (~(uint32_t(0)));
+ // CHECK-NOTYPE: SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior {{.*}}summary.cpp:[[@LINE-1]]:15
+ // CHECK-TYPE: SUMMARY: UndefinedBehaviorSanitizer: implicit-signed-integer-truncation-or-sign-change {{.*}}summary.cpp:[[@LINE-2]]:15
+ return 0;
+}