modern objective-c translator: writing @try/@finally statement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152867 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Rewriter/rewrite-modern-try-finally.m b/test/Rewriter/rewrite-modern-try-finally.m
new file mode 100644
index 0000000..cf342d7
--- /dev/null
+++ b/test/Rewriter/rewrite-modern-try-finally.m
@@ -0,0 +1,35 @@
+// RUN: %clang_cc1 -x objective-c -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+
+void FINALLY();
+void TRY();
+void INNER_FINALLY();
+void INNER_TRY();
+void CHECK();
+
+@interface Foo
+@end
+
+@implementation Foo
+- (void)bar {
+ @try {
+ TRY();
+ }
+ @finally {
+ FINALLY();
+ }
+ CHECK();
+ @try {
+ TRY();
+ }
+ @finally {
+ @try {
+ INNER_TRY();
+ }
+ @finally {
+ INNER_FINALLY();
+ }
+ FINALLY();
+ }
+}
+@end