Skip to content

Commit 28be34b

Browse files
committed
This test now optimizes the partial_apply
1 parent 99664ef commit 28be34b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/IRGen/ptrauth-objc-partial-apply.sil

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// REQUIRES: CPU=arm64e
55
// REQUIRES: OS=ios
66

7-
// CHECK: @"$sTa.ptrauth" = private constant { i8*, i32, i64, i64 } { i8* bitcast (void (%swift.refcounted*)* @"$sTa" to i8*), i32 0, i64 0, i64 {{.*}} }, section "llvm.ptrauth"
87

98
@objc class A {
109
@objc func foo() {}
@@ -21,9 +20,11 @@ bb0(%0 : $A):
2120
unreachable
2221
}
2322

24-
// It would also be reasonable to not apply ptrauth here, but as long as we're partial_apply
23+
// The partial apply was optimized.
2524
// CHECK-LABEL: define swiftcc void @test0(
26-
// CHECK: call swiftcc void bitcast ({ i8*, i32, i64, i64 }* @"$sTa.ptrauth" to void (%swift.refcounted*)*)(%swift.refcounted* swiftself {{%.*}}) [ "ptrauth"(i32 0, i64 {{.*}}) ]
25+
// CHECK: %1 = load i8*, i8** @"\01L_selector(foo)"
26+
// CHECK: %2 = bitcast %T4test1AC* %0
27+
// CHECK: call void bitcast (void ()* @objc_msgSend to void (%0*, i8*)*)(%0* %2, i8* %1)
2728
sil @test0 : $@convention(thin) (@guaranteed A) -> () {
2829
bb0(%0: $A):
2930
%method = objc_method %0 : $A, #A.foo!foreign, $@convention(objc_method) (A) -> ()

0 commit comments

Comments
 (0)