summaryrefslogtreecommitdiff
path: root/test/Tooling
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2017-08-19 02:56:35 +0000
committerJohannes Altmanninger <aclopte@gmail.com>2017-08-19 02:56:35 +0000
commitc15e70eae870a8683089e94c1cc6e9c238a094a6 (patch)
tree34f4d4a86f8a23aafbf86586bd5b27a993258bf3 /test/Tooling
parent2ebc6faf999708676fa08524ffeb0df8d1988e3a (diff)
Revert "Revert "[clang-diff] Move printing of matches and changes to clang-diff""
Fix build by renaming ChangeKind -> Change This reverts commit 0c78c5729f29315d7945988efd048c0cb86c07ce. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311222 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Tooling')
-rw-r--r--test/Tooling/clang-diff-basic.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/test/Tooling/clang-diff-basic.cpp b/test/Tooling/clang-diff-basic.cpp
index ac676991e9..e70171509d 100644
--- a/test/Tooling/clang-diff-basic.cpp
+++ b/test/Tooling/clang-diff-basic.cpp
@@ -31,6 +31,10 @@ public:
int id(int i) { return i; }
};
}
+
+void m() { int x = 0 + 0 + 0; }
+int um = 1 + 2 + 3;
+
#else
// CHECK: Match TranslationUnitDecl{{.*}} to TranslationUnitDecl
// CHECK: Match NamespaceDecl: src{{.*}} to NamespaceDecl: dst
@@ -54,8 +58,8 @@ const char *b = "f" "o" "o";
typedef unsigned nat;
// CHECK: Match VarDecl: p(int){{.*}} to VarDecl: prod(double)
-// CHECK: Match BinaryOperator: *{{.*}} to BinaryOperator: *
// CHECK: Update VarDecl: p(int){{.*}} to prod(double)
+// CHECK: Match BinaryOperator: *{{.*}} to BinaryOperator: *
double prod = 1 * 2 * 10;
// CHECK: Update DeclRefExpr
int squared = prod * prod;
@@ -70,9 +74,15 @@ class X {
return "foo";
return 0;
}
- // CHECK: Delete AccessSpecDecl: public
- X(){};
- // CHECK: Delete CXXMethodDecl
+ X(){}
};
}
+
+// CHECK: Move DeclStmt{{.*}} into CompoundStmt
+void m() { { int x = 0 + 0 + 0; } }
+// CHECK: Update and Move IntegerLiteral: 7{{.*}} into BinaryOperator: +({{.*}}) at 1
+int um = 1 + 7;
#endif
+
+// CHECK: Delete AccessSpecDecl: public
+// CHECK: Delete CXXMethodDecl