Home | History | Annotate | Download | only in ARCMT
      1 // RUN: %clang_cc1 -fblocks -fsyntax-only -fobjc-arc -x objective-c %s.result
      2 // RUN: cp %s %t
      3 // RUN: %clang_cc1 -arcmt-modify -triple x86_64-apple-macosx10.6 -x objective-c %t
      4 // RUN: diff %t %s.result
      5 // RUN: rm %t
      6 
      7 typedef int BOOL;
      8 
      9 id IhaveSideEffect();
     10 
     11 @protocol NSObject
     12 - (BOOL)isEqual:(id)object;
     13 - (id)retain;
     14 - (oneway void)release;
     15 @end
     16 
     17 @interface NSObject <NSObject> {}
     18 @end
     19 
     20 @interface Foo : NSObject {
     21   id bar;
     22 }
     23 @property (strong) id bar;
     24 -(void)test:(id)obj;
     25 @end
     26 
     27 @implementation Foo
     28 
     29 @synthesize bar;
     30 
     31 -(void)test:(id)obj {
     32   id x = self.bar;
     33   self.bar = obj;
     34   // do stuff with x;
     35 
     36   IhaveSideEffect();
     37 
     38   x = 0;
     39 }
     40   
     41 @end
     42 
     43 void func(Foo *p) {
     44 }
     45 
     46 @interface Baz {
     47 	id <NSObject> _foo;
     48 }
     49 @end
     50 
     51 @implementation Baz
     52 @end
     53 
     54 #define RELEASE_MACRO(x) [x release]
     55 #define RELEASE_MACRO2(x) RELEASE_MACRO(x)
     56 
     57 void test2(id p) {
     58 }
     59