Files
llvm-project/clang/test/Misc/ast-dump-stmt.c
Richard Trieu de5cc7d3d8 Add indents to AST dumping and removed parenthesis from AST nodes.
Indents were given the color blue when outputting with color.
AST dumping now looks like this:

Node
|-Node
| `-Node
`-Node
  `-Node

Compared to the previous:

(Node
  (Node
    (Node))
  (Node
    (Node)))

llvm-svn: 174022
2013-01-31 01:44:26 +00:00

36 lines
1.1 KiB
C

// RUN: %clang_cc1 -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s
int TestLocation = 0;
// CHECK: VarDecl{{.*}}TestLocation
// CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:20> 'int' 0
int TestIndent = 1 + (1);
// CHECK: VarDecl{{.*}}TestIndent
// CHECK-NEXT: {{^}}`-BinaryOperator{{[^()]*$}}
// CHECK-NEXT: {{^}} |-IntegerLiteral{{.*0[^()]*$}}
// CHECK-NEXT: {{^}} `-ParenExpr{{.*0[^()]*$}}
// CHECK-NEXT: {{^}} `-IntegerLiteral{{.*0[^()]*$}}
void TestDeclStmt() {
int x = 0;
int y, z;
}
// CHECK: FunctionDecl{{.*}}TestDeclStmt
// CHECK-NEXT: CompoundStmt
// CHECK-NEXT: DeclStmt
// CHECK-NEXT: VarDecl{{.*}}x
// CHECK-NEXT: IntegerLiteral
// CHECK-NEXT: DeclStmt
// CHECK-NEXT: VarDecl{{.*}}y
// CHECK-NEXT: VarDecl{{.*}}z
int TestOpaqueValueExpr = 0 ?: 1;
// CHECK: VarDecl{{.*}}TestOpaqueValueExpr
// CHECK-NEXT: BinaryConditionalOperator
// CHECK-NEXT: IntegerLiteral
// CHECK-NEXT: OpaqueValueExpr
// CHECK-NEXT: IntegerLiteral
// CHECK-NEXT: OpaqueValueExpr
// CHECK-NEXT: IntegerLiteral
// CHECK-NEXT: IntegerLiteral