1
- // RUN: %target-swift-frontend -emit-ir %s | %FileCheck %s
1
+ // RUN: %target-swift-frontend -emit-ir %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-cpu
2
2
3
3
sil_stage canonical
4
4
@@ -13,7 +13,8 @@ struct SingleRefcounted {
13
13
}
14
14
15
15
// CHECK-LABEL: define {{.*}} @escape_partial_apply_swift_class
16
- // CHECK: [[FPTR:%.*]] = insertvalue { i8*, %swift.refcounted* } undef, i8* %0, 0
16
+ // CHECK-arm64e: call i64 @llvm.ptrauth.resign.i64
17
+ // CHECK: [[FPTR:%.*]] = insertvalue { i8*, %swift.refcounted* } undef, i8* {{.*}}, 0
17
18
// CHECK-NEXT: [[FCTX:%.*]] = insertvalue { i8*, %swift.refcounted* } [[FPTR]], %swift.refcounted* {{.*}}, 1
18
19
// CHECK-NEXT: ret { i8*, %swift.refcounted* } [[FCTX]]
19
20
sil @escape_partial_apply_swift_class : $@convention(thin) (@convention(method) (Int, @guaranteed C) -> Int, @guaranteed C) -> @callee_guaranteed (Int) -> Int {
@@ -23,7 +24,8 @@ entry(%body : $@convention(method) (Int, @guaranteed C) -> Int, %context : $C):
23
24
}
24
25
25
26
// CHECK-LABEL: define {{.*}} @escape_partial_apply_swift_single_refcount_struct
26
- // CHECK: [[FPTR:%.*]] = insertvalue { i8*, %swift.refcounted* } undef, i8* %0, 0
27
+ // CHECK-arm64e: call i64 @llvm.ptrauth.resign.i64
28
+ // CHECK: [[FPTR:%.*]] = insertvalue { i8*, %swift.refcounted* } undef, i8* {{.*}}, 0
27
29
// CHECK-NEXT: [[FCTX:%.*]] = insertvalue { i8*, %swift.refcounted* } [[FPTR]], %swift.refcounted* {{.*}}, 1
28
30
// CHECK-NEXT: ret { i8*, %swift.refcounted* } [[FCTX]]
29
31
sil @escape_partial_apply_swift_single_refcount_struct : $@convention(thin) (@convention(method) (Int, @guaranteed SingleRefcounted) -> Int, @guaranteed SingleRefcounted) -> @callee_guaranteed (Int) -> Int {
@@ -33,9 +35,10 @@ entry(%body : $@convention(method) (Int, @guaranteed SingleRefcounted) -> Int, %
33
35
}
34
36
35
37
// CHECK-LABEL: define {{.*}} @noescape_partial_apply_swift_indirect
38
+ // CHECK-arm64e: call i64 @llvm.ptrauth.resign.i64
36
39
// CHECK: [[CTX:%.*]] = bitcast {{.*}}** %1 to %swift.opaque*
37
40
// CHECK-NEXT: [[CONT:%.*]] = bitcast i8* %2
38
- // CHECK-NEXT: call {{.*}}void [[CONT]](i8* %0 , %swift.opaque* [[CTX]], %swift.refcounted* {{.*}}%3)
41
+ // CHECK-NEXT: call {{.*}}void [[CONT]](i8* {{.*}} , %swift.opaque* [[CTX]], %swift.refcounted* {{.*}}%3)
39
42
sil @noescape_partial_apply_swift_indirect : $@convention(thin) (@convention(method) (Int, @in_guaranteed C) -> Int, @in_guaranteed C, @guaranteed @callee_guaranteed (@noescape @callee_guaranteed (Int) -> Int) -> ()) -> () {
40
43
entry(%body : $@convention(method) (Int, @in_guaranteed C) -> Int, %context : $*C, %cont : $@callee_guaranteed (@noescape @callee_guaranteed (Int) -> Int) -> ()):
41
44
%closure = partial_apply [callee_guaranteed] [on_stack] %body(%context) : $@convention(method) (Int, @in_guaranteed C) -> Int
@@ -45,9 +48,10 @@ entry(%body : $@convention(method) (Int, @in_guaranteed C) -> Int, %context : $*
45
48
}
46
49
47
50
// CHECK-LABEL: define {{.*}} @noescape_partial_apply_swift_direct_word
51
+ // CHECK-arm64e: call i64 @llvm.ptrauth.resign.i64
48
52
// CHECK: [[CTX:%.*]] = inttoptr i{{.*}} %1 to %swift.opaque*
49
53
// CHECK-NEXT: [[CONT:%.*]] = bitcast i8* %2
50
- // CHECK-NEXT: call {{.*}}void [[CONT]](i8* %0 , %swift.opaque* [[CTX]], %swift.refcounted* {{.*}}%3)
54
+ // CHECK-NEXT: call {{.*}}void [[CONT]](i8* {{.*}} , %swift.opaque* [[CTX]], %swift.refcounted* {{.*}}%3)
51
55
sil @noescape_partial_apply_swift_direct_word : $@convention(thin) (@convention(method) (Int, Int) -> Int, Int, @guaranteed @callee_guaranteed (@noescape @callee_guaranteed (Int) -> Int) -> ()) -> () {
52
56
entry(%body : $@convention(method) (Int, Int) -> Int, %context : $Int, %cont : $@callee_guaranteed (@noescape @callee_guaranteed (Int) -> Int) -> ()):
53
57
%closure = partial_apply [callee_guaranteed] [on_stack] %body(%context) : $@convention(method) (Int, Int) -> Int
0 commit comments