aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Lex/LexerTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Lex/LexerTest.cpp')
-rw-r--r--clang/unittests/Lex/LexerTest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/unittests/Lex/LexerTest.cpp b/clang/unittests/Lex/LexerTest.cpp
index c68eed9..4cdabe0 100644
--- a/clang/unittests/Lex/LexerTest.cpp
+++ b/clang/unittests/Lex/LexerTest.cpp
@@ -556,4 +556,17 @@ TEST_F(LexerTest, FindNextToken) {
EXPECT_THAT(GeneratedByNextToken, ElementsAre("abcd", "=", "0", ";", "int",
"xyz", "=", "abcd", ";"));
}
+
+TEST_F(LexerTest, CreatedFIDCountForPredefinedBuffer) {
+ TrivialModuleLoader ModLoader;
+ auto PP = CreatePP("", ModLoader);
+ while (1) {
+ Token tok;
+ PP->Lex(tok);
+ if (tok.is(tok::eof))
+ break;
+ }
+ EXPECT_EQ(SourceMgr.getNumCreatedFIDsForFileID(PP->getPredefinesFileID()),
+ 1U);
+}
} // anonymous namespace