]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Rewriter/rewrite-modern-try-finally.m
Vendor import of clang trunk r338150:
[FreeBSD/FreeBSD.git] / test / Rewriter / rewrite-modern-try-finally.m
1 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -x objective-c -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
2 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -fsyntax-only -fcxx-exceptions -fexceptions  -Wno-address-of-temporary -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
3
4 typedef struct objc_class *Class;
5 typedef struct objc_object {
6     Class isa;
7 } *id;
8
9 void FINALLY();
10 void TRY();
11 void INNER_FINALLY();
12 void INNER_TRY();
13 void CHECK();
14
15 @interface Foo
16 @end
17
18 @implementation Foo
19 - (void)bar {
20     @try {
21         TRY();
22     } 
23     @finally {
24         FINALLY();
25     }
26     CHECK();
27     @try {
28         TRY();
29     } 
30     @finally {
31       @try {
32         INNER_TRY();
33       }
34       @finally {
35         INNER_FINALLY();
36       }
37       FINALLY();
38     }
39 }
40 @end