From 1ef8342e11bd6750d1d6e0ffdabbf596d8bd09de Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 4 Sep 2013 14:35:00 +0000 Subject: ASTDumper: fix dump of CXXCatchStmt Summary: I added the display of the VarDecl contained in the statement. CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1596 llvm-svn: 189941 --- clang/test/Misc/ast-dump-stmt.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'clang/test/Misc/ast-dump-stmt.cpp') 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 (...) { + } +} -- cgit v1.2.3