[Heikki Kultala] This patch contains the ABI changes for the TCE target.
[clang.git] / test / Rewriter / finally.m
blob7d160cfbdd2b1bb0190d1e11b2b30544c3b26e35
1 // RUN: %clang_cc1 -rewrite-objc -verify %s -o -
3 int main() {
4   @try {
5     printf("executing try"); // expected-warning{{implicitly declaring C library function 'printf' with type 'int (const char *, ...)'}} \
6         // expected-note{{please include the header <stdio.h> or explicitly provide a declaration for 'printf'}}
7     return(0); // expected-warning{{rewriter doesn't support user-specified control flow semantics for @try/@finally (code may not execute properly)}}
8   } @finally {
9     printf("executing finally");
10   }
11   while (1) {
12     @try {
13       printf("executing try");
14       break;
15     } @finally {
16       printf("executing finally");
17     }
18     printf("executing after finally block");
19   }
20   @try {
21     printf("executing try");
22   } @finally {
23     printf("executing finally");
24   }
25   return 0;
28 void test_sync_with_implicit_finally() {
29     id foo;
30     @synchronized (foo) {
31         return; // The rewriter knows how to generate code for implicit finally
32     }
35 void test2_try_with_implicit_finally() {
36     @try {
37         return; // The rewriter knows how to generate code for implicit finally
38     } @catch (id e) {
39         
40     }