1 // RUN: clang-diff -ast-dump %s -- -std=c++11 | FileCheck %s
4 // CHECK: {{^}}TranslationUnitDecl(0)
5 // CHECK: {{^}} NamespaceDecl: test;(
8 // CHECK: {{^}} FunctionDecl: :f(
9 // CHECK: CompoundStmt(
11 // CHECK: VarDecl: i(int)(
12 // CHECK: IntegerLiteral: 1
14 // CHECK: FloatingLiteral: 1.5(
16 // CHECK: CXXBoolLiteralExpr: true(
19 // CHECK-NOT: ImplicitCastExpr
20 // CHECK: DeclRefExpr: :f(
22 // CHECK: UnaryOperator: ++(
24 // CHECK: BinaryOperator: =(
28 } // end namespace test
30 // CHECK: UsingDirectiveDecl: test(
33 // CHECK: TypedefDecl: nat;unsigned int;(
35 // CHECK: TypeAliasDecl: real;double;(
41 // CHECK: CXXRecordDecl: X;X;(
44 // CHECK: CXXMethodDecl: :foo(const char *(int)
45 // CHECK: ParmVarDecl: i(int)(
46 const char *foo(int i
) {
48 // CHECK: StringLiteral: foo(
50 // CHECK-NOT: ImplicitCastExpr
54 // CHECK: AccessSpecDecl: public(
57 // CHECK: CXXConstructorDecl: :X(void (char, int){{( __attribute__\(\(thiscall\)\))?}})(
58 // CHECK-NEXT: ParmVarDecl: s(char)
59 // CHECK-NEXT: ParmVarDecl: (int)
60 // CHECK-NEXT: CXXCtorInitializer: Base
61 // CHECK-NEXT: CXXConstructExpr
62 // CHECK-NEXT: CXXCtorInitializer: m
63 // CHECK-NEXT: IntegerLiteral: 0
64 X(char s
, int) : Base(), m(0) {
65 // CHECK-NEXT: CompoundStmt
66 // CHECK: MemberExpr: :m(
69 // CHECK: CXXConstructorDecl: :X(void (char){{( __attribute__\(\(thiscall\)\))?}})(
70 // CHECK: CXXCtorInitializer: X
71 X(char s
) : X(s
, 4) {}
75 #define MA(a, b) (void)a, b
76 // CHECK: FunctionDecl
77 // CHECK-NEXT: CompoundStmt
85 // CHECK-NEXT: NamespaceDecl
87 // nodes from other files are excluded, there should be no output here
88 #include "clang-diff-ast.cpp"
90 // CHECK-NEXT: FunctionDecl: sentinel