Index: compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-arithmetic-value-change.c =================================================================== --- compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-arithmetic-value-change.c +++ compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-arithmetic-value-change.c @@ -157,19 +157,19 @@ convert_unsigned_char_to_signed_int((uint8_t)UINT8_MAX); convert_signed_char_to_signed_int((int8_t)UINT8_MAX); convert_unsigned_int_to_signed_int((uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-arithmetic-value-change.c:900:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -1 (32-bit, signed) +// CHECK-V0: {{.*}}integer-arithmetic-value-change.c:900:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -1 (32-bit, signed) convert_signed_int_to_unsigned_int((int32_t)(uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-arithmetic-value-change.c:1000:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -1 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) +// CHECK-V0: {{.*}}integer-arithmetic-value-change.c:1000:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -1 (32-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) convert_signed_int_to_unsigned_char((int32_t)(uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-arithmetic-value-change.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -1 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V0: {{.*}}integer-arithmetic-value-change.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -1 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)UINT8_MAX); -// CHECK-V0: {{.*}}integer-arithmetic-value-change.c:1200:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -1 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V0: {{.*}}integer-arithmetic-value-change.c:1200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -1 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_unsigned_char_to_signed_char((uint8_t)UINT8_MAX); -// CHECK-V0: {{.*}}integer-arithmetic-value-change.c:1300:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 255 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V0: {{.*}}integer-arithmetic-value-change.c:1300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 255 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) convert_signed_char_to_unsigned_int((int8_t)UINT8_MAX); -// CHECK-V0: {{.*}}integer-arithmetic-value-change.c:1400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -1 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) +// CHECK-V0: {{.*}}integer-arithmetic-value-change.c:1400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -1 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) convert_unsigned_int_to_signed_char((uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V0: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)UINT32_MAX); #elif defined(V1) // Source 'Sign' bit set. @@ -182,21 +182,21 @@ convert_unsigned_char_to_signed_int((uint8_t)INT8_MIN); convert_signed_char_to_signed_int((int8_t)INT8_MIN); convert_unsigned_int_to_signed_int((uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:900:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -2147483648 (32-bit, signed) +// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:900:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -2147483648 (32-bit, signed) convert_signed_int_to_unsigned_int((int32_t)(uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:1000:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) +// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:1000:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) convert_signed_int_to_unsigned_char((int32_t)(uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) +// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MIN); -// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:1200:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:1200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_unsigned_char_to_signed_char((uint8_t)INT8_MIN); -// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:1300:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:1300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_char_to_unsigned_int((int8_t)INT8_MIN); -// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:1400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) +// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:1400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) convert_unsigned_int_to_signed_char((uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to 0 (8-bit, signed) +// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to 0 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 0 (8-bit, signed) +// CHECK-V1: {{.*}}integer-arithmetic-value-change.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to 0 (8-bit, signed) #elif defined(V2) // All bits except the source 'Sign' bit are set. convert_unsigned_int_to_unsigned_int((uint32_t)INT32_MAX); @@ -210,14 +210,14 @@ convert_unsigned_int_to_signed_int((uint32_t)INT32_MAX); convert_signed_int_to_unsigned_int((int32_t)(uint32_t)INT32_MAX); convert_signed_int_to_unsigned_char((int32_t)(uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}integer-arithmetic-value-change.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483647 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V2: {{.*}}integer-arithmetic-value-change.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483647 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MAX); convert_unsigned_char_to_signed_char((uint8_t)INT8_MAX); convert_signed_char_to_unsigned_int((int8_t)INT8_MAX); convert_unsigned_int_to_signed_char((uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V2: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}integer-arithmetic-value-change.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483647 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V2: {{.*}}integer-arithmetic-value-change.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483647 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) #elif defined(V3) // All destination bits set. convert_unsigned_int_to_unsigned_int((uint32_t)UINT8_MAX); @@ -232,15 +232,15 @@ convert_signed_int_to_unsigned_int((int32_t)(uint32_t)UINT8_MAX); convert_signed_int_to_unsigned_char((int32_t)(uint32_t)UINT8_MAX); convert_signed_char_to_unsigned_char((int8_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-arithmetic-value-change.c:1200:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -1 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V3: {{.*}}integer-arithmetic-value-change.c:1200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -1 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_unsigned_char_to_signed_char((uint8_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-arithmetic-value-change.c:1300:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 255 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V3: {{.*}}integer-arithmetic-value-change.c:1300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 255 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) convert_signed_char_to_unsigned_int((int8_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-arithmetic-value-change.c:1400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -1 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) +// CHECK-V3: {{.*}}integer-arithmetic-value-change.c:1400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -1 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) convert_unsigned_int_to_signed_char((uint32_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 255 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V3: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 255 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-arithmetic-value-change.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 255 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V3: {{.*}}integer-arithmetic-value-change.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 255 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) #elif defined(V4) // Destination 'sign' bit set. convert_unsigned_int_to_unsigned_int((uint32_t)(uint8_t)INT8_MIN); @@ -255,15 +255,15 @@ convert_signed_int_to_unsigned_int((int32_t)(uint32_t)(uint8_t)INT8_MIN); convert_signed_int_to_unsigned_char((int32_t)(uint32_t)(uint8_t)INT8_MIN); convert_signed_char_to_unsigned_char((int8_t)(uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-arithmetic-value-change.c:1200:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V4: {{.*}}integer-arithmetic-value-change.c:1200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_unsigned_char_to_signed_char((uint8_t)(uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-arithmetic-value-change.c:1300:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V4: {{.*}}integer-arithmetic-value-change.c:1300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_char_to_unsigned_int((int8_t)(uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-arithmetic-value-change.c:1400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) +// CHECK-V4: {{.*}}integer-arithmetic-value-change.c:1400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) convert_unsigned_int_to_signed_char((uint32_t)(uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 128 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V4: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 128 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)(uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-arithmetic-value-change.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 128 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V4: {{.*}}integer-arithmetic-value-change.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 128 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) #elif defined(V5) // All bits except the destination 'sign' bit are set. convert_unsigned_int_to_unsigned_int((~((uint32_t)(uint8_t)INT8_MIN))); @@ -275,21 +275,21 @@ convert_unsigned_char_to_signed_int((uint8_t)(uint8_t)INT8_MIN); convert_signed_char_to_signed_int((int8_t)(uint8_t)INT8_MIN); convert_unsigned_int_to_signed_int((~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:900:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -129 (32-bit, signed) +// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:900:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -129 (32-bit, signed) convert_signed_int_to_unsigned_int((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:1000:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -129 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967167 (32-bit, unsigned) +// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:1000:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -129 (32-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967167 (32-bit, unsigned) convert_signed_int_to_unsigned_char((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -129 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -129 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)(uint8_t)INT8_MIN); -// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:1200:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:1200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_unsigned_char_to_signed_char((uint8_t)(uint8_t)INT8_MIN); -// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:1300:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:1300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_char_to_unsigned_int((int8_t)(uint8_t)INT8_MIN); -// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:1400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) +// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:1400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) convert_unsigned_int_to_signed_char((~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -129 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V5: {{.*}}integer-arithmetic-value-change.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -129 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) #elif defined(V6) // Only the source and destination sign bits are set. convert_unsigned_int_to_unsigned_int((uint32_t)INT32_MIN); @@ -301,21 +301,21 @@ convert_unsigned_char_to_signed_int((uint8_t)INT8_MIN); convert_signed_char_to_signed_int((int8_t)INT8_MIN); convert_unsigned_int_to_signed_int((uint32_t)INT32_MIN); -// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:900:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -2147483648 (32-bit, signed) +// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:900:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -2147483648 (32-bit, signed) convert_signed_int_to_unsigned_int((int32_t)INT32_MIN); -// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:1000:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) +// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:1000:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) convert_signed_int_to_unsigned_char((int32_t)(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483520 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483520 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MIN); -// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:1200:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:1200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_unsigned_char_to_signed_char((uint8_t)INT8_MIN); -// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:1300:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:1300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_char_to_unsigned_int((int8_t)INT8_MIN); -// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:1400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) +// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:1400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) convert_unsigned_int_to_signed_char((((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483520 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V6: {{.*}}integer-arithmetic-value-change.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483520 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) #elif defined(V7) // All bits except the source and destination sign bits are set. convert_unsigned_int_to_unsigned_int((uint32_t)INT32_MAX); @@ -329,14 +329,14 @@ convert_unsigned_int_to_signed_int((uint32_t)INT32_MAX); convert_signed_int_to_unsigned_int((int32_t)INT32_MAX); convert_signed_int_to_unsigned_char((int32_t)(~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN)))); -// CHECK-V7: {{.*}}integer-arithmetic-value-change.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483519 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V7: {{.*}}integer-arithmetic-value-change.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483519 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MAX); convert_unsigned_char_to_signed_char((uint8_t)INT8_MAX); convert_signed_char_to_unsigned_int((int8_t)INT8_MAX); convert_unsigned_int_to_signed_char(~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V7: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483519 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V7: {{.*}}integer-arithmetic-value-change.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483519 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V7: {{.*}}integer-arithmetic-value-change.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483519 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V7: {{.*}}integer-arithmetic-value-change.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483519 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) #else #error Some V* needs to be defined! #endif Index: compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-conversion.c =================================================================== --- compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-conversion.c +++ compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-conversion.c @@ -153,24 +153,24 @@ convert_signed_int_to_signed_int((int32_t)(uint32_t)UINT32_MAX); convert_signed_char_to_signed_char((int8_t)UINT8_MAX); convert_unsigned_int_to_unsigned_char((uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-conversion.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned +// CHECK-V0: {{.*}}integer-conversion.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned convert_unsigned_char_to_unsigned_int((uint8_t)UINT8_MAX); convert_unsigned_char_to_signed_int((uint8_t)UINT8_MAX); convert_signed_char_to_signed_int((int8_t)UINT8_MAX); convert_unsigned_int_to_signed_int((uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-conversion.c:900:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -1 (32-bit, signed) +// CHECK-V0: {{.*}}integer-conversion.c:900:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -1 (32-bit, signed) convert_signed_int_to_unsigned_int((int32_t)(uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-conversion.c:1000:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -1 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) +// CHECK-V0: {{.*}}integer-conversion.c:1000:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -1 (32-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) convert_signed_int_to_unsigned_char((int32_t)(uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-conversion.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -1 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V0: {{.*}}integer-conversion.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -1 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)UINT8_MAX); -// CHECK-V0: {{.*}}integer-conversion.c:1200:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -1 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V0: {{.*}}integer-conversion.c:1200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -1 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_unsigned_char_to_signed_char((uint8_t)UINT8_MAX); -// CHECK-V0: {{.*}}integer-conversion.c:1300:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 255 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V0: {{.*}}integer-conversion.c:1300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 255 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) convert_signed_char_to_unsigned_int((int8_t)UINT8_MAX); -// CHECK-V0: {{.*}}integer-conversion.c:1400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -1 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) +// CHECK-V0: {{.*}}integer-conversion.c:1400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -1 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) convert_unsigned_int_to_signed_char((uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V0: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)UINT32_MAX); #elif defined(V1) // Source 'Sign' bit set. @@ -179,26 +179,26 @@ convert_signed_int_to_signed_int((int32_t)(uint32_t)INT32_MIN); convert_signed_char_to_signed_char((int8_t)INT8_MIN); convert_unsigned_int_to_unsigned_char((uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-conversion.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) +// CHECK-V1: {{.*}}integer-conversion.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)INT8_MIN); convert_unsigned_char_to_signed_int((uint8_t)INT8_MIN); convert_signed_char_to_signed_int((int8_t)INT8_MIN); convert_unsigned_int_to_signed_int((uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-conversion.c:900:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -2147483648 (32-bit, signed) +// CHECK-V1: {{.*}}integer-conversion.c:900:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -2147483648 (32-bit, signed) convert_signed_int_to_unsigned_int((int32_t)(uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-conversion.c:1000:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) +// CHECK-V1: {{.*}}integer-conversion.c:1000:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) convert_signed_int_to_unsigned_char((int32_t)(uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-conversion.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) +// CHECK-V1: {{.*}}integer-conversion.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MIN); -// CHECK-V1: {{.*}}integer-conversion.c:1200:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V1: {{.*}}integer-conversion.c:1200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_unsigned_char_to_signed_char((uint8_t)INT8_MIN); -// CHECK-V1: {{.*}}integer-conversion.c:1300:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V1: {{.*}}integer-conversion.c:1300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_char_to_unsigned_int((int8_t)INT8_MIN); -// CHECK-V1: {{.*}}integer-conversion.c:1400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) +// CHECK-V1: {{.*}}integer-conversion.c:1400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) convert_unsigned_int_to_signed_char((uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to 0 (8-bit, signed) +// CHECK-V1: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to 0 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-conversion.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 0 (8-bit, signed) +// CHECK-V1: {{.*}}integer-conversion.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to 0 (8-bit, signed) #elif defined(V2) // All bits except the source 'Sign' bit are set. convert_unsigned_int_to_unsigned_int((uint32_t)INT32_MAX); @@ -206,21 +206,21 @@ convert_signed_int_to_signed_int((int32_t)(uint32_t)INT32_MAX); convert_signed_char_to_signed_char((int8_t)INT8_MAX); convert_unsigned_int_to_unsigned_char((uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}integer-conversion.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V2: {{.*}}integer-conversion.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)INT8_MAX); convert_unsigned_char_to_signed_int((uint8_t)INT8_MAX); convert_signed_char_to_signed_int((int8_t)INT8_MAX); convert_unsigned_int_to_signed_int((uint32_t)INT32_MAX); convert_signed_int_to_unsigned_int((int32_t)(uint32_t)INT32_MAX); convert_signed_int_to_unsigned_char((int32_t)(uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}integer-conversion.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483647 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V2: {{.*}}integer-conversion.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483647 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MAX); convert_unsigned_char_to_signed_char((uint8_t)INT8_MAX); convert_signed_char_to_unsigned_int((int8_t)INT8_MAX); convert_unsigned_int_to_signed_char((uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V2: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}integer-conversion.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483647 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V2: {{.*}}integer-conversion.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483647 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) #elif defined(V3) // All destination bits set. convert_unsigned_int_to_unsigned_int((uint32_t)UINT8_MAX); @@ -235,15 +235,15 @@ convert_signed_int_to_unsigned_int((int32_t)(uint32_t)UINT8_MAX); convert_signed_int_to_unsigned_char((int32_t)(uint32_t)UINT8_MAX); convert_signed_char_to_unsigned_char((int8_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-conversion.c:1200:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -1 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V3: {{.*}}integer-conversion.c:1200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -1 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_unsigned_char_to_signed_char((uint8_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-conversion.c:1300:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 255 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V3: {{.*}}integer-conversion.c:1300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 255 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) convert_signed_char_to_unsigned_int((int8_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-conversion.c:1400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -1 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) +// CHECK-V3: {{.*}}integer-conversion.c:1400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -1 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) convert_unsigned_int_to_signed_char((uint32_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 255 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V3: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 255 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-conversion.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 255 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V3: {{.*}}integer-conversion.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 255 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) #elif defined(V4) // Destination 'sign' bit set. convert_unsigned_int_to_unsigned_int((uint32_t)(uint8_t)INT8_MIN); @@ -258,15 +258,15 @@ convert_signed_int_to_unsigned_int((int32_t)(uint32_t)(uint8_t)INT8_MIN); convert_signed_int_to_unsigned_char((int32_t)(uint32_t)(uint8_t)INT8_MIN); convert_signed_char_to_unsigned_char((int8_t)(uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-conversion.c:1200:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V4: {{.*}}integer-conversion.c:1200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_unsigned_char_to_signed_char((uint8_t)(uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-conversion.c:1300:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V4: {{.*}}integer-conversion.c:1300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_char_to_unsigned_int((int8_t)(uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-conversion.c:1400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) +// CHECK-V4: {{.*}}integer-conversion.c:1400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) convert_unsigned_int_to_signed_char((uint32_t)(uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 128 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V4: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 128 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)(uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-conversion.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 128 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V4: {{.*}}integer-conversion.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 128 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) #elif defined(V5) // All bits except the destination 'sign' bit are set. convert_unsigned_int_to_unsigned_int((~((uint32_t)(uint8_t)INT8_MIN))); @@ -274,26 +274,26 @@ convert_signed_int_to_signed_int((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); convert_signed_char_to_signed_char((int8_t)(uint8_t)INT8_MIN); convert_unsigned_int_to_unsigned_char((~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-conversion.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V5: {{.*}}integer-conversion.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)(uint8_t)INT8_MIN); convert_unsigned_char_to_signed_int((uint8_t)(uint8_t)INT8_MIN); convert_signed_char_to_signed_int((int8_t)(uint8_t)INT8_MIN); convert_unsigned_int_to_signed_int((~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-conversion.c:900:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -129 (32-bit, signed) +// CHECK-V5: {{.*}}integer-conversion.c:900:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -129 (32-bit, signed) convert_signed_int_to_unsigned_int((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-conversion.c:1000:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -129 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967167 (32-bit, unsigned) +// CHECK-V5: {{.*}}integer-conversion.c:1000:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -129 (32-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967167 (32-bit, unsigned) convert_signed_int_to_unsigned_char((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-conversion.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -129 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V5: {{.*}}integer-conversion.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -129 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)(uint8_t)INT8_MIN); -// CHECK-V5: {{.*}}integer-conversion.c:1200:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V5: {{.*}}integer-conversion.c:1200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_unsigned_char_to_signed_char((uint8_t)(uint8_t)INT8_MIN); -// CHECK-V5: {{.*}}integer-conversion.c:1300:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V5: {{.*}}integer-conversion.c:1300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_char_to_unsigned_int((int8_t)(uint8_t)INT8_MIN); -// CHECK-V5: {{.*}}integer-conversion.c:1400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) +// CHECK-V5: {{.*}}integer-conversion.c:1400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) convert_unsigned_int_to_signed_char((~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V5: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-conversion.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -129 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V5: {{.*}}integer-conversion.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -129 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) #elif defined(V6) // Only the source and destination sign bits are set. convert_unsigned_int_to_unsigned_int((uint32_t)INT32_MIN); @@ -301,26 +301,26 @@ convert_signed_int_to_signed_int((int32_t)INT32_MIN); convert_signed_char_to_signed_char((int8_t)INT8_MIN); convert_unsigned_int_to_unsigned_char(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN)); -// CHECK-V6: {{.*}}integer-conversion.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V6: {{.*}}integer-conversion.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)INT8_MIN); convert_unsigned_char_to_signed_int((uint8_t)INT8_MIN); convert_signed_char_to_signed_int((int8_t)INT8_MIN); convert_unsigned_int_to_signed_int((uint32_t)INT32_MIN); -// CHECK-V6: {{.*}}integer-conversion.c:900:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -2147483648 (32-bit, signed) +// CHECK-V6: {{.*}}integer-conversion.c:900:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -2147483648 (32-bit, signed) convert_signed_int_to_unsigned_int((int32_t)INT32_MIN); -// CHECK-V6: {{.*}}integer-conversion.c:1000:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) +// CHECK-V6: {{.*}}integer-conversion.c:1000:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) convert_signed_int_to_unsigned_char((int32_t)(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V6: {{.*}}integer-conversion.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483520 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V6: {{.*}}integer-conversion.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483520 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MIN); -// CHECK-V6: {{.*}}integer-conversion.c:1200:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V6: {{.*}}integer-conversion.c:1200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_unsigned_char_to_signed_char((uint8_t)INT8_MIN); -// CHECK-V6: {{.*}}integer-conversion.c:1300:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V6: {{.*}}integer-conversion.c:1300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_char_to_unsigned_int((int8_t)INT8_MIN); -// CHECK-V6: {{.*}}integer-conversion.c:1400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) +// CHECK-V6: {{.*}}integer-conversion.c:1400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) convert_unsigned_int_to_signed_char((((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V6: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V6: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V6: {{.*}}integer-conversion.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483520 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V6: {{.*}}integer-conversion.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483520 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) #elif defined(V7) // All bits except the source and destination sign bits are set. convert_unsigned_int_to_unsigned_int((uint32_t)INT32_MAX); @@ -328,21 +328,21 @@ convert_signed_int_to_signed_int((int32_t)INT32_MAX); convert_signed_char_to_signed_char((int8_t)INT8_MAX); convert_unsigned_int_to_unsigned_char(~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V7: {{.*}}integer-conversion.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483519 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V7: {{.*}}integer-conversion.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483519 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)INT8_MAX); convert_unsigned_char_to_signed_int((uint8_t)INT8_MAX); convert_signed_char_to_signed_int((int8_t)INT8_MAX); convert_unsigned_int_to_signed_int((uint32_t)INT32_MAX); convert_signed_int_to_unsigned_int((int32_t)INT32_MAX); convert_signed_int_to_unsigned_char((int32_t)(~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN)))); -// CHECK-V7: {{.*}}integer-conversion.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483519 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V7: {{.*}}integer-conversion.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483519 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MAX); convert_unsigned_char_to_signed_char((uint8_t)INT8_MAX); convert_signed_char_to_unsigned_int((int8_t)INT8_MAX); convert_unsigned_int_to_signed_char(~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V7: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483519 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V7: {{.*}}integer-conversion.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483519 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V7: {{.*}}integer-conversion.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483519 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V7: {{.*}}integer-conversion.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483519 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) #else #error Some V* needs to be defined! #endif Index: compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-sign-change-blacklist.c =================================================================== --- compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-sign-change-blacklist.c +++ compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-sign-change-blacklist.c @@ -20,7 +20,7 @@ int32_t implicitSignChange(uint32_t argc) { return argc; // BOOM -// CHECK: {{.*}}integer-sign-change-blacklist.c:[[@LINE-1]]:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -1 (32-bit, signed) +// CHECK: {{.*}}integer-sign-change-blacklist.c:[[@LINE-1]]:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -1 (32-bit, signed) } int main(int argc, char **argv) { Index: compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-sign-change.c =================================================================== --- compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-sign-change.c +++ compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-sign-change.c @@ -173,37 +173,37 @@ #if defined(V0) // All source bits set. positive0_convert_unsigned_int_to_signed_int((uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-sign-change.c:100:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -1 (32-bit, signed) +// CHECK-V0: {{.*}}integer-sign-change.c:100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -1 (32-bit, signed) positive1_convert_signed_int_to_unsigned_int((int32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-sign-change.c:200:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -1 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) +// CHECK-V0: {{.*}}integer-sign-change.c:200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -1 (32-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) positive2_convert_signed_int_to_unsigned_char((int32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-sign-change.c:300:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -1 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V0: {{.*}}integer-sign-change.c:300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -1 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) positive3_convert_signed_char_to_unsigned_char((int8_t)UINT8_MAX); -// CHECK-V0: {{.*}}integer-sign-change.c:400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -1 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V0: {{.*}}integer-sign-change.c:400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -1 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) positive4_convert_unsigned_char_to_signed_char((uint8_t)UINT8_MAX); -// CHECK-V0: {{.*}}integer-sign-change.c:500:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 255 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V0: {{.*}}integer-sign-change.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 255 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) positive5_convert_signed_char_to_unsigned_int((int8_t)UINT8_MAX); -// CHECK-V0: {{.*}}integer-sign-change.c:600:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -1 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) +// CHECK-V0: {{.*}}integer-sign-change.c:600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -1 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) positive6_convert_unsigned_int_to_signed_char((uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-sign-change.c:700:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V0: {{.*}}integer-sign-change.c:700:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) positive7_convert_signed_int_to_signed_char((int32_t)UINT32_MAX); #elif defined(V1) // Source 'Sign' bit set. positive0_convert_unsigned_int_to_signed_int((uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-sign-change.c:100:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -2147483648 (32-bit, signed) +// CHECK-V1: {{.*}}integer-sign-change.c:100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -2147483648 (32-bit, signed) positive1_convert_signed_int_to_unsigned_int((int32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-sign-change.c:200:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) +// CHECK-V1: {{.*}}integer-sign-change.c:200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) positive2_convert_signed_int_to_unsigned_char((int32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-sign-change.c:300:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) +// CHECK-V1: {{.*}}integer-sign-change.c:300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) positive3_convert_signed_char_to_unsigned_char((int8_t)INT8_MIN); -// CHECK-V1: {{.*}}integer-sign-change.c:400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V1: {{.*}}integer-sign-change.c:400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) positive4_convert_unsigned_char_to_signed_char((uint8_t)INT8_MIN); -// CHECK-V1: {{.*}}integer-sign-change.c:500:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V1: {{.*}}integer-sign-change.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) positive5_convert_signed_char_to_unsigned_int((int8_t)INT8_MIN); -// CHECK-V1: {{.*}}integer-sign-change.c:600:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) +// CHECK-V1: {{.*}}integer-sign-change.c:600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) positive6_convert_unsigned_int_to_signed_char((uint32_t)INT32_MIN); positive7_convert_signed_int_to_signed_char((int32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-sign-change.c:800:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 0 (8-bit, signed) +// CHECK-V1: {{.*}}integer-sign-change.c:800:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to 0 (8-bit, signed) #elif defined(V2) // All bits except the source 'Sign' bit are set. positive0_convert_unsigned_int_to_signed_int((uint32_t)INT32_MAX); @@ -213,74 +213,74 @@ positive4_convert_unsigned_char_to_signed_char((uint8_t)INT8_MAX); positive5_convert_signed_char_to_unsigned_int((int8_t)INT8_MAX); positive6_convert_unsigned_int_to_signed_char((uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}integer-sign-change.c:700:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V2: {{.*}}integer-sign-change.c:700:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) positive7_convert_signed_int_to_signed_char((int32_t)INT32_MAX); -// CHECK-V2: {{.*}}integer-sign-change.c:800:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483647 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V2: {{.*}}integer-sign-change.c:800:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483647 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) #elif defined(V3) // All destination bits set. positive0_convert_unsigned_int_to_signed_int((uint32_t)UINT32_MAX); -// CHECK-V3: {{.*}}integer-sign-change.c:100:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -1 (32-bit, signed) +// CHECK-V3: {{.*}}integer-sign-change.c:100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -1 (32-bit, signed) positive1_convert_signed_int_to_unsigned_int((int32_t)UINT32_MAX); -// CHECK-V3: {{.*}}integer-sign-change.c:200:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -1 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) +// CHECK-V3: {{.*}}integer-sign-change.c:200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -1 (32-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) positive2_convert_signed_int_to_unsigned_char((int32_t)UINT8_MAX); positive3_convert_signed_char_to_unsigned_char((int8_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-sign-change.c:400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -1 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V3: {{.*}}integer-sign-change.c:400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -1 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) positive4_convert_unsigned_char_to_signed_char((uint8_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-sign-change.c:500:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 255 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V3: {{.*}}integer-sign-change.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 255 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) positive5_convert_signed_char_to_unsigned_int((int8_t)UINT32_MAX); -// CHECK-V3: {{.*}}integer-sign-change.c:600:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -1 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) +// CHECK-V3: {{.*}}integer-sign-change.c:600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -1 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) positive6_convert_unsigned_int_to_signed_char((uint32_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-sign-change.c:700:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 255 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V3: {{.*}}integer-sign-change.c:700:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 255 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) positive7_convert_signed_int_to_signed_char((int32_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-sign-change.c:800:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 255 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V3: {{.*}}integer-sign-change.c:800:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 255 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) #elif defined(V4) // Destination 'sign' bit set. positive0_convert_unsigned_int_to_signed_int((uint32_t)INT32_MIN); -// CHECK-V4: {{.*}}integer-sign-change.c:100:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -2147483648 (32-bit, signed) +// CHECK-V4: {{.*}}integer-sign-change.c:100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -2147483648 (32-bit, signed) positive1_convert_signed_int_to_unsigned_int((int32_t)INT32_MIN); -// CHECK-V4: {{.*}}integer-sign-change.c:200:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) +// CHECK-V4: {{.*}}integer-sign-change.c:200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) positive2_convert_signed_int_to_unsigned_char((int32_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-sign-change.c:300:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -128 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V4: {{.*}}integer-sign-change.c:300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -128 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) positive3_convert_signed_char_to_unsigned_char((int8_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-sign-change.c:400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V4: {{.*}}integer-sign-change.c:400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) positive4_convert_unsigned_char_to_signed_char((uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-sign-change.c:500:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V4: {{.*}}integer-sign-change.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) positive5_convert_signed_char_to_unsigned_int((int8_t)INT32_MIN); positive6_convert_unsigned_int_to_signed_char((uint32_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-sign-change.c:700:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967168 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V4: {{.*}}integer-sign-change.c:700:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967168 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) positive7_convert_signed_int_to_signed_char((int32_t)INT8_MIN); #elif defined(V5) // All bits except the destination 'sign' bit are set. positive0_convert_unsigned_int_to_signed_int((uint32_t)INT32_MIN); -// CHECK-V5: {{.*}}integer-sign-change.c:100:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -2147483648 (32-bit, signed) +// CHECK-V5: {{.*}}integer-sign-change.c:100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -2147483648 (32-bit, signed) positive1_convert_signed_int_to_unsigned_int((int32_t)INT32_MIN); -// CHECK-V5: {{.*}}integer-sign-change.c:200:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) +// CHECK-V5: {{.*}}integer-sign-change.c:200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) positive2_convert_signed_int_to_unsigned_char((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-sign-change.c:300:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -129 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V5: {{.*}}integer-sign-change.c:300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -129 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) positive3_convert_signed_char_to_unsigned_char((int8_t)(INT8_MIN)); -// CHECK-V5: {{.*}}integer-sign-change.c:400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V5: {{.*}}integer-sign-change.c:400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) positive4_convert_unsigned_char_to_signed_char((uint8_t)(INT8_MIN)); -// CHECK-V5: {{.*}}integer-sign-change.c:500:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V5: {{.*}}integer-sign-change.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) positive5_convert_signed_char_to_unsigned_int((int8_t)(INT32_MIN)); positive6_convert_unsigned_int_to_signed_char(~((uint32_t)(uint8_t)INT8_MIN)); positive7_convert_signed_int_to_signed_char((int32_t)(~((uint32_t)((uint8_t)INT8_MIN)))); -// CHECK-V5: {{.*}}integer-sign-change.c:800:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -129 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V5: {{.*}}integer-sign-change.c:800:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -129 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) #elif defined(V6) // Only the source and destination sign bits are set. positive0_convert_unsigned_int_to_signed_int((uint32_t)INT32_MIN); -// CHECK-V6: {{.*}}integer-sign-change.c:100:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -2147483648 (32-bit, signed) +// CHECK-V6: {{.*}}integer-sign-change.c:100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'int') changed the value to -2147483648 (32-bit, signed) positive1_convert_signed_int_to_unsigned_int((int32_t)INT32_MIN); -// CHECK-V6: {{.*}}integer-sign-change.c:200:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) +// CHECK-V6: {{.*}}integer-sign-change.c:200:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 2147483648 (32-bit, unsigned) positive2_convert_signed_int_to_unsigned_char((int32_t)((uint32_t)INT32_MIN | (uint32_t)((uint8_t)INT8_MIN))); -// CHECK-V6: {{.*}}integer-sign-change.c:300:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483520 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V6: {{.*}}integer-sign-change.c:300:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483520 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) positive3_convert_signed_char_to_unsigned_char((int8_t)INT8_MIN); -// CHECK-V6: {{.*}}integer-sign-change.c:400:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V6: {{.*}}integer-sign-change.c:400:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) positive4_convert_unsigned_char_to_signed_char((uint8_t)INT8_MIN); -// CHECK-V6: {{.*}}integer-sign-change.c:500:10: runtime error: implicit conversion from type 'uint8_t' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V6: {{.*}}integer-sign-change.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) positive5_convert_signed_char_to_unsigned_int((int8_t)INT8_MIN); -// CHECK-V6: {{.*}}integer-sign-change.c:600:10: runtime error: implicit conversion from type 'int8_t' (aka 'signed char') of value -128 (8-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) +// CHECK-V6: {{.*}}integer-sign-change.c:600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'signed char') of value -128 (8-bit, signed) to type '{{.*}}' (aka 'unsigned int') changed the value to 4294967168 (32-bit, unsigned) positive6_convert_unsigned_int_to_signed_char((uint32_t)((uint32_t)INT32_MIN | (uint32_t)((uint8_t)INT8_MIN))); -// CHECK-V6: {{.*}}integer-sign-change.c:700:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V6: {{.*}}integer-sign-change.c:700:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) positive7_convert_signed_int_to_signed_char((int32_t)((uint32_t)INT32_MIN | (uint32_t)((uint8_t)INT8_MIN))); #else #error Some V* needs to be defined! Index: compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation.c =================================================================== --- compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation.c +++ compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/integer-truncation.c @@ -153,14 +153,14 @@ convert_signed_int_to_signed_int((int32_t)(uint32_t)UINT32_MAX); convert_signed_char_to_signed_char((int8_t)UINT8_MAX); convert_unsigned_int_to_unsigned_char((uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-truncation.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned +// CHECK-V0: {{.*}}integer-truncation.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned convert_unsigned_char_to_unsigned_int((uint8_t)UINT8_MAX); convert_unsigned_char_to_signed_int((uint8_t)UINT8_MAX); convert_signed_char_to_signed_int((int8_t)UINT8_MAX); convert_unsigned_int_to_signed_int((uint32_t)UINT32_MAX); convert_signed_int_to_unsigned_int((int32_t)(uint32_t)UINT32_MAX); convert_signed_int_to_unsigned_char((int32_t)(uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}integer-truncation.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -1 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V0: {{.*}}integer-truncation.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -1 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)UINT8_MAX); convert_unsigned_char_to_signed_char((uint8_t)UINT8_MAX); convert_signed_char_to_unsigned_int((int8_t)UINT8_MAX); @@ -173,21 +173,21 @@ convert_signed_int_to_signed_int((int32_t)(uint32_t)INT32_MIN); convert_signed_char_to_signed_char((int8_t)INT8_MIN); convert_unsigned_int_to_unsigned_char((uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-truncation.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) +// CHECK-V1: {{.*}}integer-truncation.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)INT8_MIN); convert_unsigned_char_to_signed_int((uint8_t)INT8_MIN); convert_signed_char_to_signed_int((int8_t)INT8_MIN); convert_unsigned_int_to_signed_int((uint32_t)INT32_MIN); convert_signed_int_to_unsigned_int((int32_t)(uint32_t)INT32_MIN); convert_signed_int_to_unsigned_char((int32_t)(uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-truncation.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) +// CHECK-V1: {{.*}}integer-truncation.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MIN); convert_unsigned_char_to_signed_char((uint8_t)INT8_MIN); convert_signed_char_to_unsigned_int((int8_t)INT8_MIN); convert_unsigned_int_to_signed_char((uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-truncation.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to 0 (8-bit, signed) +// CHECK-V1: {{.*}}integer-truncation.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to 0 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}integer-truncation.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 0 (8-bit, signed) +// CHECK-V1: {{.*}}integer-truncation.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to 0 (8-bit, signed) #elif defined(V2) // All bits except the source 'Sign' bit are set. convert_unsigned_int_to_unsigned_int((uint32_t)INT32_MAX); @@ -195,21 +195,21 @@ convert_signed_int_to_signed_int((int32_t)(uint32_t)INT32_MAX); convert_signed_char_to_signed_char((int8_t)INT8_MAX); convert_unsigned_int_to_unsigned_char((uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}integer-truncation.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V2: {{.*}}integer-truncation.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)INT8_MAX); convert_unsigned_char_to_signed_int((uint8_t)INT8_MAX); convert_signed_char_to_signed_int((int8_t)INT8_MAX); convert_unsigned_int_to_signed_int((uint32_t)INT32_MAX); convert_signed_int_to_unsigned_int((int32_t)(uint32_t)INT32_MAX); convert_signed_int_to_unsigned_char((int32_t)(uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}integer-truncation.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483647 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V2: {{.*}}integer-truncation.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483647 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MAX); convert_unsigned_char_to_signed_char((uint8_t)INT8_MAX); convert_signed_char_to_unsigned_int((int8_t)INT8_MAX); convert_unsigned_int_to_signed_char((uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}integer-truncation.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V2: {{.*}}integer-truncation.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}integer-truncation.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483647 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V2: {{.*}}integer-truncation.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483647 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) #elif defined(V3) // All destination bits set. convert_unsigned_int_to_unsigned_int((uint32_t)UINT8_MAX); @@ -227,9 +227,9 @@ convert_unsigned_char_to_signed_char((uint8_t)UINT8_MAX); convert_signed_char_to_unsigned_int((int8_t)UINT8_MAX); convert_unsigned_int_to_signed_char((uint32_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-truncation.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 255 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V3: {{.*}}integer-truncation.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 255 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)UINT8_MAX); -// CHECK-V3: {{.*}}integer-truncation.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 255 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V3: {{.*}}integer-truncation.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 255 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) #elif defined(V4) // Destination 'sign' bit set. convert_unsigned_int_to_unsigned_int((uint32_t)(uint8_t)INT8_MIN); @@ -247,9 +247,9 @@ convert_unsigned_char_to_signed_char((uint8_t)(uint8_t)INT8_MIN); convert_signed_char_to_unsigned_int((int8_t)(uint8_t)INT8_MIN); convert_unsigned_int_to_signed_char((uint32_t)(uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-truncation.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 128 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V4: {{.*}}integer-truncation.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 128 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)(uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}integer-truncation.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 128 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V4: {{.*}}integer-truncation.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 128 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) #elif defined(V5) // All bits except the destination 'sign' bit are set. convert_unsigned_int_to_unsigned_int((~((uint32_t)(uint8_t)INT8_MIN))); @@ -257,21 +257,21 @@ convert_signed_int_to_signed_int((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); convert_signed_char_to_signed_char((int8_t)(uint8_t)INT8_MIN); convert_unsigned_int_to_unsigned_char((~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-truncation.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V5: {{.*}}integer-truncation.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)(uint8_t)INT8_MIN); convert_unsigned_char_to_signed_int((uint8_t)(uint8_t)INT8_MIN); convert_signed_char_to_signed_int((int8_t)(uint8_t)INT8_MIN); convert_unsigned_int_to_signed_int((~((uint32_t)(uint8_t)INT8_MIN))); convert_signed_int_to_unsigned_int((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); convert_signed_int_to_unsigned_char((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-truncation.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -129 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V5: {{.*}}integer-truncation.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -129 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)(uint8_t)INT8_MIN); convert_unsigned_char_to_signed_char((uint8_t)(uint8_t)INT8_MIN); convert_signed_char_to_unsigned_int((int8_t)(uint8_t)INT8_MIN); convert_unsigned_int_to_signed_char((~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-truncation.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V5: {{.*}}integer-truncation.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}integer-truncation.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -129 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V5: {{.*}}integer-truncation.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -129 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) #elif defined(V6) // Only the source and destination sign bits are set. convert_unsigned_int_to_unsigned_int((uint32_t)INT32_MIN); @@ -279,21 +279,21 @@ convert_signed_int_to_signed_int((int32_t)INT32_MIN); convert_signed_char_to_signed_char((int8_t)INT8_MIN); convert_unsigned_int_to_unsigned_char(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN)); -// CHECK-V6: {{.*}}integer-truncation.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V6: {{.*}}integer-truncation.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)INT8_MIN); convert_unsigned_char_to_signed_int((uint8_t)INT8_MIN); convert_signed_char_to_signed_int((int8_t)INT8_MIN); convert_unsigned_int_to_signed_int((uint32_t)INT32_MIN); convert_signed_int_to_unsigned_int((uint32_t)INT32_MIN); convert_signed_int_to_unsigned_char((int32_t)(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V6: {{.*}}integer-truncation.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483520 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V6: {{.*}}integer-truncation.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483520 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MIN); convert_unsigned_char_to_signed_char((uint8_t)INT8_MIN); convert_signed_char_to_unsigned_int((int8_t)INT8_MIN); convert_unsigned_int_to_signed_char((((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V6: {{.*}}integer-truncation.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V6: {{.*}}integer-truncation.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V6: {{.*}}integer-truncation.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483520 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V6: {{.*}}integer-truncation.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483520 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) #elif defined(V7) // All bits except the source and destination sign bits are set. convert_unsigned_int_to_unsigned_int((uint32_t)INT32_MAX); @@ -301,21 +301,21 @@ convert_signed_int_to_signed_int((int32_t)INT32_MAX); convert_signed_char_to_signed_char((int8_t)INT8_MAX); convert_unsigned_int_to_unsigned_char(~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V7: {{.*}}integer-truncation.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483519 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V7: {{.*}}integer-truncation.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483519 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)INT8_MAX); convert_unsigned_char_to_signed_int((uint8_t)INT8_MAX); convert_signed_char_to_signed_int((int8_t)INT8_MAX); convert_unsigned_int_to_signed_int((uint32_t)INT32_MAX); convert_signed_int_to_unsigned_int((uint32_t)INT32_MAX); convert_signed_int_to_unsigned_char((int32_t)(~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN)))); -// CHECK-V7: {{.*}}integer-truncation.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483519 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V7: {{.*}}integer-truncation.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483519 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MAX); convert_unsigned_char_to_signed_char((uint8_t)INT8_MAX); convert_signed_char_to_unsigned_int((int8_t)INT8_MAX); convert_unsigned_int_to_signed_char(~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V7: {{.*}}integer-truncation.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483519 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V7: {{.*}}integer-truncation.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483519 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V7: {{.*}}integer-truncation.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483519 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V7: {{.*}}integer-truncation.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483519 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) #else #error Some V* needs to be defined! #endif Index: compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-blacklist.c =================================================================== --- compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-blacklist.c +++ compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-blacklist.c @@ -52,7 +52,7 @@ uint8_t implicitUnsignedTruncation(int32_t argc) { return argc; // BOOM -// CHECK: {{.*}}signed-integer-truncation-blacklist.c:[[@LINE-1]]:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -1 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK: {{.*}}signed-integer-truncation-blacklist.c:[[@LINE-1]]:10: runtime error: implicit conversion from type '{{.*}} (aka 'int') of value -1 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) } int main(int argc, char **argv) { Index: compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c =================================================================== --- compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c +++ compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c @@ -50,7 +50,7 @@ int8_t implicitConversion(uint32_t argc) { return argc; // BOOM -// CHECK: {{.*}}signed-integer-truncation-or-sign-change-blacklist.c:[[@LINE-1]]:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK: {{.*}}signed-integer-truncation-or-sign-change-blacklist.c:[[@LINE-1]]:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) } int main(int argc, char **argv) { Index: compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation.c =================================================================== --- compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation.c +++ compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation.c @@ -159,7 +159,7 @@ convert_unsigned_int_to_signed_int((uint32_t)UINT32_MAX); convert_signed_int_to_unsigned_int((int32_t)(uint32_t)UINT32_MAX); convert_signed_int_to_unsigned_char((int32_t)(uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}signed-integer-truncation.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -1 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V0: {{.*}}signed-integer-truncation.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -1 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)UINT8_MAX); convert_unsigned_char_to_signed_char((uint8_t)UINT8_MAX); convert_signed_char_to_unsigned_int((int8_t)UINT8_MAX); @@ -178,14 +178,14 @@ convert_unsigned_int_to_signed_int((uint32_t)INT32_MIN); convert_signed_int_to_unsigned_int((int32_t)(uint32_t)INT32_MIN); convert_signed_int_to_unsigned_char((int32_t)(uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}signed-integer-truncation.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) +// CHECK-V1: {{.*}}signed-integer-truncation.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MIN); convert_unsigned_char_to_signed_char((uint8_t)INT8_MIN); convert_signed_char_to_unsigned_int((int8_t)INT8_MIN); convert_unsigned_int_to_signed_char((uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}signed-integer-truncation.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to 0 (8-bit, signed) +// CHECK-V1: {{.*}}signed-integer-truncation.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to 0 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}signed-integer-truncation.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483648 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 0 (8-bit, signed) +// CHECK-V1: {{.*}}signed-integer-truncation.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483648 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to 0 (8-bit, signed) #elif defined(V2) // All bits except the source 'Sign' bit are set. convert_unsigned_int_to_unsigned_int((uint32_t)INT32_MAX); @@ -199,14 +199,14 @@ convert_unsigned_int_to_signed_int((uint32_t)INT32_MAX); convert_signed_int_to_unsigned_int((int32_t)(uint32_t)INT32_MAX); convert_signed_int_to_unsigned_char((int32_t)(uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}signed-integer-truncation.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483647 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V2: {{.*}}signed-integer-truncation.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483647 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MAX); convert_unsigned_char_to_signed_char((uint8_t)INT8_MAX); convert_signed_char_to_unsigned_int((int8_t)INT8_MAX); convert_unsigned_int_to_signed_char((uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}signed-integer-truncation.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V2: {{.*}}signed-integer-truncation.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}signed-integer-truncation.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483647 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V2: {{.*}}signed-integer-truncation.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483647 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) #elif defined(V3) // All destination bits set. convert_unsigned_int_to_unsigned_int((uint32_t)UINT8_MAX); @@ -224,9 +224,9 @@ convert_unsigned_char_to_signed_char((uint8_t)UINT8_MAX); convert_signed_char_to_unsigned_int((int8_t)UINT8_MAX); convert_unsigned_int_to_signed_char((uint32_t)UINT8_MAX); -// CHECK-V3: {{.*}}signed-integer-truncation.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 255 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V3: {{.*}}signed-integer-truncation.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 255 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)UINT8_MAX); -// CHECK-V3: {{.*}}signed-integer-truncation.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 255 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -1 (8-bit, signed) +// CHECK-V3: {{.*}}signed-integer-truncation.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 255 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) #elif defined(V4) // Destination 'sign' bit set. convert_unsigned_int_to_unsigned_int((uint32_t)(uint8_t)INT8_MIN); @@ -244,9 +244,9 @@ convert_unsigned_char_to_signed_char((uint8_t)(uint8_t)INT8_MIN); convert_signed_char_to_unsigned_int((int8_t)(uint8_t)INT8_MIN); convert_unsigned_int_to_signed_char((uint32_t)(uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}signed-integer-truncation.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 128 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V4: {{.*}}signed-integer-truncation.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 128 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(uint32_t)(uint8_t)INT8_MIN); -// CHECK-V4: {{.*}}signed-integer-truncation.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 128 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V4: {{.*}}signed-integer-truncation.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 128 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) #elif defined(V5) // All bits except the destination 'sign' bit are set. convert_unsigned_int_to_unsigned_int((~((uint32_t)(uint8_t)INT8_MIN))); @@ -260,14 +260,14 @@ convert_unsigned_int_to_signed_int((~((uint32_t)(uint8_t)INT8_MIN))); convert_signed_int_to_unsigned_int((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); convert_signed_int_to_unsigned_char((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}signed-integer-truncation.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -129 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V5: {{.*}}signed-integer-truncation.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -129 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)(uint8_t)INT8_MIN); convert_unsigned_char_to_signed_char((uint8_t)(uint8_t)INT8_MIN); convert_signed_char_to_unsigned_int((int8_t)(uint8_t)INT8_MIN); convert_unsigned_int_to_signed_char((~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}signed-integer-truncation.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V5: {{.*}}signed-integer-truncation.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}signed-integer-truncation.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -129 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V5: {{.*}}signed-integer-truncation.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -129 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) #elif defined(V6) // Only the source and destination sign bits are set. convert_unsigned_int_to_unsigned_int((uint32_t)INT32_MIN); @@ -281,14 +281,14 @@ convert_unsigned_int_to_signed_int((uint32_t)INT32_MIN); convert_signed_int_to_unsigned_int((uint32_t)INT32_MIN); convert_signed_int_to_unsigned_char((int32_t)(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V6: {{.*}}signed-integer-truncation.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483520 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V6: {{.*}}signed-integer-truncation.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483520 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MIN); convert_unsigned_char_to_signed_char((uint8_t)INT8_MIN); convert_signed_char_to_unsigned_int((int8_t)INT8_MIN); convert_unsigned_int_to_signed_char((((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V6: {{.*}}signed-integer-truncation.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V6: {{.*}}signed-integer-truncation.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V6: {{.*}}signed-integer-truncation.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -2147483520 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to -128 (8-bit, signed) +// CHECK-V6: {{.*}}signed-integer-truncation.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value -2147483520 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to -128 (8-bit, signed) #elif defined(V7) // All bits except the source and destination sign bits are set. convert_unsigned_int_to_unsigned_int((uint32_t)INT32_MAX); @@ -302,14 +302,14 @@ convert_unsigned_int_to_signed_int((uint32_t)INT32_MAX); convert_signed_int_to_unsigned_int((uint32_t)INT32_MAX); convert_signed_int_to_unsigned_char((int32_t)(~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN)))); -// CHECK-V7: {{.*}}signed-integer-truncation.c:1100:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483519 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V7: {{.*}}signed-integer-truncation.c:1100:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483519 (32-bit, signed) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) convert_signed_char_to_unsigned_char((int8_t)INT8_MAX); convert_unsigned_char_to_signed_char((uint8_t)INT8_MAX); convert_signed_char_to_unsigned_int((int8_t)INT8_MAX); convert_unsigned_int_to_signed_char(~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V7: {{.*}}signed-integer-truncation.c:1500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483519 (32-bit, unsigned) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V7: {{.*}}signed-integer-truncation.c:1500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483519 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) convert_signed_int_to_signed_char((int32_t)~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V7: {{.*}}signed-integer-truncation.c:1600:10: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value 2147483519 (32-bit, signed) to type 'int8_t' (aka 'signed char') changed the value to 127 (8-bit, signed) +// CHECK-V7: {{.*}}signed-integer-truncation.c:1600:10: runtime error: implicit conversion from type '{{.*}}' (aka 'int') of value 2147483519 (32-bit, signed) to type '{{.*}}' (aka 'signed char') changed the value to 127 (8-bit, signed) #else #error Some V* needs to be defined! #endif Index: compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/unsigned-integer-truncation-blacklist.c =================================================================== --- compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/unsigned-integer-truncation-blacklist.c +++ compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/unsigned-integer-truncation-blacklist.c @@ -52,7 +52,7 @@ uint8_t implicitUnsignedTruncation(uint32_t argc) { return argc; // BOOM -// CHECK: {{.*}}unsigned-integer-truncation-blacklist.c:[[@LINE-1]]:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK: {{.*}}unsigned-integer-truncation-blacklist.c:[[@LINE-1]]:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) } int main(int argc, char **argv) { Index: compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/unsigned-integer-truncation.c =================================================================== --- compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/unsigned-integer-truncation.c +++ compiler-rt/trunk/test/ubsan/TestCases/ImplicitConversion/unsigned-integer-truncation.c @@ -153,7 +153,7 @@ convert_signed_int_to_signed_int((int32_t)(uint32_t)UINT32_MAX); convert_signed_char_to_signed_char((int8_t)UINT8_MAX); convert_unsigned_int_to_unsigned_char((uint32_t)UINT32_MAX); -// CHECK-V0: {{.*}}unsigned-integer-truncation.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned +// CHECK-V0: {{.*}}unsigned-integer-truncation.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned convert_unsigned_char_to_unsigned_int((uint8_t)UINT8_MAX); convert_unsigned_char_to_signed_int((uint8_t)UINT8_MAX); convert_signed_char_to_signed_int((int8_t)UINT8_MAX); @@ -172,7 +172,7 @@ convert_signed_int_to_signed_int((int32_t)(uint32_t)INT32_MIN); convert_signed_char_to_signed_char((int8_t)INT8_MIN); convert_unsigned_int_to_unsigned_char((uint32_t)INT32_MIN); -// CHECK-V1: {{.*}}unsigned-integer-truncation.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) +// CHECK-V1: {{.*}}unsigned-integer-truncation.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483648 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)INT8_MIN); convert_unsigned_char_to_signed_int((uint8_t)INT8_MIN); convert_signed_char_to_signed_int((int8_t)INT8_MIN); @@ -191,7 +191,7 @@ convert_signed_int_to_signed_int((int32_t)(uint32_t)INT32_MAX); convert_signed_char_to_signed_char((int8_t)INT8_MAX); convert_unsigned_int_to_unsigned_char((uint32_t)INT32_MAX); -// CHECK-V2: {{.*}}unsigned-integer-truncation.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) +// CHECK-V2: {{.*}}unsigned-integer-truncation.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483647 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 255 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)INT8_MAX); convert_unsigned_char_to_signed_int((uint8_t)INT8_MAX); convert_signed_char_to_signed_int((int8_t)INT8_MAX); @@ -246,7 +246,7 @@ convert_signed_int_to_signed_int((int32_t)(~((uint32_t)(uint8_t)INT8_MIN))); convert_signed_char_to_signed_char((int8_t)(uint8_t)INT8_MIN); convert_unsigned_int_to_unsigned_char((~((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V5: {{.*}}unsigned-integer-truncation.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V5: {{.*}}unsigned-integer-truncation.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967167 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)(uint8_t)INT8_MIN); convert_unsigned_char_to_signed_int((uint8_t)(uint8_t)INT8_MIN); convert_signed_char_to_signed_int((int8_t)(uint8_t)INT8_MIN); @@ -265,7 +265,7 @@ convert_signed_int_to_signed_int((int32_t)INT32_MIN); convert_signed_char_to_signed_char((int8_t)INT8_MIN); convert_unsigned_int_to_unsigned_char(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN)); -// CHECK-V6: {{.*}}unsigned-integer-truncation.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) +// CHECK-V6: {{.*}}unsigned-integer-truncation.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483776 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)INT8_MIN); convert_unsigned_char_to_signed_int((uint8_t)INT8_MIN); convert_signed_char_to_signed_int((int8_t)INT8_MIN); @@ -284,7 +284,7 @@ convert_signed_int_to_signed_int((int32_t)INT32_MAX); convert_signed_char_to_signed_char((int8_t)INT8_MAX); convert_unsigned_int_to_unsigned_char(~(((uint32_t)INT32_MIN) | ((uint32_t)(uint8_t)INT8_MIN))); -// CHECK-V7: {{.*}}unsigned-integer-truncation.c:500:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483519 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) +// CHECK-V7: {{.*}}unsigned-integer-truncation.c:500:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 2147483519 (32-bit, unsigned) to type '{{.*}}' (aka 'unsigned char') changed the value to 127 (8-bit, unsigned) convert_unsigned_char_to_unsigned_int((uint8_t)INT8_MAX); convert_unsigned_char_to_signed_int((uint8_t)INT8_MAX); convert_signed_char_to_signed_int((int8_t)INT8_MAX);