Home | History | Annotate | Download | only in CodeGenObjC
      1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fblocks -fobjc-arc -o - %s | FileCheck %s
      2 
      3 @interface Test0
      4 - (id) self;
      5 @end
      6 void test0(Test0 *val) {
      7   Test0 *x = [val self];
      8 
      9 // CHECK:    define void @test0(
     10 // CHECK:      [[VAL:%.*]] = alloca [[TEST0:%.*]]*
     11 // CHECK-NEXT: [[X:%.*]] = alloca [[TEST0]]*
     12 // CHECK-NEXT: bitcast
     13 // CHECK-NEXT: call i8* @objc_retain(
     14 // CHECK-NEXT: bitcast
     15 // CHECK-NEXT: store
     16 // CHECK-NEXT: load [[TEST0]]** [[VAL]],
     17 // CHECK-NEXT: load
     18 // CHECK-NEXT: bitcast
     19 // CHECK-NEXT: [[T0:%.*]] = call i8* bitcast (
     20 // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]])
     21 // CHECK-NEXT: [[T2:%.*]] = bitcast i8* [[T1]] to [[TEST0]]*
     22 // CHECK-NEXT: store [[TEST0]]* [[T2]], [[TEST0]]** [[X]]
     23 // CHECK-NEXT: [[T0:%.*]] = load [[TEST0]]** [[X]]
     24 // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST0]]* [[T0]] to i8*
     25 // CHECK-NEXT: call void @objc_release(i8* [[T1]])
     26 // CHECK-NEXT: [[T0:%.*]] = load [[TEST0]]** [[VAL]]
     27 // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST0]]* [[T0]] to i8*
     28 // CHECK-NEXT: call void @objc_release(i8* [[T1]])
     29 // CHECK-NEXT: ret void
     30 }
     31