1
- // RUN: %target-swift-frontend %use_no_opaque_pointers -emit-ir %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-cpu
2
- // RUN: %target-swift-frontend -emit-ir %s
1
+ // RUN: %target-swift-frontend -emit-ir %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-cpu
3
2
4
3
sil_stage canonical
5
4
@@ -15,9 +14,9 @@ struct SingleRefcounted {
15
14
16
15
// CHECK-LABEL: define {{.*}} @escape_partial_apply_swift_class
17
16
// CHECK-arm64e: call i64 @llvm.ptrauth.resign
18
- // CHECK: [[FPTR:%.*]] = insertvalue { i8*, %swift.refcounted* } undef, i8* {{.*}}, 0
19
- // CHECK-NEXT: [[FCTX:%.*]] = insertvalue { i8*, %swift.refcounted* } [[FPTR]], %swift.refcounted* {{.*}}, 1
20
- // CHECK-NEXT: ret { i8*, %swift.refcounted* } [[FCTX]]
17
+ // CHECK: [[FPTR:%.*]] = insertvalue { ptr, ptr } undef, ptr {{.*}}, 0
18
+ // CHECK-NEXT: [[FCTX:%.*]] = insertvalue { ptr, ptr } [[FPTR]], ptr {{.*}}, 1
19
+ // CHECK-NEXT: ret { ptr, ptr } [[FCTX]]
21
20
sil @escape_partial_apply_swift_class : $@convention(thin) (@convention(method) (Int, @guaranteed C) -> Int, @guaranteed C) -> @callee_guaranteed (Int) -> Int {
22
21
entry(%body : $@convention(method) (Int, @guaranteed C) -> Int, %context : $C):
23
22
%closure = partial_apply [callee_guaranteed] %body(%context) : $@convention(method) (Int, @guaranteed C) -> Int
@@ -28,19 +27,16 @@ entry(%body : $@convention(method) (Int, @guaranteed C) -> Int, %context : $C):
28
27
29
28
// CHECK-LABEL: define {{.*}} @escape_partial_apply_swift_single_refcount_struct
30
29
// CHECK: [[CTXT:%.*]] = call {{.*}} @swift_allocObject
31
- // CHECK: [[FCTX:%.*]] = insertvalue { i8*, %swift.refcounted* } { i8* bitcast ({{.*}}* @"$sTA{{.*}}" to i8*), %swift.refcounted* undef }, %swift.refcounted* [[CTXT]], 1
32
- // CHECK-NEXT: ret { i8*, %swift.refcounted* } [[FCTX]]
30
+ // CHECK: [[FCTX:%.*]] = insertvalue { ptr, ptr } { ptr @"$sTA{{.*}}", ptr undef }, ptr [[CTXT]], 1
31
+ // CHECK-NEXT: ret { ptr, ptr } [[FCTX]]
33
32
sil @escape_partial_apply_swift_single_refcount_struct : $@convention(thin) (@convention(method) (Int, @guaranteed SingleRefcounted) -> Int, @guaranteed SingleRefcounted) -> @callee_guaranteed (Int) -> Int {
34
33
entry(%body : $@convention(method) (Int, @guaranteed SingleRefcounted) -> Int, %context : $SingleRefcounted):
35
34
%closure = partial_apply [callee_guaranteed] %body(%context) : $@convention(method) (Int, @guaranteed SingleRefcounted) -> Int
36
35
return %closure : $@callee_guaranteed (Int) -> Int
37
36
}
38
37
39
38
// CHECK-LABEL: define {{.*}} @noescape_partial_apply_swift_indirect
40
- // CHECK-arm64e: call i64 @llvm.ptrauth.resign
41
- // CHECK: [[CTX:%.*]] = bitcast {{.*}}** %1 to %swift.opaque*
42
- // CHECK-NEXT: [[CONT:%.*]] = bitcast i8* %2
43
- // CHECK-NEXT: call {{.*}}void [[CONT]](i8* {{.*}}, %swift.opaque* [[CTX]], %swift.refcounted* {{.*}}%3)
39
+ // CHECK: call {{.*}}void %2(ptr {{.*}}, ptr %1, ptr {{.*}}%3)
44
40
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) -> ()) -> () {
45
41
entry(%body : $@convention(method) (Int, @in_guaranteed C) -> Int, %context : $*C, %cont : $@callee_guaranteed (@noescape @callee_guaranteed (Int) -> Int) -> ()):
46
42
%closure = partial_apply [callee_guaranteed] [on_stack] %body(%context) : $@convention(method) (Int, @in_guaranteed C) -> Int
@@ -51,7 +47,7 @@ entry(%body : $@convention(method) (Int, @in_guaranteed C) -> Int, %context : $*
51
47
52
48
// Can't reuse the method because it does not have swiftself.
53
49
// CHECK-LABEL: define {{.*}} @noescape_partial_apply_swift_direct_word
54
- // CHECK: call swiftcc void {{.*}}(i8* bitcast ({{.*}}* @"$sTA{{.*}}" to i8*), %swift.opaque* {{.*}}, %swift.refcounted* swiftself {{.*}})
50
+ // CHECK: call swiftcc void {{.*}}(ptr @"$sTA{{.*}}", ptr {{.*}}, ptr swiftself {{.*}})
55
51
sil @noescape_partial_apply_swift_direct_word : $@convention(thin) (@convention(method) (Int, Int) -> Int, Int, @guaranteed @callee_guaranteed (@noescape @callee_guaranteed (Int) -> Int) -> ()) -> () {
56
52
entry(%body : $@convention(method) (Int, Int) -> Int, %context : $Int, %cont : $@callee_guaranteed (@noescape @callee_guaranteed (Int) -> Int) -> ()):
57
53
%closure = partial_apply [callee_guaranteed] [on_stack] %body(%context) : $@convention(method) (Int, Int) -> Int
0 commit comments