| author | |
| committer | |
| log | 05de6c279bb4b36bd8751659984a9918624f7108 |
| tree | 0a3c908736be592aa36e05d7327c73a8643fd62b |
| parent | 55b28c7e4438b3b8404a0fd703aad45db9dfe2ff |
| signature |
- implements `airSlice`, `airBitAnd`, `airBitOr`, `airShr`.
- got a basic design going for the `airErrorName` but for some reason it simply returns
empty bytes. will investigate further.
- only generating `.got.zig` entries when not compiling an object or shared library
- reduced the total amount of ops a mnemonic can have to 3, simplifying the logic44 files changed, 216 insertions(+), 177 deletions(-)
src/arch/riscv64/CodeGen.zig+193-14| ... | @@ -1609,10 +1609,7 @@ fn allocRegOrMem(self: *Self, inst: Air.Inst.Index, reg_ok: bool) !MCValue { | ... | @@ -1609,10 +1609,7 @@ fn allocRegOrMem(self: *Self, inst: Air.Inst.Index, reg_ok: bool) !MCValue { |
| 1609 | }; | 1609 | }; |
| 1610 | 1610 | ||
| 1611 | if (reg_ok) { | 1611 | if (reg_ok) { |
| 1612 | // Make sure the type can fit in a register before we try to allocate one. | 1612 | if (abi_size <= 8) { |
| 1613 | const ptr_bits = self.target.ptrBitWidth(); | ||
| 1614 | const ptr_bytes: u64 = @divExact(ptr_bits, 8); | ||
| 1615 | if (abi_size <= ptr_bytes) { | ||
| 1616 | if (self.register_manager.tryAllocReg(inst, gp)) |reg| { | 1613 | if (self.register_manager.tryAllocReg(inst, gp)) |reg| { |
| 1617 | return .{ .register = reg }; | 1614 | return .{ .register = reg }; |
| 1618 | } | 1615 | } |
| ... | @@ -1625,7 +1622,7 @@ fn allocRegOrMem(self: *Self, inst: Air.Inst.Index, reg_ok: bool) !MCValue { | ... | @@ -1625,7 +1622,7 @@ fn allocRegOrMem(self: *Self, inst: Air.Inst.Index, reg_ok: bool) !MCValue { |
| 1625 | 1622 | ||
| 1626 | /// Allocates a register from the general purpose set and returns the Register and the Lock. | 1623 | /// Allocates a register from the general purpose set and returns the Register and the Lock. |
| 1627 | /// | 1624 | /// |
| 1628 | /// Up to the user to unlock the register later. | 1625 | /// Up to the caller to unlock the register later. |
| 1629 | fn allocReg(self: *Self) !struct { Register, RegisterLock } { | 1626 | fn allocReg(self: *Self) !struct { Register, RegisterLock } { |
| 1630 | const reg = try self.register_manager.allocReg(null, gp); | 1627 | const reg = try self.register_manager.allocReg(null, gp); |
| 1631 | const lock = self.register_manager.lockRegAssumeUnused(reg); | 1628 | const lock = self.register_manager.lockRegAssumeUnused(reg); |
| ... | @@ -1923,9 +1920,25 @@ fn airMinMax( | ... | @@ -1923,9 +1920,25 @@ fn airMinMax( |
| 1923 | } | 1920 | } |
| 1924 | 1921 | ||
| 1925 | fn airSlice(self: *Self, inst: Air.Inst.Index) !void { | 1922 | fn airSlice(self: *Self, inst: Air.Inst.Index) !void { |
| 1923 | const zcu = self.bin_file.comp.module.?; | ||
| 1926 | const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl; | 1924 | const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl; |
| 1927 | const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data; | 1925 | const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data; |
| 1928 | const result: MCValue = if (self.liveness.isUnused(inst)) .unreach else return self.fail("TODO implement slice for {}", .{self.target.cpu.arch}); | 1926 | |
| 1927 | const slice_ty = self.typeOfIndex(inst); | ||
| 1928 | const frame_index = try self.allocFrameIndex(FrameAlloc.initSpill(slice_ty, zcu)); | ||
| 1929 | |||
| 1930 | const ptr_ty = self.typeOf(bin_op.lhs); | ||
| 1931 | try self.genSetMem(.{ .frame = frame_index }, 0, ptr_ty, .{ .air_ref = bin_op.lhs }); | ||
| 1932 | |||
| 1933 | const len_ty = self.typeOf(bin_op.rhs); | ||
| 1934 | try self.genSetMem( | ||
| 1935 | .{ .frame = frame_index }, | ||
| 1936 | @intCast(ptr_ty.abiSize(zcu)), | ||
| 1937 | len_ty, | ||
| 1938 | .{ .air_ref = bin_op.rhs }, | ||
| 1939 | ); | ||
| 1940 | |||
| 1941 | const result = MCValue{ .load_frame = .{ .index = frame_index } }; | ||
| 1929 | return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none }); | 1942 | return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none }); |
| 1930 | } | 1943 | } |
| 1931 | 1944 | ||
| ... | @@ -2575,13 +2588,91 @@ fn airMod(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -2575,13 +2588,91 @@ fn airMod(self: *Self, inst: Air.Inst.Index) !void { |
| 2575 | 2588 | ||
| 2576 | fn airBitAnd(self: *Self, inst: Air.Inst.Index) !void { | 2589 | fn airBitAnd(self: *Self, inst: Air.Inst.Index) !void { |
| 2577 | const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; | 2590 | const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; |
| 2578 | const result: MCValue = if (self.liveness.isUnused(inst)) .unreach else return self.fail("TODO implement bitwise and for {}", .{self.target.cpu.arch}); | 2591 | const result: MCValue = if (self.liveness.isUnused(inst)) .unreach else result: { |
| 2592 | const lhs = try self.resolveInst(bin_op.lhs); | ||
| 2593 | const rhs = try self.resolveInst(bin_op.rhs); | ||
| 2594 | |||
| 2595 | const lhs_ty = self.typeOf(bin_op.lhs); | ||
| 2596 | const rhs_ty = self.typeOf(bin_op.rhs); | ||
| 2597 | |||
| 2598 | const lhs_reg, const lhs_lock = blk: { | ||
| 2599 | if (lhs == .register) break :blk .{ lhs.register, null }; | ||
| 2600 | |||
| 2601 | const lhs_reg, const lhs_lock = try self.allocReg(); | ||
| 2602 | try self.genSetReg(lhs_ty, lhs_reg, lhs); | ||
| 2603 | break :blk .{ lhs_reg, lhs_lock }; | ||
| 2604 | }; | ||
| 2605 | defer if (lhs_lock) |lock| self.register_manager.unlockReg(lock); | ||
| 2606 | |||
| 2607 | const rhs_reg, const rhs_lock = blk: { | ||
| 2608 | if (rhs == .register) break :blk .{ rhs.register, null }; | ||
| 2609 | |||
| 2610 | const rhs_reg, const rhs_lock = try self.allocReg(); | ||
| 2611 | try self.genSetReg(rhs_ty, rhs_reg, rhs); | ||
| 2612 | break :blk .{ rhs_reg, rhs_lock }; | ||
| 2613 | }; | ||
| 2614 | defer if (rhs_lock) |lock| self.register_manager.unlockReg(lock); | ||
| 2615 | |||
| 2616 | const dest_reg, const dest_lock = try self.allocReg(); | ||
| 2617 | defer self.register_manager.unlockReg(dest_lock); | ||
| 2618 | |||
| 2619 | _ = try self.addInst(.{ | ||
| 2620 | .tag = .@"and", | ||
| 2621 | .ops = .rrr, | ||
| 2622 | .data = .{ .r_type = .{ | ||
| 2623 | .rd = dest_reg, | ||
| 2624 | .rs1 = lhs_reg, | ||
| 2625 | .rs2 = rhs_reg, | ||
| 2626 | } }, | ||
| 2627 | }); | ||
| 2628 | |||
| 2629 | break :result .{ .register = dest_reg }; | ||
| 2630 | }; | ||
| 2579 | return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none }); | 2631 | return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none }); |
| 2580 | } | 2632 | } |
| 2581 | 2633 | ||
| 2582 | fn airBitOr(self: *Self, inst: Air.Inst.Index) !void { | 2634 | fn airBitOr(self: *Self, inst: Air.Inst.Index) !void { |
| 2583 | const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; | 2635 | const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; |
| 2584 | const result: MCValue = if (self.liveness.isUnused(inst)) .unreach else return self.fail("TODO implement bitwise or for {}", .{self.target.cpu.arch}); | 2636 | const result: MCValue = if (self.liveness.isUnused(inst)) .unreach else result: { |
| 2637 | const lhs = try self.resolveInst(bin_op.lhs); | ||
| 2638 | const rhs = try self.resolveInst(bin_op.rhs); | ||
| 2639 | |||
| 2640 | const lhs_ty = self.typeOf(bin_op.lhs); | ||
| 2641 | const rhs_ty = self.typeOf(bin_op.rhs); | ||
| 2642 | |||
| 2643 | const lhs_reg, const lhs_lock = blk: { | ||
| 2644 | if (lhs == .register) break :blk .{ lhs.register, null }; | ||
| 2645 | |||
| 2646 | const lhs_reg, const lhs_lock = try self.allocReg(); | ||
| 2647 | try self.genSetReg(lhs_ty, lhs_reg, lhs); | ||
| 2648 | break :blk .{ lhs_reg, lhs_lock }; | ||
| 2649 | }; | ||
| 2650 | defer if (lhs_lock) |lock| self.register_manager.unlockReg(lock); | ||
| 2651 | |||
| 2652 | const rhs_reg, const rhs_lock = blk: { | ||
| 2653 | if (rhs == .register) break :blk .{ rhs.register, null }; | ||
| 2654 | |||
| 2655 | const rhs_reg, const rhs_lock = try self.allocReg(); | ||
| 2656 | try self.genSetReg(rhs_ty, rhs_reg, rhs); | ||
| 2657 | break :blk .{ rhs_reg, rhs_lock }; | ||
| 2658 | }; | ||
| 2659 | defer if (rhs_lock) |lock| self.register_manager.unlockReg(lock); | ||
| 2660 | |||
| 2661 | const dest_reg, const dest_lock = try self.allocReg(); | ||
| 2662 | defer self.register_manager.unlockReg(dest_lock); | ||
| 2663 | |||
| 2664 | _ = try self.addInst(.{ | ||
| 2665 | .tag = .@"or", | ||
| 2666 | .ops = .rrr, | ||
| 2667 | .data = .{ .r_type = .{ | ||
| 2668 | .rd = dest_reg, | ||
| 2669 | .rs1 = lhs_reg, | ||
| 2670 | .rs2 = rhs_reg, | ||
| 2671 | } }, | ||
| 2672 | }); | ||
| 2673 | |||
| 2674 | break :result .{ .register = dest_reg }; | ||
| 2675 | }; | ||
| 2585 | return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none }); | 2676 | return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none }); |
| 2586 | } | 2677 | } |
| 2587 | 2678 | ||
| ... | @@ -2612,7 +2703,14 @@ fn airShlSat(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -2612,7 +2703,14 @@ fn airShlSat(self: *Self, inst: Air.Inst.Index) !void { |
| 2612 | 2703 | ||
| 2613 | fn airShr(self: *Self, inst: Air.Inst.Index) !void { | 2704 | fn airShr(self: *Self, inst: Air.Inst.Index) !void { |
| 2614 | const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; | 2705 | const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; |
| 2615 | const result: MCValue = if (self.liveness.isUnused(inst)) .unreach else return self.fail("TODO implement shr for {}", .{self.target.cpu.arch}); | 2706 | const result: MCValue = if (self.liveness.isUnused(inst)) .unreach else result: { |
| 2707 | const lhs = try self.resolveInst(bin_op.lhs); | ||
| 2708 | const rhs = try self.resolveInst(bin_op.rhs); | ||
| 2709 | const lhs_ty = self.typeOf(bin_op.lhs); | ||
| 2710 | const rhs_ty = self.typeOf(bin_op.rhs); | ||
| 2711 | |||
| 2712 | break :result try self.binOp(.shr, lhs, lhs_ty, rhs, rhs_ty); | ||
| 2713 | }; | ||
| 2616 | return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none }); | 2714 | return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none }); |
| 2617 | } | 2715 | } |
| 2618 | 2716 | ||
| ... | @@ -2671,6 +2769,10 @@ fn airUnwrapErrErr(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -2671,6 +2769,10 @@ fn airUnwrapErrErr(self: *Self, inst: Air.Inst.Index) !void { |
| 2671 | } | 2769 | } |
| 2672 | break :result result; | 2770 | break :result result; |
| 2673 | }, | 2771 | }, |
| 2772 | .load_frame => |frame_addr| break :result .{ .load_frame = .{ | ||
| 2773 | .index = frame_addr.index, | ||
| 2774 | .off = frame_addr.off + @as(i32, @intCast(err_off)), | ||
| 2775 | } }, | ||
| 2674 | else => return self.fail("TODO implement unwrap_err_err for {}", .{operand}), | 2776 | else => return self.fail("TODO implement unwrap_err_err for {}", .{operand}), |
| 2675 | } | 2777 | } |
| 2676 | }; | 2778 | }; |
| ... | @@ -3317,6 +3419,7 @@ fn airLoad(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -3317,6 +3419,7 @@ fn airLoad(self: *Self, inst: Air.Inst.Index) !void { |
| 3317 | const zcu = self.bin_file.comp.module.?; | 3419 | const zcu = self.bin_file.comp.module.?; |
| 3318 | const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op; | 3420 | const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op; |
| 3319 | const elem_ty = self.typeOfIndex(inst); | 3421 | const elem_ty = self.typeOfIndex(inst); |
| 3422 | |||
| 3320 | const result: MCValue = result: { | 3423 | const result: MCValue = result: { |
| 3321 | if (!elem_ty.hasRuntimeBits(zcu)) | 3424 | if (!elem_ty.hasRuntimeBits(zcu)) |
| 3322 | break :result .none; | 3425 | break :result .none; |
| ... | @@ -3326,8 +3429,11 @@ fn airLoad(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -3326,8 +3429,11 @@ fn airLoad(self: *Self, inst: Air.Inst.Index) !void { |
| 3326 | if (self.liveness.isUnused(inst) and !is_volatile) | 3429 | if (self.liveness.isUnused(inst) and !is_volatile) |
| 3327 | break :result .unreach; | 3430 | break :result .unreach; |
| 3328 | 3431 | ||
| 3432 | const elem_size = elem_ty.abiSize(zcu); | ||
| 3433 | |||
| 3329 | const dst_mcv: MCValue = blk: { | 3434 | const dst_mcv: MCValue = blk: { |
| 3330 | if (self.reuseOperand(inst, ty_op.operand, 0, ptr)) { | 3435 | // Pointer is 8 bytes, and if the element is more than that, we cannot reuse it. |
| 3436 | if (elem_size <= 8 and self.reuseOperand(inst, ty_op.operand, 0, ptr)) { | ||
| 3331 | // The MCValue that holds the pointer can be re-used as the value. | 3437 | // The MCValue that holds the pointer can be re-used as the value. |
| 3332 | break :blk ptr; | 3438 | break :blk ptr; |
| 3333 | } else { | 3439 | } else { |
| ... | @@ -3794,6 +3900,7 @@ fn genCall( | ... | @@ -3794,6 +3900,7 @@ fn genCall( |
| 3794 | 3900 | ||
| 3795 | for (call_info.args, arg_tys, args, frame_indices) |dst_arg, arg_ty, src_arg, frame_index| { | 3901 | for (call_info.args, arg_tys, args, frame_indices) |dst_arg, arg_ty, src_arg, frame_index| { |
| 3796 | switch (dst_arg) { | 3902 | switch (dst_arg) { |
| 3903 | .none, .load_frame => {}, | ||
| 3797 | .register_pair => try self.genCopy(arg_ty, dst_arg, src_arg), | 3904 | .register_pair => try self.genCopy(arg_ty, dst_arg, src_arg), |
| 3798 | .register => |dst_reg| try self.genSetReg( | 3905 | .register => |dst_reg| try self.genSetReg( |
| 3799 | arg_ty, | 3906 | arg_ty, |
| ... | @@ -5573,6 +5680,7 @@ fn airErrorName(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -5573,6 +5680,7 @@ fn airErrorName(self: *Self, inst: Air.Inst.Index) !void { |
| 5573 | const addr_reg, const addr_lock = try self.allocReg(); | 5680 | const addr_reg, const addr_lock = try self.allocReg(); |
| 5574 | defer self.register_manager.unlockReg(addr_lock); | 5681 | defer self.register_manager.unlockReg(addr_lock); |
| 5575 | 5682 | ||
| 5683 | // this is now the base address of the error name table | ||
| 5576 | const lazy_sym = link.File.LazySymbol.initDecl(.const_data, null, zcu); | 5684 | const lazy_sym = link.File.LazySymbol.initDecl(.const_data, null, zcu); |
| 5577 | if (self.bin_file.cast(link.File.Elf)) |elf_file| { | 5685 | if (self.bin_file.cast(link.File.Elf)) |elf_file| { |
| 5578 | const sym_index = elf_file.zigObjectPtr().?.getOrCreateMetadataForLazySymbol(elf_file, lazy_sym) catch |err| | 5686 | const sym_index = elf_file.zigObjectPtr().?.getOrCreateMetadataForLazySymbol(elf_file, lazy_sym) catch |err| |
| ... | @@ -5589,10 +5697,77 @@ fn airErrorName(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -5589,10 +5697,77 @@ fn airErrorName(self: *Self, inst: Air.Inst.Index) !void { |
| 5589 | const end_reg, const end_lock = try self.allocReg(); | 5697 | const end_reg, const end_lock = try self.allocReg(); |
| 5590 | defer self.register_manager.unlockReg(end_lock); | 5698 | defer self.register_manager.unlockReg(end_lock); |
| 5591 | 5699 | ||
| 5592 | _ = start_reg; | 5700 | // const tmp_reg, const tmp_lock = try self.allocReg(); |
| 5593 | _ = end_reg; | 5701 | // defer self.register_manager.unlockReg(tmp_lock); |
| 5702 | |||
| 5703 | // we move the base address forward by the following formula: base + (errno * 8) | ||
| 5704 | |||
| 5705 | // shifting left by 4 is the same as multiplying by 8 | ||
| 5706 | _ = try self.addInst(.{ | ||
| 5707 | .tag = .slli, | ||
| 5708 | .ops = .rri, | ||
| 5709 | .data = .{ .i_type = .{ | ||
| 5710 | .imm12 = Immediate.s(4), | ||
| 5711 | .rd = err_reg, | ||
| 5712 | .rs1 = err_reg, | ||
| 5713 | } }, | ||
| 5714 | }); | ||
| 5715 | |||
| 5716 | _ = try self.addInst(.{ | ||
| 5717 | .tag = .add, | ||
| 5718 | .ops = .rrr, | ||
| 5719 | .data = .{ .r_type = .{ | ||
| 5720 | .rd = addr_reg, | ||
| 5721 | .rs1 = addr_reg, | ||
| 5722 | .rs2 = err_reg, | ||
| 5723 | } }, | ||
| 5724 | }); | ||
| 5725 | |||
| 5726 | _ = try self.addInst(.{ | ||
| 5727 | .tag = .pseudo, | ||
| 5728 | .ops = .pseudo_load_rm, | ||
| 5729 | .data = .{ | ||
| 5730 | .rm = .{ | ||
| 5731 | .r = start_reg, | ||
| 5732 | .m = .{ | ||
| 5733 | .base = .{ .reg = addr_reg }, | ||
| 5734 | .mod = .{ .off = 0 }, | ||
| 5735 | }, | ||
| 5736 | }, | ||
| 5737 | }, | ||
| 5738 | }); | ||
| 5739 | |||
| 5740 | _ = try self.addInst(.{ | ||
| 5741 | .tag = .pseudo, | ||
| 5742 | .ops = .pseudo_load_rm, | ||
| 5743 | .data = .{ | ||
| 5744 | .rm = .{ | ||
| 5745 | .r = end_reg, | ||
| 5746 | .m = .{ | ||
| 5747 | .base = .{ .reg = addr_reg }, | ||
| 5748 | .mod = .{ .off = 8 }, | ||
| 5749 | }, | ||
| 5750 | }, | ||
| 5751 | }, | ||
| 5752 | }); | ||
| 5753 | |||
| 5754 | const dst_mcv = try self.allocRegOrMem(inst, false); | ||
| 5755 | const frame = dst_mcv.load_frame; | ||
| 5756 | try self.genSetMem( | ||
| 5757 | .{ .frame = frame.index }, | ||
| 5758 | frame.off, | ||
| 5759 | Type.usize, | ||
| 5760 | .{ .register = start_reg }, | ||
| 5761 | ); | ||
| 5594 | 5762 | ||
| 5595 | return self.fail("TODO: airErrorName", .{}); | 5763 | try self.genSetMem( |
| 5764 | .{ .frame = frame.index }, | ||
| 5765 | frame.off + 8, | ||
| 5766 | Type.usize, | ||
| 5767 | .{ .register = end_reg }, | ||
| 5768 | ); | ||
| 5769 | |||
| 5770 | return self.finishAir(inst, dst_mcv, .{ un_op, .none, .none }); | ||
| 5596 | } | 5771 | } |
| 5597 | 5772 | ||
| 5598 | fn airSplat(self: *Self, inst: Air.Inst.Index) !void { | 5773 | fn airSplat(self: *Self, inst: Air.Inst.Index) !void { |
| ... | @@ -5881,7 +6056,11 @@ fn resolveCallingConventionValues( | ... | @@ -5881,7 +6056,11 @@ fn resolveCallingConventionValues( |
| 5881 | } | 6056 | } |
| 5882 | 6057 | ||
| 5883 | for (param_types, result.args) |ty, *arg| { | 6058 | for (param_types, result.args) |ty, *arg| { |
| 5884 | assert(ty.hasRuntimeBitsIgnoreComptime(zcu)); | 6059 | if (!ty.hasRuntimeBitsIgnoreComptime(zcu)) { |
| 6060 | assert(cc == .Unspecified); | ||
| 6061 | arg.* = .none; | ||
| 6062 | continue; | ||
| 6063 | } | ||
| 5885 | 6064 | ||
| 5886 | var arg_mcv: [2]MCValue = undefined; | 6065 | var arg_mcv: [2]MCValue = undefined; |
| 5887 | var arg_mcv_i: usize = 0; | 6066 | var arg_mcv_i: usize = 0; |
src/arch/riscv64/Emit.zig+7-1| ... | @@ -42,6 +42,12 @@ pub fn emitMir(emit: *Emit) Error!void { | ... | @@ -42,6 +42,12 @@ pub fn emitMir(emit: *Emit) Error!void { |
| 42 | .enc = std.meta.activeTag(lowered_inst.encoding.data), | 42 | .enc = std.meta.activeTag(lowered_inst.encoding.data), |
| 43 | }), | 43 | }), |
| 44 | .load_symbol_reloc => |symbol| { | 44 | .load_symbol_reloc => |symbol| { |
| 45 | const is_obj_or_static_lib = switch (emit.lower.output_mode) { | ||
| 46 | .Exe => false, | ||
| 47 | .Obj => true, | ||
| 48 | .Lib => emit.lower.link_mode == .static, | ||
| 49 | }; | ||
| 50 | |||
| 45 | if (emit.lower.bin_file.cast(link.File.Elf)) |elf_file| { | 51 | if (emit.lower.bin_file.cast(link.File.Elf)) |elf_file| { |
| 46 | const atom_ptr = elf_file.symbol(symbol.atom_index).atom(elf_file).?; | 52 | const atom_ptr = elf_file.symbol(symbol.atom_index).atom(elf_file).?; |
| 47 | const sym_index = elf_file.zigObjectPtr().?.symbol(symbol.sym_index); | 53 | const sym_index = elf_file.zigObjectPtr().?.symbol(symbol.sym_index); |
| ... | @@ -50,7 +56,7 @@ pub fn emitMir(emit: *Emit) Error!void { | ... | @@ -50,7 +56,7 @@ pub fn emitMir(emit: *Emit) Error!void { |
| 50 | var hi_r_type: u32 = @intFromEnum(std.elf.R_RISCV.HI20); | 56 | var hi_r_type: u32 = @intFromEnum(std.elf.R_RISCV.HI20); |
| 51 | var lo_r_type: u32 = @intFromEnum(std.elf.R_RISCV.LO12_I); | 57 | var lo_r_type: u32 = @intFromEnum(std.elf.R_RISCV.LO12_I); |
| 52 | 58 | ||
| 53 | if (sym.flags.needs_zig_got) { | 59 | if (sym.flags.needs_zig_got and !is_obj_or_static_lib) { |
| 54 | _ = try sym.getOrCreateZigGotEntry(sym_index, elf_file); | 60 | _ = try sym.getOrCreateZigGotEntry(sym_index, elf_file); |
| 55 | 61 | ||
| 56 | hi_r_type = Elf.R_ZIG_GOT_HI20; | 62 | hi_r_type = Elf.R_ZIG_GOT_HI20; |
src/arch/riscv64/Encoding.zig+4| ... | @@ -16,6 +16,7 @@ pub const Mnemonic = enum { | ... | @@ -16,6 +16,7 @@ pub const Mnemonic = enum { |
| 16 | slli, | 16 | slli, |
| 17 | srli, | 17 | srli, |
| 18 | srai, | 18 | srai, |
| 19 | sllw, | ||
| 19 | 20 | ||
| 20 | addi, | 21 | addi, |
| 21 | jalr, | 22 | jalr, |
| ... | @@ -77,6 +78,8 @@ pub const Mnemonic = enum { | ... | @@ -77,6 +78,8 @@ pub const Mnemonic = enum { |
| 77 | .slli => .{ .opcode = 0b0010011, .funct3 = 0b001, .funct7 = null }, | 78 | .slli => .{ .opcode = 0b0010011, .funct3 = 0b001, .funct7 = null }, |
| 78 | .srli => .{ .opcode = 0b0010011, .funct3 = 0b101, .funct7 = null }, | 79 | .srli => .{ .opcode = 0b0010011, .funct3 = 0b101, .funct7 = null }, |
| 79 | .srai => .{ .opcode = 0b0010011, .funct3 = 0b101, .funct7 = null, .offset = 1 << 10 }, | 80 | .srai => .{ .opcode = 0b0010011, .funct3 = 0b101, .funct7 = null, .offset = 1 << 10 }, |
| 81 | |||
| 82 | .sllw => .{ .opcode = 0b0111011, .funct3 = 0b001, .funct7 = 0b0000000 }, | ||
| 80 | 83 | ||
| 81 | .lui => .{ .opcode = 0b0110111, .funct3 = null, .funct7 = null }, | 84 | .lui => .{ .opcode = 0b0110111, .funct3 = null, .funct7 = null }, |
| 82 | .auipc => .{ .opcode = 0b0010111, .funct3 = null, .funct7 = null }, | 85 | .auipc => .{ .opcode = 0b0010111, .funct3 = null, .funct7 = null }, |
| ... | @@ -152,6 +155,7 @@ pub const InstEnc = enum { | ... | @@ -152,6 +155,7 @@ pub const InstEnc = enum { |
| 152 | 155 | ||
| 153 | .slt, | 156 | .slt, |
| 154 | .sltu, | 157 | .sltu, |
| 158 | .sllw, | ||
| 155 | .mul, | 159 | .mul, |
| 156 | .xor, | 160 | .xor, |
| 157 | .add, | 161 | .add, |
src/arch/riscv64/Lower.zig+2-2| ... | @@ -71,7 +71,7 @@ pub fn lowerMir(lower: *Lower, index: Mir.Inst.Index) Error!struct { | ... | @@ -71,7 +71,7 @@ pub fn lowerMir(lower: *Lower, index: Mir.Inst.Index) Error!struct { |
| 71 | 71 | ||
| 72 | switch (inst.ops) { | 72 | switch (inst.ops) { |
| 73 | .pseudo_load_rm => { | 73 | .pseudo_load_rm => { |
| 74 | const tag: Encoding.Mnemonic = switch (rm.m.mod.rm.size) { | 74 | const tag: Encoding.Mnemonic = switch (rm.m.mod.size()) { |
| 75 | .byte => .lb, | 75 | .byte => .lb, |
| 76 | .hword => .lh, | 76 | .hword => .lh, |
| 77 | .word => .lw, | 77 | .word => .lw, |
| ... | @@ -85,7 +85,7 @@ pub fn lowerMir(lower: *Lower, index: Mir.Inst.Index) Error!struct { | ... | @@ -85,7 +85,7 @@ pub fn lowerMir(lower: *Lower, index: Mir.Inst.Index) Error!struct { |
| 85 | }); | 85 | }); |
| 86 | }, | 86 | }, |
| 87 | .pseudo_store_rm => { | 87 | .pseudo_store_rm => { |
| 88 | const tag: Encoding.Mnemonic = switch (rm.m.mod.rm.size) { | 88 | const tag: Encoding.Mnemonic = switch (rm.m.mod.size()) { |
| 89 | .byte => .sb, | 89 | .byte => .sb, |
| 90 | .hword => .sh, | 90 | .hword => .sh, |
| 91 | .word => .sw, | 91 | .word => .sw, |
src/arch/riscv64/bits.zig+7| ... | @@ -21,6 +21,13 @@ pub const Memory = struct { | ... | @@ -21,6 +21,13 @@ pub const Memory = struct { |
| 21 | disp: i32 = 0, | 21 | disp: i32 = 0, |
| 22 | }, | 22 | }, |
| 23 | off: i32, | 23 | off: i32, |
| 24 | |||
| 25 | pub fn size(mod: Mod) Size { | ||
| 26 | return switch (mod) { | ||
| 27 | .rm => |rm| rm.size, | ||
| 28 | .off => Size.dword, // assumed to be a register size | ||
| 29 | }; | ||
| 30 | } | ||
| 24 | }; | 31 | }; |
| 25 | 32 | ||
| 26 | pub const Size = enum(u4) { | 33 | pub const Size = enum(u4) { |
src/arch/riscv64/encoder.zig+1-2| ... | @@ -11,12 +11,11 @@ pub const Instruction = struct { | ... | @@ -11,12 +11,11 @@ pub const Instruction = struct { |
| 11 | 11 | ||
| 12 | pub fn new(mnemonic: Encoding.Mnemonic, ops: []const Operand) !Instruction { | 12 | pub fn new(mnemonic: Encoding.Mnemonic, ops: []const Operand) !Instruction { |
| 13 | const encoding = (try Encoding.findByMnemonic(mnemonic, ops)) orelse { | 13 | const encoding = (try Encoding.findByMnemonic(mnemonic, ops)) orelse { |
| 14 | std.log.err("no encoding found for: {s} {s} {s} {s} {s}", .{ | 14 | std.log.err("no encoding found for: {s} [{s} {s} {s}]", .{ |
| 15 | @tagName(mnemonic), | 15 | @tagName(mnemonic), |
| 16 | @tagName(if (ops.len > 0) ops[0] else .none), | 16 | @tagName(if (ops.len > 0) ops[0] else .none), |
| 17 | @tagName(if (ops.len > 1) ops[1] else .none), | 17 | @tagName(if (ops.len > 1) ops[1] else .none), |
| 18 | @tagName(if (ops.len > 2) ops[2] else .none), | 18 | @tagName(if (ops.len > 2) ops[2] else .none), |
| 19 | @tagName(if (ops.len > 3) ops[3] else .none), | ||
| 20 | }); | 19 | }); |
| 21 | return error.InvalidInstruction; | 20 | return error.InvalidInstruction; |
| 22 | }; | 21 | }; |
test/behavior/align.zig-3| ... | @@ -54,7 +54,6 @@ fn addUnaligned(a: *align(1) const u32, b: *align(1) const u32) u32 { | ... | @@ -54,7 +54,6 @@ fn addUnaligned(a: *align(1) const u32, b: *align(1) const u32) u32 { |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | test "@alignCast pointers" { | 56 | test "@alignCast pointers" { |
| 57 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | ||
| 58 | var x: u32 align(4) = 1; | 57 | var x: u32 align(4) = 1; |
| 59 | expectsOnly1(&x); | 58 | expectsOnly1(&x); |
| 60 | try expect(x == 2); | 59 | try expect(x == 2); |
| ... | @@ -426,7 +425,6 @@ test "function callconv expression depends on generic parameter" { | ... | @@ -426,7 +425,6 @@ test "function callconv expression depends on generic parameter" { |
| 426 | } | 425 | } |
| 427 | 426 | ||
| 428 | test "runtime-known array index has best alignment possible" { | 427 | test "runtime-known array index has best alignment possible" { |
| 429 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | ||
| 430 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 428 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 431 | 429 | ||
| 432 | // take full advantage of over-alignment | 430 | // take full advantage of over-alignment |
| ... | @@ -562,7 +560,6 @@ test "align(@alignOf(T)) T does not force resolution of T" { | ... | @@ -562,7 +560,6 @@ test "align(@alignOf(T)) T does not force resolution of T" { |
| 562 | } | 560 | } |
| 563 | 561 | ||
| 564 | test "align(N) on functions" { | 562 | test "align(N) on functions" { |
| 565 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | ||
| 566 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 563 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 567 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 564 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 568 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 565 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
test/behavior/array.zig-1| ... | @@ -1047,7 +1047,6 @@ test "union that needs padding bytes inside an array" { | ... | @@ -1047,7 +1047,6 @@ test "union that needs padding bytes inside an array" { |
| 1047 | 1047 | ||
| 1048 | test "runtime index of array of zero-bit values" { | 1048 | test "runtime index of array of zero-bit values" { |
| 1049 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1049 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1050 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1051 | 1050 | ||
| 1052 | var runtime: struct { array: [1]void, index: usize } = undefined; | 1051 | var runtime: struct { array: [1]void, index: usize } = undefined; |
| 1053 | runtime = .{ .array = .{{}}, .index = 0 }; | 1052 | runtime = .{ .array = .{{}}, .index = 0 }; |
test/behavior/basic.zig-6| ... | @@ -513,7 +513,6 @@ var global_foo: *i32 = undefined; | ... | @@ -513,7 +513,6 @@ var global_foo: *i32 = undefined; |
| 513 | test "peer result location with typed parent, runtime condition, comptime prongs" { | 513 | test "peer result location with typed parent, runtime condition, comptime prongs" { |
| 514 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 514 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 515 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 515 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 516 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 517 | 516 | ||
| 518 | const S = struct { | 517 | const S = struct { |
| 519 | fn doTheTest(arg: i32) i32 { | 518 | fn doTheTest(arg: i32) i32 { |
| ... | @@ -593,7 +592,6 @@ test "equality compare fn ptrs" { | ... | @@ -593,7 +592,6 @@ test "equality compare fn ptrs" { |
| 593 | 592 | ||
| 594 | test "self reference through fn ptr field" { | 593 | test "self reference through fn ptr field" { |
| 595 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 594 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 596 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 597 | 595 | ||
| 598 | const S = struct { | 596 | const S = struct { |
| 599 | const A = struct { | 597 | const A = struct { |
| ... | @@ -838,7 +836,6 @@ test "labeled block implicitly ends in a break" { | ... | @@ -838,7 +836,6 @@ test "labeled block implicitly ends in a break" { |
| 838 | test "catch in block has correct result location" { | 836 | test "catch in block has correct result location" { |
| 839 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 837 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 840 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 838 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 841 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 842 | 839 | ||
| 843 | const S = struct { | 840 | const S = struct { |
| 844 | fn open() error{A}!@This() { | 841 | fn open() error{A}!@This() { |
| ... | @@ -870,7 +867,6 @@ test "labeled block with runtime branch forwards its result location type to bre | ... | @@ -870,7 +867,6 @@ test "labeled block with runtime branch forwards its result location type to bre |
| 870 | 867 | ||
| 871 | test "try in labeled block doesn't cast to wrong type" { | 868 | test "try in labeled block doesn't cast to wrong type" { |
| 872 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 869 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 873 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 874 | 870 | ||
| 875 | const S = struct { | 871 | const S = struct { |
| 876 | a: u32, | 872 | a: u32, |
| ... | @@ -1246,8 +1242,6 @@ test "pointer to tuple field can be dereferenced at comptime" { | ... | @@ -1246,8 +1242,6 @@ test "pointer to tuple field can be dereferenced at comptime" { |
| 1246 | } | 1242 | } |
| 1247 | 1243 | ||
| 1248 | test "proper value is returned from labeled block" { | 1244 | test "proper value is returned from labeled block" { |
| 1249 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1250 | |||
| 1251 | const S = struct { | 1245 | const S = struct { |
| 1252 | fn hash(v: *u32, key: anytype) void { | 1246 | fn hash(v: *u32, key: anytype) void { |
| 1253 | const Key = @TypeOf(key); | 1247 | const Key = @TypeOf(key); |
test/behavior/bitcast.zig-5| ... | @@ -250,7 +250,6 @@ test "bitcast packed struct to integer and back" { | ... | @@ -250,7 +250,6 @@ test "bitcast packed struct to integer and back" { |
| 250 | test "implicit cast to error union by returning" { | 250 | test "implicit cast to error union by returning" { |
| 251 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 251 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 252 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 252 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 253 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 254 | 253 | ||
| 255 | const S = struct { | 254 | const S = struct { |
| 256 | fn entry() !void { | 255 | fn entry() !void { |
| ... | @@ -280,8 +279,6 @@ test "comptime bitcast used in expression has the correct type" { | ... | @@ -280,8 +279,6 @@ test "comptime bitcast used in expression has the correct type" { |
| 280 | } | 279 | } |
| 281 | 280 | ||
| 282 | test "bitcast passed as tuple element" { | 281 | test "bitcast passed as tuple element" { |
| 283 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 284 | |||
| 285 | const S = struct { | 282 | const S = struct { |
| 286 | fn foo(args: anytype) !void { | 283 | fn foo(args: anytype) !void { |
| 287 | comptime assert(@TypeOf(args[0]) == f32); | 284 | comptime assert(@TypeOf(args[0]) == f32); |
| ... | @@ -292,8 +289,6 @@ test "bitcast passed as tuple element" { | ... | @@ -292,8 +289,6 @@ test "bitcast passed as tuple element" { |
| 292 | } | 289 | } |
| 293 | 290 | ||
| 294 | test "triple level result location with bitcast sandwich passed as tuple element" { | 291 | test "triple level result location with bitcast sandwich passed as tuple element" { |
| 295 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 296 | |||
| 297 | const S = struct { | 292 | const S = struct { |
| 298 | fn foo(args: anytype) !void { | 293 | fn foo(args: anytype) !void { |
| 299 | comptime assert(@TypeOf(args[0]) == f64); | 294 | comptime assert(@TypeOf(args[0]) == f64); |
test/behavior/call.zig-6| ... | @@ -60,7 +60,6 @@ test "tuple parameters" { | ... | @@ -60,7 +60,6 @@ test "tuple parameters" { |
| 60 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 60 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 61 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 61 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 62 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 62 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 63 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 64 | 63 | ||
| 65 | const add = struct { | 64 | const add = struct { |
| 66 | fn add(a: i32, b: i32) i32 { | 65 | fn add(a: i32, b: i32) i32 { |
| ... | @@ -94,7 +93,6 @@ test "result location of function call argument through runtime condition and st | ... | @@ -94,7 +93,6 @@ test "result location of function call argument through runtime condition and st |
| 94 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 93 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 95 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 94 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 96 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 95 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 97 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 98 | 96 | ||
| 99 | const E = enum { a, b }; | 97 | const E = enum { a, b }; |
| 100 | const S = struct { | 98 | const S = struct { |
| ... | @@ -411,7 +409,6 @@ test "recursive inline call with comptime known argument" { | ... | @@ -411,7 +409,6 @@ test "recursive inline call with comptime known argument" { |
| 411 | test "inline while with @call" { | 409 | test "inline while with @call" { |
| 412 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 410 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 413 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 411 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 414 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 415 | 412 | ||
| 416 | const S = struct { | 413 | const S = struct { |
| 417 | fn inc(a: *u32) void { | 414 | fn inc(a: *u32) void { |
| ... | @@ -427,8 +424,6 @@ test "inline while with @call" { | ... | @@ -427,8 +424,6 @@ test "inline while with @call" { |
| 427 | } | 424 | } |
| 428 | 425 | ||
| 429 | test "method call as parameter type" { | 426 | test "method call as parameter type" { |
| 430 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 431 | |||
| 432 | const S = struct { | 427 | const S = struct { |
| 433 | fn foo(x: anytype, y: @TypeOf(x).Inner()) @TypeOf(y) { | 428 | fn foo(x: anytype, y: @TypeOf(x).Inner()) @TypeOf(y) { |
| 434 | return y; | 429 | return y; |
| ... | @@ -477,7 +472,6 @@ test "argument to generic function has correct result type" { | ... | @@ -477,7 +472,6 @@ test "argument to generic function has correct result type" { |
| 477 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 472 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 478 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 473 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 479 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 474 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 480 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 481 | 475 | ||
| 482 | const S = struct { | 476 | const S = struct { |
| 483 | fn foo(_: anytype, e: enum { a, b }) bool { | 477 | fn foo(_: anytype, e: enum { a, b }) bool { |
test/behavior/cast.zig-7| ... | @@ -483,7 +483,6 @@ fn castToOptionalTypeError(z: i32) !void { | ... | @@ -483,7 +483,6 @@ fn castToOptionalTypeError(z: i32) !void { |
| 483 | test "implicitly cast from [0]T to anyerror![]T" { | 483 | test "implicitly cast from [0]T to anyerror![]T" { |
| 484 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 484 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 485 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 485 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 486 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 487 | 486 | ||
| 488 | try testCastZeroArrayToErrSliceMut(); | 487 | try testCastZeroArrayToErrSliceMut(); |
| 489 | try comptime testCastZeroArrayToErrSliceMut(); | 488 | try comptime testCastZeroArrayToErrSliceMut(); |
| ... | @@ -558,7 +557,6 @@ fn testCastConstArrayRefToConstSlice() !void { | ... | @@ -558,7 +557,6 @@ fn testCastConstArrayRefToConstSlice() !void { |
| 558 | test "peer type resolution: error and [N]T" { | 557 | test "peer type resolution: error and [N]T" { |
| 559 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 558 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 560 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 559 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 561 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 562 | 560 | ||
| 563 | try expect(mem.eql(u8, try testPeerErrorAndArray(0), "OK")); | 561 | try expect(mem.eql(u8, try testPeerErrorAndArray(0), "OK")); |
| 564 | comptime assert(mem.eql(u8, try testPeerErrorAndArray(0), "OK")); | 562 | comptime assert(mem.eql(u8, try testPeerErrorAndArray(0), "OK")); |
| ... | @@ -1157,7 +1155,6 @@ fn foobar(func: PFN_void) !void { | ... | @@ -1157,7 +1155,6 @@ fn foobar(func: PFN_void) !void { |
| 1157 | 1155 | ||
| 1158 | test "cast function with an opaque parameter" { | 1156 | test "cast function with an opaque parameter" { |
| 1159 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1157 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1160 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1161 | 1158 | ||
| 1162 | if (builtin.zig_backend == .stage2_c) { | 1159 | if (builtin.zig_backend == .stage2_c) { |
| 1163 | // https://github.com/ziglang/zig/issues/16845 | 1160 | // https://github.com/ziglang/zig/issues/16845 |
| ... | @@ -1309,7 +1306,6 @@ fn incrementVoidPtrValue(value: ?*anyopaque) void { | ... | @@ -1309,7 +1306,6 @@ fn incrementVoidPtrValue(value: ?*anyopaque) void { |
| 1309 | test "implicit cast *[0]T to E![]const u8" { | 1306 | test "implicit cast *[0]T to E![]const u8" { |
| 1310 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1307 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1311 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1308 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1312 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1313 | 1309 | ||
| 1314 | var x = @as(anyerror![]const u8, &[0]u8{}); | 1310 | var x = @as(anyerror![]const u8, &[0]u8{}); |
| 1315 | _ = &x; | 1311 | _ = &x; |
| ... | @@ -1496,7 +1492,6 @@ test "cast compatible optional types" { | ... | @@ -1496,7 +1492,6 @@ test "cast compatible optional types" { |
| 1496 | test "coerce undefined single-item pointer of array to error union of slice" { | 1492 | test "coerce undefined single-item pointer of array to error union of slice" { |
| 1497 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1493 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1498 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1494 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1499 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1500 | 1495 | ||
| 1501 | const a = @as([*]u8, undefined)[0..0]; | 1496 | const a = @as([*]u8, undefined)[0..0]; |
| 1502 | var b: error{a}![]const u8 = a; | 1497 | var b: error{a}![]const u8 = a; |
| ... | @@ -2206,7 +2201,6 @@ test "peer type resolution: tuples with comptime fields" { | ... | @@ -2206,7 +2201,6 @@ test "peer type resolution: tuples with comptime fields" { |
| 2206 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2201 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2207 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2202 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2208 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO | 2203 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO |
| 2209 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 2210 | 2204 | ||
| 2211 | const a = .{ 1, 2 }; | 2205 | const a = .{ 1, 2 }; |
| 2212 | const b = .{ @as(u32, 3), @as(i16, 4) }; | 2206 | const b = .{ @as(u32, 3), @as(i16, 4) }; |
| ... | @@ -2361,7 +2355,6 @@ test "cast builtins can wrap result in error union" { | ... | @@ -2361,7 +2355,6 @@ test "cast builtins can wrap result in error union" { |
| 2361 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 2355 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 2362 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2356 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2363 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2357 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2364 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 2365 | 2358 | ||
| 2366 | const S = struct { | 2359 | const S = struct { |
| 2367 | const MyEnum = enum(u32) { _ }; | 2360 | const MyEnum = enum(u32) { _ }; |
test/behavior/comptime_memory.zig-4| ... | @@ -408,8 +408,6 @@ test "mutate entire slice at comptime" { | ... | @@ -408,8 +408,6 @@ test "mutate entire slice at comptime" { |
| 408 | } | 408 | } |
| 409 | 409 | ||
| 410 | test "dereference undefined pointer to zero-bit type" { | 410 | test "dereference undefined pointer to zero-bit type" { |
| 411 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 412 | |||
| 413 | const p0: *void = undefined; | 411 | const p0: *void = undefined; |
| 414 | try testing.expectEqual({}, p0.*); | 412 | try testing.expectEqual({}, p0.*); |
| 415 | 413 | ||
| ... | @@ -515,7 +513,5 @@ fn fieldPtrTest() u32 { | ... | @@ -515,7 +513,5 @@ fn fieldPtrTest() u32 { |
| 515 | return a.value; | 513 | return a.value; |
| 516 | } | 514 | } |
| 517 | test "pointer in aggregate field can mutate comptime state" { | 515 | test "pointer in aggregate field can mutate comptime state" { |
| 518 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 519 | |||
| 520 | try comptime std.testing.expect(fieldPtrTest() == 2); | 516 | try comptime std.testing.expect(fieldPtrTest() == 2); |
| 521 | } | 517 | } |
test/behavior/defer.zig-1| ... | @@ -162,7 +162,6 @@ test "reference to errdefer payload" { | ... | @@ -162,7 +162,6 @@ test "reference to errdefer payload" { |
| 162 | test "simple else prong doesn't emit an error for unreachable else prong" { | 162 | test "simple else prong doesn't emit an error for unreachable else prong" { |
| 163 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 163 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 164 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 164 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 165 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 166 | 165 | ||
| 167 | const S = struct { | 166 | const S = struct { |
| 168 | fn foo() error{Foo}!void { | 167 | fn foo() error{Foo}!void { |
test/behavior/empty_union.zig-4| ... | @@ -48,8 +48,6 @@ test "empty extern union" { | ... | @@ -48,8 +48,6 @@ test "empty extern union" { |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | test "empty union passed as argument" { | 50 | test "empty union passed as argument" { |
| 51 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 52 | |||
| 53 | const U = union(enum) { | 51 | const U = union(enum) { |
| 54 | fn f(u: @This()) void { | 52 | fn f(u: @This()) void { |
| 55 | switch (u) {} | 53 | switch (u) {} |
| ... | @@ -59,8 +57,6 @@ test "empty union passed as argument" { | ... | @@ -59,8 +57,6 @@ test "empty union passed as argument" { |
| 59 | } | 57 | } |
| 60 | 58 | ||
| 61 | test "empty enum passed as argument" { | 59 | test "empty enum passed as argument" { |
| 62 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 63 | |||
| 64 | const E = enum { | 60 | const E = enum { |
| 65 | fn f(e: @This()) void { | 61 | fn f(e: @This()) void { |
| 66 | switch (e) {} | 62 | switch (e) {} |
test/behavior/enum.zig-2| ... | @@ -856,8 +856,6 @@ fn doALoopThing(id: EnumWithOneMember) void { | ... | @@ -856,8 +856,6 @@ fn doALoopThing(id: EnumWithOneMember) void { |
| 856 | } | 856 | } |
| 857 | 857 | ||
| 858 | test "comparison operator on enum with one member is comptime-known" { | 858 | test "comparison operator on enum with one member is comptime-known" { |
| 859 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 860 | |||
| 861 | doALoopThing(EnumWithOneMember.Eof); | 859 | doALoopThing(EnumWithOneMember.Eof); |
| 862 | } | 860 | } |
| 863 | 861 |
test/behavior/error.zig-22| ... | @@ -31,7 +31,6 @@ fn shouldBeNotEqual(a: anyerror, b: anyerror) void { | ... | @@ -31,7 +31,6 @@ fn shouldBeNotEqual(a: anyerror, b: anyerror) void { |
| 31 | 31 | ||
| 32 | test "error binary operator" { | 32 | test "error binary operator" { |
| 33 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 33 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 34 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 35 | 34 | ||
| 36 | const a = errBinaryOperatorG(true) catch 3; | 35 | const a = errBinaryOperatorG(true) catch 3; |
| 37 | const b = errBinaryOperatorG(false) catch 3; | 36 | const b = errBinaryOperatorG(false) catch 3; |
| ... | @@ -63,14 +62,12 @@ pub fn baz() anyerror!i32 { | ... | @@ -63,14 +62,12 @@ pub fn baz() anyerror!i32 { |
| 63 | 62 | ||
| 64 | test "error wrapping" { | 63 | test "error wrapping" { |
| 65 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 64 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 66 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 67 | 65 | ||
| 68 | try expect((baz() catch unreachable) == 15); | 66 | try expect((baz() catch unreachable) == 15); |
| 69 | } | 67 | } |
| 70 | 68 | ||
| 71 | test "unwrap simple value from error" { | 69 | test "unwrap simple value from error" { |
| 72 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 70 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 73 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 74 | 71 | ||
| 75 | const i = unwrapSimpleValueFromErrorDo() catch unreachable; | 72 | const i = unwrapSimpleValueFromErrorDo() catch unreachable; |
| 76 | try expect(i == 13); | 73 | try expect(i == 13); |
| ... | @@ -81,7 +78,6 @@ fn unwrapSimpleValueFromErrorDo() anyerror!isize { | ... | @@ -81,7 +78,6 @@ fn unwrapSimpleValueFromErrorDo() anyerror!isize { |
| 81 | 78 | ||
| 82 | test "error return in assignment" { | 79 | test "error return in assignment" { |
| 83 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 80 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 84 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 85 | 81 | ||
| 86 | doErrReturnInAssignment() catch unreachable; | 82 | doErrReturnInAssignment() catch unreachable; |
| 87 | } | 83 | } |
| ... | @@ -104,7 +100,6 @@ test "syntax: optional operator in front of error union operator" { | ... | @@ -104,7 +100,6 @@ test "syntax: optional operator in front of error union operator" { |
| 104 | test "widen cast integer payload of error union function call" { | 100 | test "widen cast integer payload of error union function call" { |
| 105 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 101 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 106 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 102 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 107 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 108 | 103 | ||
| 109 | const S = struct { | 104 | const S = struct { |
| 110 | fn errorable() !u64 { | 105 | fn errorable() !u64 { |
| ... | @@ -241,8 +236,6 @@ fn testExplicitErrorSetCast(set1: Set1) !void { | ... | @@ -241,8 +236,6 @@ fn testExplicitErrorSetCast(set1: Set1) !void { |
| 241 | } | 236 | } |
| 242 | 237 | ||
| 243 | test "@errorCast on error unions" { | 238 | test "@errorCast on error unions" { |
| 244 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 245 | |||
| 246 | const S = struct { | 239 | const S = struct { |
| 247 | fn doTheTest() !void { | 240 | fn doTheTest() !void { |
| 248 | { | 241 | { |
| ... | @@ -270,7 +263,6 @@ test "@errorCast on error unions" { | ... | @@ -270,7 +263,6 @@ test "@errorCast on error unions" { |
| 270 | 263 | ||
| 271 | test "comptime test error for empty error set" { | 264 | test "comptime test error for empty error set" { |
| 272 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 265 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 273 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 274 | 266 | ||
| 275 | try testComptimeTestErrorEmptySet(1234); | 267 | try testComptimeTestErrorEmptySet(1234); |
| 276 | try comptime testComptimeTestErrorEmptySet(1234); | 268 | try comptime testComptimeTestErrorEmptySet(1234); |
| ... | @@ -306,8 +298,6 @@ test "inferred empty error set comptime catch" { | ... | @@ -306,8 +298,6 @@ test "inferred empty error set comptime catch" { |
| 306 | } | 298 | } |
| 307 | 299 | ||
| 308 | test "error inference with an empty set" { | 300 | test "error inference with an empty set" { |
| 309 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 310 | |||
| 311 | const S = struct { | 301 | const S = struct { |
| 312 | const Struct = struct { | 302 | const Struct = struct { |
| 313 | pub fn func() (error{})!usize { | 303 | pub fn func() (error{})!usize { |
| ... | @@ -362,7 +352,6 @@ fn quux_1() !i32 { | ... | @@ -362,7 +352,6 @@ fn quux_1() !i32 { |
| 362 | 352 | ||
| 363 | test "error: Zero sized error set returned with value payload crash" { | 353 | test "error: Zero sized error set returned with value payload crash" { |
| 364 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 354 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 365 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 366 | 355 | ||
| 367 | _ = try foo3(0); | 356 | _ = try foo3(0); |
| 368 | _ = try comptime foo3(0); | 357 | _ = try comptime foo3(0); |
| ... | @@ -376,7 +365,6 @@ fn foo3(b: usize) Error!usize { | ... | @@ -376,7 +365,6 @@ fn foo3(b: usize) Error!usize { |
| 376 | test "error: Infer error set from literals" { | 365 | test "error: Infer error set from literals" { |
| 377 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 366 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 378 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 367 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 379 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 380 | 368 | ||
| 381 | _ = nullLiteral("n") catch |err| handleErrors(err); | 369 | _ = nullLiteral("n") catch |err| handleErrors(err); |
| 382 | _ = floatLiteral("n") catch |err| handleErrors(err); | 370 | _ = floatLiteral("n") catch |err| handleErrors(err); |
| ... | @@ -498,7 +486,6 @@ test "optional error set is the same size as error set" { | ... | @@ -498,7 +486,6 @@ test "optional error set is the same size as error set" { |
| 498 | test "nested catch" { | 486 | test "nested catch" { |
| 499 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 487 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 500 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 488 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 501 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 502 | 489 | ||
| 503 | const S = struct { | 490 | const S = struct { |
| 504 | fn entry() !void { | 491 | fn entry() !void { |
| ... | @@ -524,7 +511,6 @@ test "nested catch" { | ... | @@ -524,7 +511,6 @@ test "nested catch" { |
| 524 | test "function pointer with return type that is error union with payload which is pointer of parent struct" { | 511 | test "function pointer with return type that is error union with payload which is pointer of parent struct" { |
| 525 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 512 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 526 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 513 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 527 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 528 | 514 | ||
| 529 | const S = struct { | 515 | const S = struct { |
| 530 | const Foo = struct { | 516 | const Foo = struct { |
| ... | @@ -582,7 +568,6 @@ test "error payload type is correctly resolved" { | ... | @@ -582,7 +568,6 @@ test "error payload type is correctly resolved" { |
| 582 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 568 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 583 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 569 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 584 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 570 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 585 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 586 | 571 | ||
| 587 | const MyIntWrapper = struct { | 572 | const MyIntWrapper = struct { |
| 588 | const Self = @This(); | 573 | const Self = @This(); |
| ... | @@ -1039,7 +1024,6 @@ test "function called at runtime is properly analyzed for inferred error set" { | ... | @@ -1039,7 +1024,6 @@ test "function called at runtime is properly analyzed for inferred error set" { |
| 1039 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1024 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1040 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1025 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1041 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1026 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1042 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1043 | 1027 | ||
| 1044 | const S = struct { | 1028 | const S = struct { |
| 1045 | fn foo() !void { | 1029 | fn foo() !void { |
| ... | @@ -1063,7 +1047,6 @@ test "generic type constructed from inferred error set of unresolved function" { | ... | @@ -1063,7 +1047,6 @@ test "generic type constructed from inferred error set of unresolved function" { |
| 1063 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1047 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1064 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1048 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1065 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1049 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1066 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1067 | 1050 | ||
| 1068 | const S = struct { | 1051 | const S = struct { |
| 1069 | fn write(_: void, bytes: []const u8) !usize { | 1052 | fn write(_: void, bytes: []const u8) !usize { |
| ... | @@ -1079,8 +1062,6 @@ test "generic type constructed from inferred error set of unresolved function" { | ... | @@ -1079,8 +1062,6 @@ test "generic type constructed from inferred error set of unresolved function" { |
| 1079 | } | 1062 | } |
| 1080 | 1063 | ||
| 1081 | test "errorCast to adhoc inferred error set" { | 1064 | test "errorCast to adhoc inferred error set" { |
| 1082 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1083 | |||
| 1084 | const S = struct { | 1065 | const S = struct { |
| 1085 | inline fn baz() !i32 { | 1066 | inline fn baz() !i32 { |
| 1086 | return @errorCast(err()); | 1067 | return @errorCast(err()); |
| ... | @@ -1093,8 +1074,6 @@ test "errorCast to adhoc inferred error set" { | ... | @@ -1093,8 +1074,6 @@ test "errorCast to adhoc inferred error set" { |
| 1093 | } | 1074 | } |
| 1094 | 1075 | ||
| 1095 | test "errorCast from error sets to error unions" { | 1076 | test "errorCast from error sets to error unions" { |
| 1096 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1097 | |||
| 1098 | const err_union: Set1!void = @errorCast(error.A); | 1077 | const err_union: Set1!void = @errorCast(error.A); |
| 1099 | try expectError(error.A, err_union); | 1078 | try expectError(error.A, err_union); |
| 1100 | } | 1079 | } |
| ... | @@ -1103,7 +1082,6 @@ test "result location initialization of error union with OPV payload" { | ... | @@ -1103,7 +1082,6 @@ test "result location initialization of error union with OPV payload" { |
| 1103 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1082 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1104 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1083 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1105 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1084 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1106 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1107 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1085 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1108 | 1086 | ||
| 1109 | const S = struct { | 1087 | const S = struct { |
test/behavior/eval.zig-5| ... | @@ -505,7 +505,6 @@ test "comptime shlWithOverflow" { | ... | @@ -505,7 +505,6 @@ test "comptime shlWithOverflow" { |
| 505 | test "const ptr to variable data changes at runtime" { | 505 | test "const ptr to variable data changes at runtime" { |
| 506 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 506 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 507 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 507 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 508 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 509 | 508 | ||
| 510 | try expect(foo_ref.name[0] == 'a'); | 509 | try expect(foo_ref.name[0] == 'a'); |
| 511 | foo_ref.name = "b"; | 510 | foo_ref.name = "b"; |
| ... | @@ -720,8 +719,6 @@ fn loopNTimes(comptime n: usize) void { | ... | @@ -720,8 +719,6 @@ fn loopNTimes(comptime n: usize) void { |
| 720 | } | 719 | } |
| 721 | 720 | ||
| 722 | test "variable inside inline loop that has different types on different iterations" { | 721 | test "variable inside inline loop that has different types on different iterations" { |
| 723 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 724 | |||
| 725 | try testVarInsideInlineLoop(.{ true, @as(u32, 42) }); | 722 | try testVarInsideInlineLoop(.{ true, @as(u32, 42) }); |
| 726 | } | 723 | } |
| 727 | 724 | ||
| ... | @@ -1643,8 +1640,6 @@ test "result of nested switch assigned to variable" { | ... | @@ -1643,8 +1640,6 @@ test "result of nested switch assigned to variable" { |
| 1643 | } | 1640 | } |
| 1644 | 1641 | ||
| 1645 | test "inline for loop of functions returning error unions" { | 1642 | test "inline for loop of functions returning error unions" { |
| 1646 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1647 | |||
| 1648 | const T1 = struct { | 1643 | const T1 = struct { |
| 1649 | fn v() error{}!usize { | 1644 | fn v() error{}!usize { |
| 1650 | return 1; | 1645 | return 1; |
test/behavior/fn.zig-11| ... | @@ -71,7 +71,6 @@ fn outer(y: u32) *const fn (u32) u32 { | ... | @@ -71,7 +71,6 @@ fn outer(y: u32) *const fn (u32) u32 { |
| 71 | 71 | ||
| 72 | test "return inner function which references comptime variable of outer function" { | 72 | test "return inner function which references comptime variable of outer function" { |
| 73 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 73 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 74 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 75 | 74 | ||
| 76 | const func = outer(10); | 75 | const func = outer(10); |
| 77 | try expect(func(3) == 7); | 76 | try expect(func(3) == 7); |
| ... | @@ -81,7 +80,6 @@ test "discard the result of a function that returns a struct" { | ... | @@ -81,7 +80,6 @@ test "discard the result of a function that returns a struct" { |
| 81 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 80 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 82 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 81 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 83 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 82 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 84 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 85 | 83 | ||
| 86 | const S = struct { | 84 | const S = struct { |
| 87 | fn entry() void { | 85 | fn entry() void { |
| ... | @@ -191,7 +189,6 @@ test "function with complex callconv and return type expressions" { | ... | @@ -191,7 +189,6 @@ test "function with complex callconv and return type expressions" { |
| 191 | 189 | ||
| 192 | test "pass by non-copying value" { | 190 | test "pass by non-copying value" { |
| 193 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 191 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 194 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 195 | 192 | ||
| 196 | try expect(addPointCoords(Point{ .x = 1, .y = 2 }) == 3); | 193 | try expect(addPointCoords(Point{ .x = 1, .y = 2 }) == 3); |
| 197 | } | 194 | } |
| ... | @@ -207,7 +204,6 @@ fn addPointCoords(pt: Point) i32 { | ... | @@ -207,7 +204,6 @@ fn addPointCoords(pt: Point) i32 { |
| 207 | 204 | ||
| 208 | test "pass by non-copying value through var arg" { | 205 | test "pass by non-copying value through var arg" { |
| 209 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 206 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 210 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 211 | 207 | ||
| 212 | try expect((try addPointCoordsVar(Point{ .x = 1, .y = 2 })) == 3); | 208 | try expect((try addPointCoordsVar(Point{ .x = 1, .y = 2 })) == 3); |
| 213 | } | 209 | } |
| ... | @@ -219,7 +215,6 @@ fn addPointCoordsVar(pt: anytype) !i32 { | ... | @@ -219,7 +215,6 @@ fn addPointCoordsVar(pt: anytype) !i32 { |
| 219 | 215 | ||
| 220 | test "pass by non-copying value as method" { | 216 | test "pass by non-copying value as method" { |
| 221 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 217 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 222 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 223 | 218 | ||
| 224 | var pt = Point2{ .x = 1, .y = 2 }; | 219 | var pt = Point2{ .x = 1, .y = 2 }; |
| 225 | try expect(pt.addPointCoords() == 3); | 220 | try expect(pt.addPointCoords() == 3); |
| ... | @@ -236,7 +231,6 @@ const Point2 = struct { | ... | @@ -236,7 +231,6 @@ const Point2 = struct { |
| 236 | 231 | ||
| 237 | test "pass by non-copying value as method, which is generic" { | 232 | test "pass by non-copying value as method, which is generic" { |
| 238 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 233 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 239 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 240 | 234 | ||
| 241 | var pt = Point3{ .x = 1, .y = 2 }; | 235 | var pt = Point3{ .x = 1, .y = 2 }; |
| 242 | try expect(pt.addPointCoords(i32) == 3); | 236 | try expect(pt.addPointCoords(i32) == 3); |
| ... | @@ -292,7 +286,6 @@ test "implicit cast fn call result to optional in field result" { | ... | @@ -292,7 +286,6 @@ test "implicit cast fn call result to optional in field result" { |
| 292 | test "void parameters" { | 286 | test "void parameters" { |
| 293 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 287 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 294 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 288 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 295 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 296 | 289 | ||
| 297 | try voidFun(1, void{}, 2, {}); | 290 | try voidFun(1, void{}, 2, {}); |
| 298 | } | 291 | } |
| ... | @@ -424,7 +417,6 @@ test "function with inferred error set but returning no error" { | ... | @@ -424,7 +417,6 @@ test "function with inferred error set but returning no error" { |
| 424 | 417 | ||
| 425 | test "import passed byref to function in return type" { | 418 | test "import passed byref to function in return type" { |
| 426 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 419 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 427 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 428 | 420 | ||
| 429 | const S = struct { | 421 | const S = struct { |
| 430 | fn get() @import("std").ArrayListUnmanaged(i32) { | 422 | fn get() @import("std").ArrayListUnmanaged(i32) { |
| ... | @@ -541,7 +533,6 @@ test "function returns function returning type" { | ... | @@ -541,7 +533,6 @@ test "function returns function returning type" { |
| 541 | 533 | ||
| 542 | test "peer type resolution of inferred error set with non-void payload" { | 534 | test "peer type resolution of inferred error set with non-void payload" { |
| 543 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 535 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 544 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 545 | 536 | ||
| 546 | const S = struct { | 537 | const S = struct { |
| 547 | fn openDataFile(mode: enum { read, write }) !u32 { | 538 | fn openDataFile(mode: enum { read, write }) !u32 { |
| ... | @@ -584,8 +575,6 @@ test "lazy values passed to anytype parameter" { | ... | @@ -584,8 +575,6 @@ test "lazy values passed to anytype parameter" { |
| 584 | } | 575 | } |
| 585 | 576 | ||
| 586 | test "pass and return comptime-only types" { | 577 | test "pass and return comptime-only types" { |
| 587 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 588 | |||
| 589 | const S = struct { | 578 | const S = struct { |
| 590 | fn returnNull(comptime x: @Type(.Null)) @Type(.Null) { | 579 | fn returnNull(comptime x: @Type(.Null)) @Type(.Null) { |
| 591 | return x; | 580 | return x; |
test/behavior/fn_delegation.zig-1| ... | @@ -34,7 +34,6 @@ fn custom(comptime T: type, comptime num: u64) fn (T) u64 { | ... | @@ -34,7 +34,6 @@ fn custom(comptime T: type, comptime num: u64) fn (T) u64 { |
| 34 | test "fn delegation" { | 34 | test "fn delegation" { |
| 35 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 35 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 36 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 36 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 37 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 38 | 37 | ||
| 39 | const foo = Foo{}; | 38 | const foo = Foo{}; |
| 40 | try expect(foo.one() == 11); | 39 | try expect(foo.one() == 11); |
test/behavior/for.zig-2| ... | @@ -438,7 +438,6 @@ test "inline for with counter as the comptime-known" { | ... | @@ -438,7 +438,6 @@ test "inline for with counter as the comptime-known" { |
| 438 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 438 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 439 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 439 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 440 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 440 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 441 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 442 | 441 | ||
| 443 | var runtime_slice = "hello"; | 442 | var runtime_slice = "hello"; |
| 444 | var runtime_i: usize = 3; | 443 | var runtime_i: usize = 3; |
| ... | @@ -471,7 +470,6 @@ test "inline for on tuple pointer" { | ... | @@ -471,7 +470,6 @@ test "inline for on tuple pointer" { |
| 471 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 470 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 472 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 471 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 473 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 472 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 474 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 475 | 473 | ||
| 476 | const S = struct { u32, u32, u32 }; | 474 | const S = struct { u32, u32, u32 }; |
| 477 | var s: S = .{ 100, 200, 300 }; | 475 | var s: S = .{ 100, 200, 300 }; |
test/behavior/generics.zig-6| ... | @@ -286,7 +286,6 @@ test "generic function instantiation turns into comptime call" { | ... | @@ -286,7 +286,6 @@ test "generic function instantiation turns into comptime call" { |
| 286 | 286 | ||
| 287 | test "generic function with void and comptime parameter" { | 287 | test "generic function with void and comptime parameter" { |
| 288 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 288 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 289 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 290 | 289 | ||
| 291 | const S = struct { x: i32 }; | 290 | const S = struct { x: i32 }; |
| 292 | const namespace = struct { | 291 | const namespace = struct { |
| ... | @@ -303,7 +302,6 @@ test "generic function with void and comptime parameter" { | ... | @@ -303,7 +302,6 @@ test "generic function with void and comptime parameter" { |
| 303 | test "anonymous struct return type referencing comptime parameter" { | 302 | test "anonymous struct return type referencing comptime parameter" { |
| 304 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 303 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 305 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 304 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 306 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 307 | 305 | ||
| 308 | const S = struct { | 306 | const S = struct { |
| 309 | pub fn extraData(comptime T: type, index: usize) struct { data: T, end: usize } { | 307 | pub fn extraData(comptime T: type, index: usize) struct { data: T, end: usize } { |
| ... | @@ -394,7 +392,6 @@ test "extern function used as generic parameter" { | ... | @@ -394,7 +392,6 @@ test "extern function used as generic parameter" { |
| 394 | 392 | ||
| 395 | test "generic struct as parameter type" { | 393 | test "generic struct as parameter type" { |
| 396 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 394 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 397 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 398 | 395 | ||
| 399 | const S = struct { | 396 | const S = struct { |
| 400 | fn doTheTest(comptime Int: type, thing: struct { int: Int }) !void { | 397 | fn doTheTest(comptime Int: type, thing: struct { int: Int }) !void { |
| ... | @@ -435,7 +432,6 @@ test "null sentinel pointer passed as generic argument" { | ... | @@ -435,7 +432,6 @@ test "null sentinel pointer passed as generic argument" { |
| 435 | 432 | ||
| 436 | test "generic function passed as comptime argument" { | 433 | test "generic function passed as comptime argument" { |
| 437 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 434 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 438 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 439 | 435 | ||
| 440 | const S = struct { | 436 | const S = struct { |
| 441 | fn doMath(comptime f: fn (type, i32, i32) error{Overflow}!i32, a: i32, b: i32) !void { | 437 | fn doMath(comptime f: fn (type, i32, i32) error{Overflow}!i32, a: i32, b: i32) !void { |
| ... | @@ -461,7 +457,6 @@ test "return type of generic function is function pointer" { | ... | @@ -461,7 +457,6 @@ test "return type of generic function is function pointer" { |
| 461 | 457 | ||
| 462 | test "coerced function body has inequal value with its uncoerced body" { | 458 | test "coerced function body has inequal value with its uncoerced body" { |
| 463 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 459 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 464 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 465 | 460 | ||
| 466 | const S = struct { | 461 | const S = struct { |
| 467 | const A = B(i32, c); | 462 | const A = B(i32, c); |
| ... | @@ -546,7 +541,6 @@ test "call generic function with from function called by the generic function" { | ... | @@ -546,7 +541,6 @@ test "call generic function with from function called by the generic function" { |
| 546 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 541 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 547 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 542 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 548 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 543 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 549 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 550 | if (builtin.zig_backend == .stage2_llvm and | 544 | if (builtin.zig_backend == .stage2_llvm and |
| 551 | builtin.cpu.arch == .aarch64 and builtin.os.tag == .windows) return error.SkipZigTest; | 545 | builtin.cpu.arch == .aarch64 and builtin.os.tag == .windows) return error.SkipZigTest; |
| 552 | 546 |
test/behavior/incomplete_struct_param_tld.zig-1| ... | @@ -23,7 +23,6 @@ fn foo(a: A) i32 { | ... | @@ -23,7 +23,6 @@ fn foo(a: A) i32 { |
| 23 | 23 | ||
| 24 | test "incomplete struct param top level declaration" { | 24 | test "incomplete struct param top level declaration" { |
| 25 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 25 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 26 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 27 | 26 | ||
| 28 | const a = A{ | 27 | const a = A{ |
| 29 | .b = B{ | 28 | .b = B{ |
test/behavior/inline_switch.zig-1| ... | @@ -89,7 +89,6 @@ test "inline else bool" { | ... | @@ -89,7 +89,6 @@ test "inline else bool" { |
| 89 | test "inline else error" { | 89 | test "inline else error" { |
| 90 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 90 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 91 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 91 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 92 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 93 | 92 | ||
| 94 | const Err = error{ a, b, c }; | 93 | const Err = error{ a, b, c }; |
| 95 | var a = Err.a; | 94 | var a = Err.a; |
test/behavior/ir_block_deps.zig-1| ... | @@ -21,7 +21,6 @@ test "ir block deps" { | ... | @@ -21,7 +21,6 @@ test "ir block deps" { |
| 21 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 21 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 22 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 22 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 23 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 23 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 24 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 25 | 24 | ||
| 26 | try expect((foo(1) catch unreachable) == 0); | 25 | try expect((foo(1) catch unreachable) == 0); |
| 27 | try expect((foo(2) catch unreachable) == 0); | 26 | try expect((foo(2) catch unreachable) == 0); |
test/behavior/math.zig-2| ... | @@ -1471,8 +1471,6 @@ fn testShrExact(x: u8) !void { | ... | @@ -1471,8 +1471,6 @@ fn testShrExact(x: u8) !void { |
| 1471 | } | 1471 | } |
| 1472 | 1472 | ||
| 1473 | test "shift left/right on u0 operand" { | 1473 | test "shift left/right on u0 operand" { |
| 1474 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1475 | |||
| 1476 | const S = struct { | 1474 | const S = struct { |
| 1477 | fn doTheTest() !void { | 1475 | fn doTheTest() !void { |
| 1478 | var x: u0 = 0; | 1476 | var x: u0 = 0; |
test/behavior/maximum_minimum.zig+1| ... | @@ -300,6 +300,7 @@ test "@min/@max notices bounds from vector types when element of comptime-known | ... | @@ -300,6 +300,7 @@ test "@min/@max notices bounds from vector types when element of comptime-known |
| 300 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 300 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 301 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 301 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 302 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 302 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 303 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 303 | if (builtin.zig_backend == .stage2_x86_64 and | 304 | if (builtin.zig_backend == .stage2_x86_64 and |
| 304 | !comptime std.Target.x86.featureSetHas(builtin.cpu.features, .avx)) return error.SkipZigTest; | 305 | !comptime std.Target.x86.featureSetHas(builtin.cpu.features, .avx)) return error.SkipZigTest; |
| 305 | 306 |
test/behavior/member_func.zig-1| ... | @@ -31,7 +31,6 @@ test "standard field calls" { | ... | @@ -31,7 +31,6 @@ test "standard field calls" { |
| 31 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 31 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 32 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 32 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 33 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 33 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 34 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 35 | 34 | ||
| 36 | try expect(HasFuncs.one(0) == 1); | 35 | try expect(HasFuncs.one(0) == 1); |
| 37 | try expect(HasFuncs.two(0) == 2); | 36 | try expect(HasFuncs.two(0) == 2); |
test/behavior/memset.zig-2| ... | @@ -7,7 +7,6 @@ test "@memset on array pointers" { | ... | @@ -7,7 +7,6 @@ test "@memset on array pointers" { |
| 7 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 7 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 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_riscv64) return error.SkipZigTest; | ||
| 11 | 10 | ||
| 12 | try testMemsetArray(); | 11 | try testMemsetArray(); |
| 13 | try comptime testMemsetArray(); | 12 | try comptime testMemsetArray(); |
| ... | @@ -167,7 +166,6 @@ test "zero keys with @memset" { | ... | @@ -167,7 +166,6 @@ test "zero keys with @memset" { |
| 167 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 166 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 168 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 167 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 169 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 168 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 170 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 171 | 169 | ||
| 172 | const Keys = struct { | 170 | const Keys = struct { |
| 173 | up: bool, | 171 | up: bool, |
test/behavior/merge_error_sets.zig-1| ... | @@ -13,7 +13,6 @@ fn foo() C!void { | ... | @@ -13,7 +13,6 @@ fn foo() C!void { |
| 13 | 13 | ||
| 14 | test "merge error sets" { | 14 | test "merge error sets" { |
| 15 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 15 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 16 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 17 | 16 | ||
| 18 | if (foo()) { | 17 | if (foo()) { |
| 19 | @panic("unexpected"); | 18 | @panic("unexpected"); |
test/behavior/optional.zig-2| ... | @@ -615,8 +615,6 @@ test "cast slice to const slice nested in error union and optional" { | ... | @@ -615,8 +615,6 @@ test "cast slice to const slice nested in error union and optional" { |
| 615 | } | 615 | } |
| 616 | 616 | ||
| 617 | test "variable of optional of noreturn" { | 617 | test "variable of optional of noreturn" { |
| 618 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 619 | |||
| 620 | var null_opv: ?noreturn = null; | 618 | var null_opv: ?noreturn = null; |
| 621 | _ = &null_opv; | 619 | _ = &null_opv; |
| 622 | try std.testing.expectEqual(@as(?noreturn, null), null_opv); | 620 | try std.testing.expectEqual(@as(?noreturn, null), null_opv); |
test/behavior/packed-struct.zig+1-2| ... | @@ -238,7 +238,6 @@ test "regular in irregular packed struct" { | ... | @@ -238,7 +238,6 @@ test "regular in irregular packed struct" { |
| 238 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 238 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 239 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 239 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 240 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 240 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 241 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 242 | 241 | ||
| 243 | const Irregular = packed struct { | 242 | const Irregular = packed struct { |
| 244 | bar: Regular = Regular{}, | 243 | bar: Regular = Regular{}, |
| ... | @@ -435,6 +434,7 @@ test "nested packed struct field pointers" { | ... | @@ -435,6 +434,7 @@ test "nested packed struct field pointers" { |
| 435 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 434 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 436 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 435 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 437 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // ubsan unaligned pointer access | 436 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // ubsan unaligned pointer access |
| 437 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 438 | if (native_endian != .little) return error.SkipZigTest; // Byte aligned packed struct field pointers have not been implemented yet | 438 | if (native_endian != .little) return error.SkipZigTest; // Byte aligned packed struct field pointers have not been implemented yet |
| 439 | 439 | ||
| 440 | const S2 = packed struct { | 440 | const S2 = packed struct { |
| ... | @@ -1190,7 +1190,6 @@ test "packed struct field pointer aligned properly" { | ... | @@ -1190,7 +1190,6 @@ test "packed struct field pointer aligned properly" { |
| 1190 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1190 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1191 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1191 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1192 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO | 1192 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO |
| 1193 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1194 | 1193 | ||
| 1195 | const Foo = packed struct { | 1194 | const Foo = packed struct { |
| 1196 | a: i32, | 1195 | a: i32, |
test/behavior/ptrfromint.zig-3| ... | @@ -3,8 +3,6 @@ const builtin = @import("builtin"); | ... | @@ -3,8 +3,6 @@ const builtin = @import("builtin"); |
| 3 | const expectEqual = std.testing.expectEqual; | 3 | const expectEqual = std.testing.expectEqual; |
| 4 | 4 | ||
| 5 | test "casting integer address to function pointer" { | 5 | test "casting integer address to function pointer" { |
| 6 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 7 | |||
| 8 | addressToFunction(); | 6 | addressToFunction(); |
| 9 | comptime addressToFunction(); | 7 | comptime addressToFunction(); |
| 10 | } | 8 | } |
| ... | @@ -19,7 +17,6 @@ test "mutate through ptr initialized with constant ptrFromInt value" { | ... | @@ -19,7 +17,6 @@ test "mutate through ptr initialized with constant ptrFromInt value" { |
| 19 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 17 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 20 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 18 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 21 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 19 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 22 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 23 | 20 | ||
| 24 | forceCompilerAnalyzeBranchHardCodedPtrDereference(false); | 21 | forceCompilerAnalyzeBranchHardCodedPtrDereference(false); |
| 25 | } | 22 | } |
test/behavior/sizeof_and_typeof.zig-2| ... | @@ -158,7 +158,6 @@ test "@TypeOf() has no runtime side effects" { | ... | @@ -158,7 +158,6 @@ test "@TypeOf() has no runtime side effects" { |
| 158 | 158 | ||
| 159 | test "branching logic inside @TypeOf" { | 159 | test "branching logic inside @TypeOf" { |
| 160 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 160 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 161 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 162 | 161 | ||
| 163 | const S = struct { | 162 | const S = struct { |
| 164 | var data: i32 = 0; | 163 | var data: i32 = 0; |
| ... | @@ -412,7 +411,6 @@ test "Extern function calls, dereferences and field access in @TypeOf" { | ... | @@ -412,7 +411,6 @@ test "Extern function calls, dereferences and field access in @TypeOf" { |
| 412 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 411 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 413 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 412 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 414 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 413 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 415 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 416 | 414 | ||
| 417 | const Test = struct { | 415 | const Test = struct { |
| 418 | fn test_fn_1(a: c_long) @TypeOf(c_fopen("test", "r").*) { | 416 | fn test_fn_1(a: c_long) @TypeOf(c_fopen("test", "r").*) { |
test/behavior/slice.zig-4| ... | @@ -124,7 +124,6 @@ test "slice of type" { | ... | @@ -124,7 +124,6 @@ test "slice of type" { |
| 124 | 124 | ||
| 125 | test "generic malloc free" { | 125 | test "generic malloc free" { |
| 126 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 126 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 127 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 128 | 127 | ||
| 129 | const a = memAlloc(u8, 10) catch unreachable; | 128 | const a = memAlloc(u8, 10) catch unreachable; |
| 130 | memFree(u8, a); | 129 | memFree(u8, a); |
| ... | @@ -874,8 +873,6 @@ test "slice of void" { | ... | @@ -874,8 +873,6 @@ test "slice of void" { |
| 874 | } | 873 | } |
| 875 | 874 | ||
| 876 | test "slice with dereferenced value" { | 875 | test "slice with dereferenced value" { |
| 877 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 878 | |||
| 879 | var a: usize = 0; | 876 | var a: usize = 0; |
| 880 | const idx: *usize = &a; | 877 | const idx: *usize = &a; |
| 881 | _ = blk: { | 878 | _ = blk: { |
| ... | @@ -1004,7 +1001,6 @@ test "sentinel-terminated 0-length slices" { | ... | @@ -1004,7 +1001,6 @@ test "sentinel-terminated 0-length slices" { |
| 1004 | if (builtin.zig_backend == .stage2_x86) return error.SkipZigTest; // TODO | 1001 | if (builtin.zig_backend == .stage2_x86) return error.SkipZigTest; // TODO |
| 1005 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1002 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1006 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1003 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1007 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1008 | 1004 | ||
| 1009 | const u32s: [4]u32 = [_]u32{ 0, 1, 2, 3 }; | 1005 | const u32s: [4]u32 = [_]u32{ 0, 1, 2, 3 }; |
| 1010 | 1006 |
test/behavior/struct.zig-25| ... | @@ -92,7 +92,6 @@ test "structs" { | ... | @@ -92,7 +92,6 @@ test "structs" { |
| 92 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 92 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 93 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 93 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 94 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 94 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 95 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 96 | 95 | ||
| 97 | var foo: StructFoo = undefined; | 96 | var foo: StructFoo = undefined; |
| 98 | @memset(@as([*]u8, @ptrCast(&foo))[0..@sizeOf(StructFoo)], 0); | 97 | @memset(@as([*]u8, @ptrCast(&foo))[0..@sizeOf(StructFoo)], 0); |
| ... | @@ -175,7 +174,6 @@ const MemberFnTestFoo = struct { | ... | @@ -175,7 +174,6 @@ const MemberFnTestFoo = struct { |
| 175 | 174 | ||
| 176 | test "call member function directly" { | 175 | test "call member function directly" { |
| 177 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 176 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 178 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 179 | 177 | ||
| 180 | const instance = MemberFnTestFoo{ .x = 1234 }; | 178 | const instance = MemberFnTestFoo{ .x = 1234 }; |
| 181 | const result = MemberFnTestFoo.member(instance); | 179 | const result = MemberFnTestFoo.member(instance); |
| ... | @@ -184,7 +182,6 @@ test "call member function directly" { | ... | @@ -184,7 +182,6 @@ test "call member function directly" { |
| 184 | 182 | ||
| 185 | test "store member function in variable" { | 183 | test "store member function in variable" { |
| 186 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 184 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 187 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 188 | 185 | ||
| 189 | const instance = MemberFnTestFoo{ .x = 1234 }; | 186 | const instance = MemberFnTestFoo{ .x = 1234 }; |
| 190 | const memberFn = MemberFnTestFoo.member; | 187 | const memberFn = MemberFnTestFoo.member; |
| ... | @@ -206,7 +203,6 @@ const MemberFnRand = struct { | ... | @@ -206,7 +203,6 @@ const MemberFnRand = struct { |
| 206 | test "return struct byval from function" { | 203 | test "return struct byval from function" { |
| 207 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 204 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 208 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 205 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 209 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 210 | 206 | ||
| 211 | const Bar = struct { | 207 | const Bar = struct { |
| 212 | x: i32, | 208 | x: i32, |
| ... | @@ -255,7 +251,6 @@ test "usingnamespace within struct scope" { | ... | @@ -255,7 +251,6 @@ test "usingnamespace within struct scope" { |
| 255 | test "struct field init with catch" { | 251 | test "struct field init with catch" { |
| 256 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 252 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 257 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 253 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 258 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 259 | 254 | ||
| 260 | const S = struct { | 255 | const S = struct { |
| 261 | fn doTheTest() !void { | 256 | fn doTheTest() !void { |
| ... | @@ -631,7 +626,6 @@ fn getC(data: *const BitField1) u2 { | ... | @@ -631,7 +626,6 @@ fn getC(data: *const BitField1) u2 { |
| 631 | test "default struct initialization fields" { | 626 | test "default struct initialization fields" { |
| 632 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 627 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 633 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 628 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 634 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 635 | 629 | ||
| 636 | const S = struct { | 630 | const S = struct { |
| 637 | a: i32 = 1234, | 631 | a: i32 = 1234, |
| ... | @@ -807,7 +801,6 @@ test "fn with C calling convention returns struct by value" { | ... | @@ -807,7 +801,6 @@ test "fn with C calling convention returns struct by value" { |
| 807 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 801 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 808 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 802 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 809 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 803 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 810 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 811 | 804 | ||
| 812 | const S = struct { | 805 | const S = struct { |
| 813 | fn entry() !void { | 806 | fn entry() !void { |
| ... | @@ -907,8 +900,6 @@ test "anonymous struct literal syntax" { | ... | @@ -907,8 +900,6 @@ test "anonymous struct literal syntax" { |
| 907 | } | 900 | } |
| 908 | 901 | ||
| 909 | test "fully anonymous struct" { | 902 | test "fully anonymous struct" { |
| 910 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 911 | |||
| 912 | const S = struct { | 903 | const S = struct { |
| 913 | fn doTheTest() !void { | 904 | fn doTheTest() !void { |
| 914 | try dump(.{ | 905 | try dump(.{ |
| ... | @@ -931,8 +922,6 @@ test "fully anonymous struct" { | ... | @@ -931,8 +922,6 @@ test "fully anonymous struct" { |
| 931 | } | 922 | } |
| 932 | 923 | ||
| 933 | test "fully anonymous list literal" { | 924 | test "fully anonymous list literal" { |
| 934 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 935 | |||
| 936 | const S = struct { | 925 | const S = struct { |
| 937 | fn doTheTest() !void { | 926 | fn doTheTest() !void { |
| 938 | try dump(.{ @as(u32, 1234), @as(f64, 12.34), true, "hi" }); | 927 | try dump(.{ @as(u32, 1234), @as(f64, 12.34), true, "hi" }); |
| ... | @@ -980,7 +969,6 @@ test "tuple element initialized with fn call" { | ... | @@ -980,7 +969,6 @@ test "tuple element initialized with fn call" { |
| 980 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 969 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 981 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 970 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 982 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 971 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 983 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 984 | 972 | ||
| 985 | const S = struct { | 973 | const S = struct { |
| 986 | fn doTheTest() !void { | 974 | fn doTheTest() !void { |
| ... | @@ -1041,7 +1029,6 @@ test "type coercion of anon struct literal to struct" { | ... | @@ -1041,7 +1029,6 @@ test "type coercion of anon struct literal to struct" { |
| 1041 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1029 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1042 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1030 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1043 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1031 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1044 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1045 | 1032 | ||
| 1046 | const S = struct { | 1033 | const S = struct { |
| 1047 | const S2 = struct { | 1034 | const S2 = struct { |
| ... | @@ -1081,7 +1068,6 @@ test "type coercion of pointer to anon struct literal to pointer to struct" { | ... | @@ -1081,7 +1068,6 @@ test "type coercion of pointer to anon struct literal to pointer to struct" { |
| 1081 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1068 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1082 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1069 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1083 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1070 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1084 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1085 | 1071 | ||
| 1086 | const S = struct { | 1072 | const S = struct { |
| 1087 | const S2 = struct { | 1073 | const S2 = struct { |
| ... | @@ -1296,7 +1282,6 @@ test "initialize struct with empty literal" { | ... | @@ -1296,7 +1282,6 @@ test "initialize struct with empty literal" { |
| 1296 | 1282 | ||
| 1297 | test "loading a struct pointer perfoms a copy" { | 1283 | test "loading a struct pointer perfoms a copy" { |
| 1298 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1284 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1299 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1300 | 1285 | ||
| 1301 | const S = struct { | 1286 | const S = struct { |
| 1302 | a: i32, | 1287 | a: i32, |
| ... | @@ -1558,7 +1543,6 @@ test "discarded struct initialization works as expected" { | ... | @@ -1558,7 +1543,6 @@ test "discarded struct initialization works as expected" { |
| 1558 | test "function pointer in struct returns the struct" { | 1543 | test "function pointer in struct returns the struct" { |
| 1559 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 1544 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1560 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1545 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1561 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1562 | 1546 | ||
| 1563 | const A = struct { | 1547 | const A = struct { |
| 1564 | const A = @This(); | 1548 | const A = @This(); |
| ... | @@ -1766,8 +1750,6 @@ test "extern struct field pointer has correct alignment" { | ... | @@ -1766,8 +1750,6 @@ test "extern struct field pointer has correct alignment" { |
| 1766 | } | 1750 | } |
| 1767 | 1751 | ||
| 1768 | test "packed struct field in anonymous struct" { | 1752 | test "packed struct field in anonymous struct" { |
| 1769 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1770 | |||
| 1771 | const T = packed struct { | 1753 | const T = packed struct { |
| 1772 | f1: bool = false, | 1754 | f1: bool = false, |
| 1773 | }; | 1755 | }; |
| ... | @@ -1779,8 +1761,6 @@ fn countFields(v: anytype) usize { | ... | @@ -1779,8 +1761,6 @@ fn countFields(v: anytype) usize { |
| 1779 | } | 1761 | } |
| 1780 | 1762 | ||
| 1781 | test "struct init with no result pointer sets field result types" { | 1763 | test "struct init with no result pointer sets field result types" { |
| 1782 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1783 | |||
| 1784 | const S = struct { | 1764 | const S = struct { |
| 1785 | // A function parameter has a result type, but no result pointer. | 1765 | // A function parameter has a result type, but no result pointer. |
| 1786 | fn f(s: struct { x: u32 }) u32 { | 1766 | fn f(s: struct { x: u32 }) u32 { |
| ... | @@ -1922,8 +1902,6 @@ test "circular dependency through pointer field of a struct" { | ... | @@ -1922,8 +1902,6 @@ test "circular dependency through pointer field of a struct" { |
| 1922 | } | 1902 | } |
| 1923 | 1903 | ||
| 1924 | test "field calls do not force struct field init resolution" { | 1904 | test "field calls do not force struct field init resolution" { |
| 1925 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 1926 | |||
| 1927 | const S = struct { | 1905 | const S = struct { |
| 1928 | x: u32 = blk: { | 1906 | x: u32 = blk: { |
| 1929 | _ = @TypeOf(make().dummyFn()); // runtime field call - S not fully resolved - dummyFn call should not force field init resolution | 1907 | _ = @TypeOf(make().dummyFn()); // runtime field call - S not fully resolved - dummyFn call should not force field init resolution |
| ... | @@ -2057,7 +2035,6 @@ test "runtime value in nested initializer passed as pointer to function" { | ... | @@ -2057,7 +2035,6 @@ test "runtime value in nested initializer passed as pointer to function" { |
| 2057 | if (builtin.zig_backend == .stage2_x86) return error.SkipZigTest; // TODO | 2035 | if (builtin.zig_backend == .stage2_x86) return error.SkipZigTest; // TODO |
| 2058 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 2036 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 2059 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2037 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2060 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 2061 | 2038 | ||
| 2062 | const Bar = struct { | 2039 | const Bar = struct { |
| 2063 | b: u32, | 2040 | b: u32, |
| ... | @@ -2132,7 +2109,6 @@ test "assignment of field with padding" { | ... | @@ -2132,7 +2109,6 @@ test "assignment of field with padding" { |
| 2132 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 2109 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 2133 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2110 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2134 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2111 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2135 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 2136 | 2112 | ||
| 2137 | const Mesh = extern struct { | 2113 | const Mesh = extern struct { |
| 2138 | id: u32, | 2114 | id: u32, |
| ... | @@ -2163,7 +2139,6 @@ test "initiate global variable with runtime value" { | ... | @@ -2163,7 +2139,6 @@ test "initiate global variable with runtime value" { |
| 2163 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 2139 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 2164 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2140 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2165 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2141 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2166 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 2167 | 2142 | ||
| 2168 | const S = struct { | 2143 | const S = struct { |
| 2169 | field: i32, | 2144 | field: i32, |
test/behavior/switch.zig-2| ... | @@ -397,7 +397,6 @@ fn switchWithUnreachable(x: i32) i32 { | ... | @@ -397,7 +397,6 @@ fn switchWithUnreachable(x: i32) i32 { |
| 397 | 397 | ||
| 398 | test "capture value of switch with all unreachable prongs" { | 398 | test "capture value of switch with all unreachable prongs" { |
| 399 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 399 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 400 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 401 | 400 | ||
| 402 | const x = return_a_number() catch |err| switch (err) { | 401 | const x = return_a_number() catch |err| switch (err) { |
| 403 | else => unreachable, | 402 | else => unreachable, |
| ... | @@ -503,7 +502,6 @@ test "switch prongs with error set cases make a new error set type for capture v | ... | @@ -503,7 +502,6 @@ test "switch prongs with error set cases make a new error set type for capture v |
| 503 | 502 | ||
| 504 | test "return result loc and then switch with range implicit casted to error union" { | 503 | test "return result loc and then switch with range implicit casted to error union" { |
| 505 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 504 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 506 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 507 | 505 | ||
| 508 | const S = struct { | 506 | const S = struct { |
| 509 | fn doTheTest() !void { | 507 | fn doTheTest() !void { |
test/behavior/try.zig-1| ... | @@ -4,7 +4,6 @@ const expect = std.testing.expect; | ... | @@ -4,7 +4,6 @@ const expect = std.testing.expect; |
| 4 | 4 | ||
| 5 | test "try on error union" { | 5 | test "try on error union" { |
| 6 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 6 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 7 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 8 | 7 | ||
| 9 | try tryOnErrorUnionImpl(); | 8 | try tryOnErrorUnionImpl(); |
| 10 | try comptime tryOnErrorUnionImpl(); | 9 | try comptime tryOnErrorUnionImpl(); |
test/behavior/tuple.zig-6| ... | @@ -10,7 +10,6 @@ test "tuple concatenation" { | ... | @@ -10,7 +10,6 @@ test "tuple concatenation" { |
| 10 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 10 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 11 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 11 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 12 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 12 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 13 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 14 | 13 | ||
| 15 | const S = struct { | 14 | const S = struct { |
| 16 | fn doTheTest() !void { | 15 | fn doTheTest() !void { |
| ... | @@ -56,7 +55,6 @@ test "more tuple concatenation" { | ... | @@ -56,7 +55,6 @@ test "more tuple concatenation" { |
| 56 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 55 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 57 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 56 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 58 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 57 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 59 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 60 | 58 | ||
| 61 | const T = struct { | 59 | const T = struct { |
| 62 | fn consume_tuple(tuple: anytype, len: usize) !void { | 60 | fn consume_tuple(tuple: anytype, len: usize) !void { |
| ... | @@ -326,8 +324,6 @@ test "tuple type with void field" { | ... | @@ -326,8 +324,6 @@ test "tuple type with void field" { |
| 326 | } | 324 | } |
| 327 | 325 | ||
| 328 | test "zero sized struct in tuple handled correctly" { | 326 | test "zero sized struct in tuple handled correctly" { |
| 329 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 330 | |||
| 331 | const State = struct { | 327 | const State = struct { |
| 332 | const Self = @This(); | 328 | const Self = @This(); |
| 333 | data: @Type(.{ | 329 | data: @Type(.{ |
| ... | @@ -369,7 +365,6 @@ test "branching inside tuple literal" { | ... | @@ -369,7 +365,6 @@ test "branching inside tuple literal" { |
| 369 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 365 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 370 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 366 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 371 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 367 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 372 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 373 | 368 | ||
| 374 | const S = struct { | 369 | const S = struct { |
| 375 | fn foo(a: anytype) !void { | 370 | fn foo(a: anytype) !void { |
| ... | @@ -474,7 +469,6 @@ test "coerce anon tuple to tuple" { | ... | @@ -474,7 +469,6 @@ test "coerce anon tuple to tuple" { |
| 474 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 469 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 475 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 470 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 476 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 471 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 477 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 478 | 472 | ||
| 479 | var x: u8 = 1; | 473 | var x: u8 = 1; |
| 480 | var y: u16 = 2; | 474 | var y: u16 = 2; |
test/behavior/type.zig-1| ... | @@ -203,7 +203,6 @@ test "Type.Opaque" { | ... | @@ -203,7 +203,6 @@ test "Type.Opaque" { |
| 203 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 203 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 204 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 204 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 205 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 205 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 206 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 207 | 206 | ||
| 208 | const Opaque = @Type(.{ | 207 | const Opaque = @Type(.{ |
| 209 | .Opaque = .{ | 208 | .Opaque = .{ |
test/behavior/underscore.zig-1| ... | @@ -8,7 +8,6 @@ test "ignore lval with underscore" { | ... | @@ -8,7 +8,6 @@ test "ignore lval with underscore" { |
| 8 | 8 | ||
| 9 | test "ignore lval with underscore (while loop)" { | 9 | test "ignore lval with underscore (while loop)" { |
| 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 11 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 12 | 11 | ||
| 13 | while (optionalReturnError()) |_| { | 12 | while (optionalReturnError()) |_| { |
| 14 | while (optionalReturnError()) |_| { | 13 | while (optionalReturnError()) |_| { |
test/behavior/union.zig-1| ... | @@ -418,7 +418,6 @@ test "tagged union initialization with runtime void" { | ... | @@ -418,7 +418,6 @@ test "tagged union initialization with runtime void" { |
| 418 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 418 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 419 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 419 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 420 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 420 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 421 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 422 | 421 | ||
| 423 | try expect(testTaggedUnionInit({})); | 422 | try expect(testTaggedUnionInit({})); |
| 424 | } | 423 | } |
test/behavior/var_args.zig-10| ... | @@ -14,8 +14,6 @@ fn add(args: anytype) i32 { | ... | @@ -14,8 +14,6 @@ fn add(args: anytype) i32 { |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | test "add arbitrary args" { | 16 | test "add arbitrary args" { |
| 17 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 18 | |||
| 19 | try expect(add(.{ @as(i32, 1), @as(i32, 2), @as(i32, 3), @as(i32, 4) }) == 10); | 17 | try expect(add(.{ @as(i32, 1), @as(i32, 2), @as(i32, 3), @as(i32, 4) }) == 10); |
| 20 | try expect(add(.{@as(i32, 1234)}) == 1234); | 18 | try expect(add(.{@as(i32, 1234)}) == 1234); |
| 21 | try expect(add(.{}) == 0); | 19 | try expect(add(.{}) == 0); |
| ... | @@ -26,15 +24,12 @@ fn readFirstVarArg(args: anytype) void { | ... | @@ -26,15 +24,12 @@ fn readFirstVarArg(args: anytype) void { |
| 26 | } | 24 | } |
| 27 | 25 | ||
| 28 | test "send void arg to var args" { | 26 | test "send void arg to var args" { |
| 29 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 30 | |||
| 31 | readFirstVarArg(.{{}}); | 27 | readFirstVarArg(.{{}}); |
| 32 | } | 28 | } |
| 33 | 29 | ||
| 34 | test "pass args directly" { | 30 | test "pass args directly" { |
| 35 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 31 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 36 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 32 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 37 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 38 | 33 | ||
| 39 | try expect(addSomeStuff(.{ @as(i32, 1), @as(i32, 2), @as(i32, 3), @as(i32, 4) }) == 10); | 34 | try expect(addSomeStuff(.{ @as(i32, 1), @as(i32, 2), @as(i32, 3), @as(i32, 4) }) == 10); |
| 40 | try expect(addSomeStuff(.{@as(i32, 1234)}) == 1234); | 35 | try expect(addSomeStuff(.{@as(i32, 1234)}) == 1234); |
| ... | @@ -48,7 +43,6 @@ fn addSomeStuff(args: anytype) i32 { | ... | @@ -48,7 +43,6 @@ fn addSomeStuff(args: anytype) i32 { |
| 48 | test "runtime parameter before var args" { | 43 | test "runtime parameter before var args" { |
| 49 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 44 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 50 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 45 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 51 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 52 | 46 | ||
| 53 | try expect((try extraFn(10, .{})) == 0); | 47 | try expect((try extraFn(10, .{})) == 0); |
| 54 | try expect((try extraFn(10, .{false})) == 1); | 48 | try expect((try extraFn(10, .{false})) == 1); |
| ... | @@ -87,15 +81,11 @@ fn foo2(args: anytype) bool { | ... | @@ -87,15 +81,11 @@ fn foo2(args: anytype) bool { |
| 87 | } | 81 | } |
| 88 | 82 | ||
| 89 | test "array of var args functions" { | 83 | test "array of var args functions" { |
| 90 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 91 | |||
| 92 | try expect(foos[0](.{})); | 84 | try expect(foos[0](.{})); |
| 93 | try expect(!foos[1](.{})); | 85 | try expect(!foos[1](.{})); |
| 94 | } | 86 | } |
| 95 | 87 | ||
| 96 | test "pass zero length array to var args param" { | 88 | test "pass zero length array to var args param" { |
| 97 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 98 | |||
| 99 | doNothingWithFirstArg(.{""}); | 89 | doNothingWithFirstArg(.{""}); |
| 100 | } | 90 | } |
| 101 | 91 |
test/behavior/while.zig-3| ... | @@ -258,7 +258,6 @@ fn returnWithImplicitCastFromWhileLoopTest() anyerror!void { | ... | @@ -258,7 +258,6 @@ fn returnWithImplicitCastFromWhileLoopTest() anyerror!void { |
| 258 | 258 | ||
| 259 | test "while on error union with else result follow else prong" { | 259 | test "while on error union with else result follow else prong" { |
| 260 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 260 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 261 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 262 | 261 | ||
| 263 | const result = while (returnError()) |value| { | 262 | const result = while (returnError()) |value| { |
| 264 | break value; | 263 | break value; |
| ... | @@ -268,7 +267,6 @@ test "while on error union with else result follow else prong" { | ... | @@ -268,7 +267,6 @@ test "while on error union with else result follow else prong" { |
| 268 | 267 | ||
| 269 | test "while on error union with else result follow break prong" { | 268 | test "while on error union with else result follow break prong" { |
| 270 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 269 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 271 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 272 | 270 | ||
| 273 | const result = while (returnSuccess(10)) |value| { | 271 | const result = while (returnSuccess(10)) |value| { |
| 274 | break value; | 272 | break value; |
| ... | @@ -315,7 +313,6 @@ test "while error 2 break statements and an else" { | ... | @@ -315,7 +313,6 @@ test "while error 2 break statements and an else" { |
| 315 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 313 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 316 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 314 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 317 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 315 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 318 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | ||
| 319 | 316 | ||
| 320 | const S = struct { | 317 | const S = struct { |
| 321 | fn entry(opt_t: anyerror!bool, f: bool) !void { | 318 | fn entry(opt_t: anyerror!bool, f: bool) !void { |