diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2018-10-11 09:09:52 +0000 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2018-10-11 09:09:52 +0000 |
commit | d32c0d1466de85f68b82cbb500d04dcedf95984f (patch) | |
tree | fd17c6c2f740c36b16b76dcd5073fc18c9bda94d /compiler-rt/test/fuzzer/fuzzer-implicit-unsigned-integer-truncation.test | |
parent | dd403575a2e2068fd278a6165bc199b037759e6b (diff) | |
download | bcm5719-llvm-d32c0d1466de85f68b82cbb500d04dcedf95984f.tar.gz bcm5719-llvm-d32c0d1466de85f68b82cbb500d04dcedf95984f.zip |
[compiler-rt][ubsan] Split Implicit Integer Truncation Sanitizer into unsigned and signed checks
Summary:
This is compiler-rt part.
clang part is D50901.
Reviewers: rsmith, vsk, filcab, Sanitizers
Reviewed by: filcab
Differential Revision: https://reviews.llvm.org/D50902
llvm-svn: 344231
Diffstat (limited to 'compiler-rt/test/fuzzer/fuzzer-implicit-unsigned-integer-truncation.test')
-rw-r--r-- | compiler-rt/test/fuzzer/fuzzer-implicit-unsigned-integer-truncation.test | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler-rt/test/fuzzer/fuzzer-implicit-unsigned-integer-truncation.test b/compiler-rt/test/fuzzer/fuzzer-implicit-unsigned-integer-truncation.test new file mode 100644 index 00000000000..93a7e7618e3 --- /dev/null +++ b/compiler-rt/test/fuzzer/fuzzer-implicit-unsigned-integer-truncation.test @@ -0,0 +1,5 @@ +RUN: rm -f %t-ImplicitUnsignedIntegerTruncationTest-Ubsan +RUN: %cpp_compiler -fsanitize=implicit-unsigned-integer-truncation -fno-sanitize-recover=all %S/ImplicitUnsignedIntegerTruncationTest.cpp -o %t-ImplicitUnsignedIntegerTruncationTest-Ubsan +RUN: not %run %t-ImplicitUnsignedIntegerTruncationTest-Ubsan 2>&1 | FileCheck %s +CHECK: ImplicitUnsignedIntegerTruncationTest.cpp:22:17: runtime error: implicit conversion from type 'unsigned int' of value 256 (32-bit, unsigned) to type 'unsigned char' changed the value to 0 (8-bit, unsigned) +CHECK: Test unit written to ./crash- |