Index: test/ubsan/TestCases/Float/cast-overflow.cpp =================================================================== --- test/ubsan/TestCases/Float/cast-overflow.cpp +++ test/ubsan/TestCases/Float/cast-overflow.cpp @@ -87,9 +87,11 @@ static int test_int = MaxFloatRepresentableAsInt + 0x80; return 0; } - case '1': + case '1': { // CHECK-1: runtime error: value -2.14748{{.*}} is outside the range of representable values of type 'int' - return MinFloatRepresentableAsInt - 0x100; + static int test_int = MinFloatRepresentableAsInt - 0x100; + return 0; + } case '2': { // CHECK-2: runtime error: value -1 is outside the range of representable values of type 'unsigned int' volatile float f = -1.0; @@ -107,9 +109,11 @@ static int test_int = Inf; return 0; } - case '5': + case '5': { // CHECK-5: runtime error: value {{.*}} is outside the range of representable values of type 'int' - return NaN; + static int test_int = NaN; + return 0; + } // Integer -> floating point overflow. case '6': {