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 |
| 4 | 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) |
| 5 | CHECK: Test unit written to ./crash- |