Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -rewrite-objc -verify %s -o - |
Steve Naroff | 8c56515 | 2008-12-05 17:03:39 +0000 | [diff] [blame] | 2 | |
| 3 | int main() { |
| 4 | @try { |
Douglas Gregor | a316e7b | 2009-02-14 00:32:47 +0000 | [diff] [blame] | 5 | printf("executing try"); // expected-warning{{implicitly declaring C library function 'printf' with type 'int (char const *, ...)'}} \ |
| 6 | // expected-note{{please include the header <stdio.h> or explicitly provide a declaration for 'printf'}} |
Steve Naroff | 8c56515 | 2008-12-05 17:03:39 +0000 | [diff] [blame] | 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; // expected-warning{{rewriter doesn't support user-specified control flow semantics for @try/@finally (code may not execute properly)}} |
| 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; |
| 26 | } |
| 27 | |