| author | |
| committer | |
| log | 47ff57ed7ddbf4c4a0f93208fc96851c9033b8b7 |
| tree | 9b9b34a7deb95bccf2f9a886e29d21642cf1160c |
| parent | 1f64432196e51785fe1dba442a0878c1b10f8b06 |
3 files changed, 5 insertions(+), 7 deletions(-)
src/arch/wasm/CodeGen.zig+5-2| ... | ... | @@ -3880,8 +3880,11 @@ fn isNull(func: *CodeGen, operand: WValue, optional_ty: Type, opcode: wasm.Opcod |
| 3880 | 3880 | try func.addMemArg(.i32_load8_u, .{ .offset = operand.offset(), .alignment = 1 }); |
| 3881 | 3881 | } |
| 3882 | 3882 | } else if (payload_ty.isSlice()) { |
| 3883 | // move the ptr on top of the stack | |
| 3884 | _ = try func.load(operand, Type.usize, 0); | |
| 3883 | switch (func.arch()) { | |
| 3884 | .wasm32 => try func.addMemArg(.i32_load, .{ .offset = operand.offset(), .alignment = 4 }), | |
| 3885 | .wasm64 => try func.addMemArg(.i64_load, .{ .offset = operand.offset(), .alignment = 8 }), | |
| 3886 | else => unreachable, | |
| 3887 | } | |
| 3885 | 3888 | } |
| 3886 | 3889 | |
| 3887 | 3890 | // Compare the null value with '0' |
test/behavior/cast.zig-3| ... | ... | @@ -1179,7 +1179,6 @@ fn peerTypeEmptyArrayAndSlice(a: bool, slice: []const u8) []const u8 { |
| 1179 | 1179 | test "implicitly cast from [N]T to ?[]const T" { |
| 1180 | 1180 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1181 | 1181 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1182 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1183 | 1182 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1184 | 1183 | |
| 1185 | 1184 | try expect(mem.eql(u8, castToOptionalSlice().?, "hi")); |
| ... | ... | @@ -1264,7 +1263,6 @@ test "cast from array reference to fn: runtime fn ptr" { |
| 1264 | 1263 | test "*const [N]null u8 to ?[]const u8" { |
| 1265 | 1264 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1266 | 1265 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1267 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1268 | 1266 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1269 | 1267 | |
| 1270 | 1268 | const S = struct { |
| ... | ... | @@ -1413,7 +1411,6 @@ test "cast i8 fn call peers to i32 result" { |
| 1413 | 1411 | test "cast compatible optional types" { |
| 1414 | 1412 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1415 | 1413 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1416 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | |
| 1417 | 1414 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1418 | 1415 | |
| 1419 | 1416 | var a: ?[:0]const u8 = null; |
test/behavior/optional.zig-2| ... | ... | @@ -439,7 +439,6 @@ test "Optional slice size is optimized" { |
| 439 | 439 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 440 | 440 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 441 | 441 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 442 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 443 | 442 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 444 | 443 | |
| 445 | 444 | try expect(@sizeOf(?[]u8) == @sizeOf([]u8)); |
| ... | ... | @@ -479,7 +478,6 @@ test "cast slice to const slice nested in error union and optional" { |
| 479 | 478 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 480 | 479 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 481 | 480 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 482 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 483 | 481 | |
| 484 | 482 | const S = struct { |
| 485 | 483 | fn inner() !?[]u8 { |