summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/ubsan/lit_tests/Float/cast-overflow.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-03-19 00:04:20 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-03-19 00:04:20 +0000
commit807e4dced5419437b7965da8fea34e8d0227d49a (patch)
tree573f3c868f130dc83f3837a8ce587b0bb737c21a /compiler-rt/lib/ubsan/lit_tests/Float/cast-overflow.cpp
parent4af40c4083efdc50792dc7eecbb7b7fae713ca12 (diff)
downloadbcm5719-llvm-807e4dced5419437b7965da8fea34e8d0227d49a.tar.gz
bcm5719-llvm-807e4dced5419437b7965da8fea34e8d0227d49a.zip
Update ubsan test for clang change r177362.
llvm-svn: 177363
Diffstat (limited to 'compiler-rt/lib/ubsan/lit_tests/Float/cast-overflow.cpp')
-rw-r--r--compiler-rt/lib/ubsan/lit_tests/Float/cast-overflow.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler-rt/lib/ubsan/lit_tests/Float/cast-overflow.cpp b/compiler-rt/lib/ubsan/lit_tests/Float/cast-overflow.cpp
index 63410dc8714..98addf8a2c2 100644
--- a/compiler-rt/lib/ubsan/lit_tests/Float/cast-overflow.cpp
+++ b/compiler-rt/lib/ubsan/lit_tests/Float/cast-overflow.cpp
@@ -36,6 +36,9 @@ int main(int argc, char **argv) {
(void)(float)FloatMaxAsUInt128; // ok
#endif
+ float NearlyMinusOne = -0.99999;
+ unsigned Zero = NearlyMinusOne; // ok
+
// Build a '+Inf'.
char InfVal[] = { 0x00, 0x00, 0x80, 0x7f };
float Inf;
@@ -59,8 +62,8 @@ int main(int argc, char **argv) {
// CHECK-1: runtime error: value -2.14748{{.*}} is outside the range of representable values of type 'int'
return MinFloatRepresentableAsInt - 0x100;
case '2':
- // CHECK-2: runtime error: value -0.001 is outside the range of representable values of type 'unsigned int'
- return (unsigned)-0.001;
+ // CHECK-2: runtime error: value -1 is outside the range of representable values of type 'unsigned int'
+ return (unsigned)-1.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);
OpenPOWER on IntegriCloud