Skip to content

Commit 886312d

Browse files
committed
[Test] Fix IRGen/abi_v7k.swift
rdar://155863017 The way enum tag bits are represented in the compiler has changed, which also caused the emitted code to slightly change.
1 parent 83d7dbb commit 886312d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/IRGen/abi_v7k.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func testData(x: DataCase) -> Double {
9898
// CHECK: [[ID:%[0-9]+]] = phi i32 [ 2, {{.*}} ], [ 1, {{.*}} ]
9999
// CHECK: ret i32 [[ID]]
100100
// V7K-LABEL: _$s8test_v7k0A6Clike2
101-
// V7K: tst.w r0, #1
101+
// V7K: cmp r0, #1
102102
// V7K: movs r0, #1
103103
// V7K: movs r0, #2
104104
enum CLike2 {
@@ -155,7 +155,8 @@ func testClike8(t: Int, x: CLike8) -> Int {
155155
// CHECK: bitcast i64 [[RESULT]] to double
156156
// CHECK: phi double [ 0.000000e+00, {{.*}} ]
157157
// V7K-LABEL: _$s8test_v7k0A7SingleP
158-
// V7K: tst.w r2, #1
158+
// V7K: sxtb [[R0:r[0-9]+]], r2
159+
// V7K: cmp [[R0]], #1
159160
// V7K: vldr d0, [{{.*}}]
160161
enum SinglePayload {
161162
case Paragraph
@@ -212,13 +213,14 @@ func testMultiP(x: MultiPayload) -> Double {
212213

213214
// CHECK-LABEL: define hidden swiftcc float @"$s8test_v7k0A3Opt{{.*}}"(i32 %0, i8 %1)
214215
// CHECK: entry:
215-
// CHECK: [[TR:%.*]] = trunc i8 %1
216+
// CHECK: [[TR:%.*]] = icmp eq i8 %1, 1
216217
// CHECK: br i1 [[TR]], {{.*}}, label %[[PAYLOADLABEL:.*]]
217218
// CHECK: [[PAYLOADLABEL]]:
218219
// CHECK: [[ID:%[0-9]+]] = bitcast i32 %0 to float
219220
// CHECK: ret float
220221
// V7K-LABEL: _$s8test_v7k0A3Opt
221-
// V7K: tst.w r1, #1
222+
// V7K: sxtb [[R0:r[0-9]+]], r1
223+
// V7K: cmp [[R0]], #1
222224
// V7K: vmov s0, r0
223225
// V7K: vstr s0, [sp, [[SLOT:#[0-9]+]]
224226
// V7K: vldr s0, [sp, [[SLOT]]
@@ -308,7 +310,6 @@ func testRet3() -> MyRect2 {
308310
// V7K: str.w {{.*}}, [{{.*}}[[R0_RELOAD]], #12]
309311
// V7K: str {{.*}}, [{{.*}}[[R0_RELOAD]], #16]
310312
// V7K: str {{.*}}, [{{.*}}[[R0_RELOAD]], #20]
311-
// V7K: and {{.*}}, {{.*}}, #1
312313
// V7K: strb {{.*}}, [{{.*}}[[R0_RELOAD]], #24]
313314
func minMax2(x : Int, y : Int) -> (min: Int, max: Int, min2: Int, max2: Int, min3: Int, max3: Int)? {
314315
if x == y {

0 commit comments

Comments
 (0)