Skip to content

Commit 8349b41

Browse files
Merge pull request #74826 from nate-chandler/cherrypick/release/6.0/rdar130761556
6.0: [Test] Loosen checks for arm64e.
2 parents 6dea6b7 + 0aaa36c commit 8349b41

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

test/IRGen/moveonly_value_functions.sil

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,36 @@ import Swift
1414
@_alwaysEmitIntoClient @inlinable deinit
1515
}
1616

17-
sil @$sSp12deinitialize5countSvSi_tF : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer
17+
struct Int {
18+
var _value: Builtin.Int64
19+
}
20+
sil @deinit_count : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (moveonly_value_functions.Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer
1821

1922
// CHECK-LABEL: define{{.*}} @"$s15Synchronization5_CellVAARi_zrlEfD"(
2023
// CHECK-SAME: ptr %"_Cell<Value>",
2124
// CHECK-SAME: ptr noalias swiftself [[SOURCE:%[0-9]+]]
2225
// CHECK-SAME: )
2326
// CHECK-SAME: {
2427
// CHECK: entry:
25-
// CHECK: [[CELL_VWT_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %"_Cell<Value>", i64 -1
28+
// CHECK: [[CELL_VWT_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %"_Cell<Value>", [[INT]] -1
2629
// CHECK: %"_Cell<Value>.valueWitnesses" = load ptr, ptr [[CELL_VWT_ADDR]]
27-
// CHECK: [[CELL_SIZE_ADDR:%[^,]+]] = getelementptr inbounds %swift.vwtable, ptr %"_Cell<Value>.valueWitnesses", i32 0, i32 8
28-
// CHECK: %size = load i64, ptr [[CELL_SIZE_ADDR]]
29-
// CHECK: [[DEST:%[^,]+]] = alloca i8, i64 %size
30+
// CHECK: [[CELL_SIZE_ADDR:%[^,]+]] = getelementptr inbounds %swift.vwtable
31+
// : ptr %"_Cell<Value>.valueWitnesses",
32+
// CHECK-SAME: i32 0
33+
// CHECK-SAME: i32 8
34+
// CHECK: %size = load [[INT]], ptr [[CELL_SIZE_ADDR]]
35+
// CHECK: [[DEST:%[^,]+]] = alloca i8, [[INT]] %size
3036
// CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr [[DEST]])
31-
// CHECK: [[VALUE_METADATA_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %"_Cell<Value>", i64 2
37+
// CHECK: [[VALUE_METADATA_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %"_Cell<Value>", [[INT]] 2
3238
// CHECK: %Value = load ptr, ptr [[VALUE_METADATA_ADDR]]
33-
// CHECK: [[VALUE_VWT_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %Value, i64 -1
39+
// CHECK: [[VALUE_VWT_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %Value, [[INT]] -1
3440
// CHECK: %Value.valueWitnesses = load ptr, ptr [[VALUE_VWT_ADDR]]
35-
// CHECK: [[VALUE_INIT_WITH_TAKE_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %Value.valueWitnesses, i32 4
41+
// CHECK: [[VALUE_INIT_WITH_TAKE_ADDR:%[^,]+]] = getelementptr inbounds ptr
42+
// : ptr %Value.valueWitnesses
43+
// CHECK-SAME: i32 4
3644
// CHECK: %InitializeWithTake = load ptr, ptr [[VALUE_INIT_WITH_TAKE_ADDR]]
3745
// CHECK: call ptr %InitializeWithTake(ptr noalias [[DEST]], ptr noalias [[SOURCE]], ptr %Value)
38-
// CHECK: call swiftcc ptr @"$sSp12deinitialize5countSvSi_tF"(i64 1, ptr [[DEST]], ptr %Value)
46+
// CHECK: call swiftcc ptr @deinit_count(i64 1, ptr [[DEST]], ptr %Value)
3947
// CHECK: call void @llvm.lifetime.end.p0(i64 -1, ptr [[DEST]])
4048
// CHECK: }
4149
sil @$s15Synchronization5_CellVAARi_zrlEfD : $@convention(method) <Value where Value : ~Copyable> (@in _Cell<Value>) -> () {
@@ -46,8 +54,8 @@ bb0(%0 : $*_Cell<Value>):
4654
%8 = struct $UnsafeMutablePointer<Value> (%7 : $Builtin.RawPointer)
4755
%9 = integer_literal $Builtin.Int64, 1
4856
%10 = struct $Int (%9 : $Builtin.Int64)
49-
%11 = function_ref @$sSp12deinitialize5countSvSi_tF : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer
50-
%12 = apply %11<Value>(%10, %8) : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer
57+
%11 = function_ref @deinit_count : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (moveonly_value_functions.Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer
58+
%12 = apply %11<Value>(%10, %8) : $@convention(method) <τ_0_0 where τ_0_0 : ~Copyable> (moveonly_value_functions.Int, UnsafeMutablePointer<τ_0_0>) -> UnsafeMutableRawPointer
5159
%13 = tuple ()
5260
dealloc_stack %1 : $*_Cell<Value>
5361
return %13 : $()

0 commit comments

Comments
 (0)