From e616a4259889b55ed1bf5bf095f0e59658c6e311 Mon Sep 17 00:00:00 2001 From: Eduardo Caldas Date: Fri, 18 Sep 2020 09:34:57 +0000 Subject: [PATCH] [SyntaxTree] Test for '\' inside token. Differential Revision: https://reviews.llvm.org/D87895 --- clang/unittests/Tooling/Syntax/BuildTreeTest.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp b/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp index 95ebeb2..52bd598 100644 --- a/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp +++ b/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp @@ -167,6 +167,23 @@ TranslationUnit Detached )txt")); } +TEST_P(BuildSyntaxTreeTest, Simple_BackslashInsideToken) { + EXPECT_TRUE(treeDumpEqual( + R"cpp( +in\ +t a; +)cpp", + R"txt( +TranslationUnit Detached +`-SimpleDeclaration + |-'in\ +t' + |-SimpleDeclarator Declarator + | `-'a' + `-';' +)txt")); +} + TEST_P(BuildSyntaxTreeTest, If) { EXPECT_TRUE(treeDumpEqualOnAnnotations( R"cpp( -- 2.7.4