minix/external/bsd/llvm/dist/clang/test/Misc/ast-dump-stmt.c
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

35 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