blob: bdf77197a8a55313993aa570e9bd78ab03e35961 [file] [log] [blame]
John McCall8f0e8d22011-06-15 23:25:17 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s.result
Argyrios Kyrtzidiseaed19e2011-06-16 00:53:46 +00002// RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -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 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
12
13 if (argc) {
14 NSAutoreleasePool * pool = [NSAutoreleasePool new];
15 NSLog(@"%s", "YES");
16 [pool drain];
17 }
18 [pool drain];
19
20 NSAutoreleasePool * pool1 = [[NSAutoreleasePool alloc] init];
21 NSLog(@"%s", "YES");
22 [pool1 release];
23
24 return 0;
25}
26
27void f(void) {
28 NSAutoreleasePool *pool1;
29
30 pool1 = [NSAutoreleasePool new];
31 int x = 4;
32
33 NSAutoreleasePool *pool2 = [[NSAutoreleasePool alloc] init];
34 ++x;
35 [pool2 drain];
36
37 [pool1 release];
38}
39
40int UIApplicationMain(int argc, char *argv[]);
41
42int main2(int argc, char *argv[]) {
43 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
44 int result = UIApplicationMain(argc, argv);
45 [pool release];
46 return result;
47}