diff options
Diffstat (limited to 'test/CodeGenObjC')
90 files changed, 1005 insertions, 661 deletions
diff --git a/test/CodeGenObjC/2010-02-01-utf16-with-null.m b/test/CodeGenObjC/2010-02-01-utf16-with-null.m index 37fb9cd3f285..46ce3b289fc1 100644 --- a/test/CodeGenObjC/2010-02-01-utf16-with-null.m +++ b/test/CodeGenObjC/2010-02-01-utf16-with-null.m @@ -2,6 +2,6 @@ // rdar://7589850 // CHECK: @.str = private unnamed_addr constant [9 x i16] [i16 103, i16 111, i16 111, i16 100, i16 0, i16 98, i16 121, i16 101, i16 0], section "__TEXT,__ustring", align 2 -// CHECK: @_unnamed_cfstring_ = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 2000, i8* bitcast ([9 x i16]* @.str to i8*), i32 8 }, section "__DATA,__cfstring" +// CHECK: @_unnamed_cfstring_ = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 2000, i8* bitcast ([9 x i16]* @.str to i8*), i32 8 }, section "__DATA,__cfstring" // CHECK: @P = global i8* bitcast (%struct.NSConstantString* @_unnamed_cfstring_ to i8*), align 4 void *P = @"good\0bye"; diff --git a/test/CodeGenObjC/2010-02-09-DbgSelf.m b/test/CodeGenObjC/2010-02-09-DbgSelf.m index d70b3d68e827..a0179d9227a7 100644 --- a/test/CodeGenObjC/2010-02-09-DbgSelf.m +++ b/test/CodeGenObjC/2010-02-09-DbgSelf.m @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -x objective-c -emit-llvm -g < %s | FileCheck %s // Test to check that "self" argument is assigned a location. // CHECK: call void @llvm.dbg.declare(metadata %0** %{{[^,]+}}, metadata [[SELF:![0-9]*]], metadata !{{.*}}) -// CHECK: [[SELF]] = {{.*}} ; [ DW_TAG_arg_variable ] [self] +// CHECK: [[SELF]] = !DILocalVariable(tag: DW_TAG_arg_variable, name: "self" @interface Foo -(void) Bar: (int)x ; diff --git a/test/CodeGenObjC/2010-02-15-Dbg-MethodStart.m b/test/CodeGenObjC/2010-02-15-Dbg-MethodStart.m index 3fb98c54da26..1a5df30dd84c 100644 --- a/test/CodeGenObjC/2010-02-15-Dbg-MethodStart.m +++ b/test/CodeGenObjC/2010-02-15-Dbg-MethodStart.m @@ -7,7 +7,7 @@ @implementation Foo -(int) barMethod { -// CHECK: [ DW_TAG_subprogram ] [line [[@LINE-1]]] + // CHECK: !DISubprogram({{.*}}line: [[@LINE-1]] int i = 0; int j = 1; int k = 1; diff --git a/test/CodeGenObjC/arc-blocks.m b/test/CodeGenObjC/arc-blocks.m index 4ba3f05fd9f6..ba76c1cbc950 100644 --- a/test/CodeGenObjC/arc-blocks.m +++ b/test/CodeGenObjC/arc-blocks.m @@ -28,36 +28,36 @@ void test2(id x) { // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], // CHECK-NEXT: [[PARM:%.*]] = call i8* @objc_retain(i8* {{%.*}}) // CHECK-NEXT: store i8* [[PARM]], i8** [[X]] -// CHECK-NEXT: [[SLOTREL:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 -// CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 -// CHECK-NEXT: [[T0:%.*]] = load i8** [[X]], +// CHECK-NEXT: [[SLOTREL:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 +// CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 +// CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[X]], // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]]) // CHECK-NEXT: store i8* [[T1]], i8** [[SLOT]], // CHECK-NEXT: bitcast // CHECK-NEXT: call void @test2_helper( -// CHECK-NEXT: [[T0:%.*]] = load i8** [[SLOTREL]] +// CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[SLOTREL]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]], !clang.imprecise_release -// CHECK-NEXT: [[T0:%.*]] = load i8** [[X]] +// CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]], !clang.imprecise_release // CHECK-NEXT: ret void extern void test2_helper(id (^)(void)); test2_helper(^{ return x; }); // CHECK-LABEL: define internal void @__copy_helper_block_ -// CHECK: [[T0:%.*]] = load i8** +// CHECK: [[T0:%.*]] = load i8*, i8** // CHECK-NEXT: [[SRC:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]* -// CHECK-NEXT: [[T0:%.*]] = load i8** +// CHECK-NEXT: [[T0:%.*]] = load i8*, i8** // CHECK-NEXT: [[DST:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]* -// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[SRC]], i32 0, i32 5 -// CHECK-NEXT: [[T1:%.*]] = load i8** [[T0]] +// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[SRC]], i32 0, i32 5 +// CHECK-NEXT: [[T1:%.*]] = load i8*, i8** [[T0]] // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]]) [[NUW]] // CHECK-NEXT: ret void // CHECK-LABEL: define internal void @__destroy_helper_block_ -// CHECK: [[T0:%.*]] = load i8** +// CHECK: [[T0:%.*]] = load i8*, i8** // CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]* -// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[T1]], i32 0, i32 5 -// CHECK-NEXT: [[T3:%.*]] = load i8** [[T2]] +// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[T1]], i32 0, i32 5 +// CHECK-NEXT: [[T3:%.*]] = load i8*, i8** [[T2]] // CHECK-NEXT: call void @objc_release(i8* [[T3]]) // CHECK-NEXT: ret void } @@ -74,28 +74,32 @@ void test3(void (^sink)(id*)) { // CHECK-NEXT: call i8* @objc_retain( // CHECK-NEXT: bitcast i8* // CHECK-NEXT: store void (i8**)* {{%.*}}, void (i8**)** [[SINK]] + // CHECK-NEXT: [[STRONGPTR1:%.*]] = bitcast i8** [[STRONG]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[STRONGPTR1]]) // CHECK-NEXT: store i8* null, i8** [[STRONG]] - // CHECK-NEXT: load void (i8**)** [[SINK]] + // CHECK-NEXT: load void (i8**)*, void (i8**)** [[SINK]] // CHECK-NEXT: bitcast // CHECK-NEXT: getelementptr // CHECK-NEXT: [[BLOCK:%.*]] = bitcast - // CHECK-NEXT: [[V:%.*]] = load i8** [[STRONG]] + // CHECK-NEXT: [[V:%.*]] = load i8*, i8** [[STRONG]] // CHECK-NEXT: store i8* [[V]], i8** [[TEMP]] - // CHECK-NEXT: [[F0:%.*]] = load i8** + // CHECK-NEXT: [[F0:%.*]] = load i8*, i8** // CHECK-NEXT: [[F1:%.*]] = bitcast i8* [[F0]] to void (i8*, i8**)* // CHECK-NEXT: call void [[F1]](i8* [[BLOCK]], i8** [[TEMP]]) - // CHECK-NEXT: [[T0:%.*]] = load i8** [[TEMP]] + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[TEMP]] // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]]) - // CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[V]]) [[NUW]] - // CHECK-NEXT: [[T2:%.*]] = load i8** [[STRONG]] + // CHECK-NEXT: call void (...) @clang.arc.use(i8* [[V]]) [[NUW]] + // CHECK-NEXT: [[T2:%.*]] = load i8*, i8** [[STRONG]] // CHECK-NEXT: store i8* [[T1]], i8** [[STRONG]] // CHECK-NEXT: call void @objc_release(i8* [[T2]]) - // CHECK-NEXT: [[T0:%.*]] = load i8** [[STRONG]] + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[STRONG]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) + // CHECK-NEXT: [[STRONGPTR2:%.*]] = bitcast i8** [[STRONG]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[STRONGPTR2]]) - // CHECK-NEXT: load void (i8**)** [[SINK]] + // CHECK-NEXT: load void (i8**)*, void (i8**)** [[SINK]] // CHECK-NEXT: bitcast // CHECK-NEXT: call void @objc_release // CHECK-NEXT: ret void @@ -111,14 +115,14 @@ void test4(void) { // 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 + // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[VAR]], i32 0, i32 2 // 0x02000000 - has copy/dispose helpers strong // CHECK-NEXT: store i32 838860800, i32* [[T0]] - // CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]]* [[VAR]], i32 0, i32 6 + // CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[VAR]], i32 0, i32 6 // CHECK-NEXT: [[T0:%.*]] = call i8* @test4_source() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) // CHECK-NEXT: store i8* [[T1]], i8** [[SLOT]] - // CHECK-NEXT: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]]* [[VAR]], i32 0, i32 6 + // CHECK-NEXT: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[VAR]], i32 0, i32 6 // 0x42800000 - has signature, copy/dispose helpers, as well as BLOCK_HAS_EXTENDED_LAYOUT // CHECK: store i32 -1040187392, // CHECK: [[T0:%.*]] = bitcast [[BYREF_T]]* [[VAR]] to i8* @@ -126,27 +130,27 @@ void test4(void) { // CHECK: call void @test4_helper( // CHECK: [[T0:%.*]] = bitcast [[BYREF_T]]* [[VAR]] to i8* // CHECK-NEXT: call void @_Block_object_dispose(i8* [[T0]], i32 8) - // CHECK-NEXT: [[T0:%.*]] = load i8** [[SLOT]] + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[SLOT]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) // CHECK: ret void // CHECK-LABEL: define internal void @__Block_byref_object_copy_ - // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6 - // CHECK-NEXT: load i8** + // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* {{%.*}}, i32 0, i32 6 + // CHECK-NEXT: load i8*, i8** // CHECK-NEXT: bitcast i8* {{%.*}} to [[BYREF_T]]* - // CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6 - // CHECK-NEXT: [[T2:%.*]] = load i8** [[T1]] + // CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* {{%.*}}, i32 0, i32 6 + // CHECK-NEXT: [[T2:%.*]] = load i8*, i8** [[T1]] // CHECK-NEXT: store i8* [[T2]], i8** [[T0]] // CHECK-NEXT: store i8* null, i8** [[T1]] // 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: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* {{%.*}}, i32 0, i32 6 + // CHECK-NEXT: [[T1:%.*]] = load i8*, i8** [[T0]] // CHECK-NEXT: call void @objc_release(i8* [[T1]]) // 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: [[T0:%.*]] = load i8*, i8** [[SLOT]], align 8 // CHECK-NEXT: store i8* null, i8** [[SLOT]], // CHECK-NEXT: call void @objc_release(i8* [[T0]]) // CHECK-NEXT: ret void @@ -167,17 +171,21 @@ void test5(void) { // CHECK-LABEL: define void @test5() // CHECK: [[VAR:%.*]] = alloca i8* // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], + // CHECK-NEXT: [[VARPTR1:%.*]] = bitcast i8** [[VAR]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[VARPTR1]]) // CHECK: [[T0:%.*]] = call i8* @test5_source() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) // CHECK-NEXT: store i8* [[T1]], i8** [[VAR]], // CHECK-NEXT: call void @objc_release(i8* [[T1]]) // 0x40800000 - has signature but no copy/dispose, as well as BLOCK_HAS_EXTENDED_LAYOUT // CHECK: store i32 -1073741824, i32* - // CHECK: [[CAPTURE:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 - // CHECK-NEXT: [[T0:%.*]] = load i8** [[VAR]] + // CHECK: [[CAPTURE:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[VAR]] // CHECK-NEXT: store i8* [[T0]], i8** [[CAPTURE]] // CHECK-NEXT: [[T0:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] to // CHECK: call void @test5_helper + // CHECK-NEXT: [[VARPTR2:%.*]] = bitcast i8** [[VAR]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[VARPTR2]]) // CHECK-NEXT: ret void } @@ -190,15 +198,17 @@ void test6(void) { // 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 + // CHECK-NEXT: [[VARPTR1:%.*]] = bitcast [[BYREF_T]]* [[VAR]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 48, i8* [[VARPTR1]]) + // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[VAR]], i32 0, i32 2 // 0x02000000 - has copy/dispose helpers weak // CHECK-NEXT: store i32 1107296256, i32* [[T0]] - // CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]]* [[VAR]], i32 0, i32 6 + // CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[VAR]], i32 0, i32 6 // CHECK-NEXT: [[T0:%.*]] = call i8* @test6_source() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) // CHECK-NEXT: call i8* @objc_initWeak(i8** [[SLOT]], i8* [[T1]]) // CHECK-NEXT: call void @objc_release(i8* [[T1]]) - // CHECK-NEXT: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]]* [[VAR]], i32 0, i32 6 + // CHECK-NEXT: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[VAR]], i32 0, i32 6 // 0x42800000 - has signature, copy/dispose helpers, as well as BLOCK_HAS_EXTENDED_LAYOUT // CHECK: store i32 -1040187392, // CHECK: [[T0:%.*]] = bitcast [[BYREF_T]]* [[VAR]] to i8* @@ -207,17 +217,19 @@ void test6(void) { // CHECK: [[T0:%.*]] = bitcast [[BYREF_T]]* [[VAR]] to i8* // CHECK-NEXT: call void @_Block_object_dispose(i8* [[T0]], i32 8) // CHECK-NEXT: call void @objc_destroyWeak(i8** [[SLOT]]) - // CHECK: ret void + // CHECK-NEXT: [[VARPTR2:%.*]] = bitcast [[BYREF_T]]* [[VAR]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 48, i8* [[VARPTR2]]) + // CHECK-NEXT: ret void // CHECK-LABEL: define internal void @__Block_byref_object_copy_ - // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6 - // CHECK-NEXT: load i8** + // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* {{%.*}}, i32 0, i32 6 + // CHECK-NEXT: load i8*, i8** // CHECK-NEXT: bitcast i8* {{%.*}} to [[BYREF_T]]* - // CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6 + // CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* {{%.*}}, i32 0, i32 6 // CHECK-NEXT: call void @objc_moveWeak(i8** [[T0]], i8** [[T1]]) // CHECK-LABEL: define internal void @__Block_byref_object_dispose_ - // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6 + // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* {{%.*}}, i32 0, i32 6 // CHECK-NEXT: call void @objc_destroyWeak(i8** [[T0]]) // CHECK-LABEL: define internal void @__test6_block_invoke @@ -250,7 +262,7 @@ void test7(void) { // CHECK-NEXT: call void @objc_release(i8* [[T1]]) // 0x42800000 - has signature, copy/dispose helpers, as well as BLOCK_HAS_EXTENDED_LAYOUT // CHECK: store i32 -1040187392, - // CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 + // CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_loadWeakRetained(i8** [[VAR]]) // CHECK-NEXT: call i8* @objc_initWeak(i8** [[SLOT]], i8* [[T0]]) // CHECK: call void @test7_helper( @@ -259,7 +271,7 @@ void test7(void) { // CHECK: ret void // CHECK-LABEL: define internal void @__test7_block_invoke - // CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]]* {{%.*}}, i32 0, i32 5 + // CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]], [[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]]) @@ -284,16 +296,16 @@ void test7(void) { // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], // CHECK: store // CHECK-NEXT: store -// CHECK: [[D0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 -// CHECK: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 -// CHECK-NEXT: [[T1:%.*]] = load [[TEST8]]** [[SELF]], +// CHECK: [[D0:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 +// CHECK: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 +// CHECK-NEXT: [[T1:%.*]] = load [[TEST8]]*, [[TEST8]]** [[SELF]], // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST8]]* [[T1]] to i8* // CHECK-NEXT: [[T3:%.*]] = call i8* @objc_retain(i8* [[T2]]) // CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to [[TEST8]]* // CHECK-NEXT: store [[TEST8]]* [[T4]], [[TEST8]]** [[T0]] // CHECK-NEXT: bitcast [[BLOCK_T]]* [[BLOCK]] to // CHECK: call void @test8_helper( -// CHECK-NEXT: [[T1:%.*]] = load [[TEST8]]** [[D0]] +// CHECK-NEXT: [[T1:%.*]] = load [[TEST8]]*, [[TEST8]]** [[D0]] // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST8]]* [[T1]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T2]]) // CHECK: ret void @@ -312,7 +324,7 @@ id test9(void) { }(); // CHECK-LABEL: define i8* @test9( -// CHECK: load i8** getelementptr +// CHECK: load i8*, i8** getelementptr // CHECK-NEXT: bitcast i8* // CHECK-NEXT: call i8* // CHECK-NEXT: tail call i8* @objc_autoreleaseReturnValue @@ -332,26 +344,26 @@ void test10a(void) { // CHECK: [[BYREF:%.*]] = alloca [[BYREF_T:%.*]], // Zero-initialization before running the initializer. - // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* [[BYREF]], i32 0, i32 6 + // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[BYREF]], i32 0, i32 6 // CHECK-NEXT: store void ()* null, void ()** [[T0]], align 8 // Run the initializer as an assignment. // CHECK: [[T0:%.*]] = bitcast void ()* {{%.*}} to i8* // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainBlock(i8* [[T0]]) // CHECK-NEXT: [[T2:%.*]] = bitcast i8* [[T1]] to void ()* - // CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds [[BYREF_T]]* [[BYREF]], i32 0, i32 1 - // CHECK-NEXT: [[T4:%.*]] = load [[BYREF_T]]** [[T3]] - // CHECK-NEXT: [[T5:%.*]] = getelementptr inbounds [[BYREF_T]]* [[T4]], i32 0, i32 6 - // CHECK-NEXT: [[T6:%.*]] = load void ()** [[T5]], align 8 + // CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[BYREF]], i32 0, i32 1 + // CHECK-NEXT: [[T4:%.*]] = load [[BYREF_T]]*, [[BYREF_T]]** [[T3]] + // CHECK-NEXT: [[T5:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[T4]], i32 0, i32 6 + // CHECK-NEXT: [[T6:%.*]] = load void ()*, void ()** [[T5]], align 8 // CHECK-NEXT: store void ()* {{%.*}}, void ()** [[T5]], align 8 // CHECK-NEXT: [[T7:%.*]] = bitcast void ()* [[T6]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T7]]) // Destroy at end of function. - // CHECK-NEXT: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]]* [[BYREF]], i32 0, i32 6 + // CHECK-NEXT: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[BYREF]], i32 0, i32 6 // CHECK-NEXT: [[T0:%.*]] = bitcast [[BYREF_T]]* [[BYREF]] to i8* // CHECK-NEXT: call void @_Block_object_dispose(i8* [[T0]], i32 8) - // CHECK-NEXT: [[T1:%.*]] = load void ()** [[SLOT]] + // CHECK-NEXT: [[T1:%.*]] = load void ()*, void ()** [[SLOT]] // CHECK-NEXT: [[T2:%.*]] = bitcast void ()* [[T1]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T2]]) // CHECK: ret void @@ -363,13 +375,13 @@ void test10a(void) { // BLOCK_FIELD_IS_BLOCK as long as we don't pass BLOCK_BYREF_CALLER. // CHECK-LABEL: define internal void @__Block_byref_object_copy -// CHECK: [[D0:%.*]] = load i8** {{%.*}} +// CHECK: [[D0:%.*]] = load i8*, i8** {{%.*}} // CHECK-NEXT: [[D1:%.*]] = bitcast i8* [[D0]] to [[BYREF_T]]* -// CHECK-NEXT: [[D2:%.*]] = getelementptr inbounds [[BYREF_T]]* [[D1]], i32 0, i32 6 -// CHECK-NEXT: [[S0:%.*]] = load i8** {{%.*}} +// CHECK-NEXT: [[D2:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[D1]], i32 0, i32 6 +// CHECK-NEXT: [[S0:%.*]] = load i8*, i8** {{%.*}} // CHECK-NEXT: [[S1:%.*]] = bitcast i8* [[S0]] to [[BYREF_T]]* -// CHECK-NEXT: [[S2:%.*]] = getelementptr inbounds [[BYREF_T]]* [[S1]], i32 0, i32 6 -// CHECK-NEXT: [[T0:%.*]] = load void ()** [[S2]], align 8 +// CHECK-NEXT: [[S2:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[S1]], i32 0, i32 6 +// CHECK-NEXT: [[T0:%.*]] = load void ()*, void ()** [[S2]], align 8 // CHECK-NEXT: [[T1:%.*]] = bitcast void ()* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainBlock(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to void ()* @@ -377,10 +389,10 @@ void test10a(void) { // CHECK: ret void // CHECK-LABEL: define internal void @__Block_byref_object_dispose -// CHECK: [[T0:%.*]] = load i8** {{%.*}} +// CHECK: [[T0:%.*]] = load i8*, i8** {{%.*}} // CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[BYREF_T]]* -// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[BYREF_T]]* [[T1]], i32 0, i32 6 -// CHECK-NEXT: [[T3:%.*]] = load void ()** [[T2]] +// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[T1]], i32 0, i32 6 +// CHECK-NEXT: [[T3:%.*]] = load void ()*, void ()** [[T2]] // CHECK-NEXT: [[T4:%.*]] = bitcast void ()* [[T3]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T4]]) // CHECK-NEXT: ret void @@ -395,19 +407,19 @@ void test10b(void) { // CHECK: [[BYREF:%.*]] = alloca [[BYREF_T:%.*]], // Zero-initialize. - // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* [[BYREF]], i32 0, i32 6 + // CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[BYREF]], i32 0, i32 6 // CHECK-NEXT: store void ()* null, void ()** [[T0]], align 8 - // CHECK-NEXT: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]]* [[BYREF]], i32 0, i32 6 + // CHECK-NEXT: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[BYREF]], i32 0, i32 6 // The assignment. // CHECK: [[T0:%.*]] = bitcast void ()* {{%.*}} to i8* // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainBlock(i8* [[T0]]) // CHECK-NEXT: [[T2:%.*]] = bitcast i8* [[T1]] to void ()* - // CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds [[BYREF_T]]* [[BYREF]], i32 0, i32 1 - // CHECK-NEXT: [[T4:%.*]] = load [[BYREF_T]]** [[T3]] - // CHECK-NEXT: [[T5:%.*]] = getelementptr inbounds [[BYREF_T]]* [[T4]], i32 0, i32 6 - // CHECK-NEXT: [[T6:%.*]] = load void ()** [[T5]], align 8 + // CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[BYREF]], i32 0, i32 1 + // CHECK-NEXT: [[T4:%.*]] = load [[BYREF_T]]*, [[BYREF_T]]** [[T3]] + // CHECK-NEXT: [[T5:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[T4]], i32 0, i32 6 + // CHECK-NEXT: [[T6:%.*]] = load void ()*, void ()** [[T5]], align 8 // CHECK-NEXT: store void ()* {{%.*}}, void ()** [[T5]], align 8 // CHECK-NEXT: [[T7:%.*]] = bitcast void ()* [[T6]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T7]]) @@ -415,7 +427,7 @@ void test10b(void) { // Destroy at end of function. // CHECK-NEXT: [[T0:%.*]] = bitcast [[BYREF_T]]* [[BYREF]] to i8* // CHECK-NEXT: call void @_Block_object_dispose(i8* [[T0]], i32 8) - // CHECK-NEXT: [[T1:%.*]] = load void ()** [[SLOT]] + // CHECK-NEXT: [[T1:%.*]] = load void ()*, void ()** [[SLOT]] // CHECK-NEXT: [[T2:%.*]] = bitcast void ()* [[T1]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T2]]) // CHECK: ret void @@ -454,7 +466,7 @@ void test11b(void) { // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to void ()* // CHECK-NEXT: [[T4:%.*]] = bitcast void ()* [[T3]] to i8* // CHECK-NEXT: store i8* [[T4]], i8** [[B]], align 8 - // CHECK-NEXT: [[T5:%.*]] = load i8** [[B]] + // CHECK-NEXT: [[T5:%.*]] = load i8*, i8** [[B]] // CHECK-NEXT: call void @objc_release(i8* [[T5]]) // CHECK: ret void } @@ -494,15 +506,17 @@ void test13(id x) { // CHECK-NEXT: [[CLEANUP_ACTIVE:%.*]] = alloca i1 // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_retain(i8* {{%.*}}) // CHECK-NEXT: store i8* [[T0]], i8** [[X]], align 8 - // CHECK-NEXT: [[CLEANUP_ADDR:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 - // CHECK-NEXT: [[T0:%.*]] = load i8** [[X]], align 8 + // CHECK-NEXT: [[BPTR1:%.*]] = bitcast void ()** [[B]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[BPTR1]]) + // CHECK-NEXT: [[CLEANUP_ADDR:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[X]], align 8 // CHECK-NEXT: [[T1:%.*]] = icmp ne i8* [[T0]], null // CHECK-NEXT: store i1 false, i1* [[CLEANUP_ACTIVE]] // CHECK-NEXT: br i1 [[T1]], // CHECK-NOT: br - // CHECK: [[CAPTURE:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 - // CHECK-NEXT: [[T0:%.*]] = load i8** [[X]], align 8 + // CHECK: [[CAPTURE:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[X]], align 8 // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]]) // CHECK-NEXT: store i8* [[T1]], i8** [[CAPTURE]], align 8 // CHECK-NEXT: store i1 true, i1* [[CLEANUP_ACTIVE]] @@ -514,19 +528,21 @@ void test13(id x) { // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainBlock(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to void ()* // CHECK-NEXT: store void ()* [[T3]], void ()** [[B]], align 8 - // CHECK-NEXT: [[T0:%.*]] = load void ()** [[B]], align 8 + // CHECK-NEXT: [[T0:%.*]] = load void ()*, void ()** [[B]], align 8 // CHECK-NEXT: call void @test13_use(void ()* [[T0]]) - // CHECK-NEXT: [[T0:%.*]] = load void ()** [[B]] + // CHECK-NEXT: [[T0:%.*]] = load void ()*, void ()** [[B]] // CHECK-NEXT: [[T1:%.*]] = bitcast void ()* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) + // CHECK-NEXT: [[BPTR2:%.*]] = bitcast void ()** [[B]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[BPTR2]]) - // CHECK-NEXT: [[T0:%.*]] = load i1* [[CLEANUP_ACTIVE]] + // CHECK-NEXT: [[T0:%.*]] = load i1, i1* [[CLEANUP_ACTIVE]] // CHECK-NEXT: br i1 [[T0]] - // CHECK: [[T0:%.*]] = load i8** [[CLEANUP_ADDR]] + // CHECK: [[T0:%.*]] = load i8*, i8** [[CLEANUP_ADDR]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) // CHECK-NEXT: br label - // CHECK: [[T0:%.*]] = load i8** [[X]] + // CHECK: [[T0:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) // CHECK-NEXT: ret void } @@ -550,7 +566,9 @@ 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 + // CHECK-NEXT: [[BLKVARPTR1:%.*]] = bitcast void ()** [[BLKVAR]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[BLKVARPTR1]]) + // CHECK-NEXT: [[SLOTREL:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 // CHECK-NEXT: store void ()* null, void ()** [[BLKVAR]], align 8 } @@ -576,11 +594,11 @@ id (^test17(id self, int which))(void) { // CHECK-NEXT: store i8* [[T0]], i8** [[SELF]], align // CHECK-NOT: objc_retain // CHECK-NOT: objc_release -// CHECK: [[DESTROY:%.*]] = getelementptr inbounds [[BLOCK]]* [[B0]], i32 0, i32 5 +// CHECK: [[DESTROY:%.*]] = getelementptr inbounds [[BLOCK]], [[BLOCK]]* [[B0]], i32 0, i32 5 // CHECK-NOT: objc_retain // CHECK-NOT: objc_release -// CHECK: [[T0:%.*]] = getelementptr inbounds [[BLOCK]]* [[B0]], i32 0, i32 5 -// CHECK-NEXT: [[T1:%.*]] = load i8** [[SELF]], align +// CHECK: [[T0:%.*]] = getelementptr inbounds [[BLOCK]], [[BLOCK]]* [[B0]], i32 0, i32 5 +// CHECK-NEXT: [[T1:%.*]] = load i8*, i8** [[SELF]], align // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]]) // CHECK-NEXT: store i8* [[T2]], i8** [[T0]], // CHECK-NEXT: [[T0:%.*]] = bitcast [[BLOCK]]* [[B0]] to i8* ()* @@ -588,17 +606,17 @@ id (^test17(id self, int which))(void) { // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainBlock(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to i8* ()* // CHECK-NEXT: store i8* ()* [[T3]], i8* ()** [[RET]] -// CHECK-NEXT: [[T0:%.*]] = load i8** [[DESTROY]] +// CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[DESTROY]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) // CHECK-NEXT: store i32 // CHECK-NEXT: br label // CHECK-NOT: objc_retain // CHECK-NOT: objc_release -// CHECK: [[DESTROY:%.*]] = getelementptr inbounds [[BLOCK]]* [[B1]], i32 0, i32 5 +// CHECK: [[DESTROY:%.*]] = getelementptr inbounds [[BLOCK]], [[BLOCK]]* [[B1]], i32 0, i32 5 // CHECK-NOT: objc_retain // CHECK-NOT: objc_release -// CHECK: [[T0:%.*]] = getelementptr inbounds [[BLOCK]]* [[B1]], i32 0, i32 5 -// CHECK-NEXT: [[T1:%.*]] = load i8** [[SELF]], align +// CHECK: [[T0:%.*]] = getelementptr inbounds [[BLOCK]], [[BLOCK]]* [[B1]], i32 0, i32 5 +// CHECK-NEXT: [[T1:%.*]] = load i8*, i8** [[SELF]], align // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]]) // CHECK-NEXT: store i8* [[T2]], i8** [[T0]], // CHECK-NEXT: [[T0:%.*]] = bitcast [[BLOCK]]* [[B1]] to i8* ()* @@ -606,7 +624,7 @@ id (^test17(id self, int which))(void) { // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainBlock(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to i8* ()* // CHECK-NEXT: store i8* ()* [[T3]], i8* ()** [[RET]] -// CHECK-NEXT: [[T0:%.*]] = load i8** [[DESTROY]] +// CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[DESTROY]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) // CHECK-NEXT: store i32 // CHECK-NEXT: br label @@ -617,9 +635,9 @@ void test18(id x) { // CHECK-UNOPT-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], // CHECK-UNOPT-NEXT: store i8* null, i8** [[X]] // CHECK-UNOPT-NEXT: call void @objc_storeStrong(i8** [[X]], -// CHECK-UNOPT-NEXT: [[SLOTREL:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 -// CHECK-UNOPT: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 -// CHECK-UNOPT-NEXT: [[T0:%.*]] = load i8** [[X]], +// CHECK-UNOPT-NEXT: [[SLOTREL:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 +// CHECK-UNOPT: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 +// CHECK-UNOPT-NEXT: [[T0:%.*]] = load i8*, i8** [[X]], // CHECK-UNOPT-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]]) // CHECK-UNOPT-NEXT: store i8* [[T1]], i8** [[SLOT]], // CHECK-UNOPT-NEXT: bitcast @@ -631,21 +649,21 @@ void test18(id x) { test18_helper(^{ return x; }); // CHECK-UNOPT-LABEL: define internal void @__copy_helper_block_ -// CHECK-UNOPT: [[T0:%.*]] = load i8** +// CHECK-UNOPT: [[T0:%.*]] = load i8*, i8** // CHECK-UNOPT-NEXT: [[SRC:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]* -// CHECK-UNOPT-NEXT: [[T0:%.*]] = load i8** +// CHECK-UNOPT-NEXT: [[T0:%.*]] = load i8*, i8** // CHECK-UNOPT-NEXT: [[DST:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]* -// CHECK-UNOPT-NEXT: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[SRC]], i32 0, i32 5 -// CHECK-UNOPT-NEXT: [[T1:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[DST]], i32 0, i32 5 -// CHECK-UNOPT-NEXT: [[T2:%.*]] = load i8** [[T0]] +// CHECK-UNOPT-NEXT: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[SRC]], i32 0, i32 5 +// CHECK-UNOPT-NEXT: [[T1:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[DST]], i32 0, i32 5 +// CHECK-UNOPT-NEXT: [[T2:%.*]] = load i8*, i8** [[T0]] // CHECK-UNOPT-NEXT: store i8* null, i8** [[T1]] // CHECK-UNOPT-NEXT: call void @objc_storeStrong(i8** [[T1]], i8* [[T2]]) [[NUW]] // CHECK-UNOPT-NEXT: ret void // CHECK-UNOPT-LABEL: define internal void @__destroy_helper_block_ -// CHECK-UNOPT: [[T0:%.*]] = load i8** +// CHECK-UNOPT: [[T0:%.*]] = load i8*, i8** // CHECK-UNOPT-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]* -// CHECK-UNOPT-NEXT: [[T2:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[T1]], i32 0, i32 5 +// CHECK-UNOPT-NEXT: [[T2:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[T1]], i32 0, i32 5 // CHECK-UNOPT-NEXT: call void @objc_storeStrong(i8** [[T2]], i8* null) // CHECK-UNOPT-NEXT: ret void } @@ -663,9 +681,9 @@ void test19(void (^b)(void)) { // CHECK-NEXT: store void ()* [[T2]], void ()** [[B]] // Block setup. We skip most of this. Note the bare retain. -// CHECK-NEXT: [[SLOTREL:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 -// CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 -// CHECK-NEXT: [[T0:%.*]] = load void ()** [[B]], +// CHECK-NEXT: [[SLOTREL:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 +// CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 +// CHECK-NEXT: [[T0:%.*]] = load void ()*, void ()** [[B]], // CHECK-NEXT: [[T1:%.*]] = bitcast void ()* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to void ()* @@ -677,12 +695,12 @@ void test19(void (^b)(void)) { test19_sink(^(int x) { b(); }); // Block teardown. -// CHECK-NEXT: [[T0:%.*]] = load void ()** [[SLOTREL]] +// CHECK-NEXT: [[T0:%.*]] = load void ()*, void ()** [[SLOTREL]] // CHECK-NEXT: [[T1:%.*]] = bitcast void ()* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) // Local cleanup. -// CHECK-NEXT: [[T0:%.*]] = load void ()** [[B]] +// CHECK-NEXT: [[T0:%.*]] = load void ()*, void ()** [[B]] // CHECK-NEXT: [[T1:%.*]] = bitcast void ()* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) diff --git a/test/CodeGenObjC/arc-bridged-cast.m b/test/CodeGenObjC/arc-bridged-cast.m index cdfe1dbfc55f..f48985303132 100644 --- a/test/CodeGenObjC/arc-bridged-cast.m +++ b/test/CodeGenObjC/arc-bridged-cast.m @@ -31,6 +31,8 @@ void bridge_transfer_from_cf(int *i) { // CHECK: store i32 17 *i = 17; // CHECK: call void @objc_release + // CHECK-NEXT: bitcast + // CHECK-NEXT: call void @llvm.lifetime.end // CHECK-NEXT: ret void } @@ -50,6 +52,8 @@ void bridge_from_cf(int *i) { // CHECK: store i32 17 *i = 17; // CHECK: call void @objc_release + // CHECK-NEXT: bitcast + // CHECK-NEXT: call void @llvm.lifetime.end // CHECK-NEXT: ret void } @@ -67,6 +71,8 @@ void bridge_retained_of_cf(int *i) { // CHECK: store i32 13 // CHECK: store i32 17 *i = 17; + // CHECK-NEXT: bitcast + // CHECK-NEXT: call void @llvm.lifetime.end // CHECK-NEXT: ret void } @@ -74,7 +80,8 @@ void bridge_retained_of_cf(int *i) { void bridge_of_cf(int *i) { // CHECK: store i32 7 *i = 7; - // CHECK: call i8* @CreateSomething() + // CHECK: call void @llvm.lifetime.start + // CHECK-NEXT: call i8* @CreateSomething() CFTypeRef cf1 = (__bridge CFTypeRef)CreateSomething(); // CHECK-NOT: retain // CHECK: store i32 11 @@ -85,6 +92,8 @@ void bridge_of_cf(int *i) { // CHECK-NOT: release // CHECK: store i32 17 *i = 17; + // CHECK-NEXT: bitcast + // CHECK-NEXT: call void @llvm.lifetime.end // CHECK-NEXT: ret void } diff --git a/test/CodeGenObjC/arc-foreach.m b/test/CodeGenObjC/arc-foreach.m index 46c5da0dd002..17067a0a584e 100644 --- a/test/CodeGenObjC/arc-foreach.m +++ b/test/CodeGenObjC/arc-foreach.m @@ -40,13 +40,13 @@ void test0(NSArray *array) { // CHECK-LP64-NEXT: call void @llvm.memset.p0i8.i64(i8* [[T0]], i8 0, i64 64, i32 8, i1 false) // Evaluate the collection expression and retain. -// CHECK-LP64-NEXT: [[T0:%.*]] = load [[ARRAY_T]]** [[ARRAY]], align 8 +// CHECK-LP64-NEXT: [[T0:%.*]] = load [[ARRAY_T]]*, [[ARRAY_T]]** [[ARRAY]], align 8 // CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[ARRAY_T]]* [[T0]] to i8* // CHECK-LP64-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]]) // CHECK-LP64-NEXT: [[SAVED_ARRAY:%.*]] = bitcast i8* [[T2]] to [[ARRAY_T]]* // Call the enumeration method. -// CHECK-LP64-NEXT: [[T0:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ +// CHECK-LP64-NEXT: [[T0:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[ARRAY_T]]* [[SAVED_ARRAY]] to i8* // CHECK-LP64-NEXT: [[SIZE:%.*]] = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, [[STATE_T]]*, [16 x i8*]*, i64)*)(i8* [[T1]], i8* [[T0]], [[STATE_T]]* [[STATE]], [16 x i8*]* [[BUFFER]], i64 16) @@ -54,22 +54,22 @@ void test0(NSArray *array) { // CHECK-LP64-NEXT: [[T0:%.*]] = icmp eq i64 [[SIZE]], 0 // CHECK-LP64-NEXT: br i1 [[T0]] -// CHECK-LP64: [[T0:%.*]] = getelementptr inbounds [[STATE_T]]* [[STATE]], i32 0, i32 1 -// CHECK-LP64-NEXT: [[T1:%.*]] = load i8*** [[T0]] -// CHECK-LP64-NEXT: [[T2:%.*]] = getelementptr i8** [[T1]], i64 -// CHECK-LP64-NEXT: [[T3:%.*]] = load i8** [[T2]] +// CHECK-LP64: [[T0:%.*]] = getelementptr inbounds [[STATE_T]], [[STATE_T]]* [[STATE]], i32 0, i32 1 +// CHECK-LP64-NEXT: [[T1:%.*]] = load i8**, i8*** [[T0]] +// CHECK-LP64-NEXT: [[T2:%.*]] = getelementptr i8*, i8** [[T1]], i64 +// CHECK-LP64-NEXT: [[T3:%.*]] = load i8*, i8** [[T2]] // CHECK-LP64-NEXT: store i8* [[T3]], i8** [[X]] -// CHECK-LP64: [[D0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 -// CHECK-LP64: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 -// CHECK-LP64-NEXT: [[T1:%.*]] = load i8** [[X]] +// CHECK-LP64: [[D0:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 +// CHECK-LP64: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 +// CHECK-LP64-NEXT: [[T1:%.*]] = load i8*, i8** [[X]] // CHECK-LP64-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]]) // CHECK-LP64-NEXT: store i8* [[T2]], i8** [[T0]] // CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] // CHECK-LP64: call void @use_block( // CHECK-LP64-NEXT: call void @objc_storeStrong(i8** [[D0]], i8* null) -// CHECK-LP64: [[T0:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ +// CHECK-LP64: [[T0:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[ARRAY_T]]* [[SAVED_ARRAY]] to i8* // CHECK-LP64-NEXT: [[SIZE:%.*]] = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, [[STATE_T]]*, [16 x i8*]*, i64)*)(i8* [[T1]], i8* [[T0]], [[STATE_T]]* [[STATE]], [16 x i8*]* [[BUFFER]], i64 16) @@ -85,8 +85,8 @@ void test0(NSArray *array) { // CHECK-LP64-LABEL: define internal void @__test0_block_invoke // CHECK-LP64: [[BLOCK:%.*]] = bitcast i8* {{%.*}} to [[BLOCK_T]]* // CHECK-LP64-NOT: ret -// CHECK-LP64: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 -// CHECK-LP64-NEXT: [[T2:%.*]] = load i8** [[T0]], align 8 +// CHECK-LP64: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 +// CHECK-LP64-NEXT: [[T2:%.*]] = load i8*, i8** [[T0]], align 8 // CHECK-LP64-NEXT: call void @use(i8* [[T2]]) void test1(NSArray *array) { @@ -102,14 +102,14 @@ void test1(NSArray *array) { // CHECK-LP64-NEXT: alloca [16 x i8*], align 8 // CHECK-LP64-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]], -// CHECK-LP64: [[T0:%.*]] = getelementptr inbounds [[STATE_T]]* [[STATE]], i32 0, i32 1 -// CHECK-LP64-NEXT: [[T1:%.*]] = load i8*** [[T0]] -// CHECK-LP64-NEXT: [[T2:%.*]] = getelementptr i8** [[T1]], i64 -// CHECK-LP64-NEXT: [[T3:%.*]] = load i8** [[T2]] +// CHECK-LP64: [[T0:%.*]] = getelementptr inbounds [[STATE_T]], [[STATE_T]]* [[STATE]], i32 0, i32 1 +// CHECK-LP64-NEXT: [[T1:%.*]] = load i8**, i8*** [[T0]] +// CHECK-LP64-NEXT: [[T2:%.*]] = getelementptr i8*, i8** [[T1]], i64 +// CHECK-LP64-NEXT: [[T3:%.*]] = load i8*, i8** [[T2]] // CHECK-LP64-NEXT: call i8* @objc_initWeak(i8** [[X]], i8* [[T3]]) -// CHECK-LP64: [[D0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 -// CHECK-LP64: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 +// CHECK-LP64: [[D0:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 +// CHECK-LP64: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 // CHECK-LP64-NEXT: [[T1:%.*]] = call i8* @objc_loadWeakRetained(i8** [[X]]) // CHECK-LP64-NEXT: call i8* @objc_initWeak(i8** [[T0]], i8* [[T1]]) // CHECK-LP64-NEXT: call void @objc_release(i8* [[T1]]) @@ -135,7 +135,7 @@ void test2(Test2 *a) { // CHECK-LP64-NEXT: [[COLL:%.*]] = bitcast i8* [[T2]] to [[ARRAY_T]]* // Make sure it's not immediately released before starting the iteration. -// CHECK-LP64-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ +// CHECK-LP64-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-LP64-NEXT: [[T0:%.*]] = bitcast [[ARRAY_T]]* [[COLL]] to i8* // CHECK-LP64-NEXT: @objc_msgSend @@ -163,11 +163,11 @@ void test3(NSArray *array) { // CHECK-LP64-LABEL: define void @test3( // CHECK-LP64: [[ARRAY:%.*]] = alloca [[ARRAY_T]]*, align 8 // CHECK-LP64-NEXT: [[X:%.*]] = alloca i8*, align 8 - // CHECK-LP64: [[T0:%.*]] = load i8** [[X]], align 8 + // CHECK-LP64: [[T0:%.*]] = load i8*, i8** [[X]], align 8 // CHECK-LP64-NEXT: [[T1:%.*]] = icmp ne i8* [[T0]], null // CHECK-LP64-NEXT: br i1 [[T1]], // CHECK-LP64: br label [[L:%[^ ]+]] - // CHECK-LP64: [[T0:%.*]] = load i8** [[X]], align 8 + // CHECK-LP64: [[T0:%.*]] = load i8*, i8** [[X]], align 8 // CHECK-LP64-NEXT: call void @use(i8* [[T0]]) // CHECK-LP64-NEXT: br label [[L]] } diff --git a/test/CodeGenObjC/arc-ivar-layout.m b/test/CodeGenObjC/arc-ivar-layout.m index 06e387c817ee..086a726d806c 100644 --- a/test/CodeGenObjC/arc-ivar-layout.m +++ b/test/CodeGenObjC/arc-ivar-layout.m @@ -17,7 +17,7 @@ @implementation AllPointers @end -// CHECK-LP64: L_OBJC_CLASS_NAME_1: +// CHECK-LP64: L_OBJC_CLASS_NAME_.1: // CHECK-LP64-NEXT: .asciz "\003" @class NSString, NSNumber; @@ -40,7 +40,7 @@ @implementation B @end -// CHECK-LP64: L_OBJC_CLASS_NAME_15: +// CHECK-LP64: L_OBJC_CLASS_NAME_.15: // CHECK-LP64-NEXT: .asciz "\022" @interface UnsafePerson { @@ -52,7 +52,7 @@ @end @implementation UnsafePerson @end -// CHECK-LP64: L_OBJC_CLASS_NAME_20: +// CHECK-LP64: L_OBJC_CLASS_NAME_.20: // CHECK-LP64-NEXT: .asciz "!" // rdar://16136439 @@ -61,5 +61,5 @@ @end @implementation rdar16136439 @end -// CHECK-LP64: L_OBJC_PROP_NAME_ATTR_29: +// CHECK-LP64: L_OBJC_PROP_NAME_ATTR_.29: // CHECK-LP64-NEXT: .asciz "T@,R,W,N,V_first" diff --git a/test/CodeGenObjC/arc-linetable-autorelease.m b/test/CodeGenObjC/arc-linetable-autorelease.m index ab20f3e9baf4..329206867b85 100644 --- a/test/CodeGenObjC/arc-linetable-autorelease.m +++ b/test/CodeGenObjC/arc-linetable-autorelease.m @@ -32,8 +32,8 @@ NSRect NSMakeRect(CGFloat x, CGFloat y, CGFloat w, CGFloat h); // CHECK: call void @objc_storeStrong{{.*}} !dbg ![[ARC:[0-9]+]] // CHECK: call {{.*}} @objc_autoreleaseReturnValue{{.*}} !dbg ![[ARC]] // CHECK: ret {{.*}} !dbg ![[ARC]] - // CHECK: ![[RET]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) + // CHECK: ![[RET]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}}) return path; - // CHECK: ![[ARC]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) + // CHECK: ![[ARC]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}}) } @end diff --git a/test/CodeGenObjC/arc-linetable.m b/test/CodeGenObjC/arc-linetable.m index 656c34346879..a3232ecd4e05 100644 --- a/test/CodeGenObjC/arc-linetable.m +++ b/test/CodeGenObjC/arc-linetable.m @@ -4,8 +4,8 @@ // CHECK: define {{.*}}testNoSideEffect // CHECK: call void @objc_storeStrong{{.*}} -// CHECK: call void @objc_storeStrong{{.*}} !dbg ![[ARC1:[0-9]+]] -// CHECK: ret {{.*}} !dbg ![[RET1:[0-9]+]] +// CHECK: call void @objc_storeStrong{{.*}} !dbg ![[RET1:[0-9]+]] +// CHECK: ret {{.*}} !dbg ![[RET1]] // CHECK: define {{.*}}testNoCleanup // CHECK: ret {{.*}} !dbg ![[RET2:[0-9]+]] @@ -21,8 +21,8 @@ // CHECK: define {{.*}}testVoid // CHECK: call void @objc_storeStrong{{.*}} -// CHECK: call void @objc_storeStrong{{.*}} !dbg ![[ARC5:[0-9]+]] -// CHECK: ret {{.*}} !dbg ![[RET5:[0-9]+]] +// CHECK: call void @objc_storeStrong{{.*}} !dbg ![[RET5:[0-9]+]] +// CHECK: ret {{.*}} !dbg ![[RET5]] // CHECK: define {{.*}}testVoidNoReturn // CHECK: @objc_msgSend{{.*}} !dbg ![[MSG6:[0-9]+]] @@ -54,55 +54,55 @@ typedef signed char BOOL; @implementation AppDelegate : NSObject -// CHECK: ![[TESTNOSIDEEFFECT:.*]] = {{.*}}[ DW_TAG_subprogram ] [line [[@LINE+1]]] [local] [def] [-[AppDelegate testNoSideEffect:]] +// CHECK: ![[TESTNOSIDEEFFECT:.*]] = !DISubprogram(name: "-[AppDelegate testNoSideEffect:]" +// CHECK-SAME: line: [[@LINE+2]] +// CHECK-SAME: isLocal: true, isDefinition: true - (int)testNoSideEffect:(NSString *)foo { int x = 1; - // CHECK: ![[ARC1]] = !MDLocation(line: [[@LINE+1]], scope: ![[TESTNOSIDEEFFECT]]) return 1; // Return expression - // CHECK: ![[RET1]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) + // CHECK: ![[RET1]] = !DILocation(line: [[@LINE+1]], scope: ![[TESTNOSIDEEFFECT]]) } // Cleanup + Ret - (int)testNoCleanup { - // CHECK: ![[RET2]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) + // CHECK: ![[RET2]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}}) return 1; } - (int)testSideEffect:(NSString *)foo { - // CHECK: ![[MSG3]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) + // CHECK: ![[MSG3]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}}) return [self testNoSideEffect :foo]; - // CHECK: ![[RET3]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) + // CHECK: ![[RET3]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}}) } - (int)testMultiline:(NSString *)foo { - // CHECK: ![[MSG4]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) + // CHECK: ![[MSG4]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}}) int r = [self testSideEffect :foo]; - // CHECK: ![[EXP4]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) + // CHECK: ![[EXP4]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}}) return r; - // CHECK: ![[RET4]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) + // CHECK: ![[RET4]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}}) } - (void)testVoid:(NSString *)foo { - // CHECK: ![[ARC5]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) return; - // CHECK: ![[RET5]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) + // CHECK: ![[RET5]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}}) } - (void)testVoidNoReturn:(NSString *)foo { - // CHECK: ![[MSG6]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) + // CHECK: ![[MSG6]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}}) [self testVoid :foo]; - // CHECK: ![[RET6]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) + // CHECK: ![[RET6]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}}) } - (int)testNoCleanupSideEffect { - // CHECK: ![[MSG7]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) + // CHECK: ![[MSG7]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}}) [self testVoid :@"foo"]; - // CHECK: ![[RET7]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) + // CHECK: ![[RET7]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}}) return 1; } - (void)testCleanupVoid:(BOOL)skip withDelegate: (AppDelegate *) delegate { static BOOL skip_all; - // CHECK: ![[SKIP1]] = !MDLocation(line: [[@LINE+1]], scope: + // CHECK: ![[SKIP1]] = !DILocation(line: [[@LINE+1]], scope: if (!skip_all) { if (!skip) { return; @@ -112,8 +112,8 @@ typedef signed char BOOL; [delegate testVoid :s]; } } - // CHECK: ![[RET8]] = !MDLocation(line: [[@LINE+2]], scope: - // CHECK: ![[ARC8]] = !MDLocation(line: [[@LINE+1]], scope: + // CHECK: ![[RET8]] = !DILocation(line: [[@LINE+2]], scope: + // CHECK: ![[ARC8]] = !DILocation(line: [[@LINE+1]], scope: } diff --git a/test/CodeGenObjC/arc-literals.m b/test/CodeGenObjC/arc-literals.m index abeb49f9dddf..d107a28506f9 100644 --- a/test/CodeGenObjC/arc-literals.m +++ b/test/CodeGenObjC/arc-literals.m @@ -27,9 +27,13 @@ void test_numeric() { // CHECK: call i8* @objc_retainAutoreleasedReturnValue id charlit = @'a'; // 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 } @@ -43,20 +47,20 @@ void test_array(id a, id b) { // CHECK: call i8* @objc_retain(i8* // Constructing the array - // CHECK: [[T0:%.*]] = getelementptr inbounds [2 x i8*]* [[OBJECTS:%[A-Za-z0-9]+]], i32 0, i32 0 - // CHECK-NEXT: [[V0:%.*]] = load i8** [[A]], + // CHECK: [[T0:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[OBJECTS:%[A-Za-z0-9]+]], i32 0, i32 0 + // CHECK-NEXT: [[V0:%.*]] = load i8*, i8** [[A]], // CHECK-NEXT: store i8* [[V0]], i8** [[T0]] - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [2 x i8*]* [[OBJECTS]], i32 0, i32 1 - // CHECK-NEXT: [[V1:%.*]] = load i8** [[B]], + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[OBJECTS]], i32 0, i32 1 + // CHECK-NEXT: [[V1:%.*]] = load i8*, i8** [[B]], // CHECK-NEXT: store i8* [[V1]], i8** [[T0]] - // CHECK-NEXT: [[T0:%.*]] = load [[CLASS_T:%.*]]** @"OBJC_CLASSLIST - // CHECK-NEXT: [[SEL:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES + // CHECK-NEXT: [[T0:%.*]] = load [[CLASS_T:%.*]]*, [[CLASS_T:%.*]]** @"OBJC_CLASSLIST + // CHECK-NEXT: [[SEL:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES // CHECK-NEXT: [[T1:%.*]] = bitcast [[CLASS_T]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = bitcast [2 x i8*]* [[OBJECTS]] to i8** // CHECK-NEXT: [[T3:%.*]] = call i8* bitcast ({{.*@objc_msgSend.*}})(i8* [[T1]], i8* [[SEL]], i8** [[T2]], i64 2) // CHECK-NEXT: [[T4:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T3]]) - // CHECK: call void (...)* @clang.arc.use(i8* [[V0]], i8* [[V1]]) + // CHECK: call void (...) @clang.arc.use(i8* [[V0]], i8* [[V1]]) id arr = @[a, b]; // CHECK: call void @objc_release @@ -79,28 +83,28 @@ void test_dictionary(id k1, id o1, id k2, id o2) { // CHECK: call i8* @objc_retain(i8* // Constructing the arrays - // CHECK: [[T0:%.*]] = getelementptr inbounds [2 x i8*]* [[KEYS:%[A-Za-z0-9]+]], i32 0, i32 0 - // CHECK-NEXT: [[V0:%.*]] = load i8** [[K1]], + // CHECK: [[T0:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[KEYS:%[A-Za-z0-9]+]], i32 0, i32 0 + // CHECK-NEXT: [[V0:%.*]] = load i8*, i8** [[K1]], // CHECK-NEXT: store i8* [[V0]], i8** [[T0]] - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [2 x i8*]* [[OBJECTS:%[A-Za-z0-9]+]], i32 0, i32 0 - // CHECK-NEXT: [[V1:%.*]] = load i8** [[O1]], + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[OBJECTS:%[A-Za-z0-9]+]], i32 0, i32 0 + // CHECK-NEXT: [[V1:%.*]] = load i8*, i8** [[O1]], // CHECK-NEXT: store i8* [[V1]], i8** [[T0]] - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [2 x i8*]* [[KEYS]], i32 0, i32 1 - // CHECK-NEXT: [[V2:%.*]] = load i8** [[K2]], + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[KEYS]], i32 0, i32 1 + // CHECK-NEXT: [[V2:%.*]] = load i8*, i8** [[K2]], // CHECK-NEXT: store i8* [[V2]], i8** [[T0]] - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [2 x i8*]* [[OBJECTS]], i32 0, i32 1 - // CHECK-NEXT: [[V3:%.*]] = load i8** [[O2]], + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[OBJECTS]], i32 0, i32 1 + // CHECK-NEXT: [[V3:%.*]] = load i8*, i8** [[O2]], // CHECK-NEXT: store i8* [[V3]], i8** [[T0]] // Constructing the dictionary - // CHECK-NEXT: [[T0:%.*]] = load [[CLASS_T:%.*]]** @"OBJC_CLASSLIST - // CHECK-NEXT: [[SEL:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES + // CHECK-NEXT: [[T0:%.*]] = load [[CLASS_T:%.*]]*, [[CLASS_T:%.*]]** @"OBJC_CLASSLIST + // CHECK-NEXT: [[SEL:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES // CHECK-NEXT: [[T1:%.*]] = bitcast [[CLASS_T]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = bitcast [2 x i8*]* [[OBJECTS]] to i8** // CHECK-NEXT: [[T3:%.*]] = bitcast [2 x i8*]* [[KEYS]] to i8** // CHECK-NEXT: [[T4:%.*]] = call i8* bitcast ({{.*@objc_msgSend.*}})(i8* [[T1]], i8* [[SEL]], i8** [[T2]], i8** [[T3]], i64 2) // CHECK-NEXT: [[T5:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T4]]) - // CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[V0]], i8* [[V1]], i8* [[V2]], i8* [[V3]]) + // CHECK-NEXT: call void (...) @clang.arc.use(i8* [[V0]], i8* [[V1]], i8* [[V2]], i8* [[V3]]) id dict = @{ k1 : o1, k2 : o2 }; @@ -124,10 +128,10 @@ void test_property(B *b) { // Retain parameter // CHECK: call i8* @objc_retain - // CHECK: [[T0:%.*]] = getelementptr inbounds [1 x i8*]* [[OBJECTS:%.*]], i32 0, i32 0 + // CHECK: [[T0:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[OBJECTS:%.*]], i32 0, i32 0 // Invoke 'prop' - // CHECK: [[SEL:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES + // CHECK: [[SEL:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES // CHECK-NEXT: [[T1:%.*]] = bitcast // CHECK-NEXT: [[T2:%.*]] = call [[B:%.*]]* bitcast ({{.*}} @objc_msgSend to {{.*}})(i8* [[T1]], i8* [[SEL]]) // CHECK-NEXT: [[T3:%.*]] = bitcast [[B]]* [[T2]] to i8* @@ -139,13 +143,13 @@ void test_property(B *b) { // CHECK-NEXT: store i8* [[V1]], i8** [[T0]] // Invoke arrayWithObjects:count: - // CHECK-NEXT: [[T0:%.*]] = load [[CLASS_T]]** @"OBJC_CLASSLIST - // CHECK-NEXT: [[SEL:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES + // CHECK-NEXT: [[T0:%.*]] = load [[CLASS_T]]*, [[CLASS_T]]** @"OBJC_CLASSLIST + // CHECK-NEXT: [[SEL:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES // CHECK-NEXT: [[T1:%.*]] = bitcast [[CLASS_T]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = bitcast [1 x i8*]* [[OBJECTS]] to i8** // CHECK-NEXT: [[T3:%.*]] = call i8* bitcast ({{.*}} @objc_msgSend to {{.*}}(i8* [[T1]], i8* [[SEL]], i8** [[T2]], i64 1) // CHECK-NEXT: call i8* @objc_retainAutoreleasedReturnValue(i8* [[T3]]) - // CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[V1]]) + // CHECK-NEXT: call void (...) @clang.arc.use(i8* [[V1]]) // CHECK-NEXT: bitcast // CHECK-NEXT: bitcast // CHECK-NEXT: store diff --git a/test/CodeGenObjC/arc-loadweakretained-release.m b/test/CodeGenObjC/arc-loadweakretained-release.m index 4db67a97de7b..5d00ace66055 100644 --- a/test/CodeGenObjC/arc-loadweakretained-release.m +++ b/test/CodeGenObjC/arc-loadweakretained-release.m @@ -30,7 +30,7 @@ int main (int argc, const char * argv[]) { // CHECK: [[SIXTEEN:%.*]] = call i8* @objc_loadWeakRetained(i8** {{%.*}}) // CHECK-NEXT: [[SEVENTEEN:%.*]] = bitcast i8* [[SIXTEEN]] to {{%.*}} -// CHECK-NEXT: [[EIGHTEEN:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_6 +// CHECK-NEXT: [[EIGHTEEN:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.6 // CHECK-NEXT: [[NINETEEN:%.*]] = bitcast %0* [[SEVENTEEN]] to i8* // CHECK-NEXT: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend // CHECK-NEXT: [[TWENTY:%.*]] = bitcast %0* [[SEVENTEEN]] to i8* @@ -64,13 +64,13 @@ void test1(int cond) { // CHECK: call void @test34_sink( // CHECK-NEXT: [[ICRISNULL1:%.*]] = icmp eq i8** [[COND1]], null // CHECK-NEXT: br i1 [[ICRISNULL1]], label [[ICRDONE:%.*]], label [[ICRWRITEBACK:%.*]] -// CHECK: [[TWO:%.*]] = load i8** [[INCRTEMP]] +// CHECK: [[TWO:%.*]] = load i8*, i8** [[INCRTEMP]] // CHECK-NEXT: [[THREE:%.*]] = call i8* @objc_storeWeak( // CHECK-NEXT br label [[ICRDONE]] -// CHECK: [[CLEANUPISACTIVE:%.*]] = load i1* [[CONDCLEANUP]] +// CHECK: [[CLEANUPISACTIVE:%.*]] = load i1, i1* [[CONDCLEANUP]] // CHECK-NEXT: br i1 [[CLEANUPISACTIVE]], label [[CLEASNUPACTION:%.*]], label [[CLEANUPDONE:%.*]] -// CHECK: [[FOUR:%.*]] = load i8** [[CONDCLEANUPSAVE]] +// CHECK: [[FOUR:%.*]] = load i8*, i8** [[CONDCLEANUPSAVE]] // CHECK-NEXT: call void @objc_release(i8* [[FOUR]]) // CHECK-NEXT: br label // CHECK: call void @objc_destroyWeak(i8** [[WEAK]]) diff --git a/test/CodeGenObjC/arc-no-arc-exceptions.m b/test/CodeGenObjC/arc-no-arc-exceptions.m index 681891bf7dcc..82977b0a1751 100644 --- a/test/CodeGenObjC/arc-no-arc-exceptions.m +++ b/test/CodeGenObjC/arc-no-arc-exceptions.m @@ -34,7 +34,7 @@ void test1(id x) { void NSLog(id, ...); // CHECK-LABEL: define void @test2( -// CHECK: invoke void (i8*, ...)* @NSLog(i8* bitcast (%struct.NSConstantString* @_unnamed_cfstring_ to i8*), i32* %{{.*}}) +// CHECK: invoke void (i8*, ...) @NSLog(i8* bitcast (%struct.NSConstantString* @_unnamed_cfstring_ to i8*), i32* %{{.*}}) // CHECK: to label %{{.*}} unwind label %{{.*}}, !clang.arc.no_objc_arc_exceptions ! // NO-METADATA-LABEL: define void @test2( // NO-METADATA-NOT: !clang.arc.no_objc_arc_exceptions diff --git a/test/CodeGenObjC/arc-precise-lifetime.m b/test/CodeGenObjC/arc-precise-lifetime.m index ddbd7041cfd2..6dc3ebf54457 100644 --- a/test/CodeGenObjC/arc-precise-lifetime.m +++ b/test/CodeGenObjC/arc-precise-lifetime.m @@ -7,18 +7,22 @@ void test0() { PRECISE_LIFETIME id x = test0_helper(); x = 0; // CHECK: [[X:%.*]] = alloca i8* + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: [[CALL:%.*]] = call i8* @test0_helper() // CHECK-NEXT: store i8* [[CALL]], i8** [[X]] - // CHECK-NEXT: [[T1:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[T1:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: store i8* null, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW:#[0-9]+]] // CHECK-NOT: clang.imprecise_release - // CHECK-NEXT: [[T1:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[T1:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW:#[0-9]+]] // CHECK-NOT: clang.imprecise_release + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -32,22 +36,32 @@ extern Test1 *test1_helper(void); // CHECK-LABEL: define void @test1a() void test1a(void) { + // CHECK: [[PTR:%.*]] = alloca [[PTR_T:%.*]]*, align 8 + // CHECK: [[C:%.*]] = alloca i8*, align 8 + // CHECK: [[PTRPTR1:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* + // CHECK: call void @llvm.lifetime.start(i64 8, i8* [[PTRPTR1]]) // CHECK: [[T0:%.*]] = call [[TEST1:%.*]]* @test1_helper() // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST1]]* // CHECK-NEXT: store [[TEST1]]* [[T3]] - // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]** + // CHECK-NEXT: [[CPTR1:%.*]] = bitcast i8** [[C]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[CPTR1]]) + // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]*, [[TEST1]]** // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutorelease(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST1]]* - // CHECK-NEXT: [[T4:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[T4:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[T5:%.*]] = bitcast [[TEST1]]* [[T3]] to i8* // CHECK-NEXT: [[T6:%.*]] = call i8* bitcast // CHECK-NEXT: store i8* [[T6]], i8** - // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]** + // CHECK-NEXT: [[CPTR2:%.*]] = bitcast i8** [[C]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[CPTR2]]) + // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]*, [[TEST1]]** // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]], !clang.imprecise_release + // CHECK-NEXT: [[PTRPTR2:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PTRPTR2]]) // CHECK-NEXT: ret void Test1 *ptr = test1_helper(); char *c = [(ptr) interior]; @@ -55,64 +69,94 @@ void test1a(void) { // CHECK-LABEL: define void @test1b() void test1b(void) { + // CHECK: [[PTR:%.*]] = alloca [[PTR_T:%.*]]*, align 8 + // CHECK: [[C:%.*]] = alloca i8*, align 8 + // CHECK: [[PTRPTR1:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* + // CHECK: call void @llvm.lifetime.start(i64 8, i8* [[PTRPTR1]]) // CHECK: [[T0:%.*]] = call [[TEST1:%.*]]* @test1_helper() // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST1]]* // CHECK-NEXT: store [[TEST1]]* [[T3]] - // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]** - // CHECK-NEXT: [[T1:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[CPTR1:%.*]] = bitcast i8** [[C]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[CPTR1]]) + // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]*, [[TEST1]]** + // CHECK-NEXT: [[T1:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T3:%.*]] = call i8* bitcast // CHECK-NEXT: store i8* [[T3]], i8** - // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]** + // CHECK-NEXT: [[CPTR2:%.*]] = bitcast i8** [[C]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[CPTR2]]) + // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]*, [[TEST1]]** // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]] // CHECK-NOT: clang.imprecise_release + // CHECK-NEXT: [[PTRPTR2:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PTRPTR2]]) // CHECK-NEXT: ret void __attribute__((objc_precise_lifetime)) Test1 *ptr = test1_helper(); char *c = [ptr interior]; } void test1c(void) { + // CHECK: [[PTR:%.*]] = alloca [[PTR_T:%.*]]*, align 8 + // CHECK: [[PC:%.*]] = alloca i8*, align 8 + // CHECK: [[PTRPTR1:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* + // CHECK: call void @llvm.lifetime.start(i64 8, i8* [[PTRPTR1]]) // CHECK: [[T0:%.*]] = call [[TEST1:%.*]]* @test1_helper() // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST1]]* // CHECK-NEXT: store [[TEST1]]* [[T3]] - // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]** + // CHECK-NEXT: [[PCPTR1:%.*]] = bitcast i8** [[PC]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[PCPTR1]]) + // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]*, [[TEST1]]** // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutorelease(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST1]]* - // CHECK-NEXT: [[T4:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[T4:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[T5:%.*]] = bitcast [[TEST1]]* [[T3]] to i8* // CHECK-NEXT: [[T6:%.*]] = call i8* bitcast // CHECK-NEXT: store i8* [[T6]], i8** - // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]** + // CHECK-NEXT: [[PCPTR2:%.*]] = bitcast i8** [[PC]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PCPTR2]]) + // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]*, [[TEST1]]** // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]], !clang.imprecise_release + // CHECK-NEXT: [[PTRPTR2:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PTRPTR2]]) // CHECK-NEXT: ret void Test1 *ptr = test1_helper(); char *pc = ptr.PropertyReturnsInnerPointer; } void test1d(void) { + // CHECK: [[PTR:%.*]] = alloca [[PTR_T:%.*]]*, align 8 + // CHECK: [[PC:%.*]] = alloca i8*, align 8 + // CHECK: [[PTRPTR1:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* + // CHECK: call void @llvm.lifetime.start(i64 8, i8* [[PTRPTR1]]) // CHECK: [[T0:%.*]] = call [[TEST1:%.*]]* @test1_helper() // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST1]]* // CHECK-NEXT: store [[TEST1]]* [[T3]] - // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]** + // CHECK-NEXT: [[PCPTR1:%.*]] = bitcast i8** [[PC]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[PCPTR1]]) + // CHECK-NEXT: [[T0:%.*]] = load [[TEST1]]*, [[TEST1]]** // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST1]]* [[T0]] to i8* // CHECK-NEXT: [[T3:%.*]] = call i8* @objc_retainAutorelease // CHECK-NEXT: [[SIX:%.*]] = bitcast i8* [[T3]] to [[TEST1]]* - // CHECK-NEXT: [[SEVEN:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[SEVEN:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[EIGHT:%.*]] = bitcast [[TEST1]]* [[SIX]] to i8* // CHECK-NEXT: [[CALL1:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* [[EIGHT]], i8* [[SEVEN]]) // CHECK-NEXT: store i8* [[CALL1]], i8** - // CHECK-NEXT: [[NINE:%.*]] = load [[TEST1]]** + // CHECK-NEXT: [[PCPTR2:%.*]] = bitcast i8** [[PC]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PCPTR2]]) + // CHECK-NEXT: [[NINE:%.*]] = load [[TEST1]]*, [[TEST1]]** // CHECK-NEXT: [[TEN:%.*]] = bitcast [[TEST1]]* [[NINE]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[TEN]]) + // CHECK-NEXT: [[PTRPTR2:%.*]] = bitcast [[PTR_T]]** [[PTR]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[PTRPTR2]]) // CHECK-NEXT: ret void __attribute__((objc_precise_lifetime)) Test1 *ptr = test1_helper(); char *pc = ptr.PropertyReturnsInnerPointer; @@ -132,17 +176,17 @@ void test2(Test2 *x) { // CHECK-NEXT: [[T2:%.*]] = bitcast i8* [[T1]] to [[TEST2]]* // CHECK-NEXT: store [[TEST2]]* [[T2]], [[TEST2]]** [[X]], - // CHECK-NEXT: [[T0:%.*]] = load [[TEST2]]** [[X]], - // CHECK-NEXT: [[OFFSET:%.*]] = load i64* @"OBJC_IVAR_$_Test2.ivar" + // CHECK-NEXT: [[T0:%.*]] = load [[TEST2]]*, [[TEST2]]** [[X]], + // CHECK-NEXT: [[OFFSET:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test2.ivar" // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST2]]* [[T0]] to i8* - // CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds i8* [[T1]], i64 [[OFFSET]] + // CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds i8, i8* [[T1]], i64 [[OFFSET]] // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to i8** - // CHECK-NEXT: [[T4:%.*]] = load i8** [[T3]], + // CHECK-NEXT: [[T4:%.*]] = load i8*, i8** [[T3]], // CHECK-NEXT: store i8* null, i8** [[T3]], // CHECK-NEXT: call void @objc_release(i8* [[T4]]) [[NUW]] // CHECK-NOT: imprecise - // CHECK-NEXT: [[T0:%.*]] = load [[TEST2]]** [[X]] + // CHECK-NEXT: [[T0:%.*]] = load [[TEST2]]*, [[TEST2]]** [[X]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST2]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]], !clang.imprecise_release @@ -155,7 +199,7 @@ void test3(PRECISE_LIFETIME id x) { // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_retain(i8* {{%.*}}) [[NUW]] // CHECK-NEXT: store i8* [[T0]], i8** [[X]], - // CHECK-NEXT: [[T0:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]] // CHECK-NOT: imprecise_release diff --git a/test/CodeGenObjC/arc-property.m b/test/CodeGenObjC/arc-property.m index 02cd50dbf286..b8dc18e872bf 100644 --- a/test/CodeGenObjC/arc-property.m +++ b/test/CodeGenObjC/arc-property.m @@ -23,18 +23,18 @@ struct S1 { Class isa; }; @end // The getter should be a simple load. // CHECK: define internal [[S1:%.*]]* @"\01-[Test1 pointer]"( -// CHECK: [[OFFSET:%.*]] = load i64* @"OBJC_IVAR_$_Test1.pointer" +// CHECK: [[OFFSET:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test1.pointer" // CHECK-NEXT: [[T0:%.*]] = bitcast [[TEST1:%.*]]* {{%.*}} to i8* -// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds i8* [[T0]], i64 [[OFFSET]] +// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 [[OFFSET]] // CHECK-NEXT: [[T2:%.*]] = bitcast i8* [[T1]] to [[S1]]** -// CHECK-NEXT: [[T3:%.*]] = load [[S1]]** [[T2]], align 8 +// CHECK-NEXT: [[T3:%.*]] = load [[S1]]*, [[S1]]** [[T2]], align 8 // CHECK-NEXT: ret [[S1]]* [[T3]] // The setter should be using objc_setProperty. // CHECK: define internal void @"\01-[Test1 setPointer:]"( // CHECK: [[T0:%.*]] = bitcast [[TEST1]]* {{%.*}} to i8* -// CHECK-NEXT: [[OFFSET:%.*]] = load i64* @"OBJC_IVAR_$_Test1.pointer" -// CHECK-NEXT: [[T1:%.*]] = load [[S1]]** {{%.*}} +// CHECK-NEXT: [[OFFSET:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test1.pointer" +// CHECK-NEXT: [[T1:%.*]] = load [[S1]]*, [[S1]]** {{%.*}} // CHECK-NEXT: [[T2:%.*]] = bitcast [[S1]]* [[T1]] to i8* // CHECK-NEXT: call void @objc_setProperty(i8* [[T0]], i8* {{%.*}}, i64 [[OFFSET]], i8* [[T2]], i1 zeroext false, i1 zeroext false) // CHECK-NEXT: ret void @@ -56,32 +56,32 @@ static Class theGlobalClass; } @end // CHECK: define internal void @"\01-[Test2 test]"( -// CHECK: [[T0:%.*]] = load i8** @theGlobalClass, align 8 -// CHECK-NEXT: [[T1:%.*]] = load [[TEST2:%.*]]** -// CHECK-NEXT: [[OFFSET:%.*]] = load i64* @"OBJC_IVAR_$_Test2._theClass" +// CHECK: [[T0:%.*]] = load i8*, i8** @theGlobalClass, align 8 +// CHECK-NEXT: [[T1:%.*]] = load [[TEST2:%.*]]*, [[TEST2:%.*]]** +// CHECK-NEXT: [[OFFSET:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test2._theClass" // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST2]]* [[T1]] to i8* -// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8* [[T2]], i64 [[OFFSET]] +// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8, i8* [[T2]], i64 [[OFFSET]] // CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to i8** // CHECK-NEXT: call void @objc_storeStrong(i8** [[T4]], i8* [[T0]]) [[NUW:#[0-9]+]] // CHECK-NEXT: ret void // CHECK: define internal i8* @"\01-[Test2 theClass]"( -// CHECK: [[OFFSET:%.*]] = load i64* @"OBJC_IVAR_$_Test2._theClass" +// CHECK: [[OFFSET:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test2._theClass" // CHECK-NEXT: [[T0:%.*]] = tail call i8* @objc_getProperty(i8* {{.*}}, i8* {{.*}}, i64 [[OFFSET]], i1 zeroext true) // CHECK-NEXT: ret i8* [[T0]] // CHECK: define internal void @"\01-[Test2 setTheClass:]"( // CHECK: [[T0:%.*]] = bitcast [[TEST2]]* {{%.*}} to i8* -// CHECK-NEXT: [[OFFSET:%.*]] = load i64* @"OBJC_IVAR_$_Test2._theClass" -// CHECK-NEXT: [[T1:%.*]] = load i8** {{%.*}} +// CHECK-NEXT: [[OFFSET:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test2._theClass" +// CHECK-NEXT: [[T1:%.*]] = load i8*, i8** {{%.*}} // CHECK-NEXT: call void @objc_setProperty(i8* [[T0]], i8* {{%.*}}, i64 [[OFFSET]], i8* [[T1]], i1 zeroext true, i1 zeroext true) // CHECK-NEXT: ret void // CHECK: define internal void @"\01-[Test2 .cxx_destruct]"( -// CHECK: [[T0:%.*]] = load [[TEST2]]** -// CHECK-NEXT: [[OFFSET:%.*]] = load i64* @"OBJC_IVAR_$_Test2._theClass" +// CHECK: [[T0:%.*]] = load [[TEST2]]*, [[TEST2]]** +// CHECK-NEXT: [[OFFSET:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test2._theClass" // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST2]]* [[T0]] to i8* -// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds i8* [[T1]], i64 [[OFFSET]] +// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds i8, i8* [[T1]], i64 [[OFFSET]] // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to i8** // CHECK-NEXT: call void @objc_storeStrong(i8** [[T3]], i8* null) [[NUW]] // CHECK-NEXT: ret void @@ -100,17 +100,17 @@ void test3(Test3 *t) { // CHECK: [[T:%.*]] = alloca [[TEST3]]*, // CHECK-NEXT: [[X:%.*]] = alloca i8*, // Property access. -// CHECK: [[T0:%.*]] = load [[TEST3]]** [[T]], -// CHECK-NEXT: [[SEL:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES +// CHECK: [[T0:%.*]] = load [[TEST3]]*, [[TEST3]]** [[T]], +// CHECK-NEXT: [[SEL:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST3]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* bitcast ({{.*}} @objc_msgSend to {{.*}})(i8* [[T1]], i8* [[SEL]]) // CHECK-NEXT: store i8* [[T2]], i8** [[X]], // Message send. -// CHECK-NEXT: [[T0:%.*]] = load [[TEST3]]** [[T]], -// CHECK-NEXT: [[SEL:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES +// CHECK-NEXT: [[T0:%.*]] = load [[TEST3]]*, [[TEST3]]** [[T]], +// CHECK-NEXT: [[SEL:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST3]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* bitcast ({{.*}} @objc_msgSend to {{.*}})(i8* [[T1]], i8* [[SEL]]) -// CHECK-NEXT: [[T3:%.*]] = load i8** [[X]], +// CHECK-NEXT: [[T3:%.*]] = load i8*, i8** [[X]], // CHECK-NEXT: store i8* [[T2]], i8** [[X]], // CHECK-NEXT: call void @objc_release(i8* [[T3]]) // Epilogue. diff --git a/test/CodeGenObjC/arc-related-result-type.m b/test/CodeGenObjC/arc-related-result-type.m index 72d287187920..02d380368b00 100644 --- a/test/CodeGenObjC/arc-related-result-type.m +++ b/test/CodeGenObjC/arc-related-result-type.m @@ -13,7 +13,7 @@ void test0(Test0 *val) { // CHECK-NEXT: bitcast // CHECK-NEXT: bitcast // CHECK-NEXT: call void @objc_storeStrong( -// CHECK-NEXT: load [[TEST0]]** [[VAL]], +// CHECK-NEXT: load [[TEST0]]*, [[TEST0]]** [[VAL]], // CHECK-NEXT: load // CHECK-NEXT: bitcast // CHECK-NEXT: [[T0:%.*]] = call i8* bitcast ( diff --git a/test/CodeGenObjC/arc-ternary-op.m b/test/CodeGenObjC/arc-ternary-op.m index 217db8019417..c6bbab28a2e8 100644 --- a/test/CodeGenObjC/arc-ternary-op.m +++ b/test/CodeGenObjC/arc-ternary-op.m @@ -10,7 +10,9 @@ void test0(_Bool cond) { // CHECK-NEXT: [[RELCOND:%.*]] = alloca i1 // CHECK-NEXT: zext // CHECK-NEXT: store - // CHECK-NEXT: [[T0:%.*]] = load i8* [[COND]] + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) + // CHECK-NEXT: [[T0:%.*]] = load i8, i8* [[COND]] // CHECK-NEXT: [[T1:%.*]] = trunc i8 [[T0]] to i1 // CHECK-NEXT: store i1 false, i1* [[RELCOND]] // CHECK-NEXT: br i1 [[T1]], @@ -22,13 +24,15 @@ void test0(_Bool cond) { // CHECK: [[T0:%.*]] = phi i8* [ null, {{%.*}} ], [ [[CALL]], {{%.*}} ] // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]]) [[NUW:#[0-9]+]] // CHECK-NEXT: store i8* [[T1]], i8** [[X]], - // CHECK-NEXT: [[REL:%.*]] = load i1* [[RELCOND]] + // CHECK-NEXT: [[REL:%.*]] = load i1, i1* [[RELCOND]] // CHECK-NEXT: br i1 [[REL]], - // CHECK: [[T0:%.*]] = load i8** [[RELVAL]] + // CHECK: [[T0:%.*]] = load i8*, i8** [[RELVAL]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]] // CHECK-NEXT: br label - // CHECK: [[T0:%.*]] = load i8** [[X]] + // CHECK: [[T0:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]] + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void id x = (cond ? 0 : test0_helper()); } @@ -49,31 +53,35 @@ void test1(int cond) { // CHECK-NEXT: [[CONDCLEANUPSAVE:%.*]] = alloca i8* // CHECK-NEXT: [[CONDCLEANUP:%.*]] = alloca i1 // CHECK-NEXT: store i32 + // CHECK-NEXT: [[STRONGPTR1:%.*]] = bitcast i8** [[STRONG]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[STRONGPTR1]]) // CHECK-NEXT: store i8* null, i8** [[STRONG]] + // CHECK-NEXT: [[WEAKPTR1:%.*]] = bitcast i8** [[WEAK]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[WEAKPTR1]]) // 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: [[W:%.*]] = phi i8* [ [[T0]], {{%.*}} ], [ undef, {{%.*}} ] // CHECK-NEXT: call void @test1_sink(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* [[W]]) [[NUW]] - // CHECK-NEXT: [[T2:%.*]] = load i8** [[ARG]] + // CHECK-NEXT: call void (...) @clang.arc.use(i8* [[W]]) [[NUW]] + // 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 @@ -88,11 +96,15 @@ void test1(int cond) { // CHECK: call void @test1_sink(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 // CHECK: call void @objc_destroyWeak(i8** [[WEAK]]) + // CHECK: [[WEAKPTR2:%.*]] = bitcast i8** [[WEAK]] to i8* + // CHECK: call void @llvm.lifetime.end(i64 8, i8* [[WEAKPTR2]]) + // CHECK: [[STRONGPTR2:%.*]] = bitcast i8** [[STRONG]] to i8* + // CHECK: call void @llvm.lifetime.end(i64 8, i8* [[STRONGPTR2]]) // CHECK: ret void } @@ -112,7 +124,7 @@ void test2(int cond) { // CHECK: [[CLEANUP_SAVE:%.*]] = alloca i8* // CHECK: [[RUN_CLEANUP:%.*]] = alloca i1 // Evaluate condition; cleanup disabled by default. - // CHECK: [[T0:%.*]] = load i32* [[COND]], + // CHECK: [[T0:%.*]] = load i32, i32* [[COND]], // CHECK-NEXT: icmp ne i32 [[T0]], 0 // CHECK-NEXT: store i1 false, i1* [[RUN_CLEANUP]] // CHECK-NEXT: br i1 @@ -126,9 +138,9 @@ void test2(int cond) { // CHECK: [[T0:%.*]] = phi i8* [ [[T1]], {{%.*}} ], [ null, {{%.*}} ] // CHECK-NEXT: [[RESULT:%.*]] = call i8* @objc_retain(i8* [[T0]]) // Leaving full-expression; run conditional cleanup. - // CHECK-NEXT: [[T0:%.*]] = load i1* [[RUN_CLEANUP]] + // CHECK-NEXT: [[T0:%.*]] = load i1, i1* [[RUN_CLEANUP]] // CHECK-NEXT: br i1 [[T0]] - // CHECK: [[T0:%.*]] = load i8** [[CLEANUP_SAVE]] + // CHECK: [[T0:%.*]] = load i8*, i8** [[CLEANUP_SAVE]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) // CHECK-NEXT: br label // And way down at the end of the loop: diff --git a/test/CodeGenObjC/arc-unopt.m b/test/CodeGenObjC/arc-unopt.m index c0e67dfd3b0f..f80514d6e4b5 100644 --- a/test/CodeGenObjC/arc-unopt.m +++ b/test/CodeGenObjC/arc-unopt.m @@ -7,7 +7,7 @@ Test0 *test0(void) { extern Test0 *test0_helper; return test0_helper; - // CHECK: [[LD:%.*]] = load [[TEST0:%.*]]** @test0_helper + // CHECK: [[LD:%.*]] = load [[TEST0:%.*]]*, [[TEST0:%.*]]** @test0_helper // CHECK-NEXT: [[T0:%.*]] = bitcast [[TEST0]]* [[LD]] to i8* // CHECK-NEXT: [[T1:%.*]] = tail call i8* @objc_retainAutoreleaseReturnValue(i8* [[T0]]) // CHECK-NEXT: [[T2:%.*]] = bitcast i8* [[T1]] to [[TEST0]]* @@ -18,7 +18,7 @@ id test1(void) { extern id test1_helper; return test1_helper; - // CHECK: [[LD:%.*]] = load i8** @test1_helper + // CHECK: [[LD:%.*]] = load i8*, i8** @test1_helper // CHECK-NEXT: [[T0:%.*]] = tail call i8* @objc_retainAutoreleaseReturnValue(i8* [[LD]]) // CHECK-NEXT: ret i8* [[T0]] } @@ -60,7 +60,7 @@ void test5(void) { // CHECK-NEXT: [[Y:%.*]] = alloca [[TEST5:%.*]]*, // CHECK-NEXT: store [[TEST5]]* null, [[TEST5]]** [[X]], // CHECK-NEXT: store [[TEST5]]* null, [[TEST5]]** [[Y]], -// CHECK-NEXT: [[T0:%.*]] = load [[TEST5]]** [[Y]], +// CHECK-NEXT: [[T0:%.*]] = load [[TEST5]]*, [[TEST5]]** [[Y]], // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST5]]** [[X]] to i8** // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST5]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_storeStrong(i8** [[T1]], i8* [[T2]]) diff --git a/test/CodeGenObjC/arc-unoptimized-byref-var.m b/test/CodeGenObjC/arc-unoptimized-byref-var.m index 4a30c6af7f1c..9d856d659afe 100644 --- a/test/CodeGenObjC/arc-unoptimized-byref-var.m +++ b/test/CodeGenObjC/arc-unoptimized-byref-var.m @@ -4,9 +4,9 @@ void test19() { __block id x; // CHECK-UNOPT-LABEL: define internal void @__Block_byref_object_copy -// CHECK-UNOPT: [[X:%.*]] = getelementptr inbounds [[BYREF_T:%.*]]* [[VAR:%.*]], i32 0, i32 6 -// CHECK-UNOPT: [[X2:%.*]] = getelementptr inbounds [[BYREF_T:%.*]]* [[VAR1:%.*]], i32 0, i32 6 -// CHECK-UNOPT-NEXT: [[SIX:%.*]] = load i8** [[X2]], align 8 +// CHECK-UNOPT: [[X:%.*]] = getelementptr inbounds [[BYREF_T:%.*]], [[BYREF_T:%.*]]* [[VAR:%.*]], i32 0, i32 6 +// CHECK-UNOPT: [[X2:%.*]] = getelementptr inbounds [[BYREF_T:%.*]], [[BYREF_T:%.*]]* [[VAR1:%.*]], i32 0, i32 6 +// CHECK-UNOPT-NEXT: [[SIX:%.*]] = load i8*, i8** [[X2]], align 8 // CHECK-UNOPT-NEXT: store i8* null, i8** [[X]], align 8 // CHECK-UNOPT-NEXT: call void @objc_storeStrong(i8** [[X]], i8* [[SIX]]) [[NUW:#[0-9]+]] // CHECK-UNOPT-NEXT: call void @objc_storeStrong(i8** [[X2]], i8* null) [[NUW]] diff --git a/test/CodeGenObjC/arc-weak-property.m b/test/CodeGenObjC/arc-weak-property.m index e8d57bcfe528..d04032bc0d46 100644 --- a/test/CodeGenObjC/arc-weak-property.m +++ b/test/CodeGenObjC/arc-weak-property.m @@ -16,10 +16,10 @@ // CHECK-NEXT: [[CMD:%.*]] = alloca i8*, // CHECK-NEXT: store [[WPT]]* {{%.*}}, [[WPT]]** [[SELF]] // CHECK-NEXT: store i8* {{%.*}}, i8** [[CMD]] -// CHECK-NEXT: [[T0:%.*]] = load [[WPT]]** [[SELF]] -// CHECK-NEXT: [[T1:%.*]] = load i64* @"OBJC_IVAR_$_WeakPropertyTest.PROP" +// CHECK-NEXT: [[T0:%.*]] = load [[WPT]]*, [[WPT]]** [[SELF]] +// CHECK-NEXT: [[T1:%.*]] = load i64, i64* @"OBJC_IVAR_$_WeakPropertyTest.PROP" // CHECK-NEXT: [[T2:%.*]] = bitcast [[WPT]]* [[T0]] to i8* -// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8* [[T2]], i64 [[T1]] +// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8, i8* [[T2]], i64 [[T1]] // CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to i8** // CHECK-NEXT: [[T5:%.*]] = call i8* @objc_loadWeakRetained(i8** [[T4]]) // CHECK-NEXT: [[T6:%.*]] = tail call i8* @objc_autoreleaseReturnValue(i8* [[T5]]) @@ -32,11 +32,11 @@ // CHECK-NEXT: store [[WPT]]* {{%.*}}, [[WPT]]** [[SELF]] // CHECK-NEXT: store i8* {{%.*}}, i8** [[CMD]] // CHECK-NEXT: store i8* {{%.*}}, i8** [[PROP]] -// CHECK-NEXT: [[V:%.*]] = load i8** [[PROP]] -// CHECK-NEXT: [[T0:%.*]] = load [[WPT]]** [[SELF]] -// CHECK-NEXT: [[T1:%.*]] = load i64* @"OBJC_IVAR_$_WeakPropertyTest.PROP" +// CHECK-NEXT: [[V:%.*]] = load i8*, i8** [[PROP]] +// CHECK-NEXT: [[T0:%.*]] = load [[WPT]]*, [[WPT]]** [[SELF]] +// CHECK-NEXT: [[T1:%.*]] = load i64, i64* @"OBJC_IVAR_$_WeakPropertyTest.PROP" // CHECK-NEXT: [[T2:%.*]] = bitcast [[WPT]]* [[T0]] to i8* -// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8* [[T2]], i64 [[T1]] +// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8, i8* [[T2]], i64 [[T1]] // CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to i8** // CHECK-NEXT: call i8* @objc_storeWeak(i8** [[T4]], i8* [[V]]) // CHECK-NEXT: ret void @@ -46,10 +46,10 @@ // CHECK-NEXT: [[CMD:%.*]] = alloca i8*, // CHECK-NEXT: store [[WPT]]* {{%.*}}, [[WPT]]** [[SELF]] // CHECK-NEXT: store i8* {{%.*}}, i8** [[CMD]] -// CHECK-NEXT: [[T0:%.*]] = load [[WPT]]** [[SELF]] -// CHECK-NEXT: [[T1:%.*]] = load i64* @"OBJC_IVAR_$_WeakPropertyTest.PROP" +// CHECK-NEXT: [[T0:%.*]] = load [[WPT]]*, [[WPT]]** [[SELF]] +// CHECK-NEXT: [[T1:%.*]] = load i64, i64* @"OBJC_IVAR_$_WeakPropertyTest.PROP" // CHECK-NEXT: [[T2:%.*]] = bitcast [[WPT]]* [[T0]] to i8* -// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8* [[T2]], i64 [[T1]] +// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8, i8* [[T2]], i64 [[T1]] // CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to i8** // CHECK-NEXT: call void @objc_destroyWeak(i8** [[T4]]) // CHECK-NEXT: ret void diff --git a/test/CodeGenObjC/arc.m b/test/CodeGenObjC/arc.m index a83fe0f24be2..3aafefd43cdc 100644 --- a/test/CodeGenObjC/arc.m +++ b/test/CodeGenObjC/arc.m @@ -37,7 +37,7 @@ void test0(id x) { // CHECK: [[X:%.*]] = alloca i8* // CHECK-NEXT: [[PARM:%.*]] = call i8* @objc_retain(i8* {{.*}}) // CHECK-NEXT: store i8* [[PARM]], i8** [[X]] - // CHECK-NEXT: [[TMP:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[TMP:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[TMP]]) // CHECK-NEXT: ret void } @@ -46,16 +46,18 @@ void test0(id x) { id test1(id x) { // CHECK: [[X:%.*]] = alloca i8* // CHECK-NEXT: [[Y:%.*]] = alloca i8* - // CHECK-NEXT: alloca i32 // CHECK-NEXT: [[PARM:%.*]] = call i8* @objc_retain(i8* {{%.*}}) // CHECK-NEXT: store i8* [[PARM]], i8** [[X]] + // CHECK-NEXT: [[YPTR1:%.*]] = bitcast i8** [[Y]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[YPTR1]]) // CHECK-NEXT: store i8* null, i8** [[Y]] - // CHECK-NEXT: [[T0:%.*]] = load i8** [[Y]] + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[Y]] // CHECK-NEXT: [[RET:%.*]] = call i8* @objc_retain(i8* [[T0]]) - // CHECK-NEXT: store i32 - // CHECK-NEXT: [[T0:%.*]] = load i8** [[Y]] + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[Y]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) - // CHECK-NEXT: [[T1:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[YPTR2:%.*]] = bitcast i8** [[Y]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[YPTR2]]) + // CHECK-NEXT: [[T1:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T1]]) // CHECK-NEXT: [[T1:%.*]] = tail call i8* @objc_autoreleaseReturnValue(i8* [[RET]]) // CHECK-NEXT: ret i8* [[T1]] @@ -99,12 +101,14 @@ void test3_unelided() { extern void test3_helper(void); // CHECK: [[X:%.*]] = alloca [[TEST3:%.*]]* + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast [[TEST3]]** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: store [[TEST3]]* null, [[TEST3]]** [[X]], align Test3 *x; // Call to +alloc. - // CHECK-NEXT: load {{.*}}* @"OBJC_CLASSLIST_REFERENCES_ - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: load {{.*}}, {{.*}}* @"OBJC_CLASSLIST_REFERENCES_ + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: bitcast // CHECK-NEXT: [[ALLOC:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend // CHECK-NEXT: bitcast @@ -112,34 +116,38 @@ void test3_unelided() { // CHECK-NEXT: call void @objc_release(i8* [Test3 alloc]; - // CHECK-NEXT: [[T0:%.*]] = load [[TEST3]]** [[X]] - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[T0:%.*]] = load [[TEST3]]*, [[TEST3]]** [[X]] + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST3]]* [[T0]] to i8* // CHECK-NEXT: [[COPY:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend {{.*}})(i8* [[T1]], // CHECK-NEXT: call void @objc_release(i8* [[COPY]]) [[NUW:#[0-9]+]] [x copy]; - // CHECK-NEXT: [[T0:%.*]] = load [[TEST3]]** [[X]] + // CHECK-NEXT: [[T0:%.*]] = load [[TEST3]]*, [[TEST3]]** [[X]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST3]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]] + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast [[TEST3]]** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } // CHECK-LABEL: define void @test3() void test3() { // CHECK: [[X:%.*]] = alloca i8* + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) id x = [[Test3 alloc] initWith: 5]; // Call to +alloc. - // CHECK-NEXT: load {{.*}}* @"OBJC_CLASSLIST_REFERENCES_ - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: load {{.*}}, {{.*}}* @"OBJC_CLASSLIST_REFERENCES_ + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: bitcast // CHECK-NEXT: [[ALLOC:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend // CHECK-NEXT: bitcast // Call to -initWith: with elided retain of consumed argument. - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: bitcast // CHECK-NEXT: [[INIT:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i32)*)(i8* // CHECK-NEXT: bitcast @@ -148,35 +156,36 @@ void test3() { // CHECK-NEXT: store i8* [[INIT]], i8** [[X]] // Call to -copy. - // CHECK-NEXT: [[V:%.*]] = load i8** [[X]] - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[V:%.*]] = load i8*, i8** [[X]] + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[COPY:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend {{.*}})(i8* [[V]], // Assignment to x. - // CHECK-NEXT: [[TMP:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[TMP:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: store i8* [[COPY]], i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[TMP]]) [[NUW]] x = [x copy]; // Cleanup for x. - // CHECK-NEXT: [[TMP:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[TMP:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[TMP]]) [[NUW]] - + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } // CHECK-LABEL: define i8* @test4() id test4() { // Call to +alloc. - // CHECK: load {{.*}}* @"OBJC_CLASSLIST_REFERENCES_ - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK: load {{.*}}, {{.*}}* @"OBJC_CLASSLIST_REFERENCES_ + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: bitcast // CHECK-NEXT: [[ALLOC:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend // CHECK-NEXT: [[ALLOC:%.*]] = bitcast // Call to -initWith: with elided retain of consumed argument. - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[ALLOC:%.*]] = bitcast // CHECK-NEXT: [[INIT:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i32)*)(i8* [[ALLOC]], @@ -209,32 +218,32 @@ void test5(Test5 *x, id y) { // CHECK-NEXT: call i8* @objc_retain // CHECK-NEXT: store - // CHECK-NEXT: load [[TEST5]]** [[X]] - // CHECK-NEXT: load i64* @"OBJC_IVAR_$_Test5.var" + // CHECK-NEXT: load [[TEST5]]*, [[TEST5]]** [[X]] + // CHECK-NEXT: load i64, i64* @"OBJC_IVAR_$_Test5.var" // CHECK-NEXT: bitcast // CHECK-NEXT: getelementptr // CHECK-NEXT: [[VAR:%.*]] = bitcast - // CHECK-NEXT: [[TMP:%.*]] = load i8** [[VAR]] + // CHECK-NEXT: [[TMP:%.*]] = load i8*, i8** [[VAR]] // CHECK-NEXT: store i8* null, i8** [[VAR]] // CHECK-NEXT: call void @objc_release(i8* [[TMP]]) [[NUW]] x->var = 0; - // CHECK-NEXT: [[YVAL:%.*]] = load i8** [[Y]] - // CHECK-NEXT: load [[TEST5]]** [[X]] - // CHECK-NEXT: load i64* @"OBJC_IVAR_$_Test5.var" + // CHECK-NEXT: [[YVAL:%.*]] = load i8*, i8** [[Y]] + // CHECK-NEXT: load [[TEST5]]*, [[TEST5]]** [[X]] + // CHECK-NEXT: load i64, i64* @"OBJC_IVAR_$_Test5.var" // CHECK-NEXT: bitcast // CHECK-NEXT: getelementptr // CHECK-NEXT: [[VAR:%.*]] = bitcast // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_retain(i8* [[YVAL]]) [[NUW]] - // CHECK-NEXT: [[TMP:%.*]] = load i8** [[VAR]] + // CHECK-NEXT: [[TMP:%.*]] = load i8*, i8** [[VAR]] // CHECK-NEXT: store i8* [[T0]], i8** [[VAR]] // CHECK-NEXT: call void @objc_release(i8* [[TMP]]) [[NUW]] x->var = y; // Epilogue. - // CHECK-NEXT: [[TMP:%.*]] = load i8** [[Y]] + // CHECK-NEXT: [[TMP:%.*]] = load i8*, i8** [[Y]] // CHECK-NEXT: call void @objc_release(i8* [[TMP]]) [[NUW]] - // CHECK-NEXT: [[T0:%.*]] = load [[TEST5]]** [[X]] + // CHECK-NEXT: [[T0:%.*]] = load [[TEST5]]*, [[TEST5]]** [[X]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST5]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]] // CHECK-NEXT: ret void @@ -244,10 +253,14 @@ id test6_helper(void) __attribute__((ns_returns_retained)); // CHECK-LABEL: define void @test6() void test6() { // CHECK: [[X:%.*]] = alloca i8* + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: [[CALL:%.*]] = call i8* @test6_helper() // CHECK-NEXT: store i8* [[CALL]], i8** [[X]] - // CHECK-NEXT: [[T1:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[T1:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]], !clang.imprecise_release + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void id x = test6_helper(); } @@ -256,12 +269,16 @@ void test7_helper(id __attribute__((ns_consumed))); // CHECK-LABEL: define void @test7() void test7() { // CHECK: [[X:%.*]] = alloca i8* + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: store i8* null, i8** [[X]] - // CHECK-NEXT: [[T0:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]]) [[NUW]] // CHECK-NEXT: call void @test7_helper(i8* [[T1]]) - // CHECK-NEXT: [[T1:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[T1:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]], !clang.imprecise_release + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void id x; test7_helper(x); @@ -271,9 +288,13 @@ id test8_helper(void) __attribute__((ns_returns_retained)); void test8() { __unsafe_unretained id x = test8_helper(); // CHECK: [[X:%.*]] = alloca i8* + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: [[T0:%.*]] = call i8* @test8_helper() // CHECK-NEXT: store i8* [[T0]], i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]], !clang.imprecise_release + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -287,15 +308,19 @@ void test10() { // CHECK-LABEL: define void @test10() // CHECK: [[X:%.*]] = alloca [[TEST10:%.*]]*, align // CHECK-NEXT: [[Y:%.*]] = alloca i8*, align + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast [[TEST10]]** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: store [[TEST10]]* null, [[TEST10]]** [[X]] - // CHECK-NEXT: load [[TEST10]]** [[X]], align - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_{{[0-9]*}} + // CHECK-NEXT: [[YPTR1:%.*]] = bitcast i8** [[Y]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[YPTR1]]) + // CHECK-NEXT: load [[TEST10]]*, [[TEST10]]** [[X]], align + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_{{[0-9]*}} // CHECK-NEXT: bitcast // CHECK-NEXT: [[T0:%.*]] = call [[TEST10]]* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST10]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) // CHECK-NEXT: [[V:%.*]] = bitcast i8* [[T2]] to [[TEST10]]* - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_{{[0-9]*}} + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_{{[0-9]*}} // CHECK-NEXT: bitcast // CHECK-NEXT: [[T0:%.*]] = call [[TEST10]]* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST10]]* [[T0]] to i8* @@ -305,11 +330,15 @@ void test10() { // CHECK-NEXT: store i8* [[T4]], i8** [[Y]] // CHECK-NEXT: [[T0:%.*]] = bitcast [[TEST10]]* [[V]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T0]]) - // CHECK-NEXT: [[T0:%.*]] = load i8** [[Y]] + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[Y]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) - // CHECK-NEXT: [[T0:%.*]] = load [[TEST10]]** [[X]] + // CHECK-NEXT: [[YPTR2:%.*]] = bitcast i8** [[Y]] to i8* + // CHECK-NEXT: void @llvm.lifetime.end(i64 8, i8* [[YPTR2]]) + // CHECK-NEXT: [[T0:%.*]] = load [[TEST10]]*, [[TEST10]]** [[X]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST10]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast [[TEST10]]** [[X]] to i8* + // CHECK-NEXT: void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -318,11 +347,15 @@ void test11(id (*f)(void) __attribute__((ns_returns_retained))) { // CHECK: [[F:%.*]] = alloca i8* ()*, align // CHECK-NEXT: [[X:%.*]] = alloca i8*, align // CHECK-NEXT: store i8* ()* {{%.*}}, i8* ()** [[F]], align - // CHECK-NEXT: [[T0:%.*]] = load i8* ()** [[F]], align + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) + // CHECK-NEXT: [[T0:%.*]] = load i8* ()*, i8* ()** [[F]], align // CHECK-NEXT: [[T1:%.*]] = call i8* [[T0]]() // CHECK-NEXT: store i8* [[T1]], i8** [[X]], align - // CHECK-NEXT: [[T3:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[T3:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T3]]) [[NUW]], !clang.imprecise_release + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void id x = f(); } @@ -335,6 +368,8 @@ void test12(void) { // CHECK-NEXT: [[Y:%.*]] = alloca i8*, align __weak id x = test12_helper(); + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: [[T0:%.*]] = call i8* @test12_helper() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) // CHECK-NEXT: call i8* @objc_initWeak(i8** [[X]], i8* [[T1]]) @@ -347,12 +382,18 @@ void test12(void) { // CHECK-NEXT: call void @objc_release(i8* [[T1]]) id y = x; + // CHECK-NEXT: [[YPTR1:%.*]] = bitcast i8** [[Y]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[YPTR1]]) // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_loadWeakRetained(i8** [[X]]) // CHECK-NEXT: store i8* [[T2]], i8** [[Y]], align - // CHECK-NEXT: [[T4:%.*]] = load i8** [[Y]] + // CHECK-NEXT: [[T4:%.*]] = load i8*, i8** [[Y]] // CHECK-NEXT: call void @objc_release(i8* [[T4]]) [[NUW]], !clang.imprecise_release + // CHECK-NEXT: [[YPTR2:%.*]] = bitcast i8** [[Y]] to i8* + // CHECK-NEXT: void @llvm.lifetime.end(i64 8, i8* [[YPTR2]]) // CHECK-NEXT: call void @objc_destroyWeak(i8** [[X]]) + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK: ret void } @@ -360,31 +401,35 @@ void test12(void) { void test13(void) { // CHECK-LABEL: define void @test13() // CHECK: [[X:%.*]] = alloca i8*, align + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: store i8* null, i8** [[X]], align id x; typedef void fnty(id __attribute__((ns_consumed))); extern fnty *test13_func; - // CHECK-NEXT: [[FN:%.*]] = load void (i8*)** @test13_func, align - // CHECK-NEXT: [[X_VAL:%.*]] = load i8** [[X]], align + // CHECK-NEXT: [[FN:%.*]] = load void (i8*)*, void (i8*)** @test13_func, align + // CHECK-NEXT: [[X_VAL:%.*]] = load i8*, i8** [[X]], align // CHECK-NEXT: [[X_TMP:%.*]] = call i8* @objc_retain(i8* [[X_VAL]]) [[NUW]] // CHECK-NEXT: call void [[FN]](i8* [[X_TMP]]) test13_func(x); extern fnty ^test13_block; - // CHECK-NEXT: [[TMP:%.*]] = load void (i8*)** @test13_block, align + // CHECK-NEXT: [[TMP:%.*]] = load void (i8*)*, void (i8*)** @test13_block, align // CHECK-NEXT: [[BLOCK:%.*]] = bitcast void (i8*)* [[TMP]] to [[BLOCKTY:%.*]]* - // CHECK-NEXT: [[BLOCK_FN_PTR:%.*]] = getelementptr inbounds [[BLOCKTY]]* [[BLOCK]], i32 0, i32 3 + // CHECK-NEXT: [[BLOCK_FN_PTR:%.*]] = getelementptr inbounds [[BLOCKTY]], [[BLOCKTY]]* [[BLOCK]], i32 0, i32 3 // CHECK-NEXT: [[BLOCK_OPAQUE:%.*]] = bitcast [[BLOCKTY]]* [[BLOCK]] to i8* - // CHECK-NEXT: [[X_VAL:%.*]] = load i8** [[X]], align + // CHECK-NEXT: [[X_VAL:%.*]] = load i8*, i8** [[X]], align // CHECK-NEXT: [[X_TMP:%.*]] = call i8* @objc_retain(i8* [[X_VAL]]) [[NUW]] - // CHECK-NEXT: [[BLOCK_FN_TMP:%.*]] = load i8** [[BLOCK_FN_PTR]] + // CHECK-NEXT: [[BLOCK_FN_TMP:%.*]] = load i8*, i8** [[BLOCK_FN_PTR]] // CHECK-NEXT: [[BLOCK_FN:%.*]] = bitcast i8* [[BLOCK_FN_TMP]] to void (i8*, i8*)* // CHECK-NEXT: call void [[BLOCK_FN]](i8* [[BLOCK_OPAQUE]], i8* [[X_TMP]]) test13_block(x); - // CHECK-NEXT: [[T0:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]] + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -406,17 +451,17 @@ void test13(void) { // CHECK-NEXT: alloca // CHECK-NEXT: store [[TEST16]]* {{%.*}}, [[TEST16]]** [[SELF]], align // CHECK-NEXT: store i8* {{%.*}}, i8** [[CMD]] - // CHECK-NEXT: [[BASE:%.*]] = load [[TEST16]]** [[SELF]] + // CHECK-NEXT: [[BASE:%.*]] = load [[TEST16]]*, [[TEST16]]** [[SELF]] // Call super. // CHECK-NEXT: [[BASE2:%.*]] = bitcast [[TEST16]]* [[BASE]] to i8* // CHECK-NEXT: [[T0:%.*]] = getelementptr // CHECK-NEXT: store i8* [[BASE2]], i8** [[T0]] - // CHECK-NEXT: load {{%.*}}** @"OBJC_CLASSLIST_SUP_REFS_$_ + // CHECK-NEXT: load {{%.*}}*, {{%.*}}** @"OBJC_CLASSLIST_SUP_REFS_$_ // CHECK-NEXT: bitcast // CHECK-NEXT: getelementptr // CHECK-NEXT: store - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: call void bitcast (i8* ({{.*}})* @objc_msgSendSuper2 to void ( // CHECK-NEXT: ret void } @@ -427,19 +472,19 @@ void test13(void) { // CHECK-NEXT: [[CMD:%.*]] = alloca i8*, align // CHECK-NEXT: store [[TEST16]]* {{%.*}}, [[TEST16]]** [[SELF]], align // CHECK-NEXT: store i8* {{%.*}}, i8** [[CMD]] - // CHECK-NEXT: [[BASE:%.*]] = load [[TEST16]]** [[SELF]] + // CHECK-NEXT: [[BASE:%.*]] = load [[TEST16]]*, [[TEST16]]** [[SELF]] // Destroy y. - // CHECK-NEXT: [[Y_OFF:%.*]] = load i64* @"OBJC_IVAR_$_Test16.y" + // CHECK-NEXT: [[Y_OFF:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test16.y" // CHECK-NEXT: [[T0:%.*]] = bitcast [[TEST16]]* [[BASE]] to i8* - // CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds i8* [[T0]], i64 [[Y_OFF]] + // CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 [[Y_OFF]] // CHECK-NEXT: [[T2:%.*]] = bitcast i8* [[T1]] to i8** // CHECK-NEXT: call void @objc_storeStrong(i8** [[T2]], i8* null) [[NUW]] // Destroy z. - // CHECK-NEXT: [[Z_OFF:%.*]] = load i64* @"OBJC_IVAR_$_Test16.z" + // CHECK-NEXT: [[Z_OFF:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test16.z" // CHECK-NEXT: [[T0:%.*]] = bitcast [[TEST16]]* [[BASE]] to i8* - // CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds i8* [[T0]], i64 [[Z_OFF]] + // CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 [[Z_OFF]] // CHECK-NEXT: [[T2:%.*]] = bitcast i8* [[T1]] to i8** // CHECK-NEXT: call void @objc_storeStrong(i8** [[T2]], i8* null) [[NUW]] @@ -470,18 +515,18 @@ void test19() { // CHECK-NEXT: [[CALL:%.*]] = call i8* @test19_helper() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[CALL]]) [[NUW]] - // CHECK-NEXT: [[SLOT:%.*]] = getelementptr inbounds [5 x i8*]* [[X]], i32 0, i64 2 - // CHECK-NEXT: [[T0:%.*]] = load i8** [[SLOT]] + // CHECK-NEXT: [[SLOT:%.*]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[X]], i32 0, i64 2 + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[SLOT]] // CHECK-NEXT: store i8* [[T1]], i8** [[SLOT]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]] - // CHECK-NEXT: [[BEGIN:%.*]] = getelementptr inbounds [5 x i8*]* [[X]], i32 0, i32 0 - // CHECK-NEXT: [[END:%.*]] = getelementptr inbounds i8** [[BEGIN]], i64 5 + // CHECK-NEXT: [[BEGIN:%.*]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[X]], i32 0, i32 0 + // CHECK-NEXT: [[END:%.*]] = getelementptr inbounds i8*, i8** [[BEGIN]], i64 5 // CHECK-NEXT: br label // CHECK: [[AFTER:%.*]] = phi i8** [ [[END]], {{%.*}} ], [ [[NEXT:%.*]], {{%.*}} ] - // CHECK-NEXT: [[CUR:%.*]] = getelementptr inbounds i8** [[AFTER]], i64 -1 - // CHECK-NEXT: [[T0:%.*]] = load i8** [[CUR]] + // CHECK-NEXT: [[CUR:%.*]] = getelementptr inbounds i8*, i8** [[AFTER]], i64 -1 + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[CUR]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]], !clang.imprecise_release // CHECK-NEXT: [[EQ:%.*]] = icmp eq i8** [[CUR]], [[BEGIN]] // CHECK-NEXT: br i1 [[EQ]], @@ -498,7 +543,7 @@ void test20(unsigned n) { id x[n]; // Capture the VLA size. - // CHECK-NEXT: [[T0:%.*]] = load i32* [[N]], align 4 + // CHECK-NEXT: [[T0:%.*]] = load i32, i32* [[N]], align 4 // CHECK-NEXT: [[DIM:%.*]] = zext i32 [[T0]] to i64 // Save the stack pointer. @@ -514,18 +559,18 @@ void test20(unsigned n) { // CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[T0]], i8 0, i64 [[T1]], i32 8, i1 false) // Destroy. - // CHECK-NEXT: [[END:%.*]] = getelementptr inbounds i8** [[VLA]], i64 [[DIM]] + // CHECK-NEXT: [[END:%.*]] = getelementptr inbounds i8*, i8** [[VLA]], i64 [[DIM]] // CHECK-NEXT: [[EMPTY:%.*]] = icmp eq i8** [[VLA]], [[END]] // CHECK-NEXT: br i1 [[EMPTY]] // CHECK: [[AFTER:%.*]] = phi i8** [ [[END]], {{%.*}} ], [ [[CUR:%.*]], {{%.*}} ] - // CHECK-NEXT: [[CUR:%.*]] = getelementptr inbounds i8** [[AFTER]], i64 -1 - // CHECK-NEXT: [[T0:%.*]] = load i8** [[CUR]] + // CHECK-NEXT: [[CUR:%.*]] = getelementptr inbounds i8*, i8** [[AFTER]], i64 -1 + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[CUR]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]], !clang.imprecise_release // CHECK-NEXT: [[EQ:%.*]] = icmp eq i8** [[CUR]], [[VLA]] // CHECK-NEXT: br i1 [[EQ]], - // CHECK: [[T0:%.*]] = load i8** [[SAVED_STACK]] + // CHECK: [[T0:%.*]] = load i8*, i8** [[SAVED_STACK]] // CHECK-NEXT: call void @llvm.stackrestore(i8* [[T0]]) // CHECK-NEXT: ret void } @@ -539,7 +584,7 @@ void test21(unsigned n) { id x[2][n][3]; // Capture the VLA size. - // CHECK-NEXT: [[T0:%.*]] = load i32* [[N]], align 4 + // CHECK-NEXT: [[T0:%.*]] = load i32, i32* [[N]], align 4 // CHECK-NEXT: [[DIM:%.*]] = zext i32 [[T0]] to i64 // CHECK-NEXT: [[T0:%.*]] = call i8* @llvm.stacksave() @@ -558,20 +603,20 @@ void test21(unsigned n) { // Destroy. // CHECK-NEXT: [[T0:%.*]] = mul nuw i64 2, [[DIM]] - // CHECK-NEXT: [[BEGIN:%.*]] = getelementptr inbounds [3 x i8*]* [[VLA]], i32 0, i32 0 + // CHECK-NEXT: [[BEGIN:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[VLA]], i32 0, i32 0 // CHECK-NEXT: [[T1:%.*]] = mul nuw i64 [[T0]], 3 - // CHECK-NEXT: [[END:%.*]] = getelementptr inbounds i8** [[BEGIN]], i64 [[T1]] + // CHECK-NEXT: [[END:%.*]] = getelementptr inbounds i8*, i8** [[BEGIN]], i64 [[T1]] // CHECK-NEXT: [[EMPTY:%.*]] = icmp eq i8** [[BEGIN]], [[END]] // CHECK-NEXT: br i1 [[EMPTY]] // CHECK: [[AFTER:%.*]] = phi i8** [ [[END]], {{%.*}} ], [ [[CUR:%.*]], {{%.*}} ] - // CHECK-NEXT: [[CUR:%.*]] = getelementptr inbounds i8** [[AFTER]], i64 -1 - // CHECK-NEXT: [[T0:%.*]] = load i8** [[CUR]] + // CHECK-NEXT: [[CUR:%.*]] = getelementptr inbounds i8*, i8** [[AFTER]], i64 -1 + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[CUR]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]], !clang.imprecise_release // CHECK-NEXT: [[EQ:%.*]] = icmp eq i8** [[CUR]], [[BEGIN]] // CHECK-NEXT: br i1 [[EQ]], - // CHECK: [[T0:%.*]] = load i8** [[SAVED_STACK]] + // CHECK: [[T0:%.*]] = load i8*, i8** [[SAVED_STACK]] // CHECK-NEXT: call void @llvm.stackrestore(i8* [[T0]]) // CHECK-NEXT: ret void } @@ -593,16 +638,16 @@ void test21(unsigned n) { @interface Test26 { id x[4]; } @end @implementation Test26 @end // CHECK: define internal void @"\01-[Test26 .cxx_destruct]"( -// CHECK: [[SELF:%.*]] = load [[TEST26:%.*]]** -// CHECK-NEXT: [[OFFSET:%.*]] = load i64* @"OBJC_IVAR_$_Test26.x" +// CHECK: [[SELF:%.*]] = load [[TEST26:%.*]]*, [[TEST26:%.*]]** +// CHECK-NEXT: [[OFFSET:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test26.x" // CHECK-NEXT: [[T0:%.*]] = bitcast [[TEST26]]* [[SELF]] to i8* -// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds i8* [[T0]], i64 [[OFFSET]] +// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 [[OFFSET]] // CHECK-NEXT: [[X:%.*]] = bitcast i8* [[T1]] to [4 x i8*]* -// CHECK-NEXT: [[BEGIN:%.*]] = getelementptr inbounds [4 x i8*]* [[X]], i32 0, i32 0 -// CHECK-NEXT: [[END:%.*]] = getelementptr inbounds i8** [[BEGIN]], i64 4 +// CHECK-NEXT: [[BEGIN:%.*]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[X]], i32 0, i32 0 +// CHECK-NEXT: [[END:%.*]] = getelementptr inbounds i8*, i8** [[BEGIN]], i64 4 // CHECK-NEXT: br label // CHECK: [[PAST:%.*]] = phi i8** [ [[END]], {{%.*}} ], [ [[CUR:%.*]], {{%.*}} ] -// CHECK-NEXT: [[CUR]] = getelementptr inbounds i8** [[PAST]], i64 -1 +// CHECK-NEXT: [[CUR]] = getelementptr inbounds i8*, i8** [[PAST]], i64 -1 // CHECK-NEXT: call void @objc_storeStrong(i8** [[CUR]], i8* null) // CHECK-NEXT: [[ISDONE:%.*]] = icmp eq i8** [[CUR]], [[BEGIN]] // CHECK-NEXT: br i1 [[ISDONE]], @@ -617,16 +662,14 @@ void test21(unsigned n) { // CHECK: define internal i8* @"\01-[Test27 init]" // CHECK: [[SELF:%.*]] = alloca [[TEST27:%.*]]*, // CHECK-NEXT: [[CMD:%.*]] = alloca i8*, -// CHECK-NEXT: [[DEST:%.*]] = alloca i32 // CHECK-NEXT: store [[TEST27]]* {{%.*}}, [[TEST27]]** [[SELF]] // CHECK-NEXT: store i8* {{%.*}}, i8** [[CMD]] -// CHECK-NEXT: [[T0:%.*]] = load [[TEST27]]** [[SELF]] +// CHECK-NEXT: [[T0:%.*]] = load [[TEST27]]*, [[TEST27]]** [[SELF]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST27]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST27]]* // CHECK-NEXT: [[RET:%.*]] = bitcast [[TEST27]]* [[T3]] to i8* -// CHECK-NEXT: store i32 {{[0-9]+}}, i32* [[DEST]] -// CHECK-NEXT: [[T0:%.*]] = load [[TEST27]]** [[SELF]] +// CHECK-NEXT: [[T0:%.*]] = load [[TEST27]]*, [[TEST27]]** [[SELF]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST27]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) // CHECK-NEXT: ret i8* [[RET]] @@ -641,10 +684,10 @@ void test21(unsigned n) { @synthesize prop; @end // CHECK: define internal void @"\01-[Test28 .cxx_destruct]" -// CHECK: [[SELF:%.*]] = load [[TEST28:%.*]]** -// CHECK-NEXT: [[OFFSET:%.*]] = load i64* @"OBJC_IVAR_$_Test28.prop" +// CHECK: [[SELF:%.*]] = load [[TEST28:%.*]]*, [[TEST28:%.*]]** +// CHECK-NEXT: [[OFFSET:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test28.prop" // CHECK-NEXT: [[T0:%.*]] = bitcast [[TEST28]]* [[SELF]] to i8* -// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds i8* [[T0]], i64 [[OFFSET]] +// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 [[OFFSET]] // CHECK-NEXT: [[T2:%.*]] = bitcast i8* [[T1]] to i8** // CHECK-NEXT: call void @objc_storeStrong(i8** [[T2]], i8* null) // CHECK-NEXT: ret void @@ -662,20 +705,19 @@ static id _test29_allocator = 0; // CHECK: define internal i8* @"\01-[Test29 init]"([[TEST29:%[^*]*]]* {{%.*}}, // CHECK: [[SELF:%.*]] = alloca [[TEST29]]*, align 8 // CHECK-NEXT: [[CMD:%.*]] = alloca i8*, align 8 -// CHECK-NEXT: [[CLEANUP:%.*]] = alloca i32 // CHECK-NEXT: store [[TEST29]]* {{%.*}}, [[TEST29]]** [[SELF]] // CHECK-NEXT: store i8* {{%.*}}, i8** [[CMD]] // Evaluate arguments. Note that the send argument is evaluated // before the zeroing of self. -// CHECK-NEXT: [[T0:%.*]] = load [[TEST29]]** [[SELF]], align 8 -// CHECK-NEXT: [[T1:%.*]] = load i8** @_test29_allocator, align 8 +// CHECK-NEXT: [[T0:%.*]] = load [[TEST29]]*, [[TEST29]]** [[SELF]], align 8 +// CHECK-NEXT: [[T1:%.*]] = load i8*, i8** @_test29_allocator, align 8 // Implicit null of 'self', i.e. direct transfer of ownership. // CHECK-NEXT: store [[TEST29]]* null, [[TEST29]]** [[SELF]] // Actual message send. -// CHECK-NEXT: [[T2:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ +// CHECK-NEXT: [[T2:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[T3:%.*]] = bitcast [[TEST29]]* [[T0]] to i8* // CHECK-NEXT: [[CALL:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i8*)*)(i8* [[T3]], i8* [[T2]], i8* [[T1]]) @@ -691,10 +733,9 @@ static id _test29_allocator = 0; // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_retain(i8* [[CALL]]) [[NUW]] // CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[TEST29]]* // CHECK-NEXT: [[RET:%.*]] = bitcast [[TEST29]]* [[T1]] to i8* -// CHECK-NEXT: store i32 1, i32* [[CLEANUP]] // Cleanup. -// CHECK-NEXT: [[T0:%.*]] = load [[TEST29]]** [[SELF]] +// CHECK-NEXT: [[T0:%.*]] = load [[TEST29]]*, [[TEST29]]** [[SELF]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST29]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]], !clang.imprecise_release @@ -708,7 +749,6 @@ static id _test29_allocator = 0; // CHECK-NEXT: [[CMD:%.*]] = alloca i8*, align 8 // CHECK-NEXT: [[ALLOCATOR:%.*]] = alloca i8*, align 8 // CHECK-NEXT: alloca -// CHECK-NEXT: [[CLEANUP:%.*]] = alloca i32 // CHECK-NEXT: store [[TEST29]]* {{%.*}}, [[TEST29]]** [[SELF]] // CHECK-NEXT: store i8* {{%.*}}, i8** [[CMD]] // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_retain(i8* {{%.*}}) @@ -716,8 +756,8 @@ static id _test29_allocator = 0; // Evaluate arguments. Note that the send argument is evaluated // before the zeroing of self. -// CHECK-NEXT: [[T0:%.*]] = load [[TEST29]]** [[SELF]] -// CHECK-NEXT: [[T1:%.*]] = load i8** [[ALLOCATOR]], align 8 +// CHECK-NEXT: [[T0:%.*]] = load [[TEST29]]*, [[TEST29]]** [[SELF]] +// CHECK-NEXT: [[T1:%.*]] = load i8*, i8** [[ALLOCATOR]], align 8 // Implicit null of 'self', i.e. direct transfer of ownership. // CHECK-NEXT: store [[TEST29]]* null, [[TEST29]]** [[SELF]] @@ -736,24 +776,23 @@ static id _test29_allocator = 0; // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST29]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]]) [[NUW]] // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST29]]* -// CHECK-NEXT: [[T4:%.*]] = load [[TEST29]]** [[SELF]], align +// CHECK-NEXT: [[T4:%.*]] = load [[TEST29]]*, [[TEST29]]** [[SELF]], align // CHECK-NEXT: store [[TEST29]]* [[T3]], [[TEST29]]** [[SELF]], align // CHECK-NEXT: [[T5:%.*]] = bitcast [[TEST29]]* [[T4]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T5]]) // Return statement. -// CHECK-NEXT: [[T0:%.*]] = load [[TEST29]]** [[SELF]] +// CHECK-NEXT: [[T0:%.*]] = load [[TEST29]]*, [[TEST29]]** [[SELF]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST29]]* [[T0]] to i8* // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_retain(i8* [[T1]]) [[NUW]] // CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[TEST29]]* // CHECK-NEXT: [[RET:%.*]] = bitcast [[TEST29]]* [[T1]] to i8* -// CHECK-NEXT: store i32 1, i32* [[CLEANUP]] // Cleanup. -// CHECK-NEXT: [[T0:%.*]] = load i8** [[ALLOCATOR]] +// CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[ALLOCATOR]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]], !clang.imprecise_release -// CHECK-NEXT: [[T0:%.*]] = load [[TEST29]]** [[SELF]] +// CHECK-NEXT: [[T0:%.*]] = load [[TEST29]]*, [[TEST29]]** [[SELF]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST29]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [[NUW]], !clang.imprecise_release @@ -776,38 +815,36 @@ char *helper; // CHECK: define internal i8* @"\01-[Test30 init]"([[TEST30:%[^*]*]]* {{%.*}}, // CHECK: [[RET:%.*]] = alloca [[TEST30]]* // CHECK-NEXT: alloca i8* -// CHECK-NEXT: alloca i32 // CHECK-NEXT: store [[TEST30]]* {{%.*}}, [[TEST30]]** [[SELF]] // CHECK-NEXT: store // Call. -// CHECK-NEXT: [[T0:%.*]] = load [[TEST30]]** [[SELF]] -// CHECK-NEXT: [[T1:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ +// CHECK-NEXT: [[T0:%.*]] = load [[TEST30]]*, [[TEST30]]** [[SELF]] +// CHECK-NEXT: [[T1:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST30]]* [[T0]] to i8* // CHECK-NEXT: [[CALL:%.*]] = call [[TEST30_HELPER:%.*]]* bitcast {{.*}} @objc_msgSend {{.*}}(i8* [[T2]], i8* [[T1]]) // Assignment. // CHECK-NEXT: [[T0:%.*]] = bitcast [[TEST30_HELPER]]* [[CALL]] to i8* -// CHECK-NEXT: [[T1:%.*]] = load [[TEST30]]** [[SELF]] -// CHECK-NEXT: [[IVAR:%.*]] = load i64* @"OBJC_IVAR_$_Test30.helper" +// CHECK-NEXT: [[T1:%.*]] = load [[TEST30]]*, [[TEST30]]** [[SELF]] +// CHECK-NEXT: [[IVAR:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test30.helper" // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST30]]* [[T1]] to i8* -// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8* [[T2]], i64 [[IVAR]] +// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8, i8* [[T2]], i64 [[IVAR]] // CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to i8** -// CHECK-NEXT#: [[T5:%.*]] = load i8** [[T4]] +// CHECK-NEXT#: [[T5:%.*]] = load i8*, i8** [[T4]] // CHECK-NEXT#: [[T6:%.*]] = call i8* @objc_retain(i8* [[T0]]) // CHECK-NEXT#: call void @objc_release(i8* [[T5]]) // CHECK-NEXT: store i8* [[T0]], i8** [[T4]] // Return. -// CHECK-NEXT: [[T0:%.*]] = load [[TEST30]]** [[SELF]] +// CHECK-NEXT: [[T0:%.*]] = load [[TEST30]]*, [[TEST30]]** [[SELF]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST30]]* [[T0]] to i8* // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_retain(i8* [[T1]]) // CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[TEST30]]* // CHECK-NEXT: [[RET:%.*]] = bitcast [[TEST30]]* [[T1]] to i8* -// CHECK-NEXT: store i32 1 // Cleanup. -// CHECK-NEXT: [[T0:%.*]] = load [[TEST30]]** [[SELF]] +// CHECK-NEXT: [[T0:%.*]] = load [[TEST30]]*, [[TEST30]]** [[SELF]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST30]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) @@ -863,61 +900,63 @@ void test33(Test33 *ptr) { // CHECK-NEXT: objc_retain // CHECK-NEXT: bitcast // CHECK-NEXT: store + // CHECK-NEXT: bitcast + // CHECK-NEXT: call void @llvm.lifetime.start // CHECK-NEXT: store [[A_T]]* null, [[A_T]]** [[A]] - // CHECK-NEXT: load [[TEST33]]** [[PTR]] - // CHECK-NEXT: [[W0:%.*]] = load [[A_T]]** [[A]] + // CHECK-NEXT: load [[TEST33]]*, [[TEST33]]** [[PTR]] + // CHECK-NEXT: [[W0:%.*]] = load [[A_T]]*, [[A_T]]** [[A]] // CHECK-NEXT: store [[A_T]]* [[W0]], [[A_T]]** [[TEMP0]] - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: bitcast // CHECK-NEXT: objc_msgSend{{.*}}, [[A_T]]** [[TEMP0]]) - // CHECK-NEXT: [[T0:%.*]] = load [[A_T]]** [[TEMP0]] + // CHECK-NEXT: [[T0:%.*]] = load [[A_T]]*, [[A_T]]** [[TEMP0]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[A_T]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[A_T]]* - // CHECK-NEXT: call void (...)* @clang.arc.use([[A_T]]* [[W0]]) [[NUW]] - // CHECK-NEXT: [[T4:%.*]] = load [[A_T]]** [[A]] + // CHECK-NEXT: call void (...) @clang.arc.use([[A_T]]* [[W0]]) [[NUW]] + // CHECK-NEXT: [[T4:%.*]] = load [[A_T]]*, [[A_T]]** [[A]] // CHECK-NEXT: store [[A_T]]* [[T3]], [[A_T]]** [[A]] // CHECK-NEXT: [[T5:%.*]] = bitcast [[A_T]]* [[T4]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T5]]) - // CHECK-NEXT: load [[TEST33]]** [[PTR]] - // CHECK-NEXT: [[W0:%.*]] = load [[A_T]]** [[A]] + // CHECK-NEXT: load [[TEST33]]*, [[TEST33]]** [[PTR]] + // CHECK-NEXT: [[W0:%.*]] = load [[A_T]]*, [[A_T]]** [[A]] // CHECK-NEXT: store [[A_T]]* [[W0]], [[A_T]]** [[TEMP1]] - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: bitcast // CHECK-NEXT: objc_msgSend{{.*}}, [[A_T]]** [[TEMP1]]) - // CHECK-NEXT: [[T0:%.*]] = load [[A_T]]** [[TEMP1]] + // CHECK-NEXT: [[T0:%.*]] = load [[A_T]]*, [[A_T]]** [[TEMP1]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[A_T]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[A_T]]* - // CHECK-NEXT: call void (...)* @clang.arc.use([[A_T]]* [[W0]]) [[NUW]] - // CHECK-NEXT: [[T4:%.*]] = load [[A_T]]** [[A]] + // CHECK-NEXT: call void (...) @clang.arc.use([[A_T]]* [[W0]]) [[NUW]] + // CHECK-NEXT: [[T4:%.*]] = load [[A_T]]*, [[A_T]]** [[A]] // CHECK-NEXT: store [[A_T]]* [[T3]], [[A_T]]** [[A]] // CHECK-NEXT: [[T5:%.*]] = bitcast [[A_T]]* [[T4]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T5]]) - // CHECK-NEXT: load [[TEST33]]** [[PTR]] - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: load [[TEST33]]*, [[TEST33]]** [[PTR]] + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: bitcast // CHECK-NEXT: objc_msgSend{{.*}}, [[A_T]]** [[A]]) - // CHECK-NEXT: load [[TEST33]]** [[PTR]] - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: load [[TEST33]]*, [[TEST33]]** [[PTR]] + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: bitcast // CHECK-NEXT: objc_msgSend{{.*}}, [[A_T]]** [[A]]) // 'out' - // CHECK-NEXT: load [[TEST33]]** [[PTR]] + // CHECK-NEXT: load [[TEST33]]*, [[TEST33]]** [[PTR]] // CHECK-NEXT: store [[A_T]]* null, [[A_T]]** [[TEMP2]] - // CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: bitcast // CHECK-NEXT: objc_msgSend{{.*}}, [[A_T]]** [[TEMP2]]) - // CHECK-NEXT: [[T0:%.*]] = load [[A_T]]** [[TEMP2]] + // CHECK-NEXT: [[T0:%.*]] = load [[A_T]]*, [[A_T]]** [[TEMP2]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[A_T]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T1]]) // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[A_T]]* - // CHECK-NEXT: [[T4:%.*]] = load [[A_T]]** [[A]] + // CHECK-NEXT: [[T4:%.*]] = load [[A_T]]*, [[A_T]]** [[A]] // CHECK-NEXT: store [[A_T]]* [[T3]], [[A_T]]** [[A]] // CHECK-NEXT: [[T5:%.*]] = bitcast [[A_T]]* [[T4]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T5]]) @@ -925,6 +964,8 @@ void test33(Test33 *ptr) { // CHECK-NEXT: load // CHECK-NEXT: bitcast // CHECK-NEXT: objc_release + // CHECK-NEXT: bitcast + // CHECK-NEXT: call void @llvm.lifetime.end // CHECK-NEXT: load // CHECK-NEXT: bitcast // CHECK-NEXT: objc_release @@ -941,7 +982,7 @@ void test36(id x) { // CHECK: call i8* @objc_retain id array[3] = { @"A", x, @"y" }; - // CHECK: [[T0:%.*]] = load i8** [[X]] + // CHECK: [[T0:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: store i8* null, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) x = 0; @@ -963,26 +1004,30 @@ void test37(void) { // CHECK-LABEL: define void @test37() // CHECK: [[VAR:%.*]] = alloca [[TEST37:%.*]]*, // CHECK-NEXT: [[TEMP:%.*]] = alloca i8* + // CHECK-NEXT: [[VARPTR1:%.*]] = bitcast [[TEST37]]** [[VAR]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[VARPTR1]]) // CHECK-NEXT: store [[TEST37]]* null, [[TEST37]]** [[VAR]] - // CHECK-NEXT: [[W0:%.*]] = load [[TEST37]]** [[VAR]] + // CHECK-NEXT: [[W0:%.*]] = load [[TEST37]]*, [[TEST37]]** [[VAR]] // CHECK-NEXT: [[W1:%.*]] = bitcast [[TEST37]]* [[W0]] to i8* // CHECK-NEXT: store i8* [[W1]], i8** [[TEMP]] // CHECK-NEXT: call void @test37_helper(i8** [[TEMP]]) - // CHECK-NEXT: [[T0:%.*]] = load i8** [[TEMP]] + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[TEMP]] // CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[TEST37]]* // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST37]]* [[T1]] to i8* // CHECK-NEXT: [[T3:%.*]] = call i8* @objc_retain(i8* [[T2]]) // CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to [[TEST37]]* - // CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[W1]]) [[NUW]] - // CHECK-NEXT: [[T5:%.*]] = load [[TEST37]]** [[VAR]] + // CHECK-NEXT: call void (...) @clang.arc.use(i8* [[W1]]) [[NUW]] + // CHECK-NEXT: [[T5:%.*]] = load [[TEST37]]*, [[TEST37]]** [[VAR]] // CHECK-NEXT: store [[TEST37]]* [[T4]], [[TEST37]]** [[VAR]] // CHECK-NEXT: [[T6:%.*]] = bitcast [[TEST37]]* [[T5]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T6]]) - // CHECK-NEXT: [[T0:%.*]] = load [[TEST37]]** [[VAR]] + // CHECK-NEXT: [[T0:%.*]] = load [[TEST37]]*, [[TEST37]]** [[VAR]] // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST37]]* [[T0]] to i8* // CHECK-NEXT: call void @objc_release(i8* [[T1]]) + // CHECK-NEXT: [[VARPTR2:%.*]] = bitcast [[TEST37]]** [[VAR]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[VARPTR2]]) // CHECK-NEXT: ret void } @@ -1015,7 +1060,7 @@ void test46(__weak id *wp, __weak volatile id *wvp) { // CHECK: [[T0:%.*]] = call i8* @test46_helper() // 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** @@ -1024,7 +1069,7 @@ void test46(__weak id *wp, __weak volatile id *wvp) { // CHECK: [[T0:%.*]] = call i8* @test46_helper() // 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** @@ -1039,18 +1084,22 @@ void test47(void) { // CHECK-LABEL: define void @test47() // CHECK: [[X:%.*]] = alloca i8* + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: store i8* null, i8** [[X]] // CHECK-NEXT: [[CALL:%.*]] = call i8* @test47_helper() // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[CALL]]) - // CHECK-NEXT: [[T1:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[T1:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: store i8* [[T0]], i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T1]]) // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retain(i8* [[T0]]) - // CHECK-NEXT: [[T3:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[T3:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: store i8* [[T2]], i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T3]]) - // CHECK-NEXT: [[T4:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[T4:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T4]]) + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -1059,6 +1108,8 @@ void test48(void) { __weak id x = x = test48_helper(); // CHECK-LABEL: define void @test48() // CHECK: [[X:%.*]] = alloca i8* + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_initWeak(i8** [[X]], i8* null) // CHECK-NEXT: [[T1:%.*]] = call i8* @test48_helper() // CHECK-NEXT: [[T2:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T1]]) @@ -1066,6 +1117,8 @@ void test48(void) { // CHECK-NEXT: [[T4:%.*]] = call i8* @objc_storeWeak(i8** [[X]], i8* [[T3]]) // CHECK-NEXT: call void @objc_release(i8* [[T2]]) // CHECK-NEXT: call void @objc_destroyWeak(i8** [[X]]) + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -1074,6 +1127,8 @@ void test49(void) { __autoreleasing id x = x = test49_helper(); // CHECK-LABEL: define void @test49() // CHECK: [[X:%.*]] = alloca i8* + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK-NEXT: store i8* null, i8** [[X]] // CHECK-NEXT: [[CALL:%.*]] = call i8* @test49_helper() // CHECK-NEXT: [[T0:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[CALL]]) @@ -1081,6 +1136,8 @@ void test49(void) { // CHECK-NEXT: store i8* [[T2]], i8** [[X]] // CHECK-NEXT: [[T3:%.*]] = call i8* @objc_retainAutorelease(i8* [[T1]]) // CHECK-NEXT: store i8* [[T3]], i8** [[X]] + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -1116,11 +1173,15 @@ id test52(void) { // CHECK-LABEL: define i8* @test52() // CHECK: [[X:%.*]] = alloca i32 // CHECK-NEXT: [[TMPALLOCA:%.*]] = alloca i8* +// CHECK-NEXT: [[XPTR1:%.*]] = bitcast i32* [[X]] to i8* +// CHECK-NEXT: call void @llvm.lifetime.start(i64 4, i8* [[XPTR1]]) // CHECK-NEXT: store i32 5, i32* [[X]], -// CHECK-NEXT: [[T0:%.*]] = load i32* [[X]], +// CHECK-NEXT: [[T0:%.*]] = load i32, i32* [[X]], // CHECK-NEXT: [[T1:%.*]] = call i8* @test52_helper(i32 [[T0]]) // CHECK-NEXT: store i8* [[T1]], i8** [[TMPALLOCA]] -// CHECK-NEXT: [[T2:%.*]] = load i8** [[TMPALLOCA]] +// CHECK-NEXT: [[XPTR2:%.*]] = bitcast i32* [[X]] to i8* +// CHECK-NEXT: call void @llvm.lifetime.end(i64 4, i8* [[XPTR2]]) +// CHECK-NEXT: [[T2:%.*]] = load i8*, i8** [[TMPALLOCA]] // CHECK-NEXT: [[T3:%.*]] = tail call i8* @objc_autoreleaseReturnValue(i8* [[T2]]) // CHECK-NEXT: ret i8* [[T3]] } @@ -1134,19 +1195,27 @@ void test53(void) { // CHECK: [[X:%.*]] = alloca i8*, // CHECK-NEXT: [[Y:%.*]] = alloca i8*, // CHECK-NEXT: [[TMPALLOCA:%.*]] = alloca i8*, +// CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* +// CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) +// CHECK-NEXT: [[YPTR1:%.*]] = bitcast i8** [[Y]] to i8* +// CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[YPTR1]]) // CHECK-NEXT: [[T0:%.*]] = call i8* @test53_helper() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) // CHECK-NEXT: store i8* [[T1]], i8** [[Y]], -// CHECK-NEXT: [[T0:%.*]] = load i8** [[Y]], +// CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[Y]], // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retain(i8* [[T0]]) // CHECK-NEXT: store i8* [[T1]], i8** [[TMPALLOCA]] -// CHECK-NEXT: [[T2:%.*]] = load i8** [[Y]] +// CHECK-NEXT: [[T2:%.*]] = load i8*, i8** [[Y]] // CHECK-NEXT: call void @objc_release(i8* [[T2]]) -// CHECK-NEXT: [[T3:%.*]] = load i8** [[TMPALLOCA]] +// CHECK-NEXT: [[YPTR2:%.*]] = bitcast i8** [[Y]] to i8* +// CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[YPTR2]]) +// CHECK-NEXT: [[T3:%.*]] = load i8*, i8** [[TMPALLOCA]] // CHECK-NEXT: store i8* [[T3]], i8** [[X]], -// CHECK-NEXT: load i8** [[X]], -// CHECK-NEXT: [[T0:%.*]] = load i8** [[X]] +// CHECK-NEXT: load i8*, i8** [[X]], +// CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) +// CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* +// CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -1193,10 +1262,14 @@ void test56_test(void) { id x = [Test56 make]; // CHECK-LABEL: define void @test56_test() // CHECK: [[X:%.*]] = alloca i8*, align 8 + // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]]) // CHECK: [[T0:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)( // CHECK-NEXT: store i8* [[T0]], i8** [[X]] - // CHECK-NEXT: [[T0:%.*]] = load i8** [[X]] + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[X]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) + // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]]) // CHECK-NEXT: ret void } @@ -1210,31 +1283,31 @@ void test56_test(void) { @synthesize strong, weak, unsafe; @end // CHECK: define internal i8* @"\01-[Test57 strong]"( -// CHECK: [[T0:%.*]] = load [[TEST57:%.*]]** {{%.*}} -// CHECK-NEXT: [[T1:%.*]] = load i64* @"OBJC_IVAR_$_Test57.strong" +// CHECK: [[T0:%.*]] = load [[TEST57:%.*]]*, [[TEST57:%.*]]** {{%.*}} +// CHECK-NEXT: [[T1:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test57.strong" // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST57]]* [[T0]] to i8* -// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8* [[T2]], i64 [[T1]] +// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8, i8* [[T2]], i64 [[T1]] // CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to i8** -// CHECK-NEXT: [[T5:%.*]] = load i8** [[T4]] +// CHECK-NEXT: [[T5:%.*]] = load i8*, i8** [[T4]] // CHECK-NEXT: ret i8* [[T5]] // CHECK: define internal i8* @"\01-[Test57 weak]"( -// CHECK: [[T0:%.*]] = load [[TEST57]]** {{%.*}} -// CHECK-NEXT: [[T1:%.*]] = load i64* @"OBJC_IVAR_$_Test57.weak" +// CHECK: [[T0:%.*]] = load [[TEST57]]*, [[TEST57]]** {{%.*}} +// CHECK-NEXT: [[T1:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test57.weak" // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST57]]* [[T0]] to i8* -// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8* [[T2]], i64 [[T1]] +// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8, i8* [[T2]], i64 [[T1]] // CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to i8** // CHECK-NEXT: [[T5:%.*]] = call i8* @objc_loadWeakRetained(i8** [[T4]]) // CHECK-NEXT: [[T6:%.*]] = tail call i8* @objc_autoreleaseReturnValue(i8* [[T5]]) // CHECK-NEXT: ret i8* [[T6]] // CHECK: define internal i8* @"\01-[Test57 unsafe]"( -// CHECK: [[T0:%.*]] = load [[TEST57]]** {{%.*}} -// CHECK-NEXT: [[T1:%.*]] = load i64* @"OBJC_IVAR_$_Test57.unsafe" +// CHECK: [[T0:%.*]] = load [[TEST57]]*, [[TEST57]]** {{%.*}} +// CHECK-NEXT: [[T1:%.*]] = load i64, i64* @"OBJC_IVAR_$_Test57.unsafe" // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST57]]* [[T0]] to i8* -// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8* [[T2]], i64 [[T1]] +// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i8, i8* [[T2]], i64 [[T1]] // CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to i8** -// CHECK-NEXT: [[T5:%.*]] = load i8** [[T4]] +// CHECK-NEXT: [[T5:%.*]] = load i8*, i8** [[T4]] // CHECK-NEXT: ret i8* [[T5]] // rdar://problem/9842343 @@ -1270,24 +1343,28 @@ void test61(void) { // CHECK-NEXT: [[T0:%.*]] = call i8* @test61_make() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) - // CHECK-NEXT: [[T2:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ - // CHECK-NEXT: [[T3:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[T2:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[T3:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[T4:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i8*)*)(i8* [[T1]], i8* [[T3]], i8* [[T2]]) // CHECK-NEXT: call void @objc_release(i8* [[T1]]) [test61_make() performSelector: @selector(test61_void)]; + // CHECK-NEXT: [[YPTR1:%.*]] = bitcast i8** [[Y]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[YPTR1]]) // CHECK-NEXT: [[T0:%.*]] = call i8* @test61_make() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) - // CHECK-NEXT: [[T2:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ - // CHECK-NEXT: [[T3:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[T2:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ + // CHECK-NEXT: [[T3:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[T4:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i8*)*)(i8* [[T1]], i8* [[T3]], i8* [[T2]]) // CHECK-NEXT: [[T5:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T4]]) // CHECK-NEXT: store i8* [[T5]], i8** [[Y]] // CHECK-NEXT: call void @objc_release(i8* [[T1]]) id y = [test61_make() performSelector: @selector(test61_id)]; - // CHECK-NEXT: [[T0:%.*]] = load i8** [[Y]] + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[Y]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) + // CHECK-NEXT: [[YPTR2:%.*]] = bitcast i8** [[Y]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[YPTR2]]) // CHECK-NEXT: ret void } @@ -1300,15 +1377,17 @@ void test62(void) { extern id test62_make(void); extern void test62_body(void); + // CHECK-NEXT: [[IPTR:%.*]] = bitcast i32* [[I]] to i8* + // CHECK-NEXT: call void @llvm.lifetime.start(i64 4, i8* [[IPTR]]) // CHECK-NEXT: store i32 0, i32* [[I]], align 4 // CHECK-NEXT: br label - // CHECK: [[T0:%.*]] = load i32* [[I]], align 4 + // CHECK: [[T0:%.*]] = load i32, i32* [[I]], align 4 // CHECK-NEXT: [[T1:%.*]] = icmp ne i32 [[T0]], 20 // CHECK-NEXT: br i1 [[T1]], for (unsigned i = 0; i != 20; ++i) { - // CHECK: [[T0:%.*]] = load i32* [[I]], align 4 + // CHECK: [[T0:%.*]] = load i32, i32* [[I]], align 4 // CHECK-NEXT: [[T1:%.*]] = icmp ne i32 [[T0]], 0 // CHECK-NEXT: store i1 false, i1* [[CLEANUP_REQUIRED]] // CHECK-NEXT: br i1 [[T1]], @@ -1319,9 +1398,9 @@ void test62(void) { // CHECK-NEXT: [[T2:%.*]] = icmp ne i8* [[T1]], null // CHECK-NEXT: br label // CHECK: [[COND:%.*]] = phi i1 [ false, {{%.*}} ], [ [[T2]], {{%.*}} ] - // CHECK-NEXT: [[T0:%.*]] = load i1* [[CLEANUP_REQUIRED]] + // CHECK-NEXT: [[T0:%.*]] = load i1, i1* [[CLEANUP_REQUIRED]] // CHECK-NEXT: br i1 [[T0]], - // CHECK: [[T0:%.*]] = load i8** [[CLEANUP_VALUE]] + // CHECK: [[T0:%.*]] = load i8*, i8** [[CLEANUP_VALUE]] // CHECK-NEXT: call void @objc_release(i8* [[T0]]) // CHECK-NEXT: br label // CHECK: br i1 [[COND]] @@ -1332,7 +1411,7 @@ void test62(void) { test62_body(); } - // CHECK: [[T0:%.*]] = load i32* [[I]], align 4 + // CHECK: [[T0:%.*]] = load i32, i32* [[I]], align 4 // CHECK-NEXT: [[T1:%.*]] = add i32 [[T0]], 1 // CHECK-NEXT: store i32 [[T1]], i32* [[I]] // CHECK-NEXT: br label @@ -1372,7 +1451,7 @@ void test66(void) { // CHECK-NEXT: [[T3:%.*]] = bitcast i8* [[T2]] to [[TEST66]]* // CHECK-NEXT: [[T4:%.*]] = call i8* @test66_arg() // CHECK-NEXT: [[T5:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T4]]) -// CHECK-NEXT: [[T6:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES +// CHECK-NEXT: [[T6:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES // CHECK-NEXT: [[T7:%.*]] = bitcast [[TEST66]]* [[T3]] to i8* // CHECK-NEXT: [[SIX:%.*]] = icmp eq i8* [[T7]], null // CHECK-NEXT: br i1 [[SIX]], label [[NULINIT:%.*]], label [[CALL:%.*]] @@ -1391,8 +1470,12 @@ void test67(void) { } // CHECK-LABEL: define void @test67() // CHECK: [[CL:%.*]] = alloca i8*, align 8 +// CHECK-NEXT: [[CLPTR1:%.*]] = bitcast i8** [[CL]] to i8* +// CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[CLPTR1]]) // CHECK-NEXT: [[T0:%.*]] = call i8* @test67_helper() // CHECK-NEXT: store i8* [[T0]], i8** [[CL]], align 8 +// CHECK-NEXT: [[CLPTR2:%.*]] = bitcast i8** [[CL]] to i8* +// CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[CLPTR2]]) // CHECK-NEXT: ret void Class test68_helper(void); @@ -1401,11 +1484,15 @@ void test68(void) { } // CHECK-LABEL: define void @test68() // CHECK: [[CL:%.*]] = alloca i8*, align 8 +// CHECK-NEXT: [[CLPTR1:%.*]] = bitcast i8** [[CL]] to i8* +// CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[CLPTR1]]) // CHECK-NEXT: [[T0:%.*]] = call i8* @test67_helper() // CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]]) // CHECK-NEXT: store i8* [[T1]], i8** [[CL]], align 8 -// CHECK-NEXT: [[T2:%.*]] = load i8** [[CL]] +// CHECK-NEXT: [[T2:%.*]] = load i8*, i8** [[CL]] // CHECK-NEXT: call void @objc_release(i8* [[T2]]) +// CHECK-NEXT: [[CLPTR2:%.*]] = bitcast i8** [[CL]] to i8* +// CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[CLPTR2]]) // CHECK-NEXT: ret void // rdar://problem/10564852 @@ -1415,7 +1502,7 @@ void test68(void) { @end // CHECK: define internal i8* @"\01-[Test69 foo]"( // CHECK: [[SELF:%.*]] = alloca [[TEST69:%.*]]*, align 8 -// CHECK: [[T0:%.*]] = load [[TEST69]]** [[SELF]], align 8 +// CHECK: [[T0:%.*]] = load [[TEST69]]*, [[TEST69]]** [[SELF]], align 8 // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST69]]* [[T0]] to i8* // CHECK-NEXT: ret i8* [[T1]] diff --git a/test/CodeGenObjC/arm64-int32-ivar.m b/test/CodeGenObjC/arm64-int32-ivar.m index 8f8c34a44a99..5f2acd6926a2 100644 --- a/test/CodeGenObjC/arm64-int32-ivar.m +++ b/test/CodeGenObjC/arm64-int32-ivar.m @@ -11,7 +11,7 @@ @end @implementation I -// CHECK: [[IVAR:%.*]] = load i32* @"OBJC_IVAR_$_I.IVAR2" +// CHECK: [[IVAR:%.*]] = load i32, i32* @"OBJC_IVAR_$_I.IVAR2" // CHECK: [[CONV:%.*]] = sext i32 [[IVAR]] to i64 - (id) METH { return IVAR2; } @end diff --git a/test/CodeGenObjC/atomic-aggregate-property.m b/test/CodeGenObjC/atomic-aggregate-property.m index 1b9cb8f8e865..3bef0a0ed71f 100644 --- a/test/CodeGenObjC/atomic-aggregate-property.m +++ b/test/CodeGenObjC/atomic-aggregate-property.m @@ -29,7 +29,7 @@ struct s2 {}; @synthesize a; @end // CHECK-LP64: define internal double @"\01-[A x]"( -// CHECK-LP64: load atomic i64* {{%.*}} unordered, align 8 +// CHECK-LP64: load atomic i64, i64* {{%.*}} unordered, align 8 // CHECK-LP64: define internal void @"\01-[A setX:]"( // CHECK-LP64: store atomic i64 {{%.*}}, i64* {{%.*}} unordered, align 8 diff --git a/test/CodeGenObjC/attr-exception.m b/test/CodeGenObjC/attr-exception.m index 4d8c425769d5..00ebb0f2a0f1 100644 --- a/test/CodeGenObjC/attr-exception.m +++ b/test/CodeGenObjC/attr-exception.m @@ -13,8 +13,8 @@ __attribute__((objc_exception)) @implementation A @end -// CHECK: @"OBJC_EHTYPE_$_A" = global {{%.*}} { i8** getelementptr (i8** @objc_ehtype_vtable, i32 2) -// CHECK-HIDDEN: @"OBJC_EHTYPE_$_A" = hidden global {{%.*}} { i8** getelementptr (i8** @objc_ehtype_vtable, i32 2) +// CHECK: @"OBJC_EHTYPE_$_A" = global {{%.*}} { i8** getelementptr (i8*, i8** @objc_ehtype_vtable, i32 2) +// CHECK-HIDDEN: @"OBJC_EHTYPE_$_A" = hidden global {{%.*}} { i8** getelementptr (i8*, i8** @objc_ehtype_vtable, i32 2) __attribute__((objc_exception)) __attribute__((visibility("default"))) @@ -23,5 +23,5 @@ __attribute__((visibility("default"))) @implementation B @end -// CHECK: @"OBJC_EHTYPE_$_B" = global {{%.*}} { i8** getelementptr (i8** @objc_ehtype_vtable, i32 2) -// CHECK-HIDDEN: @"OBJC_EHTYPE_$_B" = global {{%.*}} { i8** getelementptr (i8** @objc_ehtype_vtable, i32 2) +// CHECK: @"OBJC_EHTYPE_$_B" = global {{%.*}} { i8** getelementptr (i8*, i8** @objc_ehtype_vtable, i32 2) +// CHECK-HIDDEN: @"OBJC_EHTYPE_$_B" = global {{%.*}} { i8** getelementptr (i8*, i8** @objc_ehtype_vtable, i32 2) diff --git a/test/CodeGenObjC/autorelease.m b/test/CodeGenObjC/autorelease.m index 4b8101720123..6bb80fd2bd8f 100644 --- a/test/CodeGenObjC/autorelease.m +++ b/test/CodeGenObjC/autorelease.m @@ -26,7 +26,7 @@ @end // CHECK: call i8* @objc_autoreleasePoolPush -// CHECK: [[T:%.*]] = load i8** [[A:%.*]] +// CHECK: [[T:%.*]] = load i8*, i8** [[A:%.*]] // CHECK: call void @objc_autoreleasePoolPop // rdar://13660038 @@ -42,7 +42,7 @@ int tryTo(int (*f)(void)) { // CHECK-LABEL: define i32 @tryTo(i32 ()* // CHECK: [[RET:%.*]] = alloca i32, // CHECK: [[T0:%.*]] = call i8* @objc_autoreleasePoolPush() -// CHECK-NEXT: [[T1:%.*]] = load i32 ()** {{%.*}}, +// CHECK-NEXT: [[T1:%.*]] = load i32 ()*, i32 ()** {{%.*}}, // CHECK-NEXT: [[T2:%.*]] = invoke i32 [[T1]]() // CHECK: store i32 [[T2]], i32* [[RET]] // CHECK: invoke void @objc_autoreleasePoolPop(i8* [[T0]]) diff --git a/test/CodeGenObjC/bitfield-access.m b/test/CodeGenObjC/bitfield-access.m index 2b8039df9ec1..3f33afd9ce5b 100644 --- a/test/CodeGenObjC/bitfield-access.m +++ b/test/CodeGenObjC/bitfield-access.m @@ -15,7 +15,7 @@ // end of the structure. // // CHECK-I386-LABEL: define i32 @f0( -// CHECK-I386: [[t0_0:%.*]] = load i8* {{.*}}, align 1 +// CHECK-I386: [[t0_0:%.*]] = load i8, i8* {{.*}}, align 1 // CHECK-I386: lshr i8 [[t0_0]], 7 // CHECK-I386: } int f0(I0 *a) { @@ -27,7 +27,7 @@ int f0(I0 *a) { // CHECK-ARM-LABEL: define i32 @f1( // CHECK-ARM: [[t1_ptr:%.*]] = getelementptr // CHECK-ARM: [[t1_base:%.*]] = bitcast i8* [[t1_ptr]] to i40* -// CHECK-ARM: [[t1_0:%.*]] = load i40* [[t1_base]], align 1 +// CHECK-ARM: [[t1_0:%.*]] = load i40, i40* [[t1_base]], align 1 // CHECK-ARM: [[t1_1:%.*]] = lshr i40 [[t1_0]], 1 // CHECK-ARM: [[t1_2:%.*]] = and i40 [[t1_1]], // CHECK-ARM: trunc i40 [[t1_2]] to i32 diff --git a/test/CodeGenObjC/block-6.m b/test/CodeGenObjC/block-6.m index b04b1893191c..7867e6218734 100644 --- a/test/CodeGenObjC/block-6.m +++ b/test/CodeGenObjC/block-6.m @@ -5,13 +5,13 @@ void MYFUNC() { // CHECK-LABEL: define void @MYFUNC() // CHECK: [[OBSERVER_SLOT:%.*]] = alloca [[OBSERVER_T:%.*]], align 8 -// CHECK: [[T0:%.*]] = getelementptr inbounds [[OBSERVER_T]]* [[OBSERVER_SLOT]], i32 0, i32 1 +// CHECK: [[T0:%.*]] = getelementptr inbounds [[OBSERVER_T]], [[OBSERVER_T]]* [[OBSERVER_SLOT]], i32 0, i32 1 // CHECK: store [[OBSERVER_T]]* [[OBSERVER_SLOT]], [[OBSERVER_T]]** [[T0]] // CHECK: [[T1:%.*]] = bitcast i8* ()* -// CHECK: [[FORWARDING:%.*]] = getelementptr inbounds [[OBSERVER_T]]* [[OBSERVER_SLOT]], i32 0, i32 1 -// CHECK-NEXT: [[T0:%.*]] = load [[OBSERVER_T]]** [[FORWARDING]] -// CHECK-NEXT: [[OBSERVER:%.*]] = getelementptr inbounds [[OBSERVER_T]]* [[T0]], i32 0, i32 6 +// CHECK: [[FORWARDING:%.*]] = getelementptr inbounds [[OBSERVER_T]], [[OBSERVER_T]]* [[OBSERVER_SLOT]], i32 0, i32 1 +// CHECK-NEXT: [[T0:%.*]] = load [[OBSERVER_T]]*, [[OBSERVER_T]]** [[FORWARDING]] +// CHECK-NEXT: [[OBSERVER:%.*]] = getelementptr inbounds [[OBSERVER_T]], [[OBSERVER_T]]* [[T0]], i32 0, i32 6 // CHECK-NEXT: store i8* [[T1]], i8** [[OBSERVER]] __block id observer = ^{ return observer; }; } diff --git a/test/CodeGenObjC/block-byref-debuginfo.m b/test/CodeGenObjC/block-byref-debuginfo.m index 231767e99a66..aa916289449e 100644 --- a/test/CodeGenObjC/block-byref-debuginfo.m +++ b/test/CodeGenObjC/block-byref-debuginfo.m @@ -3,7 +3,10 @@ // rdar://problem/14386148 // Test that the foo is aligned at an 8 byte boundary in the DWARF // expression (256) that locates it inside of the byref descriptor: -// CHECK: [ DW_TAG_member ] [foo] [line 0, size {{[0-9]+}}, align 64, offset 256] [from Foo] +// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "foo", +// CHECK-NOT: line: +// CHECK-SAME: align: 64 +// CHECK-SAME: offset: 256 struct Foo { unsigned char *data; diff --git a/test/CodeGenObjC/blocks-2.m b/test/CodeGenObjC/blocks-2.m index b04fa008b275..0c6bd562b539 100644 --- a/test/CodeGenObjC/blocks-2.m +++ b/test/CodeGenObjC/blocks-2.m @@ -19,7 +19,7 @@ void test1() { extern void test1_help(void (^x)(void)); // CHECK: [[N:%.*]] = alloca [[N_T:%.*]], align 8 - // CHECK: [[T0:%.*]] = getelementptr inbounds [[N_T]]* [[N]], i32 0, i32 4 + // CHECK: [[T0:%.*]] = getelementptr inbounds [[N_T]], [[N_T]]* [[N]], i32 0, i32 4 // CHECK-NEXT: store double 1.000000e+{{0?}}01, double* [[T0]], align 8 __block double n = 10; diff --git a/test/CodeGenObjC/blocks.m b/test/CodeGenObjC/blocks.m index 6ae3e9fda076..091331e8b2bf 100644 --- a/test/CodeGenObjC/blocks.m +++ b/test/CodeGenObjC/blocks.m @@ -50,30 +50,30 @@ void test2(Test2 *x) { // CHECK-NEXT: store [[TEST2]]* // isa=1 for weak byrefs. - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[WEAK_T]]* [[WEAKX]], i32 0, i32 0 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[WEAK_T]], [[WEAK_T]]* [[WEAKX]], i32 0, i32 0 // CHECK-NEXT: store i8* inttoptr (i32 1 to i8*), i8** [[T0]] // Forwarding. - // CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[WEAK_T]]* [[WEAKX]], i32 0, i32 1 + // CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[WEAK_T]], [[WEAK_T]]* [[WEAKX]], i32 0, i32 1 // CHECK-NEXT: store [[WEAK_T]]* [[WEAKX]], [[WEAK_T]]** [[T1]] // Flags. This is just BLOCK_HAS_COPY_DISPOSE BLOCK_BYREF_LAYOUT_UNRETAINED - // CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[WEAK_T]]* [[WEAKX]], i32 0, i32 2 + // CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[WEAK_T]], [[WEAK_T]]* [[WEAKX]], i32 0, i32 2 // CHECK-NEXT: store i32 1375731712, i32* [[T2]] // Size. - // CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds [[WEAK_T]]* [[WEAKX]], i32 0, i32 3 + // CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds [[WEAK_T]], [[WEAK_T]]* [[WEAKX]], i32 0, i32 3 // CHECK-NEXT: store i32 28, i32* [[T3]] // Copy and dispose helpers. - // CHECK-NEXT: [[T4:%.*]] = getelementptr inbounds [[WEAK_T]]* [[WEAKX]], i32 0, i32 4 + // CHECK-NEXT: [[T4:%.*]] = getelementptr inbounds [[WEAK_T]], [[WEAK_T]]* [[WEAKX]], i32 0, i32 4 // CHECK-NEXT: store i8* bitcast (void (i8*, i8*)* @__Block_byref_object_copy_{{.*}} to i8*), i8** [[T4]] - // CHECK-NEXT: [[T5:%.*]] = getelementptr inbounds [[WEAK_T]]* [[WEAKX]], i32 0, i32 5 + // CHECK-NEXT: [[T5:%.*]] = getelementptr inbounds [[WEAK_T]], [[WEAK_T]]* [[WEAKX]], i32 0, i32 5 // CHECK-NEXT: store i8* bitcast (void (i8*)* @__Block_byref_object_dispose_{{.*}} to i8*), i8** [[T5]] // Actually capture the value. - // CHECK-NEXT: [[T6:%.*]] = getelementptr inbounds [[WEAK_T]]* [[WEAKX]], i32 0, i32 6 - // CHECK-NEXT: [[CAPTURE:%.*]] = load [[TEST2]]** [[X]] + // CHECK-NEXT: [[T6:%.*]] = getelementptr inbounds [[WEAK_T]], [[WEAK_T]]* [[WEAKX]], i32 0, i32 6 + // CHECK-NEXT: [[CAPTURE:%.*]] = load [[TEST2]]*, [[TEST2]]** [[X]] // CHECK-NEXT: store [[TEST2]]* [[CAPTURE]], [[TEST2]]** [[T6]] // Then we initialize the block, blah blah blah. @@ -94,13 +94,13 @@ void test2(Test2 *x) { // CHECK-LABEL: define internal void @__test2_block_invoke // CHECK: [[BLOCK:%.*]] = bitcast i8* {{%.*}} to [[BLOCK_T]]* // CHECK-NOT: bitcast -// CHECK: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 -// CHECK-NEXT: [[T1:%.*]] = load i8** [[T0]] +// CHECK: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5 +// CHECK-NEXT: [[T1:%.*]] = load i8*, i8** [[T0]] // CHECK-NEXT: [[T2:%.*]] = bitcast i8* [[T1]] to [[WEAK_T]]{{.*}}* -// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds [[WEAK_T]]{{.*}}* [[T2]], i32 0, i32 1 -// CHECK-NEXT: [[T4:%.*]] = load [[WEAK_T]]{{.*}}** [[T3]] -// CHECK-NEXT: [[WEAKX:%.*]] = getelementptr inbounds [[WEAK_T]]{{.*}}* [[T4]], i32 0, i32 6 -// CHECK-NEXT: [[T0:%.*]] = load [[TEST2]]** [[WEAKX]], align 4 +// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds [[WEAK_T]]{{.*}}, [[WEAK_T]]{{.*}}* [[T2]], i32 0, i32 1 +// CHECK-NEXT: [[T4:%.*]] = load [[WEAK_T]]{{.*}}*, [[WEAK_T]]{{.*}}** [[T3]] +// CHECK-NEXT: [[WEAKX:%.*]] = getelementptr inbounds [[WEAK_T]]{{.*}}, [[WEAK_T]]{{.*}}* [[T4]], i32 0, i32 6 +// CHECK-NEXT: [[T0:%.*]] = load [[TEST2]]*, [[TEST2]]** [[WEAKX]], align 4 // rdar://problem/12722954 // Make sure that ... is appropriately positioned in a block call. @@ -110,13 +110,13 @@ void test3(void (^block)(int, ...)) { // CHECK-LABEL: define void @test3( // CHECK: [[BLOCK:%.*]] = alloca void (i32, ...)*, align 4 // CHECK-NEXT: store void (i32, ...)* -// CHECK-NEXT: [[T0:%.*]] = load void (i32, ...)** [[BLOCK]], align 4 +// CHECK-NEXT: [[T0:%.*]] = load void (i32, ...)*, void (i32, ...)** [[BLOCK]], align 4 // CHECK-NEXT: [[T1:%.*]] = bitcast void (i32, ...)* [[T0]] to [[BLOCK_T:%.*]]* -// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[T1]], i32 0, i32 3 +// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[T1]], i32 0, i32 3 // CHECK-NEXT: [[T3:%.*]] = bitcast [[BLOCK_T]]* [[T1]] to i8* -// CHECK-NEXT: [[T4:%.*]] = load i8** [[T2]] +// CHECK-NEXT: [[T4:%.*]] = load i8*, i8** [[T2]] // CHECK-NEXT: [[T5:%.*]] = bitcast i8* [[T4]] to void (i8*, i32, ...)* -// CHECK-NEXT: call void (i8*, i32, ...)* [[T5]](i8* [[T3]], i32 0, i32 1, i32 2, i32 3) +// CHECK-NEXT: call void (i8*, i32, ...) [[T5]](i8* [[T3]], i32 0, i32 1, i32 2, i32 3) // CHECK-NEXT: ret void void test4(void (^block)()) { @@ -125,11 +125,11 @@ void test4(void (^block)()) { // CHECK-LABEL: define void @test4( // CHECK: [[BLOCK:%.*]] = alloca void (...)*, align 4 // CHECK-NEXT: store void (...)* -// CHECK-NEXT: [[T0:%.*]] = load void (...)** [[BLOCK]], align 4 +// CHECK-NEXT: [[T0:%.*]] = load void (...)*, void (...)** [[BLOCK]], align 4 // CHECK-NEXT: [[T1:%.*]] = bitcast void (...)* [[T0]] to [[BLOCK_T:%.*]]* -// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[T1]], i32 0, i32 3 +// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[T1]], i32 0, i32 3 // CHECK-NEXT: [[T3:%.*]] = bitcast [[BLOCK_T]]* [[T1]] to i8* -// CHECK-NEXT: [[T4:%.*]] = load i8** [[T2]] +// CHECK-NEXT: [[T4:%.*]] = load i8*, i8** [[T2]] // CHECK-NEXT: [[T5:%.*]] = bitcast i8* [[T4]] to void (i8*, i32, i32, i32, i32)* // CHECK-NEXT: call void [[T5]](i8* [[T3]], i32 0, i32 1, i32 2, i32 3) // CHECK-NEXT: ret void diff --git a/test/CodeGenObjC/boxing.m b/test/CodeGenObjC/boxing.m index 33dc4e698f8b..f205764a0f21 100644 --- a/test/CodeGenObjC/boxing.m +++ b/test/CodeGenObjC/boxing.m @@ -54,42 +54,42 @@ typedef signed char BOOL; @end // CHECK: [[WithIntMeth:@.*]] = private global [15 x i8] c"numberWithInt:\00" -// CHECK: [[WithIntSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([15 x i8]* [[WithIntMeth]] +// CHECK: [[WithIntSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[WithIntMeth]] // CHECK: [[WithCharMeth:@.*]] = private global [16 x i8] c"numberWithChar:\00" -// CHECK: [[WithCharSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([16 x i8]* [[WithCharMeth]] +// CHECK: [[WithCharSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([16 x i8], [16 x i8]* [[WithCharMeth]] // CHECK: [[WithBoolMeth:@.*]] = private global [16 x i8] c"numberWithBool:\00" -// CHECK: [[WithBoolSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([16 x i8]* [[WithBoolMeth]] +// CHECK: [[WithBoolSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([16 x i8], [16 x i8]* [[WithBoolMeth]] // CHECK: [[WithIntegerMeth:@.*]] = private global [19 x i8] c"numberWithInteger:\00" -// CHECK: [[WithIntegerSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([19 x i8]* [[WithIntegerMeth]] +// CHECK: [[WithIntegerSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([19 x i8], [19 x i8]* [[WithIntegerMeth]] // CHECK: [[WithUnsignedIntegerMeth:@.*]] = private global [27 x i8] c"numberWithUnsignedInteger:\00" -// CHECK: [[WithUnsignedIntegerSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([27 x i8]* [[WithUnsignedIntegerMeth]] +// CHECK: [[WithUnsignedIntegerSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([27 x i8], [27 x i8]* [[WithUnsignedIntegerMeth]] // CHECK: [[stringWithUTF8StringMeth:@.*]] = private global [22 x i8] c"stringWithUTF8String:\00" -// CHECK: [[stringWithUTF8StringSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([22 x i8]* [[stringWithUTF8StringMeth]] +// CHECK: [[stringWithUTF8StringSEL:@.*]] = private externally_initialized global i8* getelementptr inbounds ([22 x i8], [22 x i8]* [[stringWithUTF8StringMeth]] int main() { - // CHECK: load i8** [[WithIntSEL]] + // CHECK: load i8*, i8** [[WithIntSEL]] int i; @(i); - // CHECK: load i8** [[WithCharSEL]] + // CHECK: load i8*, i8** [[WithCharSEL]] signed char sc; @(sc); - // CHECK: load i8** [[WithBoolSEL]] + // CHECK: load i8*, i8** [[WithBoolSEL]] BOOL b; @(b); - // CHECK: load i8** [[WithBoolSEL]] + // CHECK: load i8*, i8** [[WithBoolSEL]] typeof(b) b2; @(b2); - // CHECK: load i8** [[WithBoolSEL]] + // CHECK: load i8*, i8** [[WithBoolSEL]] typedef const typeof(b) MyBOOL; MyBOOL b3; @(b3); - // CHECK: load i8** [[WithBoolSEL]] + // CHECK: load i8*, i8** [[WithBoolSEL]] @((BOOL)i); - // CHECK: load i8** [[WithIntegerSEL]] + // CHECK: load i8*, i8** [[WithIntegerSEL]] @((NSInteger)i); - // CHECK: load i8** [[WithUnsignedIntegerSEL]] + // CHECK: load i8*, i8** [[WithUnsignedIntegerSEL]] @((NSUInteger)i); - // CHECK: load i8** [[stringWithUTF8StringSEL]] + // CHECK: load i8*, i8** [[stringWithUTF8StringSEL]] const char *s; @(s); typedef enum : NSInteger { Red, Green, Blue } Color; - // CHECK: load i8** [[WithIntegerSEL]] + // CHECK: load i8*, i8** [[WithIntegerSEL]] @(Red); Color col = Red; - // CHECK: load i8** [[WithIntegerSEL]] + // CHECK: load i8*, i8** [[WithIntegerSEL]] @(col); } diff --git a/test/CodeGenObjC/catch-lexical-block.m b/test/CodeGenObjC/catch-lexical-block.m index d5aeee143bea..ae49405160df 100644 --- a/test/CodeGenObjC/catch-lexical-block.m +++ b/test/CodeGenObjC/catch-lexical-block.m @@ -9,7 +9,7 @@ void f0() { // We should have 3 lexical blocks here at the moment, including one // for the catch block. -// CHECK: lexical_block -// CHECK: auto_variable -// CHECK: lexical_block -// CHECK: lexical_block +// CHECK: !DILexicalBlock( +// CHECK: !DILocalVariable(tag: DW_TAG_auto_variable +// CHECK: !DILexicalBlock( +// CHECK: !DILexicalBlock( diff --git a/test/CodeGenObjC/category-super-class-meth.m b/test/CodeGenObjC/category-super-class-meth.m index 268f0b59711d..2e27a6a273e1 100644 --- a/test/CodeGenObjC/category-super-class-meth.m +++ b/test/CodeGenObjC/category-super-class-meth.m @@ -22,8 +22,8 @@ @end // CHECK: define internal i8* @"\01+[Sub2(Category) copy] -// CHECK: [[ONE:%.*]] = load %struct._class_t** @"OBJC_CLASSLIST_SUP_REFS_$_3" +// CHECK: [[ONE:%.*]] = load %struct._class_t*, %struct._class_t** @"OBJC_CLASSLIST_SUP_REFS_$_.3" // CHECK: [[TWO:%.*]] = bitcast %struct._class_t* [[ONE]] to i8* -// CHECK: [[THREE:%.*]] = getelementptr inbounds %struct._objc_super* [[OBJC_SUPER:%.*]], i32 0, i32 1 +// CHECK: [[THREE:%.*]] = getelementptr inbounds %struct._objc_super, %struct._objc_super* [[OBJC_SUPER:%.*]], i32 0, i32 1 // CHECK: store i8* [[TWO]], i8** [[THREE]] -// CHECK: [[FOUR:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ +// CHECK: [[FOUR:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ diff --git a/test/CodeGenObjC/compound-literal-property-access.m b/test/CodeGenObjC/compound-literal-property-access.m new file mode 100644 index 000000000000..bc1bd78e0c36 --- /dev/null +++ b/test/CodeGenObjC/compound-literal-property-access.m @@ -0,0 +1,21 @@ +// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-apple-darwin -o - | FileCheck %s +// rdar://20407999 + +typedef __attribute__((__ext_vector_type__(2))) float vector_float2; + +@interface GPAgent2D +@property (nonatomic, assign) vector_float2 position; +@end + +@interface GPGoal @end + +@implementation GPGoal +-(void)getForce { + GPAgent2D* targetAgent; + (vector_float2){targetAgent.position.x, targetAgent.position.y}; +} +@end + +// CHECK: [[CL:%.*]] = alloca <2 x float>, align 8 +// CHECK: store <2 x float> [[VECINIT:%.*]], <2 x float>* [[CL]] +// CHECK: [[FOURTEEN:%.*]] = load <2 x float>, <2 x float>* [[CL]] diff --git a/test/CodeGenObjC/debug-info-block-captured-self.m b/test/CodeGenObjC/debug-info-block-captured-self.m index f0ca1af34c8f..fb9d7c2045e6 100644 --- a/test/CodeGenObjC/debug-info-block-captured-self.m +++ b/test/CodeGenObjC/debug-info-block-captured-self.m @@ -54,7 +54,7 @@ typedef enum { // CHECK: %[[MEM1:.*]] = alloca i8*, align 8 // CHECK-NEXT: %[[MEM2:.*]] = alloca i8*, align 8 // CHECK: store i8* [[BLOCK_DESC:%.*]], i8** %[[MEM1]], align 8 -// CHECK: %[[TMP0:.*]] = load i8** %[[MEM1]] +// CHECK: %[[TMP0:.*]] = load i8*, i8** %[[MEM1]] // CHECK: call void @llvm.dbg.value(metadata i8* %[[TMP0]], i64 0, metadata ![[BDMD:[0-9]+]], metadata !{{.*}}) // CHECK: call void @llvm.dbg.declare(metadata i8* [[BLOCK_DESC]], metadata ![[BDMD:[0-9]+]], metadata !{{.*}}) // CHECK: %[[TMP1:.*]] = bitcast @@ -63,7 +63,9 @@ typedef enum { // make sure we are still in the same function // CHECK: define {{.*}}__copy_helper_block_ // Metadata -// CHECK: ![[MAIN:.*]] = !{!"0x13\00Main\0023\00{{.*}}", {{.*}} ; [ DW_TAG_structure_type ] [Main] [line 23, -// CHECK: ![[PMAIN:.*]] = {{.*}}![[MAIN]]} ; [ DW_TAG_pointer_type ]{{.*}}from Main -// CHECK: ![[BDMD]] = {{.*}}.block_descriptor -// CHECK: ![[SELF]] = {{.*}}![[PMAIN]]{{.*}}[ DW_TAG_auto_variable ] [self] [line 40] +// CHECK: ![[MAIN:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Main" +// CHECK-SAME: line: 23, +// CHECK: ![[PMAIN:.*]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[MAIN]], +// CHECK: ![[BDMD]] = !DILocalVariable(tag: DW_TAG_arg_variable, name: ".block_descriptor" +// CHECK: ![[SELF]] = !DILocalVariable(tag: DW_TAG_auto_variable, name: "self" +// CHECK-SAME: line: 40, diff --git a/test/CodeGenObjC/debug-info-block-helper.m b/test/CodeGenObjC/debug-info-block-helper.m index 1403327dcb49..ea68cb1cf38e 100644 --- a/test/CodeGenObjC/debug-info-block-helper.m +++ b/test/CodeGenObjC/debug-info-block-helper.m @@ -2,7 +2,7 @@ // RUN: %clang_cc1 -emit-llvm -fblocks -g -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 %s -o - | FileCheck %s extern void foo(void(^)(void)); -// CHECK: [ DW_TAG_subprogram ] {{.*}} [__destroy_helper_block_] +// CHECK: !DISubprogram(name: "__destroy_helper_block_" @interface NSObject { struct objc_object *isa; diff --git a/test/CodeGenObjC/debug-info-block-type.m b/test/CodeGenObjC/debug-info-block-type.m index ef92bf35152d..35c92dc64bda 100644 --- a/test/CodeGenObjC/debug-info-block-type.m +++ b/test/CodeGenObjC/debug-info-block-type.m @@ -1,18 +1,23 @@ // RUN: %clang_cc1 -emit-llvm -fblocks -g -triple x86_64-apple-darwin14 -x objective-c < %s -o - | FileCheck %s #define nil ((void*) 0) typedef signed char BOOL; -// CHECK: ![[BOOL:[0-9]+]] = {{.*}} [ DW_TAG_typedef ] [BOOL] [line [[@LINE-1]] -// CHECK: ![[ID:[0-9]+]] = {{.*}} [ DW_TAG_typedef ] [id] +// CHECK: ![[BOOL:[0-9]+]] = !DIDerivedType(tag: DW_TAG_typedef, name: "BOOL" +// CHECK-SAME: line: [[@LINE-2]] +// CHECK: ![[ID:[0-9]+]] = !DIDerivedType(tag: DW_TAG_typedef, name: "id" typedef BOOL (^SomeKindOfPredicate)(id obj); -// CHECK: ![[PTR:[0-9]+]]} ; [ DW_TAG_member ] [__FuncPtr] -// CHECK: ![[PTR]] = {{.*}}, ![[FNTYPE:[0-9]+]]} ; [ DW_TAG_pointer_type ] -// CHECK: ![[FNTYPE]] = {{.*}} ![[ARGS:[0-9]+]]{{.*}} ; [ DW_TAG_subroutine_type ] +// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "__FuncPtr" +// CHECK-SAME: baseType: ![[PTR:[0-9]+]] +// CHECK: ![[PTR]] = !DIDerivedType(tag: DW_TAG_pointer_type, +// CHECK-SAME: baseType: ![[FNTYPE:[0-9]+]] +// CHECK: ![[FNTYPE]] = !DISubroutineType(types: ![[ARGS:[0-9]+]]) // CHECK: ![[ARGS]] = !{![[BOOL]], ![[ID]]} int main() { SomeKindOfPredicate p = ^BOOL(id obj) { return obj != nil; }; - // CHECK: ![[PTR]]} ; [ DW_TAG_member ] [__FuncPtr] [line [[@LINE-1]], size 64, align 64, offset 128] + // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "__FuncPtr", + // CHECK-SAME: line: [[@LINE-2]] + // CHECK-SAME: size: 64, align: 64, offset: 128, return p(nil); } diff --git a/test/CodeGenObjC/debug-info-blocks.m b/test/CodeGenObjC/debug-info-blocks.m index f5f4437b7b59..5514c5164c9b 100644 --- a/test/CodeGenObjC/debug-info-blocks.m +++ b/test/CodeGenObjC/debug-info-blocks.m @@ -22,11 +22,11 @@ // CHECK-NOT: ret // CHECK: load {{.*}}, !dbg ![[DESTROY_LINE:[0-9]+]] -// CHECK-DAG: [[DBG_LINE]] = !MDLocation(line: 0, scope: ![[COPY_SP:[0-9]+]]) -// CHECK-DAG: [[COPY_LINE]] = !MDLocation(line: 0, scope: ![[COPY_SP:[0-9]+]]) -// CHECK-DAG: [[COPY_SP]] = {{.*}}[ DW_TAG_subprogram ]{{.*}}[__copy_helper_block_] -// CHECK-DAG: [[DESTROY_LINE]] = !MDLocation(line: 0, scope: ![[DESTROY_SP:[0-9]+]]) -// CHECK-DAG: [[DESTROY_SP]] = {{.*}}[ DW_TAG_subprogram ]{{.*}}[__destroy_helper_block_] +// CHECK-DAG: [[DBG_LINE]] = !DILocation(line: 0, scope: ![[COPY_SP:[0-9]+]]) +// CHECK-DAG: [[COPY_LINE]] = !DILocation(line: 0, scope: ![[COPY_SP:[0-9]+]]) +// CHECK-DAG: [[COPY_SP]] = !DISubprogram(name: "__copy_helper_block_" +// CHECK-DAG: [[DESTROY_LINE]] = !DILocation(line: 0, scope: ![[DESTROY_SP:[0-9]+]]) +// CHECK-DAG: [[DESTROY_SP]] = !DISubprogram(name: "__destroy_helper_block_" typedef unsigned int NSUInteger; @protocol NSObject @@ -61,8 +61,8 @@ static void run(void (^block)(void)) { if ((self = [super init])) { run(^{ - // CHECK-DAG: ![[SELF]] = {{.*}} [ DW_TAG_auto_variable ] [self] [line [[@LINE+4]]] - // CHECK-DAG: ![[D]] = {{.*}} [d] [line [[@LINE+1]]] + // CHECK-DAG: ![[SELF]] = !DILocalVariable(tag: DW_TAG_auto_variable, name: "self"{{.*}}, line: [[@LINE+4]], + // CHECK-DAG: ![[D]] = !DILocalVariable(tag: DW_TAG_auto_variable, name: "d"{{.*}}, line: [[@LINE+1]], NSMutableDictionary *d = [[NSMutableDictionary alloc] init]; ivar = 42 + (int)[d count]; }); diff --git a/test/CodeGenObjC/debug-info-fwddecl.m b/test/CodeGenObjC/debug-info-fwddecl.m index b43d7c0eb87c..8f419de9bfda 100644 --- a/test/CodeGenObjC/debug-info-fwddecl.m +++ b/test/CodeGenObjC/debug-info-fwddecl.m @@ -2,4 +2,9 @@ @class ForwardObjcClass; ForwardObjcClass *ptr = 0; -// CHECK: {{.*}} [ DW_TAG_structure_type ] [ForwardObjcClass] [line 2, size 0, align 0, offset 0] [decl] +// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ForwardObjcClass" +// CHECK-SAME: line: 2 +// CHECK-NOT: size: +// CHECK-NOT: align: +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagFwdDecl diff --git a/test/CodeGenObjC/debug-info-getter-name.m b/test/CodeGenObjC/debug-info-getter-name.m index 9e1e55f0f408..1d7f545f34b6 100644 --- a/test/CodeGenObjC/debug-info-getter-name.m +++ b/test/CodeGenObjC/debug-info-getter-name.m @@ -1,7 +1,7 @@ // REQUIRES: x86-registered-target // RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin10 -fexceptions -fobjc-exceptions -g %s -o - | FileCheck %s -// CHECK: !"0x2e\00-[InstanceVariablesEverywhereButTheInterface someString]\00{{.*}}", {{.*}} ; [ DW_TAG_subprogram ] +// CHECK: !DISubprogram(name: "-[InstanceVariablesEverywhereButTheInterface someString]" //rdar: //8498026 diff --git a/test/CodeGenObjC/debug-info-id-with-protocol.m b/test/CodeGenObjC/debug-info-id-with-protocol.m index 9233f6ccc859..836e456b2352 100644 --- a/test/CodeGenObjC/debug-info-id-with-protocol.m +++ b/test/CodeGenObjC/debug-info-id-with-protocol.m @@ -36,7 +36,12 @@ int main() } } // Verify that the debug type for both variables is 'id'. -// CHECK: !"0x101\00bad_carrier\00{{[0-9]+}}\000", !{{[0-9]+}}, null, ![[IDTYPE:[0-9]+]]} ; [ DW_TAG_arg_variable ] [bad_carrier] [line 0] +// CHECK: ![[IDTYPE:[0-9]+]] = !DIDerivedType(tag: DW_TAG_typedef, name: "id" // -// CHECK: !"0x101\00good_carrier\00{{[0-9]+}}\000", !{{[0-9]+}}, null, ![[IDTYPE]]} ; [ DW_TAG_arg_variable ] [good_carrier] [line 0] -// CHECK !{{.*}}[[IDTYPE]] = !{!"0x16\00id\00{{[0-9]+}}\000\000\000\000", null, !{{[0-9]+}}, !{{[0-9]+}}} ; [ DW_TAG_typedef ] [id] +// CHECK: !DILocalVariable(tag: DW_TAG_arg_variable, name: "bad_carrier" +// CHECK-NOT: line: +// CHECK-SAME: type: ![[IDTYPE]] +// +// CHECK: !DILocalVariable(tag: DW_TAG_arg_variable, name: "good_carrier" +// CHECK-NOT: line: +// CHECK-SAME: type: ![[IDTYPE]] diff --git a/test/CodeGenObjC/debug-info-impl.m b/test/CodeGenObjC/debug-info-impl.m index 8991a88962df..556bf0ee63f7 100644 --- a/test/CodeGenObjC/debug-info-impl.m +++ b/test/CodeGenObjC/debug-info-impl.m @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -g -S -emit-llvm %s -o - | FileCheck %s -// CHECK: {{.*}} [ DW_TAG_structure_type ] [Circle] [line 11, @interface NSObject { struct objc_object *isa; } @@ -8,6 +7,8 @@ @interface Shape : NSObject @end +// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Circle" +// CHECK-SAME: line: [[@LINE+1]], @interface Circle : Shape @end diff --git a/test/CodeGenObjC/debug-info-instancetype.m b/test/CodeGenObjC/debug-info-instancetype.m index 07fd5ca00b18..c96153edb9dc 100644 --- a/test/CodeGenObjC/debug-info-instancetype.m +++ b/test/CodeGenObjC/debug-info-instancetype.m @@ -13,11 +13,14 @@ @implementation Foo +(instancetype)defaultFoo {return 0;} -// CHECK: ![[FOO:[0-9]+]] = {{.*}}; [ DW_TAG_structure_type ] [Foo] -// CHECK: !"0x2e\00+[Foo defaultFoo]\00+[Foo defaultFoo]\00\00[[@LINE-2]]\00{{[^,]*}}"{{, [^,]+, [^,]+}}, ![[TYPE:[0-9]+]] -// CHECK: ![[TYPE]] = {{.*}} ![[RESULT:[0-9]+]], null, null, null} ; [ DW_TAG_subroutine_type ] -// CHECK: ![[RESULT]] = {{.*}}{![[FOOPTR:[0-9]+]], -// CHECK: ![[FOOPTR]] = {{.*}}, ![[FOO]]}{{.*}}[ DW_TAG_pointer_type ] {{.*}} [from Foo] +// CHECK: ![[FOO:[0-9]+]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Foo" +// CHECK: !DISubprogram(name: "+[Foo defaultFoo]" +// CHECK-SAME: line: [[@LINE-3]] +// CHECK-SAME: type: ![[TYPE:[0-9]+]] +// CHECK: ![[TYPE]] = !DISubroutineType(types: ![[RESULT:[0-9]+]]) +// CHECK: ![[RESULT]] = !{![[FOOPTR:[0-9]+]], +// CHECK: ![[FOOPTR]] = !DIDerivedType(tag: DW_TAG_pointer_type +// CHECK-SAME: baseType: ![[FOO]] @end diff --git a/test/CodeGenObjC/debug-info-ivars-extension.m b/test/CodeGenObjC/debug-info-ivars-extension.m index 9dd715225272..fe658f009f11 100644 --- a/test/CodeGenObjC/debug-info-ivars-extension.m +++ b/test/CodeGenObjC/debug-info-ivars-extension.m @@ -24,10 +24,24 @@ void gorf (I* pg) { int _b = pg->b; } -// CHECK: {{.*}} [ DW_TAG_structure_type ] [I] +// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "I" + // Check for "a". -// CHECK: {{.*}} [ DW_TAG_member ] [a] [line 7, size 32, align 32, offset 0] [public] [from int] +// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "a" +// CHECK-SAME: line: 7 +// CHECK-SAME: baseType: ![[INT:[0-9]+]] +// CHECK-SAME: size: 32, align: 32 +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagPublic +// CHECK: ![[INT]] = !DIBasicType(name: "int" + // Make sure we don't output the same type twice. -// CHECK-NOT: {{.*}} [ DW_TAG_structure_type ] [I] +// CHECK-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "I" + // Check for "b". -// CHECK: {{.*}} [ DW_TAG_member ] [b] [line 18, size 32, align 32, offset 0] [public] [from int] +// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "b" +// CHECK-SAME: line: 18 +// CHECK-SAME: baseType: ![[INT]] +// CHECK-SAME: size: 32, align: 32 +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagPublic diff --git a/test/CodeGenObjC/debug-info-ivars-indirect.m b/test/CodeGenObjC/debug-info-ivars-indirect.m index f9593d24dea0..0c644c7fe344 100644 --- a/test/CodeGenObjC/debug-info-ivars-indirect.m +++ b/test/CodeGenObjC/debug-info-ivars-indirect.m @@ -6,10 +6,10 @@ // This happens to be the order the members are emitted in... I'm assuming it's // not meaningful/important, so if something causes the order to change, feel // free to update the test to reflect the new order. -// CHECK: ; [ DW_TAG_member ] [a] -// CHECK: ; [ DW_TAG_member ] [d] -// CHECK: ; [ DW_TAG_member ] [c] -// CHECK: ; [ DW_TAG_member ] [b] +// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "a" +// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "d" +// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "c" +// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "b" @interface I { diff --git a/test/CodeGenObjC/debug-info-ivars-private.m b/test/CodeGenObjC/debug-info-ivars-private.m index 8505da17bbb1..d3d8cdc3e786 100644 --- a/test/CodeGenObjC/debug-info-ivars-private.m +++ b/test/CodeGenObjC/debug-info-ivars-private.m @@ -32,5 +32,16 @@ __attribute((objc_root_class)) @interface NSObject { } @end -// CHECK: {{.*}} [ DW_TAG_member ] [foo] [line 14, size 32, align 32, offset 0] [protected] [from int] -// CHECK: {{.*}} [ DW_TAG_member ] [bar] [line 27, size 32, align 32, offset 0] [private] [from int] +// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "foo" +// CHECK-SAME: line: 14 +// CHECK-SAME: baseType: ![[INT:[0-9]+]] +// CHECK-SAME: size: 32, align: 32, +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagProtected +// CHECK: ![[INT]] = !DIBasicType(name: "int" +// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "bar" +// CHECK-SAME: line: 27 +// CHECK-SAME: baseType: ![[INT:[0-9]+]] +// CHECK-SAME: size: 32, align: 32, +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagPrivate diff --git a/test/CodeGenObjC/debug-info-ivars.m b/test/CodeGenObjC/debug-info-ivars.m index a0f2963f5dcf..aea3edaa8ae6 100644 --- a/test/CodeGenObjC/debug-info-ivars.m +++ b/test/CodeGenObjC/debug-info-ivars.m @@ -18,7 +18,27 @@ __attribute((objc_root_class)) @interface NSObject { @implementation BaseClass @end -// CHECK: {{.*}} [ DW_TAG_member ] [i] [line 10, size 32, align 32, offset 0] [protected] [from int] -// CHECK: {{.*}} [ DW_TAG_member ] [flag_1] [line 11, size 9, align 32, offset 0] [protected] [from unsigned int] -// CHECK: {{.*}} [ DW_TAG_member ] [flag_2] [line 12, size 9, align 32, offset 1] [protected] [from unsigned int] -// CHECK: {{.*}} [ DW_TAG_member ] [flag_3] [line 14, size 9, align 32, offset 3] [protected] [from unsigned int] +// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "i" +// CHECK-SAME: line: 10 +// CHECK-SAME: baseType: ![[INT:[0-9]+]] +// CHECK-SAME: size: 32, align: 32, +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagProtected +// CHECK: ![[INT]] = !DIBasicType(name: "int" +// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "flag_1" +// CHECK-SAME: line: 11 +// CHECK-SAME: baseType: ![[UNSIGNED:[0-9]+]] +// CHECK-SAME: size: 9, align: 32, +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagProtected +// CHECK: ![[UNSIGNED]] = !DIBasicType(name: "unsigned int" +// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "flag_2" +// CHECK-SAME: line: 12 +// CHECK-SAME: baseType: ![[UNSIGNED]] +// CHECK-SAME: size: 9, align: 32, offset: 1, +// CHECK-SAME: flags: DIFlagProtected +// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "flag_3" +// CHECK-SAME: line: 14 +// CHECK-SAME: baseType: ![[UNSIGNED]] +// CHECK-SAME: size: 9, align: 32, offset: 3, +// CHECK-SAME: flags: DIFlagProtected diff --git a/test/CodeGenObjC/debug-info-lifetime-crash.m b/test/CodeGenObjC/debug-info-lifetime-crash.m index e2e5d7e3b3b5..bbd7dd4ac3b1 100644 --- a/test/CodeGenObjC/debug-info-lifetime-crash.m +++ b/test/CodeGenObjC/debug-info-lifetime-crash.m @@ -13,10 +13,14 @@ { // The debug type for these two will be identical, because we do not // actually emit the ownership qualifier. - // CHECK-DAG: !"0x100\00weakSelf\00[[@LINE+1]]\000"{{, [^,]+, [^,]+}}, ![[SELFTY:[0-9]+]]} ; [ DW_TAG_auto_variable ] [weakSelf] + // CHECK: !DILocalVariable(tag: DW_TAG_auto_variable, name: "weakSelf", + // CHECK-SAME: line: [[@LINE+2]] + // CHECK-SAME: type: ![[SELFTY:[0-9]+]] __attribute__((objc_ownership(weak))) __typeof(self) weakSelf = self; Block = [^{ - // CHECK-DAG: !"0x100\00strongSelf\00[[@LINE+1]]\000"{{, [^,]+, [^,]+}}, ![[SELFTY]]} ; [ DW_TAG_auto_variable ] [strongSelf] + // CHECK: !DILocalVariable(tag: DW_TAG_auto_variable, name: "strongSelf", + // CHECK-SAME: line: [[@LINE+2]] + // CHECK-SAME: type: ![[SELFTY]] __attribute__((objc_ownership(strong))) __typeof(self) strongSelf = weakSelf; } copy]; } diff --git a/test/CodeGenObjC/debug-info-property-accessors.m b/test/CodeGenObjC/debug-info-property-accessors.m index 0c7f03e6fb57..274bf6e74db6 100644 --- a/test/CodeGenObjC/debug-info-property-accessors.m +++ b/test/CodeGenObjC/debug-info-property-accessors.m @@ -5,7 +5,8 @@ // Ensure we emit the names of explicit/renamed accessors even if they // are defined later in the implementation section. // -// CHECK: !"0x4200\00blah\00{{[0-9]+}}\00isBlah\00{{.*}}", {{.*}}} ; [ DW_TAG_APPLE_property ] [blah] +// CHECK: !DIObjCProperty(name: "blah" +// CHECK-SAME: getter: "isBlah" @class NSString; extern void NSLog(NSString *format, ...); diff --git a/test/CodeGenObjC/debug-info-property3.m b/test/CodeGenObjC/debug-info-property3.m index a6d8daf083b0..68cb234878a3 100644 --- a/test/CodeGenObjC/debug-info-property3.m +++ b/test/CodeGenObjC/debug-info-property3.m @@ -1,7 +1,9 @@ // RUN: %clang_cc1 -S -emit-llvm -g %s -o - | FileCheck %s -// CHECK: !"0x4200\00p1\005\00\00\002316", {{.*}}} ; [ DW_TAG_APPLE_property ] @interface I1 +// CHECK: !DIObjCProperty(name: "p1" +// CHECK-SAME: line: [[@LINE+2]] +// CHECK-SAME: attributes: 2316 @property int p1; @end diff --git a/test/CodeGenObjC/debug-info-pubtypes.m b/test/CodeGenObjC/debug-info-pubtypes.m index 845b946f8899..e95ddab9049e 100644 --- a/test/CodeGenObjC/debug-info-pubtypes.m +++ b/test/CodeGenObjC/debug-info-pubtypes.m @@ -1,8 +1,8 @@ // REQUIRES: x86-registered-target // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -g -emit-llvm %s -o - | FileCheck %s -// CHECK: {{.*}} [ DW_TAG_structure_type ] [H] [line 6, - +// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "H" +// CHECK-SAME: line: [[@LINE+1]], @interface H -(void) foo; @end diff --git a/test/CodeGenObjC/debug-info-self.m b/test/CodeGenObjC/debug-info-self.m index a6e9daff916a..225a0bdef63f 100644 --- a/test/CodeGenObjC/debug-info-self.m +++ b/test/CodeGenObjC/debug-info-self.m @@ -14,6 +14,16 @@ } @end -// CHECK: !"0x101\00self\0016777216\001088", ![[CTOR:.*]], null, !{{.*}}} ; [ DW_TAG_arg_variable ] [self] [line 0] -// CHECK: !"0x101\00_cmd\0033554432\0064", ![[CTOR]], null, !{{.*}}} ; [ DW_TAG_arg_variable ] [_cmd] [line 0] -// CHECK: !"0x101\00myarg\0050331659\000", ![[CTOR]], !{{.*}}, !{{.*}}} ; [ DW_TAG_arg_variable ] [myarg] [line 11] +// CHECK: !DILocalVariable(tag: DW_TAG_arg_variable, name: "self", arg: 1, +// CHECK-SAME: scope: ![[CTOR:[0-9]+]] +// CHECK-NOT: line: +// CHECK-SAME: flags: DIFlagArtificial | DIFlagObjectPointer{{[,)]}} +// CHECK: !DILocalVariable(tag: DW_TAG_arg_variable, name: "_cmd", arg: 2, +// CHECK-SAME: scope: ![[CTOR]] +// CHECK-NOT: line: +// CHECK-SAME: flags: DIFlagArtificial{{[,)]}} +// CHECK: !DILocalVariable(tag: DW_TAG_arg_variable, name: "myarg", arg: 3, +// CHECK-SAME: scope: ![[CTOR]] +// CHECK-SAME: line: 11 +// CHECK-NOT: flags: +// CHECK-SAME: ){{$}} diff --git a/test/CodeGenObjC/debug-info-static-var.m b/test/CodeGenObjC/debug-info-static-var.m index 6828983b0830..50334250dfae 100644 --- a/test/CodeGenObjC/debug-info-static-var.m +++ b/test/CodeGenObjC/debug-info-static-var.m @@ -2,7 +2,9 @@ // Radar 8801045 // Do not emit AT_MIPS_linkage_name for static variable i -// CHECK: !"0x34\00i\00i\00\00{{.*}}" +// CHECK: !DIGlobalVariable(name: "i" +// CHECK-NOT: linkageName: +// CHECK-SAME: ){{$}} @interface A { } diff --git a/test/CodeGenObjC/debug-info-synthesis.m b/test/CodeGenObjC/debug-info-synthesis.m index 55867b4068a2..2bf001b28cba 100644 --- a/test/CodeGenObjC/debug-info-synthesis.m +++ b/test/CodeGenObjC/debug-info-synthesis.m @@ -30,5 +30,8 @@ int main(int argc, char *argv[]) { } } -// CHECK: ![[FILE:.*]] = {{.*}}[ DW_TAG_file_type ] [{{.*}}/foo.h] -// CHECK: ![[FILE]], {{.*}} ; [ DW_TAG_subprogram ] [line 8] [local] [def] [-[Foo dict]] +// CHECK: ![[FILE:.*]] = !DIFile(filename: "{{[^"]+}}foo.h" +// CHECK: !DISubprogram(name: "-[Foo setDict:]" +// CHECK-SAME: file: ![[FILE]], +// CHECK-SAME: line: 8, +// CHECK-SAME: isLocal: true, isDefinition: true diff --git a/test/CodeGenObjC/debug-info-variadic-method.m b/test/CodeGenObjC/debug-info-variadic-method.m index e895953ff6b6..828d4dc4a164 100644 --- a/test/CodeGenObjC/debug-info-variadic-method.m +++ b/test/CodeGenObjC/debug-info-variadic-method.m @@ -10,7 +10,7 @@ @implementation Foo - (void) Bar: (int) n, ... { - // CHECK: ![[NUM:[^,]*]], null, null, null} ; [ DW_TAG_subroutine_type ] - // CHECK: ![[NUM]] = {{!{null, ![^,]*, ![^,]*, ![^,]*, null}}} + // CHECK: !DISubroutineType(types: ![[NUM:[0-9]+]]) + // CHECK: ![[NUM]] = {{!{null, ![^,]*, ![^,]*, ![^,]*, null}}} } @end diff --git a/test/CodeGenObjC/debug-property-synth.m b/test/CodeGenObjC/debug-property-synth.m index 14657249c00d..8367478b943b 100644 --- a/test/CodeGenObjC/debug-property-synth.m +++ b/test/CodeGenObjC/debug-property-synth.m @@ -18,10 +18,10 @@ // CHECK-NOT: ret // CHECK: load {{.*}}, !dbg ![[DBG2:[0-9]+]] // -// CHECK: [ DW_TAG_subprogram ] [line [[@LINE+4]]] [local] [def] [-[I p1]] -// CHECK: [ DW_TAG_subprogram ] [line [[@LINE+3]]] [local] [def] [-[I setP1:]] -// CHECK: ![[DBG1]] = !MDLocation(line: [[@LINE+2]], -// CHECK: ![[DBG2]] = !MDLocation(line: [[@LINE+1]], +// CHECK: !DISubprogram(name: "-[I p1]",{{.*}} line: [[@LINE+4]],{{.*}} isLocal: true, isDefinition: true +// CHECK: !DISubprogram(name: "-[I setP1:]",{{.*}} line: [[@LINE+3]],{{.*}} isLocal: true, isDefinition: true +// CHECK: ![[DBG1]] = !DILocation(line: [[@LINE+2]], +// CHECK: ![[DBG2]] = !DILocation(line: [[@LINE+1]], @property int p1; @end diff --git a/test/CodeGenObjC/debuginfo-properties.m b/test/CodeGenObjC/debuginfo-properties.m index 9a3571458307..b2c479c03100 100644 --- a/test/CodeGenObjC/debuginfo-properties.m +++ b/test/CodeGenObjC/debuginfo-properties.m @@ -11,10 +11,19 @@ @protocol HasASelection <NSObject> @property (nonatomic, retain) Selection* selection; -// CHECK: [ DW_TAG_subprogram ] [line [[@LINE-1]]] [local] [def] [-[MyClass selection]] -// CHECK: [ DW_TAG_subprogram ] [line [[@LINE-2]]] [local] [def] [-[MyClass setSelection:]] -// CHECK: [ DW_TAG_subprogram ] [line [[@LINE-3]]] [local] [def] [-[OtherClass selection]] -// CHECK: [ DW_TAG_subprogram ] [line [[@LINE-4]]] [local] [def] [-[OtherClass setSelection:]] +// CHECK: !DISubprogram(name: "-[MyClass selection]" +// CHECK-SAME: line: [[@LINE-2]] +// CHECK-SAME: isLocal: true, isDefinition: true +// CHECK: !DISubprogram(name: "-[MyClass setSelection:]" +// CHECK-SAME: line: [[@LINE-5]] +// CHECK-SAME: isLocal: true, isDefinition: true +// CHECK: !DISubprogram(name: "-[OtherClass selection]" +// CHECK-SAME: line: [[@LINE-8]] +// CHECK-SAME: isLocal: true, isDefinition: true +// CHECK: !DISubprogram(name: "-[OtherClass setSelection:]" +// CHECK-SAME: line: [[@LINE-11]] +// CHECK-SAME: isLocal: true, isDefinition: true + @end @interface MyClass : NSObject <HasASelection> { diff --git a/test/CodeGenObjC/encode-test-5.m b/test/CodeGenObjC/encode-test-5.m index a27ffb7c5d1d..3f0208142f20 100644 --- a/test/CodeGenObjC/encode-test-5.m +++ b/test/CodeGenObjC/encode-test-5.m @@ -1,16 +1,21 @@ -// RUN: %clang_cc1 -triple=x86_64-apple-darwin9 -emit-llvm -o %t %s +// RUN: %clang_cc1 -x objective-c -triple=x86_64-apple-darwin9 -emit-llvm -o - < %s | FileCheck %s -// RUN: grep ji.00 %t | count 1 +// CHECK-DAG: @[[complex_int:.*]] = private unnamed_addr constant [3 x i8] c"ji\00", align 1 +// CHECK-DAG: @a = global i8* getelementptr inbounds ([3 x i8], [3 x i8]* @[[complex_int]], i32 0, i32 0), align 8 char *a = @encode(_Complex int); -// RUN: grep jf.00 %t | count 1 +// CHECK-DAG: @[[complex_float:.*]] = private unnamed_addr constant [3 x i8] c"jf\00", align 1 +// CHECK-DAG: @b = global i8* getelementptr inbounds ([3 x i8], [3 x i8]* @[[complex_float]], i32 0, i32 0), align 8 char *b = @encode(_Complex float); -// RUN: grep jd.00 %t | count 1 +// CHECK-DAG: @[[complex_double:.*]] = private unnamed_addr constant [3 x i8] c"jd\00", align 1 +// CHECK-DAG: @c = global i8* getelementptr inbounds ([3 x i8], [3 x i8]* @[[complex_double]], i32 0, i32 0), align 8 char *c = @encode(_Complex double); -// RUN: grep "t.00" %t | count 1 +// CHECK-DAG: @[[int_128:.*]] = private unnamed_addr constant [2 x i8] c"t\00", align 1 +// CHECK-DAG: @e = global i8* getelementptr inbounds ([2 x i8], [2 x i8]* @[[int_128]], i32 0, i32 0), align 8 char *e = @encode(__int128_t); -// RUN: grep "T.00" %t | count 1 +// CHECK-DAG: @[[uint_128:.*]] = private unnamed_addr constant [2 x i8] c"T\00", align 1 +// CHECK-DAG: @f = global i8* getelementptr inbounds ([2 x i8], [2 x i8]* @[[uint_128]], i32 0, i32 0), align 8 char *f = @encode(__uint128_t); diff --git a/test/CodeGenObjC/encode-test-6.m b/test/CodeGenObjC/encode-test-6.m index 4e9c4222033f..02895e74d266 100644 --- a/test/CodeGenObjC/encode-test-6.m +++ b/test/CodeGenObjC/encode-test-6.m @@ -63,4 +63,4 @@ const char * Test() } // CHECK: @e = global [2 x i8] c"i\00", align 1 // CHECK: define i8* @Test() -// CHECK: ret i8* getelementptr inbounds ([2 x i8]* @e, i32 0, i32 0) +// CHECK: ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @e, i32 0, i32 0) diff --git a/test/CodeGenObjC/encode-test.m b/test/CodeGenObjC/encode-test.m index b61fbb32eaf1..0002c0f6e460 100644 --- a/test/CodeGenObjC/encode-test.m +++ b/test/CodeGenObjC/encode-test.m @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple i686-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s // RUN: FileCheck < %t %s // -// CHECK: @OBJC_METH_VAR_TYPE_34 = private global [16 x i8] c"v12@0:4[3[4@]]8\00" +// CHECK: @OBJC_METH_VAR_TYPE_.34 = private global [16 x i8] c"v12@0:4[3[4@]]8\00" @class Int1; diff --git a/test/CodeGenObjC/exceptions.m b/test/CodeGenObjC/exceptions.m index 92f68292fff0..f27892dc7893 100644 --- a/test/CodeGenObjC/exceptions.m +++ b/test/CodeGenObjC/exceptions.m @@ -58,13 +58,13 @@ int f2() { // CHECK-NEXT: call void asm sideeffect "", "*m,*m"(i32* [[X]] // CHECK-NEXT: call void @foo() // CHECK-NEXT: call void @objc_exception_try_exit - // CHECK-NEXT: [[T:%.*]] = load i32* [[X]] + // CHECK-NEXT: [[T:%.*]] = load i32, i32* [[X]] foo(); } @catch (id) { // Landing pad. Note that we elide the re-enter. // CHECK: call void asm sideeffect "", "=*m,=*m"(i32* [[X]] // CHECK-NEXT: call i8* @objc_exception_extract - // CHECK-NEXT: [[T1:%.*]] = load i32* [[X]] + // CHECK-NEXT: [[T1:%.*]] = load i32, i32* [[X]] // CHECK-NEXT: [[T2:%.*]] = add nsw i32 [[T1]], -1 // This store is dead. @@ -82,6 +82,8 @@ void f3() { extern void f3_helper(int, int*); // CHECK: [[X:%.*]] = alloca i32 + // CHECK: [[XPTR:%.*]] = bitcast i32* [[X]] to i8* + // CHECK: call void @llvm.lifetime.start(i64 4, i8* [[XPTR]]) // CHECK: store i32 0, i32* [[X]] int x = 0; @@ -122,6 +124,7 @@ void f3() { } // CHECK: call void @f3_helper(i32 4, i32* [[X]]) + // CHECK-NEXT: call void @llvm.lifetime.end(i64 4, i8* [[XPTR]]) // CHECK-NEXT: ret void f3_helper(4, &x); } diff --git a/test/CodeGenObjC/forward-protocol-metadata-symbols.m b/test/CodeGenObjC/forward-protocol-metadata-symbols.m index 2e7ee63e0160..78c51e490137 100644 --- a/test/CodeGenObjC/forward-protocol-metadata-symbols.m +++ b/test/CodeGenObjC/forward-protocol-metadata-symbols.m @@ -23,4 +23,4 @@ int main() { // CHECK: @"\01l_OBJC_LABEL_PROTOCOL_$_P0" = weak hidden global // CHECK: @"\01l_OBJC_PROTOCOL_REFERENCE_$_P0" = weak hidden global -// CHECK: llvm.compiler.used = appending global [10 x i8*] {{[^"]*}}OBJC_CLASS_NAME_{{[^"]*}}OBJC_METH_VAR_NAME_{{[^"]*}}OBJC_METH_VAR_TYPE_{{[^"]*}}"\01l_OBJC_$_CLASS_METHODS_A"{{[^"]*}}"\01l_OBJC_CLASS_PROTOCOLS_$_A"{{[^"]*}}OBJC_CLASS_NAME_1{{[^"]*}}"\01l_OBJC_PROTOCOL_$_P0"{{[^"]*}}"\01l_OBJC_LABEL_PROTOCOL_$_P0"{{[^"]*}}"\01l_OBJC_PROTOCOL_REFERENCE_$_P0"{{[^"]*}}"OBJC_LABEL_CLASS_$"{{[^"]*}} section "llvm.metadata" +// CHECK: llvm.compiler.used = appending global [10 x i8*] {{[^"]*}}OBJC_CLASS_NAME_{{[^"]*}}OBJC_METH_VAR_NAME_{{[^"]*}}OBJC_METH_VAR_TYPE_{{[^"]*}}"\01l_OBJC_$_CLASS_METHODS_A"{{[^"]*}}"\01l_OBJC_CLASS_PROTOCOLS_$_A"{{[^"]*}}OBJC_CLASS_NAME_.1{{[^"]*}}"\01l_OBJC_PROTOCOL_$_P0"{{[^"]*}}"\01l_OBJC_LABEL_PROTOCOL_$_P0"{{[^"]*}}"\01l_OBJC_PROTOCOL_REFERENCE_$_P0"{{[^"]*}}"OBJC_LABEL_CLASS_$"{{[^"]*}} section "llvm.metadata" diff --git a/test/CodeGenObjC/gc.m b/test/CodeGenObjC/gc.m index 729cf107a903..6b6d293557e8 100644 --- a/test/CodeGenObjC/gc.m +++ b/test/CodeGenObjC/gc.m @@ -8,7 +8,7 @@ void test0(void) { // CHECK: [[T0:%.*]] = call i8* @test0_helper() // CHECK-NEXT: store i8* [[T0]], i8** [[X:%.*]], align 8 // CHECK-NEXT: call i8* @test0_helper() - // CHECK-NEXT: [[T0:%.*]] = load i8** [[X]], align 8 + // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[X]], align 8 // CHECK-NEXT: call void asm sideeffect "", "r"(i8* [[T0]]) [[NUW:#[0-9]+]] // CHECK-NEXT: ret void } diff --git a/test/CodeGenObjC/gnu-exceptions.m b/test/CodeGenObjC/gnu-exceptions.m index 7aa9709a8758..82eb6cb7bd5f 100644 --- a/test/CodeGenObjC/gnu-exceptions.m +++ b/test/CodeGenObjC/gnu-exceptions.m @@ -16,7 +16,7 @@ void test0() { } @catch (C *c) { // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gnu_objc_personality_v0 to i8*) - // CHECK-NEXT: catch i8* getelementptr inbounds ([2 x i8]* @0, i64 0, i64 0) + // CHECK-NEXT: catch i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i64 0, i64 0) // CHECK: br i1 // CHECK: call void @log(i32 0) diff --git a/test/CodeGenObjC/id-isa-codegen.m b/test/CodeGenObjC/id-isa-codegen.m index fa0f0b097a00..20f344c5396c 100644 --- a/test/CodeGenObjC/id-isa-codegen.m +++ b/test/CodeGenObjC/id-isa-codegen.m @@ -64,10 +64,10 @@ id Test2() { ((id)cat)->isa = dynamicSubclass; } @end -// CHECK-LP64: %{{.*}} = load i8** % +// CHECK-LP64: %{{.*}} = load i8*, i8** % // CHECK-NEXT: %{{.*}} = bitcast i8* %{{.*}} to i8** // CHECK-NEXT: store i8* %{{.*}}, i8** %{{.*}} -// CHECK-LP32: %{{.*}} = load i8** % +// CHECK-LP32: %{{.*}} = load i8*, i8** % // CHECK-NEXT: %{{.*}} = bitcast i8* %{{.*}} to i8** // CHECK-NEXT: store i8* %{{.*}}, i8** %{{.*}} diff --git a/test/CodeGenObjC/ivar-base-as-invariant-load.m b/test/CodeGenObjC/ivar-base-as-invariant-load.m index 061fea31a5ce..4a17eb16f6be 100644 --- a/test/CodeGenObjC/ivar-base-as-invariant-load.m +++ b/test/CodeGenObjC/ivar-base-as-invariant-load.m @@ -23,7 +23,7 @@ @end -// CHECK: [[T1:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load ![[MD_NUM:[0-9]+]] -// CHECK: [[T2:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load ![[MD_NUM]] -// CHECK: [[T3:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load ![[MD_NUM]] +// CHECK: [[T1:%.*]] = load i64, i64* @"OBJC_IVAR_$_A._flags", !invariant.load ![[MD_NUM:[0-9]+]] +// CHECK: [[T2:%.*]] = load i64, i64* @"OBJC_IVAR_$_A._flags", !invariant.load ![[MD_NUM]] +// CHECK: [[T3:%.*]] = load i64, i64* @"OBJC_IVAR_$_A._flags", !invariant.load ![[MD_NUM]] // diff --git a/test/CodeGenObjC/ivar-invariant.m b/test/CodeGenObjC/ivar-invariant.m index ef17ffc12f78..b9c5bec93063 100644 --- a/test/CodeGenObjC/ivar-invariant.m +++ b/test/CodeGenObjC/ivar-invariant.m @@ -29,7 +29,7 @@ @end // CHECK: define internal i8* @"\01-[Derived init]" -// CHECK: [[IVAR:%.*]] = load i64* @"OBJC_IVAR_$_Derived.member", !invariant.load +// CHECK: [[IVAR:%.*]] = load i64, i64* @"OBJC_IVAR_$_Derived.member", !invariant.load void * variant_load_1(int i) { void *ptr; @@ -41,7 +41,7 @@ void * variant_load_1(int i) { } // CHECK-LABEL: define i8* @variant_load_1(i32 %i) -// CHECK: [[IVAR:%.*]] = load i64* @"OBJC_IVAR_$_Derived.member"{{$}} +// CHECK: [[IVAR:%.*]] = load i64, i64* @"OBJC_IVAR_$_Derived.member"{{$}} @interface Container : Derived @end @implementation Container @@ -52,7 +52,7 @@ void * variant_load_1(int i) { @end // CHECK: define internal i8* @"\01-[Container invariant_load_1]" -// CHECK: [[IVAR:%.*]] = load i64* @"OBJC_IVAR_$_Derived.member", !invariant.load +// CHECK: [[IVAR:%.*]] = load i64, i64* @"OBJC_IVAR_$_Derived.member", !invariant.load @interface ForBlock { @@ -62,7 +62,7 @@ void * variant_load_1(int i) { @end // CHECK-LABEL: define internal i8* @block_block_invoke -// CHECK: load i64* @"OBJC_IVAR_$_ForBlock.foo" +// CHECK: load i64, i64* @"OBJC_IVAR_$_ForBlock.foo" id (^block)(ForBlock*) = ^(ForBlock* a) { return a->foo; }; diff --git a/test/CodeGenObjC/ivar-layout-array0-struct.m b/test/CodeGenObjC/ivar-layout-array0-struct.m index 8e277106a71c..26459aec4c01 100644 --- a/test/CodeGenObjC/ivar-layout-array0-struct.m +++ b/test/CodeGenObjC/ivar-layout-array0-struct.m @@ -19,5 +19,5 @@ typedef struct { @end @implementation Test @end -// CHECK-LP64: L_OBJC_CLASS_NAME_4: +// CHECK-LP64: L_OBJC_CLASS_NAME_.4: // CHECK-LP64-NEXT: .asciz "\001\020" diff --git a/test/CodeGenObjC/ivar-layout-no-optimize.m b/test/CodeGenObjC/ivar-layout-no-optimize.m index 554038f5ba9e..099bf6847434 100644 --- a/test/CodeGenObjC/ivar-layout-no-optimize.m +++ b/test/CodeGenObjC/ivar-layout-no-optimize.m @@ -16,5 +16,5 @@ @implementation AllPointers @end -// CHECK-LP64: L_OBJC_CLASS_NAME_6: +// CHECK-LP64: L_OBJC_CLASS_NAME_.6: // CHECK-LP64-NEXT: .asciz "\004" diff --git a/test/CodeGenObjC/local-static-block.m b/test/CodeGenObjC/local-static-block.m index b5b4534b8e47..b55cc6af4d65 100644 --- a/test/CodeGenObjC/local-static-block.m +++ b/test/CodeGenObjC/local-static-block.m @@ -53,5 +53,5 @@ void FUNC1() } // CHECK-LP64: @ArrayRecurs = internal global // CHECK-LP64: @FUNC.ArrayRecurs = internal global -// CHECK-LP64: @FUNC.ArrayRecurs3 = internal global +// CHECK-LP64: @FUNC.ArrayRecurs.3 = internal global // CHECK-LP64: @FUNC1.ArrayRecurs = internal global diff --git a/test/CodeGenObjC/mangle-blocks.m b/test/CodeGenObjC/mangle-blocks.m index f0339c153084..3d6e56a1501d 100644 --- a/test/CodeGenObjC/mangle-blocks.m +++ b/test/CodeGenObjC/mangle-blocks.m @@ -19,11 +19,11 @@ void __assert_rtn(const char *, const char *, int, const char *); // CHECK: @"__func__.__14-[Test mangle]_block_invoke_2" = private unnamed_addr constant [34 x i8] c"__14-[Test mangle]_block_invoke_2\00", align 1 // CHECK: @.str = private unnamed_addr constant {{.*}}, align 1 -// CHECK: @.str1 = private unnamed_addr constant [7 x i8] c"mangle\00", align 1 +// CHECK: @.str.1 = private unnamed_addr constant [7 x i8] c"mangle\00", align 1 // CHECK: define internal void @"__14-[Test mangle]_block_invoke"(i8* %.block_descriptor) // CHECK: define internal void @"__14-[Test mangle]_block_invoke_2"(i8* %.block_descriptor){{.*}}{ -// CHECK: call void @__assert_rtn(i8* getelementptr inbounds ([34 x i8]* @"__func__.__14-[Test mangle]_block_invoke_2", i32 0, i32 0), i8* getelementptr inbounds {{.*}}, i32 14, i8* getelementptr inbounds ([7 x i8]* @.str1, i32 0, i32 0)) +// CHECK: call void @__assert_rtn(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @"__func__.__14-[Test mangle]_block_invoke_2", i32 0, i32 0), i8* getelementptr inbounds {{.*}}, i32 14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0)) // CHECK: } diff --git a/test/CodeGenObjC/messages-2.m b/test/CodeGenObjC/messages-2.m index ce6624ad5a0a..4f98fc7287df 100644 --- a/test/CodeGenObjC/messages-2.m +++ b/test/CodeGenObjC/messages-2.m @@ -150,7 +150,7 @@ typedef struct { void test0(A *x) { // CHECK: [[X:%.*]] = alloca [[A]]* // CHECK-NEXT: [[POINT:%.*]] = alloca [[POINT_T:%.*]], - // CHECK: [[T0:%.*]] = load [[A]]** [[X]] + // CHECK: [[T0:%.*]] = load [[A]]*, [[A]]** [[X]] // CHECK: [[T1:%.*]] = bitcast [[A]]* [[T0]] to i8* // CHECK-NEXT: icmp eq i8* [[T1]], null // CHECK-NEXT: br i1 @@ -162,7 +162,7 @@ void test0(A *x) { // CHECK-NF: [[X:%.*]] = alloca [[A]]* // CHECK-NF-NEXT: [[POINT:%.*]] = alloca [[POINT_T:%.*]], - // CHECK-NF: [[T0:%.*]] = load [[A]]** [[X]] + // CHECK-NF: [[T0:%.*]] = load [[A]]*, [[A]]** [[X]] // CHECK-NF: [[T1:%.*]] = bitcast [[A]]* [[T0]] to i8* // CHECK-NF-NEXT: icmp eq i8* [[T1]], null // CHECK-NF-NEXT: br i1 diff --git a/test/CodeGenObjC/metadata-symbols-64.m b/test/CodeGenObjC/metadata-symbols-64.m index 8f598f41e551..5b9591ff973f 100644 --- a/test/CodeGenObjC/metadata-symbols-64.m +++ b/test/CodeGenObjC/metadata-symbols-64.m @@ -25,7 +25,7 @@ // CHECK: @"\01l_OBJC_$_CATEGORY_A_$_Cat" = private global {{.*}} section "__DATA, __objc_const", align 8 // CHECK: @"OBJC_CLASSLIST_SUP_REFS_$_{{[0-9]*}}" = private global {{.*}} section "__DATA, __objc_superrefs, regular, no_dead_strip", align 8 // CHECK: @OBJC_SELECTOR_REFERENCES_ = private externally_initialized global {{.*}} section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" -// CHECK: @"OBJC_CLASSLIST_SUP_REFS_$_{{[0-9]*}}" = private global {{.*}} section "__DATA, __objc_superrefs, regular, no_dead_strip", align 8 +// CHECK: @"OBJC_CLASSLIST_SUP_REFS_$_{{[\.0-9]*}}" = private global {{.*}} section "__DATA, __objc_superrefs, regular, no_dead_strip", align 8 // CHECK: @"OBJC_CLASS_$_B" = external global // CHECK: @"OBJC_CLASSLIST_REFERENCES_$_{{[0-9]*}}" = private global {{.*}} section "__DATA, __objc_classrefs, regular, no_dead_strip", align 8 // CHECK: @"\01l_objc_msgSend_fixup_alloc" = weak hidden global {{.*}} section "__DATA, __objc_msgrefs, coalesced", align 16 diff --git a/test/CodeGenObjC/no-sanitize.m b/test/CodeGenObjC/no-sanitize.m new file mode 100644 index 000000000000..39f8575670d5 --- /dev/null +++ b/test/CodeGenObjC/no-sanitize.m @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 %s -emit-llvm -fsanitize=address -o - | FileCheck %s + +@interface I0 @end +@implementation I0 +// CHECK-NOT: sanitize_address +- (void) im0: (int) a0 __attribute__((no_sanitize("address"))) { +} +@end diff --git a/test/CodeGenObjC/ns-constant-strings.m b/test/CodeGenObjC/ns-constant-strings.m index ccaacaf53e76..4cbbb9a6b995 100644 --- a/test/CodeGenObjC/ns-constant-strings.m +++ b/test/CodeGenObjC/ns-constant-strings.m @@ -33,7 +33,7 @@ int main() { // CHECK-NONFRAGILE: @"OBJC_CLASS_$_NSConstantString" = external global // CHECK-FRAGILE: @.str = private unnamed_addr constant [6 x i8] c"MyApp\00" -// CHECK-FRAGILE: @.str1 = private unnamed_addr constant [7 x i8] c"MyApp1\00" +// CHECK-FRAGILE: @.str.1 = private unnamed_addr constant [7 x i8] c"MyApp1\00" // CHECK-NONFRAGILE: @.str = private unnamed_addr constant [6 x i8] c"MyApp\00" -// CHECK-NONFRAGILE: @.str1 = private unnamed_addr constant [7 x i8] c"MyApp1\00" +// CHECK-NONFRAGILE: @.str.1 = private unnamed_addr constant [7 x i8] c"MyApp1\00" diff --git a/test/CodeGenObjC/ns_consume_null_check.m b/test/CodeGenObjC/ns_consume_null_check.m index d4502ec04263..777659f2686e 100644 --- a/test/CodeGenObjC/ns_consume_null_check.m +++ b/test/CodeGenObjC/ns_consume_null_check.m @@ -21,7 +21,7 @@ void test0(void) { // CHECK-NEXT: [[SIX:%.*]] = bitcast // CHECK-NEXT: [[SEVEN:%.*]] = icmp eq i8* [[SIX]], null // CHECK-NEXT: br i1 [[SEVEN]], label [[NULLINIT:%.*]], label [[CALL_LABEL:%.*]] -// CHECK: [[FN:%.*]] = load i8** getelementptr inbounds +// CHECK: [[FN:%.*]] = load i8*, i8** getelementptr inbounds // CHECK-NEXT: [[EIGHT:%.*]] = bitcast i8* [[FN]] // CHECK-NEXT: [[CALL:%.*]] = call signext i8 [[EIGHT]] // CHECK-NEXT: br label [[CONT:%.*]] @@ -43,13 +43,13 @@ void test1(void) { // Various initializations. // CHECK: [[T0:%.*]] = call i8* bitcast ( // CHECK-NEXT: store i8* [[T0]], i8** [[OBJ]] -// CHECK-NEXT: [[T0:%.*]] = load i8** [[OBJ]] +// CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[OBJ]] // CHECK-NEXT: call i8* @objc_initWeak(i8** [[WEAKOBJ]], i8* [[T0]]) [[NUW]] // Okay, start the message-send. -// CHECK-NEXT: [[T0:%.*]] = load [[MYOBJECT:%.*]]** @x -// CHECK-NEXT: [[ARG:%.*]] = load i8** [[OBJ]] +// CHECK-NEXT: [[T0:%.*]] = load [[MYOBJECT:%.*]]*, [[MYOBJECT:%.*]]** @x +// CHECK-NEXT: [[ARG:%.*]] = load i8*, i8** [[OBJ]] // CHECK-NEXT: [[ARG_RETAINED:%.*]] = call i8* @objc_retain(i8* [[ARG]]) -// CHECK-NEXT: load i8** @ +// CHECK-NEXT: load i8*, i8** @ // CHECK-NEXT: [[SELF:%.*]] = bitcast [[MYOBJECT]]* [[T0]] to i8* // Null check. // CHECK-NEXT: [[T0:%.*]] = icmp eq i8* [[SELF]], null @@ -59,10 +59,10 @@ void test1(void) { // CHECK-NEXT: to label [[INVOKE_CONT:%.*]] unwind label {{%.*}} // CHECK: [[T0:%.*]] = bitcast { float, float }* [[COERCE:%.*]] to <2 x float>* // CHECK-NEXT: store <2 x float> [[CALL]], <2 x float>* [[T0]], -// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { float, float }* [[COERCE]], i32 0, i32 0 -// CHECK-NEXT: [[REALCALL:%.*]] = load float* [[T0]] -// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { float, float }* [[COERCE]], i32 0, i32 1 -// CHECK-NEXT: [[IMAGCALL:%.*]] = load float* [[T0]] +// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { float, float }, { float, float }* [[COERCE]], i32 0, i32 0 +// CHECK-NEXT: [[REALCALL:%.*]] = load float, float* [[T0]] +// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { float, float }, { float, float }* [[COERCE]], i32 0, i32 1 +// CHECK-NEXT: [[IMAGCALL:%.*]] = load float, float* [[T0]] // CHECK-NEXT: br label [[CONT:%.*]]{{$}} // Null path. // CHECK: call void @objc_release(i8* [[ARG_RETAINED]]) [[NUW]] @@ -70,8 +70,8 @@ void test1(void) { // Join point. // CHECK: [[REAL:%.*]] = phi float [ [[REALCALL]], [[INVOKE_CONT]] ], [ 0.000000e+00, [[FORNULL]] ] // CHECK-NEXT: [[IMAG:%.*]] = phi float [ [[IMAGCALL]], [[INVOKE_CONT]] ], [ 0.000000e+00, [[FORNULL]] ] -// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { float, float }* [[RESULT]], i32 0, i32 0 -// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds { float, float }* [[RESULT]], i32 0, i32 1 +// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { float, float }, { float, float }* [[RESULT]], i32 0, i32 0 +// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds { float, float }, { float, float }* [[RESULT]], i32 0, i32 1 // CHECK-NEXT: store float [[REAL]], float* [[T0]] // CHECK-NEXT: store float [[IMAG]], float* [[T1]] // Epilogue. diff --git a/test/CodeGenObjC/objc-asm-attribute-test.m b/test/CodeGenObjC/objc-asm-attribute-test.m index 12903b522e54..589b08ae0eef 100644 --- a/test/CodeGenObjC/objc-asm-attribute-test.m +++ b/test/CodeGenObjC/objc-asm-attribute-test.m @@ -51,4 +51,4 @@ id Test16877359() { // CHECK: @"OBJC_METACLASS_$_MySecretNamespace.Message" = global %struct._class_t // CHECK: @"OBJC_CLASS_$_foo" = external global %struct._class_t // CHECK: define internal i8* @"\01-[Message MyMethod]" -// CHECK: [[IVAR:%.*]] = load i64* @"OBJC_IVAR_$_MySecretNamespace.Message.MyIVAR" +// CHECK: [[IVAR:%.*]] = load i64, i64* @"OBJC_IVAR_$_MySecretNamespace.Message.MyIVAR" diff --git a/test/CodeGenObjC/objc-container-subscripting-1.m b/test/CodeGenObjC/objc-container-subscripting-1.m index 9ddfd39f63c4..f9322fa63c1e 100644 --- a/test/CodeGenObjC/objc-container-subscripting-1.m +++ b/test/CodeGenObjC/objc-container-subscripting-1.m @@ -19,15 +19,15 @@ int main() { id oldObject = array[10]; // CHECK: [[ARR:%.*]] = load {{%.*}} [[array:%.*]], align 8 -// CHECK-NEXT: [[SEL:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ +// CHECK-NEXT: [[SEL:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[ARRC:%.*]] = bitcast {{%.*}} [[ARR]] to i8* // CHECK-NEXT: [[CALL:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i32)*)(i8* [[ARRC]], i8* [[SEL]], i32 10) // CHECK-NEXT: store i8* [[CALL]], i8** [[OLDOBJ:%.*]], align 8 val = (array[10] = oldObject); // CHECK: [[THREE:%.*]] = load {{%.*}} [[array:%.*]], align 8 -// CHECK-NEXT: [[FOUR:%.*]] = load i8** [[oldObject:%.*]], align 8 -// CHECK-NEXT: [[FIVE:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_2 +// CHECK-NEXT: [[FOUR:%.*]] = load i8*, i8** [[oldObject:%.*]], align 8 +// CHECK-NEXT: [[FIVE:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.2 // CHECK-NEXT: [[SIX:%.*]] = bitcast {{%.*}} [[THREE]] to i8* // CHECK-NEXT: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i8*, i32)*)(i8* [[SIX]], i8* [[FIVE]], i8* [[FOUR]], i32 10) // CHECK-NEXT: store i8* [[FOUR]], i8** [[val:%.*]] @@ -37,8 +37,8 @@ int main() { id newObject; oldObject = dictionary[key]; // CHECK: [[SEVEN:%.*]] = load {{%.*}} [[DICTIONARY:%.*]], align 8 -// CHECK-NEXT: [[EIGHT:%.*]] = load i8** [[KEY:%.*]], align 8 -// CHECK-NEXT: [[TEN:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_4 +// CHECK-NEXT: [[EIGHT:%.*]] = load i8*, i8** [[KEY:%.*]], align 8 +// CHECK-NEXT: [[TEN:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.4 // CHECK-NEXT: [[ELEVEN:%.*]] = bitcast {{%.*}} [[SEVEN]] to i8* // CHECK-NEXT: [[CALL1:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i8*)*)(i8* [[ELEVEN]], i8* [[TEN]], i8* [[EIGHT]]) // CHECK-NEXT: store i8* [[CALL1]], i8** [[oldObject:%.*]], align 8 @@ -46,9 +46,9 @@ int main() { val = (dictionary[key] = newObject); // CHECK: [[TWELVE:%.*]] = load {{%.*}} [[DICTIONARY]], align 8 -// CHECK-NEXT: [[THIRTEEN:%.*]] = load i8** [[KEY]], align 8 -// CHECK-NEXT: [[FOURTEEN:%.*]] = load i8** [[NEWOBJECT:%.*]], align 8 -// CHECK-NEXT: [[SIXTEEN:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_6 +// CHECK-NEXT: [[THIRTEEN:%.*]] = load i8*, i8** [[KEY]], align 8 +// CHECK-NEXT: [[FOURTEEN:%.*]] = load i8*, i8** [[NEWOBJECT:%.*]], align 8 +// CHECK-NEXT: [[SIXTEEN:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.6 // CHECK-NEXT: [[SEVENTEEN:%.*]] = bitcast {{%.*}} [[TWELVE]] to i8* // CHECK-NEXT: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i8*, i8*)*)(i8* [[SEVENTEEN]], i8* [[SIXTEEN]], i8* [[FOURTEEN]], i8* [[THIRTEEN]]) // CHECK-NEXT: store i8* [[FOURTEEN]], i8** [[val:%.*]] diff --git a/test/CodeGenObjC/objc-fixed-enum.m b/test/CodeGenObjC/objc-fixed-enum.m index eff317cdc513..52811b1d68bc 100644 --- a/test/CodeGenObjC/objc-fixed-enum.m +++ b/test/CodeGenObjC/objc-fixed-enum.m @@ -46,19 +46,35 @@ int main() { // -treated as C++11 strongly typed enums. return e0 != e1 && e1 == e2 && e2 == e3; } -// CHECK: ![[ENUMERATOR0:[0-9]+]] = {{.*}}; [ DW_TAG_enumeration_type ] [line 10 -// CHECK: ![[ENUMERATOR1:[0-9]+]] = {{.*}}; [ DW_TAG_enumeration_type ] [Enum1] [line 16{{.*}}] [from NSInteger] -// CHECK: ![[ENUMERATOR3:[0-9]+]] = {{.*}}; [ DW_TAG_typedef ] [NSInteger] [line 6{{.*}}] [from long int] -// CHECK: ![[ENUMERATOR2:[0-9]+]] = {{.*}}; [ DW_TAG_enumeration_type ] [line 22{{.*}}] [from NSInteger] +// CHECK: ![[ENUMERATOR0:[0-9]+]] = !DICompositeType(tag: DW_TAG_enumeration_type +// CHECK-SAME: line: 10, +// CHECK: ![[ENUMERATOR1:[0-9]+]] = !DICompositeType(tag: DW_TAG_enumeration_type, name: "Enum1" +// CHECK-SAME: line: 16 +// CHECK-SAME: baseType: ![[ENUMERATOR3:[0-9]+]] +// CHECK: ![[ENUMERATOR3]] = !DIDerivedType(tag: DW_TAG_typedef, name: "NSInteger" +// CHECK-SAME: line: 6 +// CHECK-SAME: baseType: ![[LONGINT:[0-9]+]] +// CHECK: ![[LONGINT]] = !DIBasicType(name: "long int" +// CHECK: ![[ENUMERATOR2:[0-9]+]] = !DICompositeType(tag: DW_TAG_enumeration_type, +// CHECK-SAME: line: 22 +// CHECK-SAME: baseType: ![[ENUMERATOR3]] -// CHECK: ![[ENUM0]] = !{!"0x100\00e0\00{{[^,]*}}"{{, [^,]+, [^,]+}}, ![[TYPE0:[0-9]+]]} ; [ DW_TAG_auto_variable ] -// CHECK: ![[TYPE0]] = !{!"0x16\00Enum0\00{{.*}}", {{.*}}, ![[ENUMERATOR0]]} ; [ DW_TAG_typedef ] [Enum0] +// CHECK: ![[ENUM0]] = !DILocalVariable(tag: DW_TAG_auto_variable, name: "e0" +// CHECK-SAME: type: ![[TYPE0:[0-9]+]] +// CHECK: ![[TYPE0]] = !DIDerivedType(tag: DW_TAG_typedef, name: "Enum0", +// CHECK-SAME: baseType: ![[ENUMERATOR0]] -// CHECK: ![[ENUM1]] = !{!"0x100\00e1\00{{[^,]*}}"{{, [^,]+, [^,]+}}, ![[TYPE1:[0-9]+]]} ; [ DW_TAG_auto_variable ] -// CHECK: ![[TYPE1]] = !{!"0x16\00Enum1\00{{.*}}", {{.*}}, ![[ENUMERATOR1]]} ; [ DW_TAG_typedef ] [Enum1] +// CHECK: ![[ENUM1]] = !DILocalVariable(tag: DW_TAG_auto_variable, name: "e1" +// CHECK-SAME: type: ![[TYPE1:[0-9]+]] +// CHECK: ![[TYPE1]] = !DIDerivedType(tag: DW_TAG_typedef, name: "Enum1" +// CHECK-SAME: baseType: ![[ENUMERATOR1]] -// CHECK: ![[ENUM2]] = !{!"0x100\00e2\00{{[^,]*}}"{{, [^,]+, [^,]+}}, ![[TYPE2:[0-9]+]]} ; [ DW_TAG_auto_variable ] -// CHECK: ![[TYPE2]] = !{!"0x16\00Enum2\00{{.*}}", {{.*}}, ![[ENUMERATOR2]]} ; [ DW_TAG_typedef ] [Enum2] +// CHECK: ![[ENUM2]] = !DILocalVariable(tag: DW_TAG_auto_variable, name: "e2" +// CHECK-SAME: type: ![[TYPE2:[0-9]+]] +// CHECK: ![[TYPE2]] = !DIDerivedType(tag: DW_TAG_typedef, name: "Enum2" +// CHECK-SAME: baseType: ![[ENUMERATOR2]] -// CHECK: ![[ENUM3]] = !{!"0x100\00e3\00{{[^,]*}}"{{, [^,]+, [^,]+}}, ![[TYPE3:[0-9]+]]} ; [ DW_TAG_auto_variable ] -// CHECK: ![[TYPE3]] = !{!"0x16\00Enum3\00{{.*}}", {{.*}}, ![[ENUMERATOR3]]} ; [ DW_TAG_typedef ] [Enum3] +// CHECK: ![[ENUM3]] = !DILocalVariable(tag: DW_TAG_auto_variable, name: "e3" +// CHECK-SAME: type: ![[TYPE3:[0-9]+]] +// CHECK: ![[TYPE3]] = !DIDerivedType(tag: DW_TAG_typedef, name: "Enum3" +// CHECK-SAME: baseType: ![[ENUMERATOR3]] diff --git a/test/CodeGenObjC/objc2-protocol-metadata.m b/test/CodeGenObjC/objc2-protocol-metadata.m new file mode 100644 index 000000000000..191016be8517 --- /dev/null +++ b/test/CodeGenObjC/objc2-protocol-metadata.m @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm -o - %s | FileCheck %s +// rdar://20286356 + +@protocol P1 +- InstP; ++ ClsP; +@end + +@interface INTF <P1> +@end + +@implementation INTF +- InstP { return 0; } ++ ClsP { return 0; } +@end + +// CHECK: %struct._protocol_t = type { i8*, i8*, %struct._objc_protocol_list*, %struct.__method_list_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct._prop_list_t*, i32, i32, i8**, i8* } diff --git a/test/CodeGenObjC/objfw.m b/test/CodeGenObjC/objfw.m index 8e72867fcde6..918b9bf41301 100644 --- a/test/CodeGenObjC/objfw.m +++ b/test/CodeGenObjC/objfw.m @@ -9,7 +9,7 @@ void test0(void) { [Test0 test]; } // CHECK-LABEL: define void @test0() -// CHECK: [[T0:%.*]] = call i8* (i8*, i8*, ...)* (i8*, i8*)* @objc_msg_lookup(i8* bitcast (i64* @_OBJC_CLASS_Test0 to i8*), +// CHECK: [[T0:%.*]] = call i8* (i8*, i8*, ...)* @objc_msg_lookup(i8* bitcast (i64* @_OBJC_CLASS_Test0 to i8*), // CHECK-NEXT: [[T1:%.*]] = bitcast i8* (i8*, i8*, ...)* [[T0]] to void (i8*, i8*)* // CHECK-NEXT: call void [[T1]](i8* bitcast (i64* @_OBJC_CLASS_Test0 to i8*), // CHECK-NEXT: ret void diff --git a/test/CodeGenObjC/optimize-ivar-offset-load.m b/test/CodeGenObjC/optimize-ivar-offset-load.m index 29f70bea7a63..0317c094033f 100644 --- a/test/CodeGenObjC/optimize-ivar-offset-load.m +++ b/test/CodeGenObjC/optimize-ivar-offset-load.m @@ -26,11 +26,11 @@ extern void foo(int); } } @end -// CHECK: [[IVAR:%.*]] = load i64* @"OBJC_IVAR_$_SampleClass._value", align 8 +// CHECK: [[IVAR:%.*]] = load i64, i64* @"OBJC_IVAR_$_SampleClass._value", align 8 // CHECK: [[THREE:%.*]] = bitcast [[ONE:%.*]]* [[CALL:%.*]] to i8* -// CHECK: [[ADDPTR:%.*]] = getelementptr inbounds i8* [[THREE]], i64 [[IVAR]] +// CHECK: [[ADDPTR:%.*]] = getelementptr inbounds i8, i8* [[THREE]], i64 [[IVAR]] // CHECK: [[FOUR:%.*]] = bitcast i8* [[ADDPTR]] to i32* -// CHECK: [[FIVE:%.*]] = load i32* [[FOUR]], align 4 +// CHECK: [[FIVE:%.*]] = load i32, i32* [[FOUR]], align 4 // CHECK: tail call void @foo(i32 [[FIVE]]) @implementation SampleClass @@ -44,8 +44,8 @@ extern void foo(int); } } @end -// CHECK: [[ZERO:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_, align 8, !invariant.load -// CHECK: [[IVAR:%.*]] = load i64* @"OBJC_IVAR_$_SampleClass._value", align 8, !invariant.load +// CHECK: [[ZERO:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_, align 8, !invariant.load +// CHECK: [[IVAR:%.*]] = load i64, i64* @"OBJC_IVAR_$_SampleClass._value", align 8, !invariant.load @interface Sample : SampleClass @end @@ -59,6 +59,6 @@ extern void foo(int); } } @end -// CHECK: [[ZERO:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_, align 8, !invariant.load -// CHECK: [[IVAR:%.*]] = load i64* @"OBJC_IVAR_$_SampleClass._value", align 8, !invariant.load +// CHECK: [[ZERO:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_, align 8, !invariant.load +// CHECK: [[IVAR:%.*]] = load i64, i64* @"OBJC_IVAR_$_SampleClass._value", align 8, !invariant.load diff --git a/test/CodeGenObjC/property-array-type.m b/test/CodeGenObjC/property-array-type.m index 84191ef6bfa5..ea757db0f60d 100644 --- a/test/CodeGenObjC/property-array-type.m +++ b/test/CodeGenObjC/property-array-type.m @@ -24,7 +24,7 @@ typedef struct _GLKMatrix4 GLKMatrix4; } @end -// CHECK: [[M:%.*]] = getelementptr inbounds %struct._GLKMatrix4* [[TMP:%.*]], i32 0, i32 0 -// CHECK: [[ARRAYDECAY:%.*]] = getelementptr inbounds [16 x float]* [[M]], i32 0, i32 0 -// CHECK: [[SIX:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES +// CHECK: [[M:%.*]] = getelementptr inbounds %struct._GLKMatrix4, %struct._GLKMatrix4* [[TMP:%.*]], i32 0, i32 0 +// CHECK: [[ARRAYDECAY:%.*]] = getelementptr inbounds [16 x float], [16 x float]* [[M]], i32 0, i32 0 +// CHECK: [[SIX:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES // CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, float*)*)(i8* [[SEVEN:%.*]], i8* [[SIX]], float* [[ARRAYDECAY]]) diff --git a/test/CodeGenObjC/property-type-mismatch.m b/test/CodeGenObjC/property-type-mismatch.m index b5618cb513a8..c24dd1f80aa2 100644 --- a/test/CodeGenObjC/property-type-mismatch.m +++ b/test/CodeGenObjC/property-type-mismatch.m @@ -13,5 +13,5 @@ void bar(Foo *x) { // CHECK: [[C1:%.*]] = call float bitcast (i8* (i8*, i8*, ...)* @objc_msgSend // CHECK: [[I:%.*]] = fadd float [[C1]], 1.000000e+00 // CHECK: [[CONV:%.*]] = fptosi float [[I]] to i32 -// CHECK: [[T3:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_2 +// CHECK: [[T3:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.2 // CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend diff --git a/test/CodeGenObjC/property.m b/test/CodeGenObjC/property.m index 0f63a0fd14b0..4d884111ad5c 100644 --- a/test/CodeGenObjC/property.m +++ b/test/CodeGenObjC/property.m @@ -58,21 +58,21 @@ int printf(const char *, ...); A *test2_helper(void); void test2() { // CHECK: [[BASE:%.*]] = call [[A:%.*]]* @test2_helper() - // CHECK-NEXT: [[SEL:%.*]] = load i8** + // CHECK-NEXT: [[SEL:%.*]] = load i8*, i8** // CHECK-NEXT: [[BASETMP:%.*]] = bitcast [[A]]* [[BASE]] to i8* // CHECK-NEXT: [[LD:%.*]] = call i32 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i32 (i8*, i8*)*)(i8* [[BASETMP]], i8* [[SEL]]) // CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[LD]], 1 - // CHECK-NEXT: [[SEL:%.*]] = load i8** + // CHECK-NEXT: [[SEL:%.*]] = load i8*, i8** // CHECK-NEXT: [[BASETMP:%.*]] = bitcast [[A]]* [[BASE]] to i8* // CHECK-NEXT: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i32)*)(i8* [[BASETMP]], i8* [[SEL]], i32 [[ADD]]) test2_helper().dyn++; // CHECK: [[BASE:%.*]] = call [[A]]* @test2_helper() - // CHECK-NEXT: [[SEL:%.*]] = load i8** + // CHECK-NEXT: [[SEL:%.*]] = load i8*, i8** // CHECK-NEXT: [[BASETMP:%.*]] = bitcast [[A]]* [[BASE]] to i8* // CHECK-NEXT: [[LD:%.*]] = call i32 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i32 (i8*, i8*)*)(i8* [[BASETMP]], i8* [[SEL]]) // CHECK-NEXT: [[ADD:%.*]] = mul nsw i32 [[LD]], 10 - // CHECK-NEXT: [[SEL:%.*]] = load i8** + // CHECK-NEXT: [[SEL:%.*]] = load i8*, i8** // CHECK-NEXT: [[BASETMP:%.*]] = bitcast [[A]]* [[BASE]] to i8* // CHECK-NEXT: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i32)*)(i8* [[BASETMP]], i8* [[SEL]], i32 [[ADD]]) test2_helper().dyn *= 10; @@ -99,7 +99,7 @@ void test4(Test4 *t) { extern int test4_printf(const char *, ...); // CHECK: [[TMP:%.*]] = call float {{.*}} @objc_msgSend // CHECK-NEXT: [[EXT:%.*]] = fpext float [[TMP]] to double - // CHECK-NEXT: call i32 (i8*, ...)* @test4_printf(i8* {{.*}}, double [[EXT]]) + // CHECK-NEXT: call i32 (i8*, ...) @test4_printf(i8* {{.*}}, double [[EXT]]) // CHECK-NEXT: ret void test4_printf("%.2f", t.f); } @@ -135,34 +135,34 @@ void test7(Test7 *t) { // CHECK: define void @test7([[TEST7:%.*]]* // CHECK: [[T:%.*]] = alloca [[TEST7]]*, // CHECK-NEXT: store -// CHECK-NEXT: [[T0:%.*]] = load [[TEST7]]** [[T]], align -// CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES +// CHECK-NEXT: [[T0:%.*]] = load [[TEST7]]*, [[TEST7]]** [[T]], align +// CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST7]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call zeroext i8 bitcast // CHECK-NEXT: [[T3:%.*]] = zext i8 [[T2]] to i32 // CHECK-NEXT: [[T4:%.*]] = and i32 [[T3]], 2 // CHECK-NEXT: [[T5:%.*]] = trunc i32 [[T4]] to i8 -// CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES +// CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES // CHECK-NEXT: [[T6:%.*]] = bitcast [[TEST7]]* [[T0]] to i8* // CHECK-NEXT: call void bitcast -// CHECK-NEXT: [[T0:%.*]] = load [[TEST7]]** [[T]], align -// CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES +// CHECK-NEXT: [[T0:%.*]] = load [[TEST7]]*, [[TEST7]]** [[T]], align +// CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST7]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call zeroext i8 bitcast // CHECK-NEXT: [[T3:%.*]] = zext i8 [[T2]] to i32 // CHECK-NEXT: [[T4:%.*]] = or i32 [[T3]], 5 // CHECK-NEXT: [[T5:%.*]] = trunc i32 [[T4]] to i8 -// CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES +// CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES // CHECK-NEXT: [[T6:%.*]] = bitcast [[TEST7]]* [[T0]] to i8* // CHECK-NEXT: call void bitcast -// CHECK-NEXT: [[T0:%.*]] = load [[TEST7]]** [[T]], align -// CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES +// CHECK-NEXT: [[T0:%.*]] = load [[TEST7]]*, [[TEST7]]** [[T]], align +// CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES // CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST7]]* [[T0]] to i8* // CHECK-NEXT: [[T2:%.*]] = call zeroext i8 bitcast // CHECK-NEXT: [[T3:%.*]] = zext i8 [[T2]] to i32 // CHECK-NEXT: [[T4:%.*]] = xor i32 [[T3]], 8 // CHECK-NEXT: [[T5:%.*]] = trunc i32 [[T4]] to i8 -// CHECK-NEXT: load i8** @OBJC_SELECTOR_REFERENCES +// CHECK-NEXT: load i8*, i8** @OBJC_SELECTOR_REFERENCES // CHECK-NEXT: [[T6:%.*]] = bitcast [[TEST7]]* [[T0]] to i8* // CHECK-NEXT: call void bitcast // CHECK-NEXT: ret void diff --git a/test/CodeGenObjC/selector-ref-invariance.m b/test/CodeGenObjC/selector-ref-invariance.m index 599bc3aa4c97..5758a1cd7ff1 100644 --- a/test/CodeGenObjC/selector-ref-invariance.m +++ b/test/CodeGenObjC/selector-ref-invariance.m @@ -3,7 +3,7 @@ // rdar://6027699 void test(id x) { -// CHECK: load i8** @OBJC_SELECTOR_REFERENCES_, !invariant.load +// CHECK: load i8*, i8** @OBJC_SELECTOR_REFERENCES_, !invariant.load // CHECK: @objc_msgSend [x foo]; } diff --git a/test/CodeGenObjC/stret_lookup.m b/test/CodeGenObjC/stret_lookup.m index 6682fac7aefe..9f1479802025 100644 --- a/test/CodeGenObjC/stret_lookup.m +++ b/test/CodeGenObjC/stret_lookup.m @@ -19,11 +19,11 @@ void test0(void) { } // HASSTRET-LABEL: define void @test0() -// HASSTRET: [[T0:%.*]] = call i8* (i8*, i8*, ...)* (i8*, i8*)* @objc_msg_lookup_stret(i8* bitcast (i64* @_OBJC_CLASS_Test0 to i8*), +// HASSTRET: [[T0:%.*]] = call i8* (i8*, i8*, ...)* @objc_msg_lookup_stret(i8* bitcast (i64* @_OBJC_CLASS_Test0 to i8*), // HASSTRET-NEXT: [[T1:%.*]] = bitcast i8* (i8*, i8*, ...)* [[T0]] to void (%struct.test*, i8*, i8*)* // HASSTRET-NEXT: call void [[T1]](%struct.test* sret {{.*}}, i8* bitcast (i64* @_OBJC_CLASS_Test0 to i8*), // NOSTRET-LABEL: define void @test0() -// NOSTRET: [[T0:%.*]] = call i8* (i8*, i8*, ...)* (i8*, i8*)* @objc_msg_lookup(i8* +// NOSTRET: [[T0:%.*]] = call i8* (i8*, i8*, ...)* @objc_msg_lookup(i8* // NOSTRET-NEXT: [[T1:%.*]] = bitcast i8* (i8*, i8*, ...)* [[T0]] to void (%struct.test*, i8*, i8*)* // NOSTRET-NEXT: call void [[T1]](%struct.test* sret {{.*}}, i8* {{.*}}, i8* bitcast ([2 x { i8*, i8* }]* diff --git a/test/CodeGenObjC/super-message-fragileabi.m b/test/CodeGenObjC/super-message-fragileabi.m index 2c917d7fd6d0..a81921c9273f 100644 --- a/test/CodeGenObjC/super-message-fragileabi.m +++ b/test/CodeGenObjC/super-message-fragileabi.m @@ -24,7 +24,7 @@ { ; } -// CHECK: load %struct._objc_class** getelementptr inbounds (%struct._objc_class* @OBJC_CLASS_BetterTable, i32 0, i32 1) +// CHECK: load %struct._objc_class*, %struct._objc_class** getelementptr inbounds (%struct._objc_class, %struct._objc_class* @OBJC_CLASS_BetterTable, i32 0, i32 1) return self; } diff --git a/test/CodeGenObjC/synchronized.m b/test/CodeGenObjC/synchronized.m index 015e55b8f8af..212d98a6bc81 100644 --- a/test/CodeGenObjC/synchronized.m +++ b/test/CodeGenObjC/synchronized.m @@ -39,7 +39,7 @@ void foo(id a) { // CHECK: unreachable // CHECK: call void @objc_exception_try_exit - // CHECK: [[T:%.*]] = load i8** [[SYNC]] + // CHECK: [[T:%.*]] = load i8*, i8** [[SYNC]] // CHECK-NEXT: call i32 @objc_sync_exit // CHECK: ret void return; @@ -59,7 +59,7 @@ int f0(id a) { @synchronized((x++, a)) { } - // CHECK: [[T:%.*]] = load i32* [[X]] + // CHECK: [[T:%.*]] = load i32, i32* [[X]] // CHECK: ret i32 [[T]] return x; } diff --git a/test/CodeGenObjC/tentative-cfconstantstring.m b/test/CodeGenObjC/tentative-cfconstantstring.m index 2b2601a54f8e..5b3c3bd92494 100644 --- a/test/CodeGenObjC/tentative-cfconstantstring.m +++ b/test/CodeGenObjC/tentative-cfconstantstring.m @@ -32,12 +32,12 @@ static inline void _inlineFunction() { @end // CHECK: @__CFConstantStringClassReference = common global [24 x i32] zeroinitializer, align 16 -// CHECK: @_unnamed_cfstring_{{.*}} = private constant %struct.NSConstantString { i32* getelementptr inbounds ([24 x i32]* @__CFConstantStringClassReference, i32 0, i32 0) +// CHECK: @_unnamed_cfstring_{{.*}} = private constant %struct.NSConstantString { i32* getelementptr inbounds ([24 x i32], [24 x i32]* @__CFConstantStringClassReference, i32 0, i32 0) // CHECK-LABEL: define internal void @_inlineFunction() -// CHECK: [[ZERO:%.*]] = load %struct._class_t** @"OBJC_CLASSLIST_REFERENCES_ -// CHECK-NEXT: [[ONE:%.*]] = load i8** @OBJC_SELECTOR_REFERENCES_ +// CHECK: [[ZERO:%.*]] = load %struct._class_t*, %struct._class_t** @"OBJC_CLASSLIST_REFERENCES_ +// CHECK-NEXT: [[ONE:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_ // CHECK-NEXT: [[TWO:%.*]] = bitcast %struct._class_t* [[ZERO]] to i8* -// CHECK-NEXT: call void (i8*, i8*, [[T:%.*]]*, ...)* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, [[T:%.*]]*, ...)*)(i8* [[TWO]], i8* [[ONE]], [[T:%.*]]* bitcast (%struct.NSConstantString* @_unnamed_cfstring_{{.*}} to [[T:%.*]]*)) +// CHECK-NEXT: call void (i8*, i8*, [[T:%.*]]*, ...) bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, [[T:%.*]]*, ...)*)(i8* [[TWO]], i8* [[ONE]], [[T:%.*]]* bitcast (%struct.NSConstantString* @_unnamed_cfstring_{{.*}} to [[T:%.*]]*)) // CHECK-NEXT: ret void diff --git a/test/CodeGenObjC/variadic-sends.m b/test/CodeGenObjC/variadic-sends.m index 726b497b21b4..3815bb3430c0 100644 --- a/test/CodeGenObjC/variadic-sends.m +++ b/test/CodeGenObjC/variadic-sends.m @@ -20,8 +20,8 @@ void f1(A *a) { } void f2(A *a) { - // CHECK-X86-32: call void (i8*, i8*, i32, ...)* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i32, ...)*) - // CHECK-X86-64: call void (i8*, i8*, i32, ...)* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i32, ...)*) + // CHECK-X86-32: call void (i8*, i8*, i32, ...) bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i32, ...)*) + // CHECK-X86-64: call void (i8*, i8*, i32, ...) bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i32, ...)*) [a im2: 1, 2]; } @@ -33,8 +33,8 @@ void f2(A *a) { [super im1: 1]; } -(void) bar { - // CHECK-X86-32: call void (%struct._objc_super*, i8*, i32, ...)* bitcast (i8* (%struct._objc_super*, i8*, ...)* @objc_msgSendSuper to void (%struct._objc_super*, i8*, i32, ...)*) - // CHECK-X86-64: call void (%struct._objc_super*, i8*, i32, ...)* bitcast (i8* (%struct._objc_super*, i8*, ...)* @objc_msgSendSuper to void (%struct._objc_super*, i8*, i32, ...)*) + // CHECK-X86-32: call void (%struct._objc_super*, i8*, i32, ...) bitcast (i8* (%struct._objc_super*, i8*, ...)* @objc_msgSendSuper to void (%struct._objc_super*, i8*, i32, ...)*) + // CHECK-X86-64: call void (%struct._objc_super*, i8*, i32, ...) bitcast (i8* (%struct._objc_super*, i8*, ...)* @objc_msgSendSuper to void (%struct._objc_super*, i8*, i32, ...)*) [super im2: 1, 2]; } |