forked from flang-compiler/flang-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ASTImporter] Add test for ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmt
Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51121 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340468 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@interface Exception | ||
@end | ||
@interface OtherException | ||
@end | ||
|
||
void f() { | ||
@try { | ||
Exception *e; | ||
@throw e; | ||
} | ||
@catch (Exception *varname) { | ||
} | ||
@finally { | ||
} | ||
|
||
@try { | ||
} | ||
@catch (Exception *varname1) { | ||
@throw; | ||
} | ||
@catch (OtherException *varname2) { | ||
} | ||
|
||
@try { | ||
} | ||
@finally { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// RUN: clang-import-test -x objective-c++ -Xcc -fobjc-exceptions -dump-ast -import %S/Inputs/F.m -expression %s | FileCheck %s | ||
|
||
// CHECK: ObjCAtTryStmt | ||
// CHECK-NEXT: CompoundStmt | ||
// CHECK-NEXT: DeclStmt | ||
// CHECK-NEXT: VarDecl | ||
// CHECK-NEXT: ObjCAtThrowStmt | ||
// CHECK-NEXT: ImplicitCastExpr | ||
// CHECK-NEXT: DeclRefExpr | ||
// CHECK-NEXT: ObjCAtCatchStmt | ||
// CHECK-NEXT: VarDecl | ||
// CHECK-SAME: varname | ||
// CHECK-SAME: 'Exception *' | ||
// CHECK-NEXT: CompoundStmt | ||
// CHECK-NEXT: ObjCAtFinallyStmt | ||
// CHECK-NEXT: CompoundStmt | ||
|
||
// CHECK-NEXT: ObjCAtTryStmt | ||
// CHECK-NEXT: CompoundStmt | ||
// CHECK-NEXT: ObjCAtCatchStmt | ||
// CHECK-NEXT: VarDecl | ||
// CHECK-SAME: varname1 | ||
// CHECK-SAME: 'Exception *' | ||
// CHECK-NEXT: CompoundStmt | ||
// CHECK-NEXT: ObjCAtThrowStmt | ||
// CHECK-NEXT: <<NULL>> | ||
// CHECK-NEXT: ObjCAtCatchStmt | ||
// CHECK-NEXT: VarDecl | ||
// CHECK-SAME: varname2 | ||
// CHECK-SAME: 'OtherException *' | ||
// CHECK-NEXT: CompoundStmt | ||
|
||
// CHECK-NEXT: ObjCAtTryStmt | ||
// CHECK-NEXT: CompoundStmt | ||
// CHECK-NEXT: ObjCAtFinallyStmt | ||
// CHECK-NEXT: CompoundStmt | ||
|
||
void expr() { | ||
f(); | ||
} |