Skip to content

Commit b37c2d5

Browse files
committed
Fixed some tests
The IRGen test had wrong offsets for inline String element on tuples kp on 32-bit platforms The stdlib test had hardcoded offsets (assumed 64-bit host) for tuple kp elements (Memorylayout)
1 parent e7eb743 commit b37c2d5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

test/IRGen/keypaths.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,11 @@ sil_vtable C2 {}
212212
// -- instantiable in-line, size 12
213213
// CHECK-SAME: <i32 0x8000_000c>,
214214
// -- offset of T.b
215-
// CHECK-32-SAME: <i32 0x0100_000c>,
215+
// CHECK-32-SAME: <i32 0x0100_0010>,
216216
// CHECK-64-SAME: <i32 0x0100_0018>,
217217
// CHECK: @"symbolic
218218
// -- tuple element #1 of T.b
219-
// CHECK-32-SAME: <i32 0x0180_0008> }>
219+
// CHECK-32-SAME: <i32 0x0180_000c> }>
220220
// CHECK-64-SAME: <i32 0x0180_0010> }>
221221

222222
// -- %i: Gen<A>.x

test/stdlib/KeyPath.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -752,13 +752,13 @@ keyPath.test("offsets") {
752752
expectEqual(TPLayout.offset(of: \TupleProperties.self), 0)
753753
expectEqual(TPLayout.offset(of: \TupleProperties.a), 0)
754754
expectEqual(TPLayout.offset(of: \TupleProperties.a.0), 0)
755-
expectEqual(TPLayout.offset(of: \TupleProperties.a.1), 8)
756-
expectEqual(TPLayout.offset(of: \TupleProperties.b), 24)
757-
expectEqual(TPLayout.offset(of: \TupleProperties.b.x), 24)
758-
expectEqual(TPLayout.offset(of: \TupleProperties.b.y), 40)
759-
expectEqual(TPLayout.offset(of: \TupleProperties.c), 48)
760-
expectEqual(TPLayout.offset(of: \TupleProperties.c.m), 48)
761-
expectEqual(TPLayout.offset(of: \TupleProperties.c.n), 56)
755+
expectEqual(TPLayout.offset(of: \TupleProperties.a.1), MemoryLayout<Int>.size)
756+
expectEqual(TPLayout.offset(of: \TupleProperties.b), MemoryLayout<(Int, String)>.size)
757+
expectEqual(TPLayout.offset(of: \TupleProperties.b.x), MemoryLayout<(Int, String)>.size)
758+
expectEqual(TPLayout.offset(of: \TupleProperties.b.y), MemoryLayout<(Int, String, String)>.size)
759+
expectEqual(TPLayout.offset(of: \TupleProperties.c), MemoryLayout<(Int, String, String, Int)>.size)
760+
expectEqual(TPLayout.offset(of: \TupleProperties.c.m), MemoryLayout<(Int, String, String, Int)>.size)
761+
expectEqual(TPLayout.offset(of: \TupleProperties.c.n), MemoryLayout<(Int, String, String, Int, C<Int>)>.size)
762762

763763
let TLayout = MemoryLayout<Tuple<Int, Int>>.self
764764
expectEqual(TLayout.offset(of: \Tuple<Int, Int>.self), 0)

0 commit comments

Comments
 (0)