| author | |
| committer | |
| log | 3faf376b081caa47a98a172fe7c7f63f82b150e4 |
| tree | 26924f0e7aa1720da8e21b9e784b7725246ab712 |
| parent | 6c2f3745564aefa669b336e249888bb7390b3a3f |
| parent | 1042deb86fd57278f3a16fd064b370bf72f28160 |
| signature |
21 files changed, 197 insertions(+), 82 deletions(-)
src/arch/wasm/CodeGen.zig+193-36| ... | @@ -1014,6 +1014,17 @@ fn typeToValtype(ty: Type, target: std.Target) wasm.Valtype { | ... | @@ -1014,6 +1014,17 @@ fn typeToValtype(ty: Type, target: std.Target) wasm.Valtype { |
| 1014 | .direct => wasm.Valtype.v128, | 1014 | .direct => wasm.Valtype.v128, |
| 1015 | .unrolled => wasm.Valtype.i32, | 1015 | .unrolled => wasm.Valtype.i32, |
| 1016 | }, | 1016 | }, |
| 1017 | .Union => switch (ty.containerLayout()) { | ||
| 1018 | .Packed => { | ||
| 1019 | var int_ty_payload: Type.Payload.Bits = .{ | ||
| 1020 | .base = .{ .tag = .int_unsigned }, | ||
| 1021 | .data = @intCast(u16, ty.bitSize(target)), | ||
| 1022 | }; | ||
| 1023 | const int_ty = Type.initPayload(&int_ty_payload.base); | ||
| 1024 | return typeToValtype(int_ty, target); | ||
| 1025 | }, | ||
| 1026 | else => wasm.Valtype.i32, | ||
| 1027 | }, | ||
| 1017 | else => wasm.Valtype.i32, // all represented as reference/immediate | 1028 | else => wasm.Valtype.i32, // all represented as reference/immediate |
| 1018 | }; | 1029 | }; |
| 1019 | } | 1030 | } |
| ... | @@ -1715,8 +1726,15 @@ fn isByRef(ty: Type, target: std.Target) bool { | ... | @@ -1715,8 +1726,15 @@ fn isByRef(ty: Type, target: std.Target) bool { |
| 1715 | 1726 | ||
| 1716 | .Array, | 1727 | .Array, |
| 1717 | .Frame, | 1728 | .Frame, |
| 1718 | .Union, | ||
| 1719 | => return ty.hasRuntimeBitsIgnoreComptime(), | 1729 | => return ty.hasRuntimeBitsIgnoreComptime(), |
| 1730 | .Union => { | ||
| 1731 | if (ty.castTag(.@"union")) |union_ty| { | ||
| 1732 | if (union_ty.data.layout == .Packed) { | ||
| 1733 | return ty.abiSize(target) > 8; | ||
| 1734 | } | ||
| 1735 | } | ||
| 1736 | return ty.hasRuntimeBitsIgnoreComptime(); | ||
| 1737 | }, | ||
| 1720 | .Struct => { | 1738 | .Struct => { |
| 1721 | if (ty.castTag(.@"struct")) |struct_ty| { | 1739 | if (ty.castTag(.@"struct")) |struct_ty| { |
| 1722 | const struct_obj = struct_ty.data; | 1740 | const struct_obj = struct_ty.data; |
| ... | @@ -2311,6 +2329,7 @@ fn airStore(func: *CodeGen, inst: Air.Inst.Index, safety: bool) InnerError!void | ... | @@ -2311,6 +2329,7 @@ fn airStore(func: *CodeGen, inst: Air.Inst.Index, safety: bool) InnerError!void |
| 2311 | 2329 | ||
| 2312 | fn store(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, offset: u32) InnerError!void { | 2330 | fn store(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, offset: u32) InnerError!void { |
| 2313 | assert(!(lhs != .stack and rhs == .stack)); | 2331 | assert(!(lhs != .stack and rhs == .stack)); |
| 2332 | const abi_size = ty.abiSize(func.target); | ||
| 2314 | switch (ty.zigTypeTag()) { | 2333 | switch (ty.zigTypeTag()) { |
| 2315 | .ErrorUnion => { | 2334 | .ErrorUnion => { |
| 2316 | const pl_ty = ty.errorUnionPayload(); | 2335 | const pl_ty = ty.errorUnionPayload(); |
| ... | @@ -2318,7 +2337,7 @@ fn store(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, offset: u32) InnerE | ... | @@ -2318,7 +2337,7 @@ fn store(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, offset: u32) InnerE |
| 2318 | return func.store(lhs, rhs, Type.anyerror, 0); | 2337 | return func.store(lhs, rhs, Type.anyerror, 0); |
| 2319 | } | 2338 | } |
| 2320 | 2339 | ||
| 2321 | const len = @intCast(u32, ty.abiSize(func.target)); | 2340 | const len = @intCast(u32, abi_size); |
| 2322 | return func.memcpy(lhs, rhs, .{ .imm32 = len }); | 2341 | return func.memcpy(lhs, rhs, .{ .imm32 = len }); |
| 2323 | }, | 2342 | }, |
| 2324 | .Optional => { | 2343 | .Optional => { |
| ... | @@ -2334,16 +2353,16 @@ fn store(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, offset: u32) InnerE | ... | @@ -2334,16 +2353,16 @@ fn store(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, offset: u32) InnerE |
| 2334 | return func.store(lhs, rhs, Type.anyerror, 0); | 2353 | return func.store(lhs, rhs, Type.anyerror, 0); |
| 2335 | } | 2354 | } |
| 2336 | 2355 | ||
| 2337 | const len = @intCast(u32, ty.abiSize(func.target)); | 2356 | const len = @intCast(u32, abi_size); |
| 2338 | return func.memcpy(lhs, rhs, .{ .imm32 = len }); | 2357 | return func.memcpy(lhs, rhs, .{ .imm32 = len }); |
| 2339 | }, | 2358 | }, |
| 2340 | .Struct, .Array, .Union => if (isByRef(ty, func.target)) { | 2359 | .Struct, .Array, .Union => if (isByRef(ty, func.target)) { |
| 2341 | const len = @intCast(u32, ty.abiSize(func.target)); | 2360 | const len = @intCast(u32, abi_size); |
| 2342 | return func.memcpy(lhs, rhs, .{ .imm32 = len }); | 2361 | return func.memcpy(lhs, rhs, .{ .imm32 = len }); |
| 2343 | }, | 2362 | }, |
| 2344 | .Vector => switch (determineSimdStoreStrategy(ty, func.target)) { | 2363 | .Vector => switch (determineSimdStoreStrategy(ty, func.target)) { |
| 2345 | .unrolled => { | 2364 | .unrolled => { |
| 2346 | const len = @intCast(u32, ty.abiSize(func.target)); | 2365 | const len = @intCast(u32, abi_size); |
| 2347 | return func.memcpy(lhs, rhs, .{ .imm32 = len }); | 2366 | return func.memcpy(lhs, rhs, .{ .imm32 = len }); |
| 2348 | }, | 2367 | }, |
| 2349 | .direct => { | 2368 | .direct => { |
| ... | @@ -2375,7 +2394,7 @@ fn store(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, offset: u32) InnerE | ... | @@ -2375,7 +2394,7 @@ fn store(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, offset: u32) InnerE |
| 2375 | return; | 2394 | return; |
| 2376 | } | 2395 | } |
| 2377 | }, | 2396 | }, |
| 2378 | .Int => if (ty.intInfo(func.target).bits > 64) { | 2397 | .Int, .Float => if (abi_size > 8 and abi_size <= 16) { |
| 2379 | try func.emitWValue(lhs); | 2398 | try func.emitWValue(lhs); |
| 2380 | const lsb = try func.load(rhs, Type.u64, 0); | 2399 | const lsb = try func.load(rhs, Type.u64, 0); |
| 2381 | try func.store(.{ .stack = {} }, lsb, Type.u64, 0 + lhs.offset()); | 2400 | try func.store(.{ .stack = {} }, lsb, Type.u64, 0 + lhs.offset()); |
| ... | @@ -2384,8 +2403,15 @@ fn store(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, offset: u32) InnerE | ... | @@ -2384,8 +2403,15 @@ fn store(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, offset: u32) InnerE |
| 2384 | const msb = try func.load(rhs, Type.u64, 8); | 2403 | const msb = try func.load(rhs, Type.u64, 8); |
| 2385 | try func.store(.{ .stack = {} }, msb, Type.u64, 8 + lhs.offset()); | 2404 | try func.store(.{ .stack = {} }, msb, Type.u64, 8 + lhs.offset()); |
| 2386 | return; | 2405 | return; |
| 2406 | } else if (abi_size > 16) { | ||
| 2407 | try func.memcpy(lhs, rhs, .{ .imm32 = @intCast(u32, ty.abiSize(func.target)) }); | ||
| 2408 | }, | ||
| 2409 | else => if (abi_size > 8) { | ||
| 2410 | return func.fail("TODO: `store` for type `{}` with abisize `{d}`", .{ | ||
| 2411 | ty.fmt(func.bin_file.base.options.module.?), | ||
| 2412 | abi_size, | ||
| 2413 | }); | ||
| 2387 | }, | 2414 | }, |
| 2388 | else => {}, | ||
| 2389 | } | 2415 | } |
| 2390 | try func.emitWValue(lhs); | 2416 | try func.emitWValue(lhs); |
| 2391 | // In this case we're actually interested in storing the stack position | 2417 | // In this case we're actually interested in storing the stack position |
| ... | @@ -2393,11 +2419,9 @@ fn store(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, offset: u32) InnerE | ... | @@ -2393,11 +2419,9 @@ fn store(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, offset: u32) InnerE |
| 2393 | try func.lowerToStack(rhs); | 2419 | try func.lowerToStack(rhs); |
| 2394 | 2420 | ||
| 2395 | const valtype = typeToValtype(ty, func.target); | 2421 | const valtype = typeToValtype(ty, func.target); |
| 2396 | const abi_size = @intCast(u8, ty.abiSize(func.target)); | ||
| 2397 | |||
| 2398 | const opcode = buildOpcode(.{ | 2422 | const opcode = buildOpcode(.{ |
| 2399 | .valtype1 = valtype, | 2423 | .valtype1 = valtype, |
| 2400 | .width = abi_size * 8, | 2424 | .width = @intCast(u8, abi_size * 8), |
| 2401 | .op = .store, | 2425 | .op = .store, |
| 2402 | }); | 2426 | }); |
| 2403 | 2427 | ||
| ... | @@ -3131,6 +3155,14 @@ fn lowerConstant(func: *CodeGen, arg_val: Value, ty: Type) InnerError!WValue { | ... | @@ -3131,6 +3155,14 @@ fn lowerConstant(func: *CodeGen, arg_val: Value, ty: Type) InnerError!WValue { |
| 3131 | val.writeToMemory(ty, func.bin_file.base.options.module.?, &buf) catch unreachable; | 3155 | val.writeToMemory(ty, func.bin_file.base.options.module.?, &buf) catch unreachable; |
| 3132 | return func.storeSimdImmd(buf); | 3156 | return func.storeSimdImmd(buf); |
| 3133 | }, | 3157 | }, |
| 3158 | .Union => { | ||
| 3159 | // in this case we have a packed union which will not be passed by reference. | ||
| 3160 | const union_ty = ty.cast(Type.Payload.Union).?.data; | ||
| 3161 | const union_obj = val.castTag(.@"union").?.data; | ||
| 3162 | const field_index = ty.unionTagFieldIndex(union_obj.tag, func.bin_file.base.options.module.?).?; | ||
| 3163 | const field_ty = union_ty.fields.values()[field_index].ty; | ||
| 3164 | return func.lowerConstant(union_obj.val, field_ty); | ||
| 3165 | }, | ||
| 3134 | else => |zig_type| return func.fail("Wasm TODO: LowerConstant for zigTypeTag {}", .{zig_type}), | 3166 | else => |zig_type| return func.fail("Wasm TODO: LowerConstant for zigTypeTag {}", .{zig_type}), |
| 3135 | } | 3167 | } |
| 3136 | } | 3168 | } |
| ... | @@ -3146,7 +3178,7 @@ fn storeSimdImmd(func: *CodeGen, value: [16]u8) !WValue { | ... | @@ -3146,7 +3178,7 @@ fn storeSimdImmd(func: *CodeGen, value: [16]u8) !WValue { |
| 3146 | fn emitUndefined(func: *CodeGen, ty: Type) InnerError!WValue { | 3178 | fn emitUndefined(func: *CodeGen, ty: Type) InnerError!WValue { |
| 3147 | switch (ty.zigTypeTag()) { | 3179 | switch (ty.zigTypeTag()) { |
| 3148 | .Bool, .ErrorSet => return WValue{ .imm32 = 0xaaaaaaaa }, | 3180 | .Bool, .ErrorSet => return WValue{ .imm32 = 0xaaaaaaaa }, |
| 3149 | .Int => switch (ty.intInfo(func.target).bits) { | 3181 | .Int, .Enum => switch (ty.intInfo(func.target).bits) { |
| 3150 | 0...32 => return WValue{ .imm32 = 0xaaaaaaaa }, | 3182 | 0...32 => return WValue{ .imm32 = 0xaaaaaaaa }, |
| 3151 | 33...64 => return WValue{ .imm64 = 0xaaaaaaaaaaaaaaaa }, | 3183 | 33...64 => return WValue{ .imm64 = 0xaaaaaaaaaaaaaaaa }, |
| 3152 | else => unreachable, | 3184 | else => unreachable, |
| ... | @@ -3617,7 +3649,6 @@ fn airStructFieldVal(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -3617,7 +3649,6 @@ fn airStructFieldVal(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 3617 | .Packed => switch (struct_ty.zigTypeTag()) { | 3649 | .Packed => switch (struct_ty.zigTypeTag()) { |
| 3618 | .Struct => result: { | 3650 | .Struct => result: { |
| 3619 | const struct_obj = struct_ty.castTag(.@"struct").?.data; | 3651 | const struct_obj = struct_ty.castTag(.@"struct").?.data; |
| 3620 | assert(struct_obj.layout == .Packed); | ||
| 3621 | const offset = struct_obj.packedFieldBitOffset(func.target, field_index); | 3652 | const offset = struct_obj.packedFieldBitOffset(func.target, field_index); |
| 3622 | const backing_ty = struct_obj.backing_int_ty; | 3653 | const backing_ty = struct_obj.backing_int_ty; |
| 3623 | const wasm_bits = toWasmBits(backing_ty.intInfo(func.target).bits) orelse { | 3654 | const wasm_bits = toWasmBits(backing_ty.intInfo(func.target).bits) orelse { |
| ... | @@ -3661,7 +3692,44 @@ fn airStructFieldVal(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -3661,7 +3692,44 @@ fn airStructFieldVal(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 3661 | const truncated = try func.trunc(shifted_value, field_ty, backing_ty); | 3692 | const truncated = try func.trunc(shifted_value, field_ty, backing_ty); |
| 3662 | break :result try truncated.toLocal(func, field_ty); | 3693 | break :result try truncated.toLocal(func, field_ty); |
| 3663 | }, | 3694 | }, |
| 3664 | .Union => return func.fail("TODO: airStructFieldVal for packed unions", .{}), | 3695 | .Union => result: { |
| 3696 | if (isByRef(struct_ty, func.target)) { | ||
| 3697 | if (!isByRef(field_ty, func.target)) { | ||
| 3698 | const val = try func.load(operand, field_ty, 0); | ||
| 3699 | break :result try val.toLocal(func, field_ty); | ||
| 3700 | } else { | ||
| 3701 | const new_stack_val = try func.allocStack(field_ty); | ||
| 3702 | try func.store(new_stack_val, operand, field_ty, 0); | ||
| 3703 | break :result new_stack_val; | ||
| 3704 | } | ||
| 3705 | } | ||
| 3706 | |||
| 3707 | var payload: Type.Payload.Bits = .{ | ||
| 3708 | .base = .{ .tag = .int_unsigned }, | ||
| 3709 | .data = @intCast(u16, struct_ty.bitSize(func.target)), | ||
| 3710 | }; | ||
| 3711 | const union_int_type = Type.initPayload(&payload.base); | ||
| 3712 | if (field_ty.zigTypeTag() == .Float) { | ||
| 3713 | var int_payload: Type.Payload.Bits = .{ | ||
| 3714 | .base = .{ .tag = .int_unsigned }, | ||
| 3715 | .data = @intCast(u16, field_ty.bitSize(func.target)), | ||
| 3716 | }; | ||
| 3717 | const int_type = Type.initPayload(&int_payload.base); | ||
| 3718 | const truncated = try func.trunc(operand, int_type, union_int_type); | ||
| 3719 | const bitcasted = try func.bitcast(field_ty, int_type, truncated); | ||
| 3720 | break :result try bitcasted.toLocal(func, field_ty); | ||
| 3721 | } else if (field_ty.isPtrAtRuntime()) { | ||
| 3722 | var int_payload: Type.Payload.Bits = .{ | ||
| 3723 | .base = .{ .tag = .int_unsigned }, | ||
| 3724 | .data = @intCast(u16, field_ty.bitSize(func.target)), | ||
| 3725 | }; | ||
| 3726 | const int_type = Type.initPayload(&int_payload.base); | ||
| 3727 | const truncated = try func.trunc(operand, int_type, union_int_type); | ||
| 3728 | break :result try truncated.toLocal(func, field_ty); | ||
| 3729 | } | ||
| 3730 | const truncated = try func.trunc(operand, field_ty, union_int_type); | ||
| 3731 | break :result try truncated.toLocal(func, field_ty); | ||
| 3732 | }, | ||
| 3665 | else => unreachable, | 3733 | else => unreachable, |
| 3666 | }, | 3734 | }, |
| 3667 | else => result: { | 3735 | else => result: { |
| ... | @@ -3907,7 +3975,12 @@ fn airUnwrapErrUnionPayload(func: *CodeGen, inst: Air.Inst.Index, op_is_ptr: boo | ... | @@ -3907,7 +3975,12 @@ fn airUnwrapErrUnionPayload(func: *CodeGen, inst: Air.Inst.Index, op_is_ptr: boo |
| 3907 | const payload_ty = err_ty.errorUnionPayload(); | 3975 | const payload_ty = err_ty.errorUnionPayload(); |
| 3908 | 3976 | ||
| 3909 | const result = result: { | 3977 | const result = result: { |
| 3910 | if (!payload_ty.hasRuntimeBitsIgnoreComptime()) break :result WValue{ .none = {} }; | 3978 | if (!payload_ty.hasRuntimeBitsIgnoreComptime()) { |
| 3979 | if (op_is_ptr) { | ||
| 3980 | break :result func.reuseOperand(ty_op.operand, operand); | ||
| 3981 | } | ||
| 3982 | break :result WValue{ .none = {} }; | ||
| 3983 | } | ||
| 3911 | 3984 | ||
| 3912 | const pl_offset = @intCast(u32, errUnionPayloadOffset(payload_ty, func.target)); | 3985 | const pl_offset = @intCast(u32, errUnionPayloadOffset(payload_ty, func.target)); |
| 3913 | if (op_is_ptr or isByRef(payload_ty, func.target)) { | 3986 | if (op_is_ptr or isByRef(payload_ty, func.target)) { |
| ... | @@ -4397,7 +4470,7 @@ fn airPtrElemVal(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -4397,7 +4470,7 @@ fn airPtrElemVal(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 4397 | try func.addTag(.i32_add); | 4470 | try func.addTag(.i32_add); |
| 4398 | 4471 | ||
| 4399 | const elem_result = val: { | 4472 | const elem_result = val: { |
| 4400 | var result = try func.allocLocal(elem_ty); | 4473 | var result = try func.allocLocal(Type.usize); |
| 4401 | try func.addLabel(.local_set, result.local.value); | 4474 | try func.addLabel(.local_set, result.local.value); |
| 4402 | if (isByRef(elem_ty, func.target)) { | 4475 | if (isByRef(elem_ty, func.target)) { |
| 4403 | break :val result; | 4476 | break :val result; |
| ... | @@ -4864,6 +4937,9 @@ fn airAggregateInit(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -4864,6 +4937,9 @@ fn airAggregateInit(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 4864 | const result = try func.allocStack(result_ty); | 4937 | const result = try func.allocStack(result_ty); |
| 4865 | const elem_ty = result_ty.childType(); | 4938 | const elem_ty = result_ty.childType(); |
| 4866 | const elem_size = @intCast(u32, elem_ty.abiSize(func.target)); | 4939 | const elem_size = @intCast(u32, elem_ty.abiSize(func.target)); |
| 4940 | const sentinel = if (result_ty.sentinel()) |sent| blk: { | ||
| 4941 | break :blk try func.lowerConstant(sent, elem_ty); | ||
| 4942 | } else null; | ||
| 4867 | 4943 | ||
| 4868 | // When the element type is by reference, we must copy the entire | 4944 | // When the element type is by reference, we must copy the entire |
| 4869 | // value. It is therefore safer to move the offset pointer and store | 4945 | // value. It is therefore safer to move the offset pointer and store |
| ... | @@ -4876,10 +4952,13 @@ fn airAggregateInit(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -4876,10 +4952,13 @@ fn airAggregateInit(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 4876 | const elem_val = try func.resolveInst(elem); | 4952 | const elem_val = try func.resolveInst(elem); |
| 4877 | try func.store(offset, elem_val, elem_ty, 0); | 4953 | try func.store(offset, elem_val, elem_ty, 0); |
| 4878 | 4954 | ||
| 4879 | if (elem_index < elements.len - 1) { | 4955 | if (elem_index < elements.len - 1 and sentinel == null) { |
| 4880 | _ = try func.buildPointerOffset(offset, elem_size, .modify); | 4956 | _ = try func.buildPointerOffset(offset, elem_size, .modify); |
| 4881 | } | 4957 | } |
| 4882 | } | 4958 | } |
| 4959 | if (sentinel) |sent| { | ||
| 4960 | try func.store(offset, sent, elem_ty, 0); | ||
| 4961 | } | ||
| 4883 | } else { | 4962 | } else { |
| 4884 | var offset: u32 = 0; | 4963 | var offset: u32 = 0; |
| 4885 | for (elements) |elem| { | 4964 | for (elements) |elem| { |
| ... | @@ -4887,6 +4966,9 @@ fn airAggregateInit(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -4887,6 +4966,9 @@ fn airAggregateInit(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 4887 | try func.store(result, elem_val, elem_ty, offset); | 4966 | try func.store(result, elem_val, elem_ty, offset); |
| 4888 | offset += elem_size; | 4967 | offset += elem_size; |
| 4889 | } | 4968 | } |
| 4969 | if (sentinel) |sent| { | ||
| 4970 | try func.store(result, sent, elem_ty, offset); | ||
| 4971 | } | ||
| 4890 | } | 4972 | } |
| 4891 | break :result_value result; | 4973 | break :result_value result; |
| 4892 | }, | 4974 | }, |
| ... | @@ -4982,31 +5064,85 @@ fn airUnionInit(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -4982,31 +5064,85 @@ fn airUnionInit(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 4982 | const result = result: { | 5064 | const result = result: { |
| 4983 | const union_ty = func.air.typeOfIndex(inst); | 5065 | const union_ty = func.air.typeOfIndex(inst); |
| 4984 | const layout = union_ty.unionGetLayout(func.target); | 5066 | const layout = union_ty.unionGetLayout(func.target); |
| 5067 | const union_obj = union_ty.cast(Type.Payload.Union).?.data; | ||
| 5068 | const field = union_obj.fields.values()[extra.field_index]; | ||
| 5069 | const field_name = union_obj.fields.keys()[extra.field_index]; | ||
| 5070 | |||
| 5071 | const tag_int = blk: { | ||
| 5072 | const tag_ty = union_ty.unionTagTypeHypothetical(); | ||
| 5073 | const enum_field_index = tag_ty.enumFieldIndex(field_name).?; | ||
| 5074 | var tag_val_payload: Value.Payload.U32 = .{ | ||
| 5075 | .base = .{ .tag = .enum_field_index }, | ||
| 5076 | .data = @intCast(u32, enum_field_index), | ||
| 5077 | }; | ||
| 5078 | const tag_val = Value.initPayload(&tag_val_payload.base); | ||
| 5079 | break :blk try func.lowerConstant(tag_val, tag_ty); | ||
| 5080 | }; | ||
| 4985 | if (layout.payload_size == 0) { | 5081 | if (layout.payload_size == 0) { |
| 4986 | if (layout.tag_size == 0) { | 5082 | if (layout.tag_size == 0) { |
| 4987 | break :result WValue{ .none = {} }; | 5083 | break :result WValue{ .none = {} }; |
| 4988 | } | 5084 | } |
| 4989 | assert(!isByRef(union_ty, func.target)); | 5085 | assert(!isByRef(union_ty, func.target)); |
| 4990 | break :result WValue{ .imm32 = extra.field_index }; | 5086 | break :result tag_int; |
| 4991 | } | 5087 | } |
| 4992 | assert(isByRef(union_ty, func.target)); | ||
| 4993 | 5088 | ||
| 4994 | const result_ptr = try func.allocStack(union_ty); | 5089 | if (isByRef(union_ty, func.target)) { |
| 4995 | const payload = try func.resolveInst(extra.init); | 5090 | const result_ptr = try func.allocStack(union_ty); |
| 4996 | const union_obj = union_ty.cast(Type.Payload.Union).?.data; | 5091 | const payload = try func.resolveInst(extra.init); |
| 4997 | assert(union_obj.haveFieldTypes()); | 5092 | if (layout.tag_align >= layout.payload_align) { |
| 4998 | const field = union_obj.fields.values()[extra.field_index]; | 5093 | if (isByRef(field.ty, func.target)) { |
| 5094 | const payload_ptr = try func.buildPointerOffset(result_ptr, layout.tag_size, .new); | ||
| 5095 | try func.store(payload_ptr, payload, field.ty, 0); | ||
| 5096 | } else { | ||
| 5097 | try func.store(result_ptr, payload, field.ty, @intCast(u32, layout.tag_size)); | ||
| 5098 | } | ||
| 4999 | 5099 | ||
| 5000 | if (layout.tag_align >= layout.payload_align) { | 5100 | if (layout.tag_size > 0) { |
| 5001 | const payload_ptr = try func.buildPointerOffset(result_ptr, layout.tag_size, .new); | 5101 | try func.store(result_ptr, tag_int, union_obj.tag_ty, 0); |
| 5002 | try func.store(payload_ptr, payload, field.ty, 0); | 5102 | } |
| 5103 | } else { | ||
| 5104 | try func.store(result_ptr, payload, field.ty, 0); | ||
| 5105 | if (layout.tag_size > 0) { | ||
| 5106 | try func.store( | ||
| 5107 | result_ptr, | ||
| 5108 | tag_int, | ||
| 5109 | union_obj.tag_ty, | ||
| 5110 | @intCast(u32, layout.payload_size), | ||
| 5111 | ); | ||
| 5112 | } | ||
| 5113 | } | ||
| 5114 | break :result result_ptr; | ||
| 5003 | } else { | 5115 | } else { |
| 5004 | try func.store(result_ptr, payload, field.ty, 0); | 5116 | const operand = try func.resolveInst(extra.init); |
| 5117 | var payload: Type.Payload.Bits = .{ | ||
| 5118 | .base = .{ .tag = .int_unsigned }, | ||
| 5119 | .data = @intCast(u16, union_ty.bitSize(func.target)), | ||
| 5120 | }; | ||
| 5121 | const union_int_type = Type.initPayload(&payload.base); | ||
| 5122 | if (field.ty.zigTypeTag() == .Float) { | ||
| 5123 | var int_payload: Type.Payload.Bits = .{ | ||
| 5124 | .base = .{ .tag = .int_unsigned }, | ||
| 5125 | .data = @intCast(u16, field.ty.bitSize(func.target)), | ||
| 5126 | }; | ||
| 5127 | const int_type = Type.initPayload(&int_payload.base); | ||
| 5128 | const bitcasted = try func.bitcast(field.ty, int_type, operand); | ||
| 5129 | const casted = try func.trunc(bitcasted, int_type, union_int_type); | ||
| 5130 | break :result try casted.toLocal(func, field.ty); | ||
| 5131 | } else if (field.ty.isPtrAtRuntime()) { | ||
| 5132 | var int_payload: Type.Payload.Bits = .{ | ||
| 5133 | .base = .{ .tag = .int_unsigned }, | ||
| 5134 | .data = @intCast(u16, field.ty.bitSize(func.target)), | ||
| 5135 | }; | ||
| 5136 | const int_type = Type.initPayload(&int_payload.base); | ||
| 5137 | const casted = try func.intcast(operand, int_type, union_int_type); | ||
| 5138 | break :result try casted.toLocal(func, field.ty); | ||
| 5139 | } | ||
| 5140 | const casted = try func.intcast(operand, field.ty, union_int_type); | ||
| 5141 | break :result try casted.toLocal(func, field.ty); | ||
| 5005 | } | 5142 | } |
| 5006 | break :result result_ptr; | ||
| 5007 | }; | 5143 | }; |
| 5008 | 5144 | ||
| 5009 | func.finishAir(inst, result, &.{extra.init}); | 5145 | return func.finishAir(inst, result, &.{extra.init}); |
| 5010 | } | 5146 | } |
| 5011 | 5147 | ||
| 5012 | fn airPrefetch(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | 5148 | fn airPrefetch(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| ... | @@ -5073,8 +5209,8 @@ fn cmpOptionals(func: *CodeGen, lhs: WValue, rhs: WValue, operand_ty: Type, op: | ... | @@ -5073,8 +5209,8 @@ fn cmpOptionals(func: *CodeGen, lhs: WValue, rhs: WValue, operand_ty: Type, op: |
| 5073 | fn cmpBigInt(func: *CodeGen, lhs: WValue, rhs: WValue, operand_ty: Type, op: std.math.CompareOperator) InnerError!WValue { | 5209 | fn cmpBigInt(func: *CodeGen, lhs: WValue, rhs: WValue, operand_ty: Type, op: std.math.CompareOperator) InnerError!WValue { |
| 5074 | assert(operand_ty.abiSize(func.target) >= 16); | 5210 | assert(operand_ty.abiSize(func.target) >= 16); |
| 5075 | assert(!(lhs != .stack and rhs == .stack)); | 5211 | assert(!(lhs != .stack and rhs == .stack)); |
| 5076 | if (operand_ty.intInfo(func.target).bits > 128) { | 5212 | if (operand_ty.bitSize(func.target) > 128) { |
| 5077 | return func.fail("TODO: Support cmpBigInt for integer bitsize: '{d}'", .{operand_ty.intInfo(func.target).bits}); | 5213 | return func.fail("TODO: Support cmpBigInt for integer bitsize: '{d}'", .{operand_ty.bitSize(func.target)}); |
| 5078 | } | 5214 | } |
| 5079 | 5215 | ||
| 5080 | var lhs_high_bit = try (try func.load(lhs, Type.u64, 0)).toLocal(func, Type.u64); | 5216 | var lhs_high_bit = try (try func.load(lhs, Type.u64, 0)).toLocal(func, Type.u64); |
| ... | @@ -5295,11 +5431,23 @@ fn airMemcpy(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -5295,11 +5431,23 @@ fn airMemcpy(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 5295 | const bin_op = func.air.instructions.items(.data)[inst].bin_op; | 5431 | const bin_op = func.air.instructions.items(.data)[inst].bin_op; |
| 5296 | const dst = try func.resolveInst(bin_op.lhs); | 5432 | const dst = try func.resolveInst(bin_op.lhs); |
| 5297 | const dst_ty = func.air.typeOf(bin_op.lhs); | 5433 | const dst_ty = func.air.typeOf(bin_op.lhs); |
| 5434 | const ptr_elem_ty = dst_ty.childType(); | ||
| 5298 | const src = try func.resolveInst(bin_op.rhs); | 5435 | const src = try func.resolveInst(bin_op.rhs); |
| 5299 | const src_ty = func.air.typeOf(bin_op.rhs); | 5436 | const src_ty = func.air.typeOf(bin_op.rhs); |
| 5300 | const len = switch (dst_ty.ptrSize()) { | 5437 | const len = switch (dst_ty.ptrSize()) { |
| 5301 | .Slice => try func.sliceLen(dst), | 5438 | .Slice => blk: { |
| 5302 | .One => @as(WValue, .{ .imm32 = @intCast(u32, dst_ty.childType().arrayLen()) }), | 5439 | const slice_len = try func.sliceLen(dst); |
| 5440 | if (ptr_elem_ty.abiSize(func.target) != 1) { | ||
| 5441 | try func.emitWValue(slice_len); | ||
| 5442 | try func.emitWValue(.{ .imm32 = @intCast(u32, ptr_elem_ty.abiSize(func.target)) }); | ||
| 5443 | try func.addTag(.i32_mul); | ||
| 5444 | try func.addLabel(.local_set, slice_len.local.value); | ||
| 5445 | } | ||
| 5446 | break :blk slice_len; | ||
| 5447 | }, | ||
| 5448 | .One => @as(WValue, .{ | ||
| 5449 | .imm32 = @intCast(u32, ptr_elem_ty.arrayLen() * ptr_elem_ty.childType().abiSize(func.target)), | ||
| 5450 | }), | ||
| 5303 | .C, .Many => unreachable, | 5451 | .C, .Many => unreachable, |
| 5304 | }; | 5452 | }; |
| 5305 | const dst_ptr = try func.sliceOrArrayPtr(dst, dst_ty); | 5453 | const dst_ptr = try func.sliceOrArrayPtr(dst, dst_ty); |
| ... | @@ -5559,6 +5707,7 @@ fn airShlWithOverflow(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -5559,6 +5707,7 @@ fn airShlWithOverflow(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 5559 | const lhs = try func.resolveInst(extra.lhs); | 5707 | const lhs = try func.resolveInst(extra.lhs); |
| 5560 | const rhs = try func.resolveInst(extra.rhs); | 5708 | const rhs = try func.resolveInst(extra.rhs); |
| 5561 | const lhs_ty = func.air.typeOf(extra.lhs); | 5709 | const lhs_ty = func.air.typeOf(extra.lhs); |
| 5710 | const rhs_ty = func.air.typeOf(extra.rhs); | ||
| 5562 | 5711 | ||
| 5563 | if (lhs_ty.zigTypeTag() == .Vector) { | 5712 | if (lhs_ty.zigTypeTag() == .Vector) { |
| 5564 | return func.fail("TODO: Implement overflow arithmetic for vectors", .{}); | 5713 | return func.fail("TODO: Implement overflow arithmetic for vectors", .{}); |
| ... | @@ -5570,7 +5719,15 @@ fn airShlWithOverflow(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -5570,7 +5719,15 @@ fn airShlWithOverflow(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 5570 | return func.fail("TODO: Implement shl_with_overflow for integer bitsize: {d}", .{int_info.bits}); | 5719 | return func.fail("TODO: Implement shl_with_overflow for integer bitsize: {d}", .{int_info.bits}); |
| 5571 | }; | 5720 | }; |
| 5572 | 5721 | ||
| 5573 | var shl = try (try func.binOp(lhs, rhs, lhs_ty, .shl)).toLocal(func, lhs_ty); | 5722 | // Ensure rhs is coerced to lhs as they must have the same WebAssembly types |
| 5723 | // before we can perform any binary operation. | ||
| 5724 | const rhs_wasm_bits = toWasmBits(rhs_ty.intInfo(func.target).bits).?; | ||
| 5725 | const rhs_final = if (wasm_bits != rhs_wasm_bits) blk: { | ||
| 5726 | const rhs_casted = try func.intcast(rhs, rhs_ty, lhs_ty); | ||
| 5727 | break :blk try rhs_casted.toLocal(func, lhs_ty); | ||
| 5728 | } else rhs; | ||
| 5729 | |||
| 5730 | var shl = try (try func.binOp(lhs, rhs_final, lhs_ty, .shl)).toLocal(func, lhs_ty); | ||
| 5574 | defer shl.free(func); | 5731 | defer shl.free(func); |
| 5575 | var result = if (wasm_bits != int_info.bits) blk: { | 5732 | var result = if (wasm_bits != int_info.bits) blk: { |
| 5576 | break :blk try (try func.wrapOperand(shl, lhs_ty)).toLocal(func, lhs_ty); | 5733 | break :blk try (try func.wrapOperand(shl, lhs_ty)).toLocal(func, lhs_ty); |
| ... | @@ -5581,11 +5738,11 @@ fn airShlWithOverflow(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { | ... | @@ -5581,11 +5738,11 @@ fn airShlWithOverflow(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { |
| 5581 | // emit lhs to stack to we can keep 'wrapped' on the stack also | 5738 | // emit lhs to stack to we can keep 'wrapped' on the stack also |
| 5582 | try func.emitWValue(lhs); | 5739 | try func.emitWValue(lhs); |
| 5583 | const abs = try func.signAbsValue(shl, lhs_ty); | 5740 | const abs = try func.signAbsValue(shl, lhs_ty); |
| 5584 | const wrapped = try func.wrapBinOp(abs, rhs, lhs_ty, .shr); | 5741 | const wrapped = try func.wrapBinOp(abs, rhs_final, lhs_ty, .shr); |
| 5585 | break :blk try func.cmp(.{ .stack = {} }, wrapped, lhs_ty, .neq); | 5742 | break :blk try func.cmp(.{ .stack = {} }, wrapped, lhs_ty, .neq); |
| 5586 | } else blk: { | 5743 | } else blk: { |
| 5587 | try func.emitWValue(lhs); | 5744 | try func.emitWValue(lhs); |
| 5588 | const shr = try func.binOp(result, rhs, lhs_ty, .shr); | 5745 | const shr = try func.binOp(result, rhs_final, lhs_ty, .shr); |
| 5589 | break :blk try func.cmp(.{ .stack = {} }, shr, lhs_ty, .neq); | 5746 | break :blk try func.cmp(.{ .stack = {} }, shr, lhs_ty, .neq); |
| 5590 | }; | 5747 | }; |
| 5591 | var overflow_local = try overflow_bit.toLocal(func, Type.initTag(.u1)); | 5748 | var overflow_local = try overflow_bit.toLocal(func, Type.initTag(.u1)); |
src/codegen.zig+4| ... | @@ -611,6 +611,10 @@ pub fn generateSymbol( | ... | @@ -611,6 +611,10 @@ pub fn generateSymbol( |
| 611 | } | 611 | } |
| 612 | } | 612 | } |
| 613 | 613 | ||
| 614 | if (layout.padding > 0) { | ||
| 615 | try code.writer().writeByteNTimes(0, layout.padding); | ||
| 616 | } | ||
| 617 | |||
| 614 | return Result.ok; | 618 | return Result.ok; |
| 615 | }, | 619 | }, |
| 616 | .Optional => { | 620 | .Optional => { |
test/behavior/align.zig-1| ... | @@ -16,7 +16,6 @@ test "global variable alignment" { | ... | @@ -16,7 +16,6 @@ test "global variable alignment" { |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | test "slicing array of length 1 can not assume runtime index is always zero" { | 18 | test "slicing array of length 1 can not assume runtime index is always zero" { |
| 19 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 20 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 19 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 21 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 20 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 22 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 21 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
test/behavior/atomics.zig-1| ... | @@ -383,7 +383,6 @@ fn testAtomicRmwInt128(comptime signedness: std.builtin.Signedness) !void { | ... | @@ -383,7 +383,6 @@ fn testAtomicRmwInt128(comptime signedness: std.builtin.Signedness) !void { |
| 383 | } | 383 | } |
| 384 | 384 | ||
| 385 | test "atomics with different types" { | 385 | test "atomics with different types" { |
| 386 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 387 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 386 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 388 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 387 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 389 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 388 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
test/behavior/basic.zig-3| ... | @@ -413,7 +413,6 @@ test "array 2D const double ptr with offset" { | ... | @@ -413,7 +413,6 @@ test "array 2D const double ptr with offset" { |
| 413 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 413 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 414 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 414 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 415 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 415 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 416 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | ||
| 417 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 416 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 418 | 417 | ||
| 419 | const rect_2d_vertexes = [_][2]f32{ | 418 | const rect_2d_vertexes = [_][2]f32{ |
| ... | @@ -427,7 +426,6 @@ test "array 3D const double ptr with offset" { | ... | @@ -427,7 +426,6 @@ test "array 3D const double ptr with offset" { |
| 427 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 426 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 428 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 427 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 429 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 428 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 430 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 431 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 429 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 432 | 430 | ||
| 433 | const rect_3d_vertexes = [_][2][2]f32{ | 431 | const rect_3d_vertexes = [_][2][2]f32{ |
| ... | @@ -1052,7 +1050,6 @@ test "inline call of function with a switch inside the return statement" { | ... | @@ -1052,7 +1050,6 @@ test "inline call of function with a switch inside the return statement" { |
| 1052 | } | 1050 | } |
| 1053 | 1051 | ||
| 1054 | test "namespace lookup ignores decl causing the lookup" { | 1052 | test "namespace lookup ignores decl causing the lookup" { |
| 1055 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 1056 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1053 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1057 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1054 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1058 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1055 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
test/behavior/bugs/12142.zig-1| ... | @@ -19,7 +19,6 @@ fn letter(e: Letter) u8 { | ... | @@ -19,7 +19,6 @@ fn letter(e: Letter) u8 { |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | test { | 21 | test { |
| 22 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 23 | if (builtin.zig_backend == .stage2_x86) return error.SkipZigTest; // TODO | 22 | if (builtin.zig_backend == .stage2_x86) return error.SkipZigTest; // TODO |
| 24 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 23 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 25 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 24 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
test/behavior/bugs/13113.zig-1| ... | @@ -7,7 +7,6 @@ const Foo = extern struct { | ... | @@ -7,7 +7,6 @@ const Foo = extern struct { |
| 7 | }; | 7 | }; |
| 8 | 8 | ||
| 9 | test { | 9 | test { |
| 10 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 11 | if (builtin.zig_backend == .stage2_x86) return error.SkipZigTest; // TODO | 10 | if (builtin.zig_backend == .stage2_x86) return error.SkipZigTest; // TODO |
| 12 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 11 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 13 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 12 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
test/behavior/bugs/13128.zig-1| ... | @@ -14,7 +14,6 @@ fn foo(val: U) !void { | ... | @@ -14,7 +14,6 @@ fn foo(val: U) !void { |
| 14 | test "runtime union init, most-aligned field != largest" { | 14 | test "runtime union init, most-aligned field != largest" { |
| 15 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 15 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 16 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 16 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 17 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 18 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 17 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 19 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 18 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 20 | 19 |
test/behavior/bugs/13664.zig-1| ... | @@ -13,7 +13,6 @@ fn value() i64 { | ... | @@ -13,7 +13,6 @@ fn value() i64 { |
| 13 | return 1341; | 13 | return 1341; |
| 14 | } | 14 | } |
| 15 | test { | 15 | test { |
| 16 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 17 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO | 16 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 18 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 17 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 19 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 18 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
test/behavior/bugs/1381.zig-1| ... | @@ -15,7 +15,6 @@ test "union that needs padding bytes inside an array" { | ... | @@ -15,7 +15,6 @@ test "union that needs padding bytes inside an array" { |
| 15 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | 15 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 16 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 16 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 17 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 17 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 18 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | ||
| 19 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 18 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 20 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 19 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 21 | 20 |
test/behavior/cast_int.zig-1| ... | @@ -4,7 +4,6 @@ const expect = std.testing.expect; | ... | @@ -4,7 +4,6 @@ const expect = std.testing.expect; |
| 4 | const maxInt = std.math.maxInt; | 4 | const maxInt = std.math.maxInt; |
| 5 | 5 | ||
| 6 | test "@intCast i32 to u7" { | 6 | test "@intCast i32 to u7" { |
| 7 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 8 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 7 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
test/behavior/empty_union.zig-5| ... | @@ -3,15 +3,12 @@ const std = @import("std"); | ... | @@ -3,15 +3,12 @@ const std = @import("std"); |
| 3 | const expect = std.testing.expect; | 3 | const expect = std.testing.expect; |
| 4 | 4 | ||
| 5 | test "switch on empty enum" { | 5 | test "switch on empty enum" { |
| 6 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 7 | |||
| 8 | const E = enum {}; | 6 | const E = enum {}; |
| 9 | var e: E = undefined; | 7 | var e: E = undefined; |
| 10 | switch (e) {} | 8 | switch (e) {} |
| 11 | } | 9 | } |
| 12 | 10 | ||
| 13 | test "switch on empty enum with a specified tag type" { | 11 | test "switch on empty enum with a specified tag type" { |
| 14 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 15 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 12 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 16 | 13 | ||
| 17 | const E = enum(u8) {}; | 14 | const E = enum(u8) {}; |
| ... | @@ -21,7 +18,6 @@ test "switch on empty enum with a specified tag type" { | ... | @@ -21,7 +18,6 @@ test "switch on empty enum with a specified tag type" { |
| 21 | 18 | ||
| 22 | test "switch on empty auto numbered tagged union" { | 19 | test "switch on empty auto numbered tagged union" { |
| 23 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 24 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 25 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 21 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 26 | 22 | ||
| 27 | const U = union(enum(u8)) {}; | 23 | const U = union(enum(u8)) {}; |
| ... | @@ -31,7 +27,6 @@ test "switch on empty auto numbered tagged union" { | ... | @@ -31,7 +27,6 @@ test "switch on empty auto numbered tagged union" { |
| 31 | 27 | ||
| 32 | test "switch on empty tagged union" { | 28 | test "switch on empty tagged union" { |
| 33 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 29 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 34 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 35 | 30 | ||
| 36 | const E = enum {}; | 31 | const E = enum {}; |
| 37 | const U = union(E) {}; | 32 | const U = union(E) {}; |
test/behavior/enum.zig-2| ... | @@ -1079,7 +1079,6 @@ const bit_field_1 = BitFieldOfEnums{ | ... | @@ -1079,7 +1079,6 @@ const bit_field_1 = BitFieldOfEnums{ |
| 1079 | }; | 1079 | }; |
| 1080 | 1080 | ||
| 1081 | test "bit field access with enum fields" { | 1081 | test "bit field access with enum fields" { |
| 1082 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 1083 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1082 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1084 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1083 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1085 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1084 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -1120,7 +1119,6 @@ test "enum literal in array literal" { | ... | @@ -1120,7 +1119,6 @@ test "enum literal in array literal" { |
| 1120 | } | 1119 | } |
| 1121 | 1120 | ||
| 1122 | test "tag name functions are unique" { | 1121 | test "tag name functions are unique" { |
| 1123 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 1124 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1122 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1125 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1123 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1126 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1124 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
test/behavior/error.zig-5| ... | @@ -720,7 +720,6 @@ test "ret_ptr doesn't cause own inferred error set to be resolved" { | ... | @@ -720,7 +720,6 @@ test "ret_ptr doesn't cause own inferred error set to be resolved" { |
| 720 | } | 720 | } |
| 721 | 721 | ||
| 722 | test "simple else prong allowed even when all errors handled" { | 722 | test "simple else prong allowed even when all errors handled" { |
| 723 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 724 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 723 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 725 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 724 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 726 | 725 | ||
| ... | @@ -749,7 +748,6 @@ test "simple else prong allowed even when all errors handled" { | ... | @@ -749,7 +748,6 @@ test "simple else prong allowed even when all errors handled" { |
| 749 | test "pointer to error union payload" { | 748 | test "pointer to error union payload" { |
| 750 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 749 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 751 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 750 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 752 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 753 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 751 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 754 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 752 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 755 | 753 | ||
| ... | @@ -783,7 +781,6 @@ const NoReturn = struct { | ... | @@ -783,7 +781,6 @@ const NoReturn = struct { |
| 783 | test "error union of noreturn used with if" { | 781 | test "error union of noreturn used with if" { |
| 784 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 782 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 785 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 783 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 786 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 787 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 784 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 788 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 785 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 789 | 786 | ||
| ... | @@ -798,7 +795,6 @@ test "error union of noreturn used with if" { | ... | @@ -798,7 +795,6 @@ test "error union of noreturn used with if" { |
| 798 | test "error union of noreturn used with try" { | 795 | test "error union of noreturn used with try" { |
| 799 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 796 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 800 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 797 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 801 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 802 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 798 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 803 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 799 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 804 | 800 | ||
| ... | @@ -810,7 +806,6 @@ test "error union of noreturn used with try" { | ... | @@ -810,7 +806,6 @@ test "error union of noreturn used with try" { |
| 810 | test "error union of noreturn used with catch" { | 806 | test "error union of noreturn used with catch" { |
| 811 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 807 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 812 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 808 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 813 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 814 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 809 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 815 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 810 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 816 | 811 |
test/behavior/eval.zig-5| ... | @@ -470,7 +470,6 @@ test "binary math operator in partially inlined function" { | ... | @@ -470,7 +470,6 @@ test "binary math operator in partially inlined function" { |
| 470 | } | 470 | } |
| 471 | 471 | ||
| 472 | test "comptime shl" { | 472 | test "comptime shl" { |
| 473 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 474 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 473 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 475 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 474 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 476 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 475 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -501,7 +500,6 @@ test "comptime bitwise operators" { | ... | @@ -501,7 +500,6 @@ test "comptime bitwise operators" { |
| 501 | 500 | ||
| 502 | test "comptime shlWithOverflow" { | 501 | test "comptime shlWithOverflow" { |
| 503 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 502 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 504 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 505 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 503 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 506 | 504 | ||
| 507 | const ct_shifted = @shlWithOverflow(~@as(u64, 0), 16)[0]; | 505 | const ct_shifted = @shlWithOverflow(~@as(u64, 0), 16)[0]; |
| ... | @@ -812,7 +810,6 @@ test "array concatenation peer resolves element types - pointer" { | ... | @@ -812,7 +810,6 @@ test "array concatenation peer resolves element types - pointer" { |
| 812 | } | 810 | } |
| 813 | 811 | ||
| 814 | test "array concatenation sets the sentinel - value" { | 812 | test "array concatenation sets the sentinel - value" { |
| 815 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | ||
| 816 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 813 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 817 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 814 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 818 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 815 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -850,7 +847,6 @@ test "array concatenation sets the sentinel - pointer" { | ... | @@ -850,7 +847,6 @@ test "array concatenation sets the sentinel - pointer" { |
| 850 | } | 847 | } |
| 851 | 848 | ||
| 852 | test "array multiplication sets the sentinel - value" { | 849 | test "array multiplication sets the sentinel - value" { |
| 853 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | ||
| 854 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 850 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 855 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 851 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 856 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 852 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -1550,7 +1546,6 @@ test "x or true is comptime-known true" { | ... | @@ -1550,7 +1546,6 @@ test "x or true is comptime-known true" { |
| 1550 | test "non-optional and optional array elements concatenated" { | 1546 | test "non-optional and optional array elements concatenated" { |
| 1551 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1547 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1552 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1548 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1553 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 1554 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1549 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1555 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1550 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1556 | 1551 |
test/behavior/optional.zig-1| ... | @@ -365,7 +365,6 @@ test "optional pointer to zero bit optional payload" { | ... | @@ -365,7 +365,6 @@ test "optional pointer to zero bit optional payload" { |
| 365 | test "optional pointer to zero bit error union payload" { | 365 | test "optional pointer to zero bit error union payload" { |
| 366 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 366 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 367 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 367 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 368 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 369 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 368 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 370 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 369 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 371 | 370 |
test/behavior/ptrcast.zig-2| ... | @@ -129,7 +129,6 @@ fn testReinterpretOverAlignedExternStructAsExternStruct() !void { | ... | @@ -129,7 +129,6 @@ fn testReinterpretOverAlignedExternStructAsExternStruct() !void { |
| 129 | test "lower reinterpreted comptime field ptr (with under-aligned fields)" { | 129 | test "lower reinterpreted comptime field ptr (with under-aligned fields)" { |
| 130 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 130 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 131 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 131 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 132 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 133 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 132 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 134 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 133 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 135 | 134 | ||
| ... | @@ -153,7 +152,6 @@ test "lower reinterpreted comptime field ptr (with under-aligned fields)" { | ... | @@ -153,7 +152,6 @@ test "lower reinterpreted comptime field ptr (with under-aligned fields)" { |
| 153 | test "lower reinterpreted comptime field ptr" { | 152 | test "lower reinterpreted comptime field ptr" { |
| 154 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 153 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 155 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 154 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 156 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 157 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 155 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 158 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 156 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 159 | 157 |
test/behavior/return_address.zig-1| ... | @@ -6,7 +6,6 @@ fn retAddr() usize { | ... | @@ -6,7 +6,6 @@ fn retAddr() usize { |
| 6 | } | 6 | } |
| 7 | 7 | ||
| 8 | test "return address" { | 8 | test "return address" { |
| 9 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 10 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 9 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 11 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 10 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 12 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 11 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
test/behavior/type.zig-2| ... | @@ -258,7 +258,6 @@ test "Type.ErrorSet" { | ... | @@ -258,7 +258,6 @@ test "Type.ErrorSet" { |
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | test "Type.Struct" { | 260 | test "Type.Struct" { |
| 261 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 262 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 261 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 263 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 262 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 264 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 263 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -488,7 +487,6 @@ test "Type.Union from regular enum" { | ... | @@ -488,7 +487,6 @@ test "Type.Union from regular enum" { |
| 488 | } | 487 | } |
| 489 | 488 | ||
| 490 | test "Type.Fn" { | 489 | test "Type.Fn" { |
| 491 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 492 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 490 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 493 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 491 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 494 | 492 |
test/behavior/union.zig-11| ... | @@ -452,7 +452,6 @@ var glbl: Foo1 = undefined; | ... | @@ -452,7 +452,6 @@ var glbl: Foo1 = undefined; |
| 452 | test "global union with single field is correctly initialized" { | 452 | test "global union with single field is correctly initialized" { |
| 453 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 453 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 454 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 454 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 455 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 456 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 455 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 457 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 456 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 458 | 457 | ||
| ... | @@ -500,7 +499,6 @@ test "update the tag value for zero-sized unions" { | ... | @@ -500,7 +499,6 @@ test "update the tag value for zero-sized unions" { |
| 500 | test "union initializer generates padding only if needed" { | 499 | test "union initializer generates padding only if needed" { |
| 501 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 500 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 502 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 501 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 503 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 504 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 502 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 505 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 503 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 506 | 504 | ||
| ... | @@ -788,7 +786,6 @@ fn Setter(comptime attr: Attribute) type { | ... | @@ -788,7 +786,6 @@ fn Setter(comptime attr: Attribute) type { |
| 788 | test "return union init with void payload" { | 786 | test "return union init with void payload" { |
| 789 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 787 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 790 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 788 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 791 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 792 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 789 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 793 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 790 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 794 | 791 | ||
| ... | @@ -814,7 +811,6 @@ test "return union init with void payload" { | ... | @@ -814,7 +811,6 @@ test "return union init with void payload" { |
| 814 | test "@unionInit stored to a const" { | 811 | test "@unionInit stored to a const" { |
| 815 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 812 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 816 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 813 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 817 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 818 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 814 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 819 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 815 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 820 | 816 | ||
| ... | @@ -985,7 +981,6 @@ test "function call result coerces from tagged union to the tag" { | ... | @@ -985,7 +981,6 @@ test "function call result coerces from tagged union to the tag" { |
| 985 | test "cast from anonymous struct to union" { | 981 | test "cast from anonymous struct to union" { |
| 986 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 982 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 987 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 983 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 988 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 989 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 984 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 990 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 985 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 991 | 986 | ||
| ... | @@ -1018,7 +1013,6 @@ test "cast from anonymous struct to union" { | ... | @@ -1018,7 +1013,6 @@ test "cast from anonymous struct to union" { |
| 1018 | test "cast from pointer to anonymous struct to pointer to union" { | 1013 | test "cast from pointer to anonymous struct to pointer to union" { |
| 1019 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1014 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1020 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1015 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1021 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 1022 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1016 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1023 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1017 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1024 | 1018 | ||
| ... | @@ -1108,7 +1102,6 @@ test "containers with single-field enums" { | ... | @@ -1108,7 +1102,6 @@ test "containers with single-field enums" { |
| 1108 | test "@unionInit on union with tag but no fields" { | 1102 | test "@unionInit on union with tag but no fields" { |
| 1109 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1103 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1110 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1104 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1111 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 1112 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1105 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1113 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1106 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1114 | 1107 | ||
| ... | @@ -1382,7 +1375,6 @@ test "union and enum field order doesn't match" { | ... | @@ -1382,7 +1375,6 @@ test "union and enum field order doesn't match" { |
| 1382 | test "@unionInit uses tag value instead of field index" { | 1375 | test "@unionInit uses tag value instead of field index" { |
| 1383 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1376 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1384 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1377 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1385 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 1386 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1378 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1387 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1379 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1388 | 1380 | ||
| ... | @@ -1440,7 +1432,6 @@ test "union field ptr - zero sized field" { | ... | @@ -1440,7 +1432,6 @@ test "union field ptr - zero sized field" { |
| 1440 | test "packed union in packed struct" { | 1432 | test "packed union in packed struct" { |
| 1441 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1433 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1442 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1434 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1443 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 1444 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1435 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1445 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1436 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1446 | 1437 | ||
| ... | @@ -1528,7 +1519,6 @@ test "union reassignment can use previous value" { | ... | @@ -1528,7 +1519,6 @@ test "union reassignment can use previous value" { |
| 1528 | test "packed union with zero-bit field" { | 1519 | test "packed union with zero-bit field" { |
| 1529 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1520 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1530 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1521 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1531 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 1532 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1522 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1533 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1523 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1534 | 1524 | ||
| ... | @@ -1549,7 +1539,6 @@ test "packed union with zero-bit field" { | ... | @@ -1549,7 +1539,6 @@ test "packed union with zero-bit field" { |
| 1549 | test "reinterpreting enum value inside packed union" { | 1539 | test "reinterpreting enum value inside packed union" { |
| 1550 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1540 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1551 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1541 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1552 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 1553 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1542 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1554 | 1543 | ||
| 1555 | const U = packed union { | 1544 | const U = packed union { |
test/behavior/union_with_members.zig-1| ... | @@ -17,7 +17,6 @@ const ET = union(enum) { | ... | @@ -17,7 +17,6 @@ const ET = union(enum) { |
| 17 | }; | 17 | }; |
| 18 | 18 | ||
| 19 | test "enum with members" { | 19 | test "enum with members" { |
| 20 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | ||
| 21 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 22 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 21 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 23 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 22 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |