1 // Test without serialization:
2 // RUN: %clang_cc1 -Wno-unused -fobjc-arc -fblocks -fobjc-exceptions -ast-dump -ast-dump-filter Test %s \
3 // RUN: | FileCheck -strict-whitespace %s
5 // Test with serialization:
6 // RUN: %clang_cc1 -Wno-unused -fobjc-arc -fblocks -fobjc-exceptions -emit-pch -o %t %s
7 // RUN: %clang_cc1 -x objective-c -Wno-unused -fobjc-arc -fblocks -fobjc-exceptions -include-pch %t \
8 // RUN: -ast-dump-all -ast-dump-filter Test /dev/null \
9 // RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
10 // RUN: | FileCheck -strict-whitespace %s
12 void TestBlockExpr(int x) {
15 // CHECK: FunctionDecl{{.*}}TestBlockExpr
16 // CHECK: BlockExpr{{.*}} 'void (^)(void)'
17 // CHECK-NEXT: BlockDecl
19 void TestExprWithCleanup(int x) {
22 // CHECK: FunctionDecl{{.*}}TestExprWithCleanup
23 // CHECK: ExprWithCleanups
24 // CHECK-NEXT: cleanup Block
25 // CHECK-NEXT: BlockExpr
30 void TestObjCAtCatchStmt(void) {
37 // CHECK: FunctionDecl{{.*}}TestObjCAtCatchStmt
38 // CHECK: ObjCAtTryStmt
39 // CHECK-NEXT: CompoundStmt
40 // CHECK-NEXT: ObjCAtCatchStmt{{.*}}
41 // CHECK-NEXT: VarDecl{{.*}}a
42 // CHECK-NEXT: CompoundStmt
43 // CHECK-NEXT: ObjCAtCatchStmt{{.*}} catch all
44 // CHECK-NEXT: CompoundStmt
45 // CHECK-NEXT: ObjCAtFinallyStmt
51 id TestCompoundLiteral(id a) {
52 return ((S){ .f = a }).f;
55 // CHECK: FunctionDecl{{.*}}TestCompoundLiteral
56 // CHECK: ExprWithCleanups
57 // CHECK-NEXT: cleanup CompoundLiteralExpr
58 // CHECK: CompoundLiteralExpr{{.*}}'S':'S' lvalue