blob: 93a7e7618e36f406257e3109da58beaa1a43a018 [file] [log] [blame]
Roman Lebedevd32c0d12018-10-11 09:09:52 +00001RUN: rm -f %t-ImplicitUnsignedIntegerTruncationTest-Ubsan
2RUN: %cpp_compiler -fsanitize=implicit-unsigned-integer-truncation -fno-sanitize-recover=all %S/ImplicitUnsignedIntegerTruncationTest.cpp -o %t-ImplicitUnsignedIntegerTruncationTest-Ubsan
3RUN: not %run %t-ImplicitUnsignedIntegerTruncationTest-Ubsan 2>&1 | FileCheck %s
4CHECK: 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)
5CHECK: Test unit written to ./crash-