blob: 8c0ca897e51149e9b7c7a5eb72b8bb36d1e2a9a8 [file] [log] [blame]
Manuel Klimek874030e2012-11-07 00:33:12 +00001// RUN: %clang_cc1 -Wno-unused -fblocks -fobjc-exceptions -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s
2
3void TestBlockExpr(int x) {
4 ^{ x; };
5}
Alexander Kornienko90ff6072012-12-20 02:09:13 +00006// CHECK: FunctionDecl{{.*}}TestBlockExpr
7// CHECK: BlockExpr{{.*}} 'void (^)(void)'
8// CHECK-NEXT: BlockDecl
Manuel Klimek874030e2012-11-07 00:33:12 +00009
10void TestExprWithCleanup(int x) {
11 ^{ x; };
12}
Alexander Kornienko90ff6072012-12-20 02:09:13 +000013// CHECK: FunctionDecl{{.*}}TestExprWithCleanup
Manuel Klimek874030e2012-11-07 00:33:12 +000014// CHECK: ExprWithCleanups
15// CHECK-NEXT: cleanup Block
16// CHECK-NEXT: BlockExpr
17
18@interface A
19@end
20
21void TestObjCAtCatchStmt() {
22 @try {
23 } @catch(A *a) {
24 } @catch(...) {
25 } @finally {
26 }
27}
Alexander Kornienko90ff6072012-12-20 02:09:13 +000028// CHECK: FunctionDecl{{.*}}TestObjCAtCatchStmt
Manuel Klimek874030e2012-11-07 00:33:12 +000029// CHECK: ObjCAtTryStmt
30// CHECK-NEXT: CompoundStmt
Alexander Kornienko90ff6072012-12-20 02:09:13 +000031// CHECK-NEXT: ObjCAtCatchStmt{{.*}}
32// CHECK-NEXT: VarDecl{{.*}}a
Manuel Klimek874030e2012-11-07 00:33:12 +000033// CHECK-NEXT: CompoundStmt
34// CHECK-NEXT: ObjCAtCatchStmt{{.*}} catch all
35// CHECK-NEXT: CompoundStmt
36// CHECK-NEXT: ObjCAtFinallyStmt