Skip to content

Commit 817153a

Browse files
test: guard part of stdlib/StaticBigInt.swift for 32-bit at compile-time
1 parent 9aed128 commit 817153a

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

test/stdlib/StaticBigInt.swift

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -154,37 +154,37 @@ extension StaticBigIntTests {
154154
let negative = Wrapper(-0x00112233_44556677_8899AABB_CCDDEEFF)
155155
expectEqual( -1, negative.actual.signum())
156156
expectEqual(118, negative.actual.bitWidth)
157-
if getInt(UInt.bitWidth) == 32 {
158-
expectEqual(0x33221101, negative.actual[0])
159-
expectEqual(0x77665544, negative.actual[1])
160-
expectEqual(0xBBAA9988, negative.actual[2])
161-
expectEqual(0xFFEEDDCC, negative.actual[3])
162-
expectEqual(0xFFFFFFFF, negative.actual[4])
163-
expectEqual(0xFFFFFFFF, negative.actual[.max])
164-
} else if getInt(UInt.bitWidth) == 64 {
165-
expectEqual(0x77665544_33221101, negative.actual[0])
166-
expectEqual(0xFFEEDDCC_BBAA9988, negative.actual[1])
167-
expectEqual(0xFFFFFFFF_FFFFFFFF, negative.actual[2])
168-
expectEqual(0xFFFFFFFF_FFFFFFFF, negative.actual[.max])
169-
}
157+
#if arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32)
158+
expectEqual(0x33221101, negative.actual[0])
159+
expectEqual(0x77665544, negative.actual[1])
160+
expectEqual(0xBBAA9988, negative.actual[2])
161+
expectEqual(0xFFEEDDCC, negative.actual[3])
162+
expectEqual(0xFFFFFFFF, negative.actual[4])
163+
expectEqual(0xFFFFFFFF, negative.actual[.max])
164+
#else
165+
expectEqual(0x77665544_33221101, negative.actual[0])
166+
expectEqual(0xFFEEDDCC_BBAA9988, negative.actual[1])
167+
expectEqual(0xFFFFFFFF_FFFFFFFF, negative.actual[2])
168+
expectEqual(0xFFFFFFFF_FFFFFFFF, negative.actual[.max])
169+
#endif
170170
}
171171
do {
172172
let positive = Wrapper(0x00112233_44556677_8899AABB_CCDDEEFF)
173173
expectEqual( +1, positive.actual.signum())
174174
expectEqual(118, positive.actual.bitWidth)
175-
if getInt(UInt.bitWidth) == 32 {
176-
expectEqual(0xCCDDEEFF, positive.actual[0])
177-
expectEqual(0x8899AABB, positive.actual[1])
178-
expectEqual(0x44556677, positive.actual[2])
179-
expectEqual(0x00112233, positive.actual[3])
180-
expectEqual(0x00000000, positive.actual[4])
181-
expectEqual(0x00000000, positive.actual[.max])
182-
} else if getInt(UInt.bitWidth) == 64 {
183-
expectEqual(0x8899AABB_CCDDEEFF, positive.actual[0])
184-
expectEqual(0x00112233_44556677, positive.actual[1])
185-
expectEqual(0x00000000_00000000, positive.actual[2])
186-
expectEqual(0x00000000_00000000, positive.actual[.max])
187-
}
175+
#if arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32)
176+
expectEqual(0xCCDDEEFF, positive.actual[0])
177+
expectEqual(0x8899AABB, positive.actual[1])
178+
expectEqual(0x44556677, positive.actual[2])
179+
expectEqual(0x00112233, positive.actual[3])
180+
expectEqual(0x00000000, positive.actual[4])
181+
expectEqual(0x00000000, positive.actual[.max])
182+
#else
183+
expectEqual(0x8899AABB_CCDDEEFF, positive.actual[0])
184+
expectEqual(0x00112233_44556677, positive.actual[1])
185+
expectEqual(0x00000000_00000000, positive.actual[2])
186+
expectEqual(0x00000000_00000000, positive.actual[.max])
187+
#endif
188188
}
189189
if getInt(UInt.bitWidth) == 64 {
190190
let fibonacciSequence = Wrapper(

0 commit comments

Comments
 (0)