diff options
Diffstat (limited to 'test/CodeGenObjCXX/arc.mm')
-rw-r--r-- | test/CodeGenObjCXX/arc.mm | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/test/CodeGenObjCXX/arc.mm b/test/CodeGenObjCXX/arc.mm index 6b42a4ca48e5..4ce59df3e0fd 100644 --- a/test/CodeGenObjCXX/arc.mm +++ b/test/CodeGenObjCXX/arc.mm @@ -21,7 +21,7 @@ void test0(__weak id *wp, __weak volatile id *wvp) { // CHECK: [[T0:%.*]] = call i8* @_Z12test0_helperv() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) - // CHECK-NEXT: [[T2:%.*]] = load i8*** {{%.*}}, align 8 + // CHECK-NEXT: [[T2:%.*]] = load i8**, i8*** {{%.*}}, align 8 // CHECK-NEXT: [[T3:%.*]] = call i8* @objc_storeWeak(i8** [[T2]], i8* [[T1]]) // CHECK-NEXT: [[T4:%.*]] = call i8* @objc_retain(i8* [[T3]]) // CHECK-NEXT: store i8* [[T4]], i8** @@ -30,7 +30,7 @@ void test0(__weak id *wp, __weak volatile id *wvp) { // CHECK: [[T0:%.*]] = call i8* @_Z12test0_helperv() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) - // CHECK-NEXT: [[T2:%.*]] = load i8*** {{%.*}}, align 8 + // CHECK-NEXT: [[T2:%.*]] = load i8**, i8*** {{%.*}}, align 8 // CHECK-NEXT: [[T3:%.*]] = call i8* @objc_storeWeak(i8** [[T2]], i8* [[T1]]) // CHECK-NEXT: [[T4:%.*]] = call i8* @objc_loadWeakRetained(i8** [[T2]]) // CHECK-NEXT: store i8* [[T4]], i8** @@ -64,31 +64,35 @@ void test34(int cond) { // CHECK-NEXT: [[CONDCLEANUPSAVE:%.*]] = alloca i8* // CHECK-NEXT: [[CONDCLEANUP:%.*]] = alloca i1 // CHECK-NEXT: store i32 + // CHECK-NEXT: [[STRONGP:%.*]] = bitcast i8** [[STRONG]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[STRONGP]]) // CHECK-NEXT: store i8* null, i8** [[STRONG]] + // CHECK-NEXT: [[WEAKP:%.*]] = bitcast i8** [[WEAK]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[WEAKP]]) // CHECK-NEXT: call i8* @objc_initWeak(i8** [[WEAK]], i8* null) - // CHECK-NEXT: [[T0:%.*]] = load i32* [[COND]] + // CHECK-NEXT: [[T0:%.*]] = load i32, i32* [[COND]] // CHECK-NEXT: [[T1:%.*]] = icmp ne i32 [[T0]], 0 // CHECK: [[ARG:%.*]] = phi i8** // CHECK-NEXT: [[T0:%.*]] = icmp eq i8** [[ARG]], null // CHECK-NEXT: [[T1:%.*]] = select i1 [[T0]], i8** null, i8** [[TEMP1]] // CHECK-NEXT: br i1 [[T0]], - // CHECK: [[T0:%.*]] = load i8** [[ARG]] + // CHECK: [[T0:%.*]] = load i8*, i8** [[ARG]] // CHECK-NEXT: store i8* [[T0]], i8** [[TEMP1]] // CHECK-NEXT: br label // CHECK: [[W0:%.*]] = phi i8* [ [[T0]], {{%.*}} ], [ undef, {{%.*}} ] // CHECK: call void @_Z11test34_sinkPU15__autoreleasingP11objc_object(i8** [[T1]]) // CHECK-NEXT: [[T0:%.*]] = icmp eq i8** [[ARG]], null // CHECK-NEXT: br i1 [[T0]], - // CHECK: [[T0:%.*]] = load i8** [[TEMP1]] + // CHECK: [[T0:%.*]] = load i8*, i8** [[TEMP1]] // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]]) - // CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[W0]]) - // CHECK-NEXT: [[T2:%.*]] = load i8** [[ARG]] + // CHECK-NEXT: call void (...) @clang.arc.use(i8* [[W0]]) + // CHECK-NEXT: [[T2:%.*]] = load i8*, i8** [[ARG]] // CHECK-NEXT: store i8* [[T1]], i8** [[ARG]] // CHECK-NEXT: call void @objc_release(i8* [[T2]]) // CHECK-NEXT: br label - // CHECK: [[T0:%.*]] = load i32* [[COND]] + // CHECK: [[T0:%.*]] = load i32, i32* [[COND]] // CHECK-NEXT: [[T1:%.*]] = icmp ne i32 [[T0]], 0 // CHECK: [[ARG:%.*]] = phi i8** // CHECK-NEXT: [[T0:%.*]] = icmp eq i8** [[ARG]], null @@ -103,7 +107,7 @@ void test34(int cond) { // CHECK: call void @_Z11test34_sinkPU15__autoreleasingP11objc_object(i8** [[T1]]) // CHECK-NEXT: [[T0:%.*]] = icmp eq i8** [[ARG]], null // CHECK-NEXT: br i1 [[T0]], - // CHECK: [[T0:%.*]] = load i8** [[TEMP2]] + // CHECK: [[T0:%.*]] = load i8*, i8** [[TEMP2]] // CHECK-NEXT: call i8* @objc_storeWeak(i8** [[ARG]], i8* [[T0]]) // CHECK-NEXT: br label @@ -120,56 +124,77 @@ struct Test35_Helper { // CHECK-LABEL: define void @_Z6test3513Test35_HelperPS_ void test35(Test35_Helper x0, Test35_Helper *x0p) { + // CHECK: call void @llvm.lifetime.start // CHECK: call i8* @_ZN13Test35_Helper11makeObject1Ev // CHECK-NOT: call i8* @objc_retain id obj1 = Test35_Helper::makeObject1(); + // CHECK: call void @llvm.lifetime.start // CHECK: call i8* @_ZN13Test35_Helper11makeObject2Ev // CHECK-NOT: call i8* @objc_retain id obj2 = x0.makeObject2(); + // CHECK: call void @llvm.lifetime.start // CHECK: call i8* @_ZN13Test35_Helper11makeObject2Ev // CHECK-NOT: call i8* @objc_retain id obj3 = x0p->makeObject2(); id (Test35_Helper::*pmf)() __attribute__((ns_returns_retained)) = &Test35_Helper::makeObject2; + // CHECK: call void @llvm.lifetime.start // CHECK: call i8* % // CHECK-NOT: call i8* @objc_retain id obj4 = (x0.*pmf)(); + // CHECK: call void @llvm.lifetime.start // CHECK: call i8* % // CHECK-NOT: call i8* @objc_retain id obj5 = (x0p->*pmf)(); // CHECK: call void @objc_release + // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release + // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release + // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release + // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release + // CHECK: call void @llvm.lifetime.end // CHECK-NEXT: ret void } // CHECK-LABEL: define void @_Z7test35b13Test35_HelperPS_ void test35b(Test35_Helper x0, Test35_Helper *x0p) { + // CHECK: call void @llvm.lifetime.start // CHECK: call i8* @_ZN13Test35_Helper11makeObject3Ev // CHECK: call i8* @objc_retain id obj1 = Test35_Helper::makeObject3(); + // CHECK: call void @llvm.lifetime.start // CHECK: call i8* @_ZN13Test35_Helper11makeObject4Ev // CHECK: call i8* @objc_retain id obj2 = x0.makeObject4(); + // CHECK: call void @llvm.lifetime.start // CHECK: call i8* @_ZN13Test35_Helper11makeObject4Ev // CHECK: call i8* @objc_retain id obj3 = x0p->makeObject4(); id (Test35_Helper::*pmf)() = &Test35_Helper::makeObject4; + // CHECK: call void @llvm.lifetime.start // CHECK: call i8* % // CHECK: call i8* @objc_retain id obj4 = (x0.*pmf)(); + // CHECK: call void @llvm.lifetime.start // CHECK: call i8* % // CHECK: call i8* @objc_retain id obj5 = (x0p->*pmf)(); // CHECK: call void @objc_release + // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release + // CHECK: call void @llvm.lifetime.end + // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release + // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release + // CHECK: call void @llvm.lifetime.end // CHECK: call void @objc_release + // CHECK: call void @llvm.lifetime.end // CHECK-NEXT: ret void } @@ -203,7 +228,7 @@ template void test37<Test37>(Test37 *a); // CHECK-NEXT: [[COLL:%.*]] = bitcast i8* [[T2]] to [[NSARRAY]]* // Make sure it's not immediately released before starting the iteration. -// CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ +// CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[T0:%.*]] = bitcast [[NSARRAY]]* [[COLL]] to i8* // CHECK-NEXT: @objc_msgSend @@ -290,10 +315,12 @@ template void test40_helper<int>(); // CHECK-LABEL: define weak_odr void @_Z13test40_helperIiEvv() // CHECK: [[X:%.*]] = alloca i8* // CHECK-NEXT: [[TEMP:%.*]] = alloca i8* +// CHECK-NEXT: [[XP:%.*]] = bitcast i8** [[X]] to i8* +// CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XP]]) // CHECK-NEXT: store i8* null, i8** [[X]] -// CHECK: [[T0:%.*]] = load i8** [[X]] +// CHECK: [[T0:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: store i8* [[T0]], i8** [[TEMP]] // CHECK: @objc_msgSend -// CHECK-NEXT: [[T0:%.*]] = load i8** [[TEMP]] +// CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[TEMP]] // CHECK-NEXT: call i8* @objc_retain(i8* [[T0]]) |