Roman Lebedev | d32c0d1 | 2018-10-11 09:09:52 +0000 | [diff] [blame] | 1 | RUN: rm -f %t-ImplicitUnsignedIntegerTruncationTest-Ubsan |
| 2 | RUN: %cpp_compiler -fsanitize=implicit-unsigned-integer-truncation -fno-sanitize-recover=all %S/ImplicitUnsignedIntegerTruncationTest.cpp -o %t-ImplicitUnsignedIntegerTruncationTest-Ubsan |
| 3 | RUN: not %run %t-ImplicitUnsignedIntegerTruncationTest-Ubsan 2>&1 | FileCheck %s |
Roman Lebedev | a0457c0 | 2018-10-30 21:59:09 +0000 | [diff] [blame] | 4 | CHECK: ImplicitUnsignedIntegerTruncationTest.cpp:22:17: runtime error: implicit conversion from type 'unsigned int' of value 256 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) |
Roman Lebedev | d32c0d1 | 2018-10-11 09:09:52 +0000 | [diff] [blame] | 5 | CHECK: Test unit written to ./crash- |