summaryrefslogtreecommitdiff
path: root/unittests/ADT/APFloatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/ADT/APFloatTest.cpp')
-rw-r--r--unittests/ADT/APFloatTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/unittests/ADT/APFloatTest.cpp b/unittests/ADT/APFloatTest.cpp
index 8b88c123b197..1212b45fb575 100644
--- a/unittests/ADT/APFloatTest.cpp
+++ b/unittests/ADT/APFloatTest.cpp
@@ -983,6 +983,13 @@ TEST(APFloatTest, toString) {
ASSERT_EQ("8.73183400000000010e+02", convertToString(873.1834, 0, 0, false));
ASSERT_EQ("1.79769313486231570e+308",
convertToString(1.7976931348623157E+308, 0, 0, false));
+
+ {
+ SmallString<64> Str;
+ APFloat UnnormalZero(APFloat::x87DoubleExtended(), APInt(80, {0, 1}));
+ UnnormalZero.toString(Str);
+ ASSERT_EQ("NaN", Str);
+ }
}
TEST(APFloatTest, toInteger) {