forked from microsoft/clang
-
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 C++'s try/catch statements.
Summary: Also enable exceptions in clang-import-test so that we can parse the test files. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50978 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340220 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
3 changed files
with
59 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,18 @@ | ||
void f() { | ||
try { | ||
} catch (...) { | ||
} | ||
|
||
try { | ||
} catch (int) { | ||
} | ||
|
||
try { | ||
} catch (int varname) { | ||
} | ||
|
||
try { | ||
} catch (int varname1) { | ||
} catch (long varname2) { | ||
} | ||
} |
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,39 @@ | ||
// RUN: clang-import-test -dump-ast -import %S/Inputs/F.cpp -expression %s | FileCheck %s | ||
|
||
// CHECK: CXXTryStmt | ||
// CHECK-NEXT: CompoundStmt | ||
// CHECK-NEXT: CXXCatchStmt | ||
// CHECK-NEXT: <<NULL>> | ||
// CHECK-NEXT: CompoundStmt | ||
|
||
// CHECK: CXXTryStmt | ||
// CHECK-NEXT: CompoundStmt | ||
// CHECK-NEXT: CXXCatchStmt | ||
// CHECK-NEXT: VarDecl | ||
// CHECK-SAME: 'int' | ||
// CHECK-NEXT: CompoundStmt | ||
|
||
// CHECK: CXXTryStmt | ||
// CHECK-NEXT: CompoundStmt | ||
// CHECK-NEXT: CXXCatchStmt | ||
// CHECK-NEXT: VarDecl | ||
// CHECK-SAME: varname | ||
// CHECK-SAME: 'int' | ||
// CHECK-NEXT: CompoundStmt | ||
|
||
// CHECK: CXXTryStmt | ||
// CHECK-NEXT: CompoundStmt | ||
// CHECK-NEXT: CXXCatchStmt | ||
// CHECK-NEXT: VarDecl | ||
// CHECK-SAME: varname1 | ||
// CHECK-SAME: 'int' | ||
// CHECK-NEXT: CompoundStmt | ||
// CHECK-NEXT: CXXCatchStmt | ||
// CHECK-NEXT: VarDecl | ||
// CHECK-SAME: varname2 | ||
// CHECK-SAME: 'long' | ||
// CHECK-NEXT: CompoundStmt | ||
|
||
void expr() { | ||
f(); | ||
} |
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