summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Tooling/clang-diff-ast.cpp28
-rw-r--r--clang/test/Tooling/clang-diff-basic.cpp10
-rw-r--r--clang/test/Tooling/clang-diff-bottomup.cpp2
-rw-r--r--clang/test/Tooling/clang-diff-html.test4
-rw-r--r--clang/test/Tooling/clang-diff-opt.cpp1
-rw-r--r--clang/test/Tooling/clang-diff-topdown.cpp2
6 files changed, 31 insertions, 16 deletions
diff --git a/clang/test/Tooling/clang-diff-ast.cpp b/clang/test/Tooling/clang-diff-ast.cpp
index 970031a95b9..9381489f8f3 100644
--- a/clang/test/Tooling/clang-diff-ast.cpp
+++ b/clang/test/Tooling/clang-diff-ast.cpp
@@ -5,22 +5,31 @@
// CHECK: {{^}} NamespaceDecl: test;(
namespace test {
-// CHECK: {{^}} FunctionDecl: f(
+// CHECK: {{^}} FunctionDecl: test::f(
// CHECK: CompoundStmt(
void f() {
// CHECK: VarDecl: i(int)(
// CHECK: IntegerLiteral: 1
auto i = 1;
+ // CHECK: FloatingLiteral: 1.5(
+ auto r = 1.5;
+ // CHECK: CXXBoolLiteralExpr: true(
+ auto b = true;
// CHECK: CallExpr(
// CHECK-NOT: ImplicitCastExpr
- // CHECK-NEXT: DeclRefExpr: f(
+ // CHECK: DeclRefExpr: test::f(
f();
+ // CHECK: UnaryOperator: ++(
+ ++i;
// CHECK: BinaryOperator: =(
i = i;
}
} // end namespace test
+// CHECK: UsingDirectiveDecl: test(
+using namespace test;
+
// CHECK: TypedefDecl: nat;unsigned int;(
typedef unsigned nat;
// CHECK: TypeAliasDecl: real;double;(
@@ -29,10 +38,10 @@ using real = double;
class Base {
};
-// CHECK: CXXRecordDecl: X;class X;(
+// CHECK: CXXRecordDecl: X;X;(
class X : Base {
int m;
- // CHECK: CXXMethodDecl: foo(const char *(int)
+ // CHECK: CXXMethodDecl: X::foo(const char *(int)
// CHECK: ParmVarDecl: i(int)(
const char *foo(int i) {
if (i == 0)
@@ -44,11 +53,16 @@ class X : Base {
// CHECK: AccessSpecDecl: public(
public:
- // CHECK: CXXConstructorDecl: X(void (char, int){{( __attribute__\(\(thiscall\)\))?}})(
- X(char, int) : Base(), m(0) {
- // CHECK: MemberExpr(
+ int not_initialized;
+ // All initialized members, bases and delegating initializers are are
+ // appended, separated by commas.
+ // CHECK: CXXConstructorDecl: X::X(void (char, int){{( __attribute__\(\(thiscall\)\))?}})Base,X::m,(
+ X(char c, int) : Base(), m(0) {
+ // CHECK: MemberExpr: X::m(
int x = m;
}
+ // CHECK: CXXConstructorDecl: X::X(void (char))X,(
+ X(char s) : X(s, 4) {}
};
#define M (void)1
diff --git a/clang/test/Tooling/clang-diff-basic.cpp b/clang/test/Tooling/clang-diff-basic.cpp
index aa78d5dc522..5febd7265dc 100644
--- a/clang/test/Tooling/clang-diff-basic.cpp
+++ b/clang/test/Tooling/clang-diff-basic.cpp
@@ -11,18 +11,18 @@ void foo() {
}
}
-// CHECK: Match DeclRefExpr: foo{{.*}} to DeclRefExpr: inner::foo
+// CHECK: Match DeclRefExpr: src::foo{{.*}} to DeclRefExpr: dst::inner::foo
void main() { inner::foo(); }
// CHECK: Match StringLiteral: foo{{.*}} to StringLiteral: foo
const char *b = "f" "o" "o";
// unsigned is canonicalized to unsigned int
-// CHECK: Match TypedefDecl: nat;unsigned int;{{.*}} to TypedefDecl: nat;unsigned int;
+// CHECK: Match TypedefDecl: src::nat;unsigned int;{{.*}} to TypedefDecl: dst::nat;unsigned int;
typedef unsigned nat;
-// CHECK: Match VarDecl: p(int){{.*}} to VarDecl: prod(double)
-// CHECK: Update VarDecl: p(int){{.*}} to prod(double)
+// CHECK: Match VarDecl: src::p(int){{.*}} to VarDecl: dst::prod(double)
+// CHECK: Update VarDecl: src::p(int){{.*}} to dst::prod(double)
// CHECK: Match BinaryOperator: *{{.*}} to BinaryOperator: *
double prod = 1 * 2 * 10;
// CHECK: Update DeclRefExpr
@@ -49,7 +49,7 @@ int um = 1 + 7;
namespace {
// match with parents of different type
-// CHECK: Match FunctionDecl: f1{{.*}} to FunctionDecl: f1
+// CHECK: Match FunctionDecl: f1{{.*}} to FunctionDecl: (anonymous namespace)::f1
void f1() {{ (void) __func__;;; }}
}
diff --git a/clang/test/Tooling/clang-diff-bottomup.cpp b/clang/test/Tooling/clang-diff-bottomup.cpp
index 8193ad7bbd6..bc5d2cbdf43 100644
--- a/clang/test/Tooling/clang-diff-bottomup.cpp
+++ b/clang/test/Tooling/clang-diff-bottomup.cpp
@@ -16,7 +16,7 @@ void f2() { ;; {{;}} }
void f1() {
// CompoundStmt: 3 matched descendants, subtree sizes 4 and 5
// Jaccard similarity = 3 / (4 + 5 - 3) = 3 / 6 >= 0.5
-// CHECK: Match FunctionDecl: f1(void (void))(1) to FunctionDecl: f1(void (void))(1)
+// CHECK: Match FunctionDecl: f1(void ())(1) to FunctionDecl: f1(void ())(1)
// CHECK: Match CompoundStmt(2) to CompoundStmt(2)
// CHECK: Match CompoundStmt(4) to CompoundStmt(3)
// CHECK: Match CompoundStmt(5) to CompoundStmt(4)
diff --git a/clang/test/Tooling/clang-diff-html.test b/clang/test/Tooling/clang-diff-html.test
index 9b0d6ebb182..876e731e9a0 100644
--- a/clang/test/Tooling/clang-diff-html.test
+++ b/clang/test/Tooling/clang-diff-html.test
@@ -11,12 +11,12 @@
// match, move
// CHECK: <span id='L[[L:[0-9]+]]' tid='R[[R:[0-9]+]]' title='FunctionDecl
// CHECK-NEXT: [[L]] -> [[R]]
-// CHECK-NEXT: foo(void (void))' class='m'>void foo()
+// CHECK-NEXT: src::foo(void ())' class='u m'>void foo()
// match
// CHECK: <span id='L[[L:[0-9]+]]' tid='R[[R:[0-9]+]]' title='FunctionDecl
// CHECK-NEXT: [[L]] -> [[R]]
-// CHECK-NEXT: main(void (void))'>void main()
+// CHECK-NEXT: src::main(void ())' class='u'>void main()
// deletion
// CHECK: <span id='L[[L:[0-9]+]]' tid='R-1' title='IntegerLiteral
diff --git a/clang/test/Tooling/clang-diff-opt.cpp b/clang/test/Tooling/clang-diff-opt.cpp
index 567483de1f2..771c6abaecb 100644
--- a/clang/test/Tooling/clang-diff-opt.cpp
+++ b/clang/test/Tooling/clang-diff-opt.cpp
@@ -41,4 +41,5 @@ void f3() {
// CHECK: Delete NullStmt(22)
;; {{;;;;;;}}
}
+
#endif
diff --git a/clang/test/Tooling/clang-diff-topdown.cpp b/clang/test/Tooling/clang-diff-topdown.cpp
index 55553899392..82aab1033d0 100644
--- a/clang/test/Tooling/clang-diff-topdown.cpp
+++ b/clang/test/Tooling/clang-diff-topdown.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -E %s > %t.src.cpp
// RUN: %clang_cc1 -E %s > %t.dst.cpp -DDEST
-// RUN: clang-diff -dump-matches -stop-after=topdown %t.src.cpp %t.dst.cpp -- | FileCheck %s
+// RUN: clang-diff -dump-matches -stop-after=topdown %t.src.cpp %t.dst.cpp -- -std=c++11 | FileCheck %s
//
// Test the top-down matching of identical subtrees only.
OpenPOWER on IntegriCloud