| ... | @@ -6,8 +6,18 @@ const maxInt = std.math.maxInt; | ... | @@ -6,8 +6,18 @@ const maxInt = std.math.maxInt; |
| 6 | const minInt = std.math.minInt; | 6 | const minInt = std.math.minInt; |
| 7 | const native_endian = builtin.target.cpu.arch.endian(); | 7 | const native_endian = builtin.target.cpu.arch.endian(); |
| 8 | | 8 | |
| 9 | test "@bitCast iX -> uX" { | 9 | test "@bitCast iX -> uX (32, 64)" { |
| 10 | const bit_values = [_]usize{ 8, 16, 32, 64 }; | 10 | const bit_values = [_]usize{ 32, 64 }; |
| | 11 | |
| | 12 | inline for (bit_values) |bits| { |
| | 13 | try testBitCast(bits); |
| | 14 | comptime try testBitCast(bits); |
| | 15 | } |
| | 16 | } |
| | 17 | |
| | 18 | test "@bitCast iX -> uX (8, 16, 128)" { |
| | 19 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| | 20 | const bit_values = [_]usize{ 8, 16, 128 }; |
| 11 | | 21 | |
| 12 | inline for (bit_values) |bits| { | 22 | inline for (bit_values) |bits| { |
| 13 | try testBitCast(bits); | 23 | try testBitCast(bits); |