Skip to content

Commit 62d5b72

Browse files
committed
[Test] Matched ordering in ptrauth-partial-apply.sil.
In f1d263b, partial apply forwarder emission was tweaked by moving the ptrauth emission for dynamic function pointers prior to the bitcast to enable the emitted ptrauth info to be used in extracting values from the async function pointer. Here, the ptrauth-partial-apply.sil test is updated to reflect that change.
1 parent 84e7ba7 commit 62d5b72

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/IRGen/ptrauth-partial-apply.sil

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ bb0(%0 : $@convention(thin) (Builtin.Int32, Builtin.Int32) -> (), %1 : $Builtin.
3030
// CHECK: [[T0:%.*]] = bitcast %swift.refcounted* %0 to [[CTXT_TY:<{ %swift.refcounted, i32, i32, i8\* }>]]*
3131
// CHECK: [[SLOT:%.*]] = getelementptr inbounds [[CTXT_TY]], [[CTXT_TY]]* [[T0]], i32 0, i32 3
3232
// CHECK: [[T0:%.*]] = load i8*, i8** [[SLOT]], align 8
33+
// CHECK: [[T1:%.*]] = ptrtoint i8** [[SLOT]] to i64
34+
// CHECK: [[DISC:%.*]] = call i64 @llvm.ptrauth.blend.i64(i64 [[T1]], i64 7185)
3335
// CHECK: [[FN:%.*]] = bitcast i8* [[T0]] to void (i32, i32)*
34-
// CHECK: [[T0:%.*]] = ptrtoint i8** [[SLOT]] to i64
35-
// CHECK: [[DISC:%.*]] = call i64 @llvm.ptrauth.blend.i64(i64 [[T0]], i64 7185)
3636
// CHECK: call swiftcc void [[FN]](i32 {{.*}}, i32 {{.*}}) [ "ptrauth"(i32 1, i64 [[DISC]]) ]
3737

3838
sil @test_thick_indirect : $@convention(thin) (@callee_owned (Builtin.Int32, Builtin.Int32) -> (), Builtin.Int32) -> @owned @callee_owned () -> () {
@@ -58,7 +58,7 @@ bb0(%0 : $@callee_owned (Builtin.Int32, Builtin.Int32) -> (), %1 : $Builtin.Int3
5858
// CHECK: [[T0:%.*]] = bitcast %swift.refcounted* %0 to <{ %swift.refcounted, i32, i32, %swift.refcounted*, i8* }>*
5959
// CHECK: [[SLOT:%.*]] = getelementptr inbounds <{ %swift.refcounted, i32, i32, %swift.refcounted*, i8* }>, <{ %swift.refcounted, i32, i32, %swift.refcounted*, i8* }>* [[T0]], i32 0, i32 4
6060
// CHECK: [[T0:%.*]] = load i8*, i8** [[SLOT]], align 8
61+
// CHECK: [[T1:%.*]] = ptrtoint i8** [[SLOT]] to i64
62+
// CHECK: [[DISC:%.*]] = call i64 @llvm.ptrauth.blend.i64(i64 [[T1]], i64 7185)
6163
// CHECK: [[FN:%.*]] = bitcast i8* [[T0]] to void (i32, i32, %swift.refcounted*)*
62-
// CHECK: [[T0:%.*]] = ptrtoint i8** [[SLOT]] to i64
63-
// CHECK: [[DISC:%.*]] = call i64 @llvm.ptrauth.blend.i64(i64 [[T0]], i64 7185)
6464
// CHECK: call swiftcc void [[FN]](i32 {{.*}}, i32 {{.*}}, %swift.refcounted* {{.*}}) [ "ptrauth"(i32 1, i64 [[DISC]]) ]

0 commit comments

Comments
 (0)