diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Misc/ast-dump-stmt.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/clang/test/Misc/ast-dump-stmt.cpp b/clang/test/Misc/ast-dump-stmt.cpp index cf3e8bf2898..72205c130e0 100644 --- a/clang/test/Misc/ast-dump-stmt.cpp +++ b/clang/test/Misc/ast-dump-stmt.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s +// RUN: %clang_cc1 -fcxx-exceptions -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s namespace n { void function() {} @@ -12,3 +12,29 @@ void TestFunction() { Variable = 4; // CHECK: DeclRefExpr{{.*}} (UsingShadow{{.*}}Variable } + +// CHECK: FunctionDecl {{.*}} TestCatch1 +void TestCatch1() { +// CHECK: CXXTryStmt +// CHECK-NEXT: CompoundStmt + try { + } +// CHECK-NEXT: CXXCatchStmt +// CHECK-NEXT: VarDecl {{.*}} x +// CHECK-NEXT: CompoundStmt + catch (int x) { + } +} + +// CHECK: FunctionDecl {{.*}} TestCatch2 +void TestCatch2() { +// CHECK: CXXTryStmt +// CHECK-NEXT: CompoundStmt + try { + } +// CHECK-NEXT: CXXCatchStmt +// CHECK-NEXT: NULL +// CHECK-NEXT: CompoundStmt + catch (...) { + } +} |