diff options
Diffstat (limited to 'llvm/unittests/Support/FormatVariadicTest.cpp')
-rw-r--r-- | llvm/unittests/Support/FormatVariadicTest.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/unittests/Support/FormatVariadicTest.cpp b/llvm/unittests/Support/FormatVariadicTest.cpp index 54373da51c4..6d621464c0e 100644 --- a/llvm/unittests/Support/FormatVariadicTest.cpp +++ b/llvm/unittests/Support/FormatVariadicTest.cpp @@ -671,3 +671,12 @@ TEST(FormatVariadicTest, CopiesAndMoves) { EXPECT_EQ(0, R.Copied); EXPECT_EQ(0, R.Moved); } + +namespace adl { +struct X {}; +raw_ostream &operator<<(raw_ostream &OS, const X &) { return OS << "X"; } +} // namespace adl +TEST(FormatVariadicTest, FormatStreamable) { + adl::X X; + EXPECT_EQ("X", formatv("{0}", X).str()); +} |