diff options
Diffstat (limited to 'test/CodeGenObjC/arc-blocks.m')
-rw-r--r-- | test/CodeGenObjC/arc-blocks.m | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/test/CodeGenObjC/arc-blocks.m b/test/CodeGenObjC/arc-blocks.m index c9ba2f6..4ba3f05 100644 --- a/test/CodeGenObjC/arc-blocks.m +++ b/test/CodeGenObjC/arc-blocks.m @@ -7,7 +7,7 @@ void test0(id (^maker)(void)) { } int (^test1(int x))(void) { - // CHECK: define i32 ()* @test1( + // CHECK-LABEL: define i32 ()* @test1( // CHECK: [[X:%.*]] = alloca i32, // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], // CHECK-NEXT: store i32 {{%.*}}, i32* [[X]] @@ -23,7 +23,7 @@ int (^test1(int x))(void) { } void test2(id x) { -// CHECK: define void @test2( +// CHECK-LABEL: define void @test2( // CHECK: [[X:%.*]] = alloca i8*, // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], // CHECK-NEXT: [[PARM:%.*]] = call i8* @objc_retain(i8* {{%.*}}) @@ -43,7 +43,7 @@ void test2(id x) { extern void test2_helper(id (^)(void)); test2_helper(^{ return x; }); -// CHECK: define internal void @__copy_helper_block_ +// CHECK-LABEL: define internal void @__copy_helper_block_ // CHECK: [[T0:%.*]] = load i8** // CHECK-NEXT: [[SRC:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]* // CHECK-NEXT: [[T0:%.*]] = load i8** @@ -53,7 +53,7 @@ void test2(id x) { // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]]) [[NUW]] // CHECK-NEXT: ret void -// CHECK: define internal void @__destroy_helper_block_ +// CHECK-LABEL: define internal void @__destroy_helper_block_ // CHECK: [[T0:%.*]] = load i8** // CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]* // CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[T1]], i32 0, i32 5 @@ -66,7 +66,7 @@ void test3(void (^sink)(id*)) { __strong id strong; sink(&strong); - // CHECK: define void @test3( + // CHECK-LABEL: define void @test3( // CHECK: [[SINK:%.*]] = alloca void (i8**)* // CHECK-NEXT: [[STRONG:%.*]] = alloca i8* // CHECK-NEXT: [[TEMP:%.*]] = alloca i8* @@ -108,7 +108,7 @@ void test4(void) { __block id var = test4_source(); test4_helper(^{ var = 0; }); - // CHECK: define void @test4() + // CHECK-LABEL: define void @test4() // CHECK: [[VAR:%.*]] = alloca [[BYREF_T:%.*]], // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* [[VAR]], i32 0, i32 2 @@ -130,7 +130,7 @@ void test4(void) { // CHECK-NEXT: call void @objc_release(i8* [[T0]]) // CHECK: ret void - // CHECK: define internal void @__Block_byref_object_copy_ + // CHECK-LABEL: define internal void @__Block_byref_object_copy_ // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6 // CHECK-NEXT: load i8** // CHECK-NEXT: bitcast i8* {{%.*}} to [[BYREF_T]]* @@ -139,22 +139,22 @@ void test4(void) { // CHECK-NEXT: store i8* [[T2]], i8** [[T0]] // CHECK-NEXT: store i8* null, i8** [[T1]] - // CHECK: define internal void @__Block_byref_object_dispose_ + // CHECK-LABEL: define internal void @__Block_byref_object_dispose_ // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6 // CHECK-NEXT: [[T1:%.*]] = load i8** [[T0]] // CHECK-NEXT: call void @objc_release(i8* [[T1]]) - // CHECK: define internal void @__test4_block_invoke + // CHECK-LABEL: define internal void @__test4_block_invoke // CHECK: [[SLOT:%.*]] = getelementptr inbounds {{.*}}, i32 0, i32 6 // CHECK-NEXT: [[T0:%.*]] = load i8** [[SLOT]], align 8 // CHECK-NEXT: store i8* null, i8** [[SLOT]], // CHECK-NEXT: call void @objc_release(i8* [[T0]]) // CHECK-NEXT: ret void - // CHECK: define internal void @__copy_helper_block_ + // CHECK-LABEL: define internal void @__copy_helper_block_ // CHECK: call void @_Block_object_assign(i8* {{%.*}}, i8* {{%.*}}, i32 8) - // CHECK: define internal void @__destroy_helper_block_ + // CHECK-LABEL: define internal void @__destroy_helper_block_ // CHECK: call void @_Block_object_dispose(i8* {{%.*}}, i32 8) } @@ -164,7 +164,7 @@ void test5(void) { __unsafe_unretained id var = test5_source(); test5_helper(^{ (void) var; }); - // CHECK: define void @test5() + // CHECK-LABEL: define void @test5() // CHECK: [[VAR:%.*]] = alloca i8* // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], // CHECK: [[T0:%.*]] = call i8* @test5_source() @@ -187,7 +187,7 @@ void test6(void) { __block __weak id var = test6_source(); test6_helper(^{ var = 0; }); - // CHECK: define void @test6() + // CHECK-LABEL: define void @test6() // CHECK: [[VAR:%.*]] = alloca [[BYREF_T:%.*]], // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* [[VAR]], i32 0, i32 2 @@ -209,27 +209,27 @@ void test6(void) { // CHECK-NEXT: call void @objc_destroyWeak(i8** [[SLOT]]) // CHECK: ret void - // CHECK: define internal void @__Block_byref_object_copy_ + // CHECK-LABEL: define internal void @__Block_byref_object_copy_ // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6 // CHECK-NEXT: load i8** // CHECK-NEXT: bitcast i8* {{%.*}} to [[BYREF_T]]* // CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6 // CHECK-NEXT: call void @objc_moveWeak(i8** [[T0]], i8** [[T1]]) - // CHECK: define internal void @__Block_byref_object_dispose_ + // CHECK-LABEL: define internal void @__Block_byref_object_dispose_ // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6 // CHECK-NEXT: call void @objc_destroyWeak(i8** [[T0]]) - // CHECK: define internal void @__test6_block_invoke + // CHECK-LABEL: define internal void @__test6_block_invoke // CHECK: [[SLOT:%.*]] = getelementptr inbounds {{.*}}, i32 0, i32 6 // CHECK-NEXT: call i8* @objc_storeWeak(i8** [[SLOT]], i8* null) // CHECK-NEXT: ret void - // CHECK: define internal void @__copy_helper_block_ + // CHECK-LABEL: define internal void @__copy_helper_block_ // 0x8 - FIELD_IS_BYREF (no FIELD_IS_WEAK because clang in control) // CHECK: call void @_Block_object_assign(i8* {{%.*}}, i8* {{%.*}}, i32 8) - // CHECK: define internal void @__destroy_helper_block_ + // CHECK-LABEL: define internal void @__destroy_helper_block_ // 0x8 - FIELD_IS_BYREF (no FIELD_IS_WEAK because clang in control) // CHECK: call void @_Block_object_dispose(i8* {{%.*}}, i32 8) } @@ -241,7 +241,7 @@ void test7(void) { __weak id var = test7_source(); test7_helper(^{ test7_consume(var); }); - // CHECK: define void @test7() + // CHECK-LABEL: define void @test7() // CHECK: [[VAR:%.*]] = alloca i8*, // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], // CHECK: [[T0:%.*]] = call i8* @test7_source() @@ -258,19 +258,19 @@ void test7(void) { // CHECK-NEXT: call void @objc_destroyWeak(i8** [[VAR]]) // CHECK: ret void - // CHECK: define internal void @__test7_block_invoke + // CHECK-LABEL: define internal void @__test7_block_invoke // CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]]* {{%.*}}, i32 0, i32 5 // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_loadWeakRetained(i8** [[SLOT]]) // CHECK-NEXT: call void @test7_consume(i8* [[T0]]) // CHECK-NEXT: call void @objc_release(i8* [[T0]]) // CHECK: ret void - // CHECK: define internal void @__copy_helper_block_ + // CHECK-LABEL: define internal void @__copy_helper_block_ // CHECK: getelementptr // CHECK-NEXT: getelementptr // CHECK-NEXT: call void @objc_copyWeak( - // CHECK: define internal void @__destroy_helper_block_ + // CHECK-LABEL: define internal void @__destroy_helper_block_ // CHECK: getelementptr // CHECK-NEXT: call void @objc_destroyWeak( } @@ -311,7 +311,7 @@ id test9(void) { return test9_produce(); }(); -// CHECK: define i8* @test9( +// CHECK-LABEL: define i8* @test9( // CHECK: load i8** getelementptr // CHECK-NEXT: bitcast i8* // CHECK-NEXT: call i8* @@ -328,7 +328,7 @@ id test9(void) { // when the initialization captures the variable. void test10a(void) { __block void (^block)(void) = ^{ block(); }; - // CHECK: define void @test10a() + // CHECK-LABEL: define void @test10a() // CHECK: [[BYREF:%.*]] = alloca [[BYREF_T:%.*]], // Zero-initialization before running the initializer. @@ -362,7 +362,7 @@ void test10a(void) { // We can also use _Block_object_assign/destroy with // BLOCK_FIELD_IS_BLOCK as long as we don't pass BLOCK_BYREF_CALLER. -// CHECK: define internal void @__Block_byref_object_copy +// CHECK-LABEL: define internal void @__Block_byref_object_copy // CHECK: [[D0:%.*]] = load i8** {{%.*}} // CHECK-NEXT: [[D1:%.*]] = bitcast i8* [[D0]] to [[BYREF_T]]* // CHECK-NEXT: [[D2:%.*]] = getelementptr inbounds [[BYREF_T]]* [[D1]], i32 0, i32 6 @@ -376,7 +376,7 @@ void test10a(void) { // CHECK-NEXT: store void ()* [[T3]], void ()** [[D2]], align 8 // CHECK: ret void -// CHECK: define internal void @__Block_byref_object_dispose +// CHECK-LABEL: define internal void @__Block_byref_object_dispose // CHECK: [[T0:%.*]] = load i8** {{%.*}} // CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[BYREF_T]]* // CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[BYREF_T]]* [[T1]], i32 0, i32 6 @@ -391,7 +391,7 @@ void test10b(void) { __block void (^block)(void); block = ^{ block(); }; - // CHECK: define void @test10b() + // CHECK-LABEL: define void @test10b() // CHECK: [[BYREF:%.*]] = alloca [[BYREF_T:%.*]], // Zero-initialize. @@ -427,7 +427,7 @@ void test11a(void) { int x; test11_helper(^{ (void) x; }); - // CHECK: define void @test11a() + // CHECK-LABEL: define void @test11a() // CHECK: [[X:%.*]] = alloca i32, align 4 // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], align 8 // CHECK: [[T0:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] to void ()* @@ -444,7 +444,7 @@ void test11b(void) { int x; id b = ^{ (void) x; }; - // CHECK: define void @test11b() + // CHECK-LABEL: define void @test11b() // CHECK: [[X:%.*]] = alloca i32, align 4 // CHECK-NEXT: [[B:%.*]] = alloca i8*, align 8 // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], align 8 @@ -487,7 +487,7 @@ void test13(id x) { void (^b)(void) = (x ? ^{test13_helper(x);} : 0); test13_use(b); - // CHECK: define void @test13( + // CHECK-LABEL: define void @test13( // CHECK: [[X:%.*]] = alloca i8*, align 8 // CHECK-NEXT: [[B:%.*]] = alloca void ()*, align 8 // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:.*]], align 8 @@ -547,7 +547,7 @@ void test15(int a) { void test16() { void (^BLKVAR)(void) = ^{ BLKVAR(); }; - // CHECK: define void @test16( + // CHECK-LABEL: define void @test16( // CHECK: [[BLKVAR:%.*]] = alloca void ()*, align 8 // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], // CHECK-NEXT: [[SLOTREL:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 @@ -567,7 +567,7 @@ id (^test17(id self, int which))(void) { } return (void*) 0; } -// CHECK: define i8* ()* @test17( +// CHECK-LABEL: define i8* ()* @test17( // CHECK: [[RET:%.*]] = alloca i8* ()*, align // CHECK-NEXT: [[SELF:%.*]] = alloca i8*, // CHECK: [[B0:%.*]] = alloca [[BLOCK:<.*>]], align @@ -612,7 +612,7 @@ id (^test17(id self, int which))(void) { // CHECK-NEXT: br label void test18(id x) { -// CHECK-UNOPT: define void @test18( +// CHECK-UNOPT-LABEL: define void @test18( // CHECK-UNOPT: [[X:%.*]] = alloca i8*, // CHECK-UNOPT-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], // CHECK-UNOPT-NEXT: store i8* null, i8** [[X]] @@ -630,7 +630,7 @@ void test18(id x) { extern void test18_helper(id (^)(void)); test18_helper(^{ return x; }); -// CHECK-UNOPT: define internal void @__copy_helper_block_ +// CHECK-UNOPT-LABEL: define internal void @__copy_helper_block_ // CHECK-UNOPT: [[T0:%.*]] = load i8** // CHECK-UNOPT-NEXT: [[SRC:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]* // CHECK-UNOPT-NEXT: [[T0:%.*]] = load i8** @@ -642,7 +642,7 @@ void test18(id x) { // CHECK-UNOPT-NEXT: call void @objc_storeStrong(i8** [[T1]], i8* [[T2]]) [[NUW]] // CHECK-UNOPT-NEXT: ret void -// CHECK-UNOPT: define internal void @__destroy_helper_block_ +// CHECK-UNOPT-LABEL: define internal void @__destroy_helper_block_ // CHECK-UNOPT: [[T0:%.*]] = load i8** // CHECK-UNOPT-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]* // CHECK-UNOPT-NEXT: [[T2:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[T1]], i32 0, i32 5 @@ -653,7 +653,7 @@ void test18(id x) { // rdar://13588325 void test19_sink(void (^)(int)); void test19(void (^b)(void)) { -// CHECK: define void @test19( +// CHECK-LABEL: define void @test19( // Prologue. // CHECK: [[B:%.*]] = alloca void ()*, // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], |