1 // RUN: clang-diff -dump-matches %S/Inputs/clang-diff-basic-src.cpp %s -- | FileCheck %s
3 // CHECK: Match TranslationUnitDecl{{.*}} to TranslationUnitDecl
4 // CHECK: Match NamespaceDecl: src{{.*}} to NamespaceDecl: dst
6 // CHECK-NOT: Match NamespaceDecl: src{{.*}} to NamespaceDecl: inner
9 // CHECK: Match IntegerLiteral: 321{{.*}} to IntegerLiteral: 322
14 // CHECK: Match DeclRefExpr: :foo{{.*}} to DeclRefExpr: :inner::foo
15 void main() { inner::foo(); }
17 // CHECK: Match StringLiteral: foo{{.*}} to StringLiteral: foo
18 const char *b
= "f" "o" "o";
20 // unsigned is canonicalized to unsigned int
21 // CHECK: Match TypedefDecl: :nat;unsigned int;{{.*}} to TypedefDecl: :nat;unsigned int;
24 // CHECK: Match VarDecl: :p(int){{.*}} to VarDecl: :prod(double)
25 // CHECK: Update VarDecl: :p(int){{.*}} to :prod(double)
26 // CHECK: Match BinaryOperator: *{{.*}} to BinaryOperator: *
27 double prod
= 1 * 2 * 10;
28 // CHECK: Update DeclRefExpr
29 int squared
= prod
* prod
;
32 const char *foo(int i
) {
35 // CHECK: Insert IfStmt{{.*}} into IfStmt
36 // CHECK: Insert BinaryOperator: =={{.*}} into IfStmt
45 // CHECK: Move CompoundStmt{{.*}} into CompoundStmt
46 void m() { { int x
= 0 + 0 + 0; } }
47 // CHECK: Update and Move IntegerLiteral: 7{{.*}} into BinaryOperator: +({{.*}}) at 1
51 // match with parents of different type
52 // CHECK: Match FunctionDecl: f1{{.*}} to FunctionDecl: (anonymous namespace)::f1
53 void f1() {{ (void) __func__
;;; }}
56 // CHECK: Delete AccessSpecDecl: public
57 // CHECK: Delete CXXMethodDecl