Home | History | Annotate | Download | only in ARCMT
      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 // DISABLE: mingw32
      5 
      6 #include "Common.h"
      7 
      8 void NSLog(id, ...);
      9 
     10 int main (int argc, const char * argv[]) {
     11 
     12     @autoreleasepool {
     13 
     14         if (argc) {
     15             @autoreleasepool {
     16                 NSLog(@"%s", "YES");
     17             }
     18         }
     19     }
     20 
     21     @autoreleasepool {
     22         NSLog(@"%s", "YES");
     23     }
     24 
     25     return 0;
     26 }
     27 
     28 void f(void) {
     29 
     30   @autoreleasepool {
     31     int x = 4;
     32 
     33     @autoreleasepool {
     34       ++x;
     35     }
     36 
     37   }
     38 }
     39 
     40 int UIApplicationMain(int argc, char *argv[]);
     41 
     42 int main2(int argc, char *argv[]) {
     43     @autoreleasepool {
     44         int result = UIApplicationMain(argc, argv);
     45         return result;
     46     }
     47 }
     48 
     49 @interface Foo : NSObject
     50 @property (unsafe_unretained) id myProp;
     51 @end
     52 
     53 @implementation Foo
     54 @synthesize myProp;
     55 
     56 -(void)test:(id)p {
     57   @autoreleasepool {
     58   }
     59   self.myProp = p;
     60 }
     61 @end
     62