diff options
| author | Vitaly Buka <vitalybuka@google.com> | 2024-08-21 17:47:17 -0700 |
|---|---|---|
| committer | Vitaly Buka <vitalybuka@google.com> | 2024-08-21 17:47:17 -0700 |
| commit | 54081b7e4a315cdbe1017eeded9e2cf861ecc0b4 (patch) | |
| tree | d7a4ed030ea94cd06ff903d648901fbe339a55bd /llvm/unittests/ADT/StringRefTest.cpp | |
| parent | ee572ed4ac2d9e2ff37217d6bedc20f530a5d3af (diff) | |
| parent | 64e464349bfca0d90e07f6db2f710d4d53cdacd4 (diff) | |
[𝘀𝗽𝗿] changes introduced through rebaseusers/vitalybuka/spr/main.asandarwin-simplify-test
Created using spr 1.3.4
[skip ci]
Diffstat (limited to 'llvm/unittests/ADT/StringRefTest.cpp')
| -rw-r--r-- | llvm/unittests/ADT/StringRefTest.cpp | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp index b3c206a33696..a0529b03ae8c 100644 --- a/llvm/unittests/ADT/StringRefTest.cpp +++ b/llvm/unittests/ADT/StringRefTest.cpp @@ -16,21 +16,6 @@ #include "gtest/gtest.h" using namespace llvm; -namespace llvm { - -std::ostream &operator<<(std::ostream &OS, const StringRef &S) { - OS << S.str(); - return OS; -} - -std::ostream &operator<<(std::ostream &OS, - const std::pair<StringRef, StringRef> &P) { - OS << "(" << P.first << ", " << P.second << ")"; - return OS; -} - -} - // Check that we can't accidentally assign a temporary std::string to a // StringRef. (Unfortunately we can't make use of the same thing with // constructors.) @@ -939,16 +924,17 @@ struct GetDoubleStrings { bool AllowInexact; bool ShouldFail; double D; -} DoubleStrings[] = {{"0", false, false, 0.0}, - {"0.0", false, false, 0.0}, - {"-0.0", false, false, -0.0}, - {"123.45", false, true, 123.45}, - {"123.45", true, false, 123.45}, - {"1.8e308", true, false, std::numeric_limits<double>::infinity()}, - {"1.8e308", false, true, std::numeric_limits<double>::infinity()}, - {"0x0.0000000000001P-1023", false, true, 0.0}, - {"0x0.0000000000001P-1023", true, false, 0.0}, - }; +} DoubleStrings[] = { + {"0", false, false, 0.0}, + {"0.0", false, false, 0.0}, + {"-0.0", false, false, -0.0}, + {"123.45", false, true, 123.45}, + {"123.45", true, false, 123.45}, + {"1.8e308", true, false, std::numeric_limits<double>::infinity()}, + {"1.8e308", false, true, std::numeric_limits<double>::infinity()}, + {"0x0.0000000000001P-1023", false, true, 0.0}, + {"0x0.0000000000001P-1023", true, false, 0.0}, +}; TEST(StringRefTest, getAsDouble) { for (const auto &Entry : DoubleStrings) { @@ -1117,7 +1103,8 @@ TEST(StringRefTest, StringLiteral) { constexpr StringRef StringRefs[] = {"Foo", "Bar"}; EXPECT_EQ(StringRef("Foo"), StringRefs[0]); EXPECT_EQ(3u, (std::integral_constant<size_t, StringRefs[0].size()>::value)); - EXPECT_EQ(false, (std::integral_constant<bool, StringRefs[0].empty()>::value)); + EXPECT_EQ(false, + (std::integral_constant<bool, StringRefs[0].empty()>::value)); EXPECT_EQ(StringRef("Bar"), StringRefs[1]); constexpr StringLiteral Strings[] = {"Foo", "Bar"}; |
