[PATCH] D109072: [flang] Remove blank from NaN string representation

vdonaldson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 1 17:46:15 PDT 2021


vdonaldson updated this revision to Diff 370124.
vdonaldson added a comment.

update unit test


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109072/new/

https://reviews.llvm.org/D109072

Files:
  flang/lib/Evaluate/real.cpp
  flang/unittests/Evaluate/real.cpp


Index: flang/unittests/Evaluate/real.cpp
===================================================================
--- flang/unittests/Evaluate/real.cpp
+++ flang/unittests/Evaluate/real.cpp
@@ -24,7 +24,7 @@
     std::uint64_t raw;
     const char *expected;
   } table[] = {
-      {0x7f876543, "NaN 0x7f876543"},
+      {0x7f876543, "NaN0x7f876543"},
       {0x7f800000, "Inf"},
       {0xff800000, "-Inf"},
       {0x00000000, "0.0"},
Index: flang/lib/Evaluate/real.cpp
===================================================================
--- flang/lib/Evaluate/real.cpp
+++ flang/lib/Evaluate/real.cpp
@@ -439,7 +439,7 @@
 
 template <typename W, int P> std::string Real<W, P>::DumpHexadecimal() const {
   if (IsNotANumber()) {
-    return "NaN 0x"s + word_.Hexadecimal();
+    return "NaN0x"s + word_.Hexadecimal();
   } else if (IsNegative()) {
     return "-"s + Negate().DumpHexadecimal();
   } else if (IsInfinite()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109072.370124.patch
Type: text/x-patch
Size: 923 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210902/e28ebfb4/attachment.bin>


More information about the llvm-commits mailing list