blob: e24339a3b9e36b56e3e6e454fe8fc06ae2111251 [file] [log] [blame]
John McCalld1e40d52011-10-02 01:16:38 +00001// 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
John McCall8f0e8d22011-06-15 23:25:17 +00003// RUN: diff %t %s.result
4
5#include "Common.h"
6
7void NSLog(id, ...);
8
9int 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
27void f(void) {
28
29 @autoreleasepool {
30 int x = 4;
31
32 @autoreleasepool {
33 ++x;
34 }
35
36 }
37}
38
39int UIApplicationMain(int argc, char *argv[]);
40
41int main2(int argc, char *argv[]) {
42 @autoreleasepool {
43 int result = UIApplicationMain(argc, argv);
44 return result;
45 }
46}
Argyrios Kyrtzidis18fd0c62011-07-27 05:28:18 +000047
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