@@ -326,6 +326,7 @@ FloatingPoint.test("Float/Int16") {
326
326
expectEqual(Int16.max, Int16(Float(Int16.max)))
327
327
}
328
328
329
+ #if !os(WASI)
329
330
FloatingPoint.test("Float/UInt32") {
330
331
expectEqual(UInt32.min, UInt32(Float(UInt32.min)))
331
332
expectCrashLater()
@@ -349,6 +350,7 @@ FloatingPoint.test("Float/Int64") {
349
350
expectCrashLater()
350
351
expectEqual(Int64.max, Int64(Float(Int64.max)))
351
352
}
353
+ #endif
352
354
353
355
FloatingPoint.test("Double/ExpressibleByIntegerLiteral") {
354
356
expectEqual(positiveOne(), 1.0 as Double)
@@ -414,6 +416,7 @@ FloatingPoint.test("Double/Int32") {
414
416
expectEqual(Int32.max, Int32(Double(Int32.max)))
415
417
}
416
418
419
+ #if !os(WASI)
417
420
FloatingPoint.test("Double/UInt64") {
418
421
expectEqual(UInt64.min, UInt64(Double(UInt64.min)))
419
422
expectCrashLater()
@@ -425,6 +428,7 @@ FloatingPoint.test("Double/Int64") {
425
428
expectCrashLater()
426
429
expectEqual(Int64.max, Int64(Double(Int64.max)))
427
430
}
431
+ #endif
428
432
429
433
FloatingPoint.test("Float/HashValueZero") {
430
434
let zero: Float = getFloat32(0.0)
@@ -1170,11 +1174,14 @@ FloatingPoint.test("Float32/quietNaN") {
1170
1174
expectTrue(f.isNaN && !f.isSignalingNaN)
1171
1175
expectEqual(0x7fdf_ffff, f.bitPattern)
1172
1176
}
1177
+
1178
+ #if !os(WASI)
1173
1179
do {
1174
1180
// Payload overflow
1175
1181
expectCrashLater()
1176
1182
_ = Float32(nan: 0x20_0000, signaling: false)
1177
1183
}
1184
+ #endif
1178
1185
}
1179
1186
1180
1187
FloatingPoint.test("Float64/quietNaN") {
@@ -1199,11 +1206,13 @@ FloatingPoint.test("Float64/quietNaN") {
1199
1206
expectTrue(f.isNaN && !f.isSignalingNaN)
1200
1207
expectEqual(0x7ffb_ffff_ffff_ffff, f.bitPattern)
1201
1208
}
1209
+ #if !os(WASI)
1202
1210
do {
1203
1211
// Payload overflow
1204
1212
expectCrashLater()
1205
1213
_ = Float64(nan: 0x4_0000_0000_0000, signaling: false)
1206
1214
}
1215
+ #endif
1207
1216
}
1208
1217
1209
1218
#if !os(Windows) && (arch(i386) || arch(x86_64))
@@ -1230,11 +1239,13 @@ FloatingPoint.test("Float80/quietNaN") {
1230
1239
expectTrue(f.isNaN && !f.isSignalingNaN)
1231
1240
expectEqual(Float80Bits(0x7fff, 0xdfff_ffff_ffff_ffff), f.bitPattern)
1232
1241
}
1242
+ #if !os(WASI)
1233
1243
do {
1234
1244
// Payload overflow
1235
1245
expectCrashLater()
1236
1246
_ = Float80(nan: 0x2000_0000_0000_0000, signaling: false)
1237
1247
}
1248
+ #endif
1238
1249
}
1239
1250
1240
1251
#endif
@@ -1263,11 +1274,13 @@ FloatingPoint.test("Float32/signalingNaN") {
1263
1274
expectTrue(f.isNaN && f.isSignalingNaN)
1264
1275
expectEqual(0x7fbf_ffff, f.bitPattern)
1265
1276
}
1277
+ #if !os(WASI)
1266
1278
do {
1267
1279
// payload overflow
1268
1280
expectCrashLater()
1269
1281
_ = Float32(nan: 0x20_0000, signaling: true)
1270
1282
}
1283
+ #endif
1271
1284
}
1272
1285
1273
1286
FloatingPoint.test("Float64/signalingNaN") {
@@ -1292,11 +1305,13 @@ FloatingPoint.test("Float64/signalingNaN") {
1292
1305
expectTrue(f.isNaN && f.isSignalingNaN)
1293
1306
expectEqual(0x7ff7_ffff_ffff_ffff, f.bitPattern)
1294
1307
}
1308
+ #if !os(WASI)
1295
1309
do {
1296
1310
// payload overflow
1297
1311
expectCrashLater()
1298
1312
_ = Float64(nan: 0x4_0000_0000_0000, signaling: true)
1299
1313
}
1314
+ #endif
1300
1315
}
1301
1316
1302
1317
#endif
@@ -1325,11 +1340,13 @@ FloatingPoint.test("Float80/signalingNaN") {
1325
1340
expectTrue(f.isNaN && f.isSignalingNaN)
1326
1341
expectEqual(Float80Bits(0x7fff, 0xbfff_ffff_ffff_ffff), f.bitPattern)
1327
1342
}
1343
+ #if !os(WASI)
1328
1344
do {
1329
1345
// payload overflow
1330
1346
expectCrashLater()
1331
1347
_ = Float80(nan: 0x2000_0000_0000_0000, signaling: true)
1332
1348
}
1349
+ #endif
1333
1350
}
1334
1351
1335
1352
#endif
0 commit comments