teemperor created this revision.
teemperor added a reviewer: uweigand.

float can't represent the given value in the literal, so we get this UB error: 
`runtime error: 1.23457e+48 is outside the range of representable values of 
type 'float'`. The test seems to not rely on this specific value, so let's just 
choose a smaller one that can be represented.


https://reviews.llvm.org/D42338

Files:
  unittests/Core/ScalarTest.cpp


Index: unittests/Core/ScalarTest.cpp
===================================================================
--- unittests/Core/ScalarTest.cpp
+++ unittests/Core/ScalarTest.cpp
@@ -31,7 +31,7 @@
 TEST(ScalarTest, GetBytes) {
   int a = 0x01020304;
   long long b = 0x0102030405060708LL;
-  float c = 1234567.89e42;
+  float c = 1234567.89e32;
   double d = 1234567.89e42;
   char e[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
   char f[32] = {1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,


Index: unittests/Core/ScalarTest.cpp
===================================================================
--- unittests/Core/ScalarTest.cpp
+++ unittests/Core/ScalarTest.cpp
@@ -31,7 +31,7 @@
 TEST(ScalarTest, GetBytes) {
   int a = 0x01020304;
   long long b = 0x0102030405060708LL;
-  float c = 1234567.89e42;
+  float c = 1234567.89e32;
   double d = 1234567.89e42;
   char e[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
   char f[32] = {1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH] D4... Raphael Isemann via Phabricator via lldb-commits

Reply via email to