2012-11-07 08:33:12 +08:00
|
|
|
// RUN: %clang_cc1 -Wno-unused -fblocks -fobjc-exceptions -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s
|
|
|
|
|
|
|
|
void TestBlockExpr(int x) {
|
|
|
|
^{ x; };
|
|
|
|
}
|
2012-12-20 10:09:13 +08:00
|
|
|
// CHECK: FunctionDecl{{.*}}TestBlockExpr
|
|
|
|
// CHECK: BlockExpr{{.*}} 'void (^)(void)'
|
|
|
|
// CHECK-NEXT: BlockDecl
|
2012-11-07 08:33:12 +08:00
|
|
|
|
|
|
|
void TestExprWithCleanup(int x) {
|
|
|
|
^{ x; };
|
|
|
|
}
|
2012-12-20 10:09:13 +08:00
|
|
|
// CHECK: FunctionDecl{{.*}}TestExprWithCleanup
|
2012-11-07 08:33:12 +08:00
|
|
|
// CHECK: ExprWithCleanups
|
|
|
|
// CHECK-NEXT: cleanup Block
|
|
|
|
// CHECK-NEXT: BlockExpr
|
|
|
|
|
|
|
|
@interface A
|
|
|
|
@end
|
|
|
|
|
|
|
|
void TestObjCAtCatchStmt() {
|
|
|
|
@try {
|
|
|
|
} @catch(A *a) {
|
|
|
|
} @catch(...) {
|
|
|
|
} @finally {
|
|
|
|
}
|
|
|
|
}
|
2012-12-20 10:09:13 +08:00
|
|
|
// CHECK: FunctionDecl{{.*}}TestObjCAtCatchStmt
|
2012-11-07 08:33:12 +08:00
|
|
|
// CHECK: ObjCAtTryStmt
|
|
|
|
// CHECK-NEXT: CompoundStmt
|
2012-12-20 10:09:13 +08:00
|
|
|
// CHECK-NEXT: ObjCAtCatchStmt{{.*}}
|
|
|
|
// CHECK-NEXT: VarDecl{{.*}}a
|
2012-11-07 08:33:12 +08:00
|
|
|
// CHECK-NEXT: CompoundStmt
|
|
|
|
// CHECK-NEXT: ObjCAtCatchStmt{{.*}} catch all
|
|
|
|
// CHECK-NEXT: CompoundStmt
|
|
|
|
// CHECK-NEXT: ObjCAtFinallyStmt
|