rupprecht created this revision. rupprecht added a reviewer: aaron.ballman. Herald added subscribers: cfe-commits, jsji, kbarton, nemanjai.
r350891 caused some internal failures that this test case exposes. Repository: rC Clang https://reviews.llvm.org/D56728 Files: unittests/Lex/PPCallbacksTest.cpp Index: unittests/Lex/PPCallbacksTest.cpp =================================================================== --- unittests/Lex/PPCallbacksTest.cpp +++ unittests/Lex/PPCallbacksTest.cpp @@ -483,6 +483,16 @@ EXPECT_EQ( GetSourceStringToEnd(CharSourceRange(Results7[1].ConditionRange, false)), "defined(FLOOFY)"); + const auto &Results8 = + DirectiveExprRange("#define FLOOFY 0\n#if __FILE__ > FLOOFY\n#endif\n"); + EXPECT_EQ(Results8.size(), 1U); + EXPECT_EQ( + GetSourceStringToEnd(CharSourceRange(Results8[0].ConditionRange, false)), + "__FILE__ > FLOOFY"); + EXPECT_EQ( + Lexer::getSourceText(CharSourceRange(Results8[0].ConditionRange, false), + SourceMgr, LangOpts), + "__FILE__ > FLOOFY"); } } // namespace
Index: unittests/Lex/PPCallbacksTest.cpp =================================================================== --- unittests/Lex/PPCallbacksTest.cpp +++ unittests/Lex/PPCallbacksTest.cpp @@ -483,6 +483,16 @@ EXPECT_EQ( GetSourceStringToEnd(CharSourceRange(Results7[1].ConditionRange, false)), "defined(FLOOFY)"); + const auto &Results8 = + DirectiveExprRange("#define FLOOFY 0\n#if __FILE__ > FLOOFY\n#endif\n"); + EXPECT_EQ(Results8.size(), 1U); + EXPECT_EQ( + GetSourceStringToEnd(CharSourceRange(Results8[0].ConditionRange, false)), + "__FILE__ > FLOOFY"); + EXPECT_EQ( + Lexer::getSourceText(CharSourceRange(Results8[0].ConditionRange, false), + SourceMgr, LangOpts), + "__FILE__ > FLOOFY"); } } // namespace
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits