| author | |
| committer | |
| log | d892665694bc437898c58631cc632bc93a528e97 |
| tree | 4aec2dd82c6ecb382a6601d8518cad2dc1ea6236 |
| parent | 3ead829de191daa0bb4047aa4dfde3b1902e5cd2 |
| parent | db1825e93159f753207f255ad6709074fece6dc5 |
| signature |
wasm - fix bitcasting between arrays and scalar types4 files changed, 11 insertions(+), 5 deletions(-)
lib/test_runner.zig+1-3| ... | @@ -13,9 +13,7 @@ var cmdline_buffer: [4096]u8 = undefined; | ... | @@ -13,9 +13,7 @@ var cmdline_buffer: [4096]u8 = undefined; |
| 13 | var fba = std.heap.FixedBufferAllocator.init(&cmdline_buffer); | 13 | var fba = std.heap.FixedBufferAllocator.init(&cmdline_buffer); |
| 14 | 14 | ||
| 15 | pub fn main() void { | 15 | pub fn main() void { |
| 16 | if (builtin.zig_backend == .stage2_aarch64 or | 16 | if (builtin.zig_backend == .stage2_aarch64) { |
| 17 | builtin.zig_backend == .stage2_wasm) | ||
| 18 | { | ||
| 19 | return mainSimple() catch @panic("test failure"); | 17 | return mainSimple() catch @panic("test failure"); |
| 20 | } | 18 | } |
| 21 | 19 |
src/arch/wasm/CodeGen.zig+10| ... | @@ -3814,6 +3814,16 @@ fn airBitcast(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -3814,6 +3814,16 @@ fn airBitcast(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 3814 | const bitcast_result = try func.bitcast(wanted_ty, given_ty, operand); | 3814 | const bitcast_result = try func.bitcast(wanted_ty, given_ty, operand); |
| 3815 | break :result try bitcast_result.toLocal(func, wanted_ty); | 3815 | break :result try bitcast_result.toLocal(func, wanted_ty); |
| 3816 | } | 3816 | } |
| 3817 | const mod = func.bin_file.base.options.module.?; | ||
| 3818 | if (isByRef(given_ty, mod) and !isByRef(wanted_ty, mod)) { | ||
| 3819 | const loaded_memory = try func.load(operand, wanted_ty, 0); | ||
| 3820 | break :result try loaded_memory.toLocal(func, wanted_ty); | ||
| 3821 | } | ||
| 3822 | if (!isByRef(given_ty, mod) and isByRef(wanted_ty, mod)) { | ||
| 3823 | const stack_memory = try func.allocStack(wanted_ty); | ||
| 3824 | try func.store(stack_memory, operand, given_ty, 0); | ||
| 3825 | break :result stack_memory; | ||
| 3826 | } | ||
| 3817 | break :result func.reuseOperand(ty_op.operand, operand); | 3827 | break :result func.reuseOperand(ty_op.operand, operand); |
| 3818 | }; | 3828 | }; |
| 3819 | func.finishAir(inst, result, &.{ty_op.operand}); | 3829 | func.finishAir(inst, result, &.{ty_op.operand}); |
test/behavior/bugs/1851.zig-1| ... | @@ -7,7 +7,6 @@ test "allocation and looping over 3-byte integer" { | ... | @@ -7,7 +7,6 @@ test "allocation and looping over 3-byte integer" { |
| 7 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 7 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 9 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 9 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 10 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | ||
| 11 | 10 | ||
| 12 | if (builtin.zig_backend == .stage2_llvm and builtin.os.tag == .macos) { | 11 | if (builtin.zig_backend == .stage2_llvm and builtin.os.tag == .macos) { |
| 13 | return error.SkipZigTest; // TODO | 12 | return error.SkipZigTest; // TODO |
test/behavior/struct.zig-1| ... | @@ -1351,7 +1351,6 @@ test "under-aligned struct field" { | ... | @@ -1351,7 +1351,6 @@ test "under-aligned struct field" { |
| 1351 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1351 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1352 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1352 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1353 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1353 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1354 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | ||
| 1355 | 1354 | ||
| 1356 | const U = extern union { | 1355 | const U = extern union { |
| 1357 | fd: i32, | 1356 | fd: i32, |