diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-10-11 01:34:16 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-10-11 01:34:16 +0000 |
commit | 19c2e631bd0264cdb48dcdefa0186913e55b72fb (patch) | |
tree | ddfa57162ca16f4df71163f2479400fd6db5eb68 /compiler-rt | |
parent | bc97a4f46c3679ad1008267a0a1b380d5f26574b (diff) | |
download | bcm5719-llvm-19c2e631bd0264cdb48dcdefa0186913e55b72fb.tar.gz bcm5719-llvm-19c2e631bd0264cdb48dcdefa0186913e55b72fb.zip |
[UBSan] Fix UBSan testcase for float->int conversion after LLVM r219542.
llvm-svn: 219559
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp b/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp index 3f87e408683..e0ba7d4f3ed 100644 --- a/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp +++ b/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp @@ -84,9 +84,12 @@ int main(int argc, char **argv) { case '1': // CHECK-1: runtime error: value -2.14748{{.*}} is outside the range of representable values of type 'int' return MinFloatRepresentableAsInt - 0x100; - case '2': + case '2': { // CHECK-2: runtime error: value -1 is outside the range of representable values of type 'unsigned int' - return (unsigned)-1.0; + volatile float f = -1.0; + volatile unsigned u = (unsigned)f; + return 0; + } case '3': // CHECK-3: runtime error: value 4.2949{{.*}} is outside the range of representable values of type 'unsigned int' return (unsigned)(MaxFloatRepresentableAsUInt + 0x100); |