1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result |
2 | // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t |
3 | // RUN: diff %t %s.result |
4 | |
5 | #include "Common.h" |
6 | |
7 | void NSLog(id, ...); |
8 | |
9 | int main (int argc, const char * argv[]) { |
10 | |
11 | @autoreleasepool { |
12 | |
13 | if (argc) { |
14 | @autoreleasepool { |
15 | NSLog(@"%s", "YES"); |
16 | } |
17 | } |
18 | } |
19 | |
20 | @autoreleasepool { |
21 | NSLog(@"%s", "YES"); |
22 | } |
23 | |
24 | return 0; |
25 | } |
26 | |
27 | void f(void) { |
28 | |
29 | @autoreleasepool { |
30 | int x = 4; |
31 | |
32 | @autoreleasepool { |
33 | ++x; |
34 | } |
35 | |
36 | } |
37 | } |
38 | |
39 | int UIApplicationMain(int argc, char *argv[]); |
40 | |
41 | int main2(int argc, char *argv[]) { |
42 | @autoreleasepool { |
43 | int result = UIApplicationMain(argc, argv); |
44 | return result; |
45 | } |
46 | } |
47 | |
48 | @interface Foo : NSObject |
49 | @property (unsafe_unretained) id myProp; |
50 | @end |
51 | |
52 | @implementation Foo |
53 | @synthesize myProp; |
54 | |
55 | -(void)test:(id)p { |
56 | @autoreleasepool { |
57 | } |
58 | self.myProp = p; |
59 | } |
60 | @end |
61 | |