aboutsummaryrefslogtreecommitdiff
path: root/test/Rewriter/finally.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/Rewriter/finally.m')
-rw-r--r--test/Rewriter/finally.m19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/Rewriter/finally.m b/test/Rewriter/finally.m
index bdc5a34fdf2d..ae650568abf1 100644
--- a/test/Rewriter/finally.m
+++ b/test/Rewriter/finally.m
@@ -1,4 +1,4 @@
-// RUN: clang-cc -rewrite-objc -verify %s -o -
+// RUN: clang -cc1 -rewrite-objc -verify %s -o -
int main() {
@try {
@@ -11,7 +11,7 @@ int main() {
while (1) {
@try {
printf("executing try");
- break; // expected-warning{{rewriter doesn't support user-specified control flow semantics for @try/@finally (code may not execute properly)}}
+ break;
} @finally {
printf("executing finally");
}
@@ -25,3 +25,18 @@ int main() {
return 0;
}
+void test_sync_with_implicit_finally() {
+ id foo;
+ @synchronized (foo) {
+ return; // The rewriter knows how to generate code for implicit finally
+ }
+}
+
+void test2_try_with_implicit_finally() {
+ @try {
+ return; // The rewriter knows how to generate code for implicit finally
+ } @catch (id e) {
+
+ }
+}
+