summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Lex/LexerTest.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2019-04-05 22:11:28 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2019-04-05 22:11:28 +0000
commit4a9007cde74b6c700d3a5614fa176b456a86dd66 (patch)
treeb5d3366ee426a3f0e3b6ce2e53ce8cb2feaf1bee /clang/unittests/Lex/LexerTest.cpp
parentcb70fe1c69a2eadda02682383e1f3e877409090d (diff)
downloadbcm5719-llvm-4a9007cde74b6c700d3a5614fa176b456a86dd66.tar.gz
bcm5719-llvm-4a9007cde74b6c700d3a5614fa176b456a86dd66.zip
Revert "[Lexer] NFC: Fix an off-by-one bug in getAsCharRange()."
This reverts commit r357823. Was breaking clang-tidy! Differential Revision: https://reviews.llvm.org/D59977 llvm-svn: 357827
Diffstat (limited to 'clang/unittests/Lex/LexerTest.cpp')
-rw-r--r--clang/unittests/Lex/LexerTest.cpp19
1 files changed, 0 insertions, 19 deletions
diff --git a/clang/unittests/Lex/LexerTest.cpp b/clang/unittests/Lex/LexerTest.cpp
index 7b14f56201e..320b60ea639 100644
--- a/clang/unittests/Lex/LexerTest.cpp
+++ b/clang/unittests/Lex/LexerTest.cpp
@@ -513,23 +513,4 @@ TEST_F(LexerTest, StringizingRasString) {
EXPECT_EQ(String6, R"(a\\\n\n\n \\\\b)");
}
-TEST_F(LexerTest, CharRangeOffByOne) {
- std::vector<Token> toks = Lex(R"(#define MOO 1
- void foo() { MOO; })");
- const Token &moo = toks[5];
-
- EXPECT_EQ(getSourceText(moo, moo), "MOO");
-
- SourceRange R{moo.getLocation(), moo.getLocation()};
-
- EXPECT_TRUE(
- Lexer::isAtStartOfMacroExpansion(R.getBegin(), SourceMgr, LangOpts));
- EXPECT_TRUE(
- Lexer::isAtEndOfMacroExpansion(R.getEnd(), SourceMgr, LangOpts));
-
- CharSourceRange CR = Lexer::getAsCharRange(R, SourceMgr, LangOpts);
-
- EXPECT_EQ(Lexer::getSourceText(CR, SourceMgr, LangOpts), "MOO"); // Was "MO".
-}
-
} // anonymous namespace
OpenPOWER on IntegriCloud