[clang] e616a42 - [SyntaxTree] Test for '\' inside token.

Eduardo Caldas via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 20 23:56:23 PDT 2020


Author: Eduardo Caldas
Date: 2020-09-21T06:56:14Z
New Revision: e616a4259889b55ed1bf5bf095f0e59658c6e311

URL: https://github.com/llvm/llvm-project/commit/e616a4259889b55ed1bf5bf095f0e59658c6e311
DIFF: https://github.com/llvm/llvm-project/commit/e616a4259889b55ed1bf5bf095f0e59658c6e311.diff

LOG: [SyntaxTree] Test for '\' inside token.

Differential Revision: https://reviews.llvm.org/D87895

Added: 
    

Modified: 
    clang/unittests/Tooling/Syntax/BuildTreeTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp b/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp
index 95ebeb2c5940..52bd5988b44e 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(


        


More information about the cfe-commits mailing list