| author | |
| committer | |
| log | a30af172e8dc360cb0a71a5c4dfd904120555715 |
| tree | e43bb564776492b6fa18187b4a379a82be5cdbb1 |
| parent | a615fbc1f8330e455d02fdda5c6de257b0cde7f4 |
32 files changed, 71 insertions(+), 189 deletions(-)
src/arch/riscv64/CodeGen.zig+64-63| ... | ... | @@ -11,6 +11,7 @@ const Type = @import("../../type.zig").Type; |
| 11 | 11 | const Value = @import("../../Value.zig"); |
| 12 | 12 | const link = @import("../../link.zig"); |
| 13 | 13 | const Module = @import("../../Module.zig"); |
| 14 | const Package = @import("../../Package.zig"); | |
| 14 | 15 | const InternPool = @import("../../InternPool.zig"); |
| 15 | 16 | const Compilation = @import("../../Compilation.zig"); |
| 16 | 17 | const ErrorMsg = Module.ErrorMsg; |
| ... | ... | @@ -54,6 +55,7 @@ const RegisterView = enum(u1) { |
| 54 | 55 | |
| 55 | 56 | gpa: Allocator, |
| 56 | 57 | air: Air, |
| 58 | mod: *Package.Module, | |
| 57 | 59 | liveness: Liveness, |
| 58 | 60 | bin_file: *link.File, |
| 59 | 61 | target: *const std.Target, |
| ... | ... | @@ -724,6 +726,7 @@ pub fn generate( |
| 724 | 726 | var function = Self{ |
| 725 | 727 | .gpa = gpa, |
| 726 | 728 | .air = air, |
| 729 | .mod = mod, | |
| 727 | 730 | .liveness = liveness, |
| 728 | 731 | .target = target, |
| 729 | 732 | .bin_file = bin_file, |
| ... | ... | @@ -2138,82 +2141,78 @@ fn airAddWithOverflow(self: *Self, inst: Air.Inst.Index) !void { |
| 2138 | 2141 | const lhs_ty = self.typeOf(extra.lhs); |
| 2139 | 2142 | const rhs_ty = self.typeOf(extra.rhs); |
| 2140 | 2143 | |
| 2141 | const add_result_mcv = try self.binOp(.add, lhs, lhs_ty, rhs, rhs_ty); | |
| 2142 | const add_result_lock = self.register_manager.lockRegAssumeUnused(add_result_mcv.register); | |
| 2143 | defer self.register_manager.unlockReg(add_result_lock); | |
| 2144 | ||
| 2145 | const tuple_ty = self.typeOfIndex(inst); | |
| 2146 | 2144 | const int_info = lhs_ty.intInfo(zcu); |
| 2147 | 2145 | |
| 2148 | // TODO: optimization, set this to true. needs the other struct access stuff to support | |
| 2149 | // accessing registers. | |
| 2146 | const tuple_ty = self.typeOfIndex(inst); | |
| 2150 | 2147 | const result_mcv = try self.allocRegOrMem(inst, false); |
| 2151 | 2148 | const offset = result_mcv.load_frame; |
| 2152 | 2149 | |
| 2153 | try self.genSetStack( | |
| 2154 | lhs_ty, | |
| 2155 | .{ | |
| 2156 | .index = offset.index, | |
| 2157 | .off = offset.off + @as(i32, @intCast(tuple_ty.structFieldOffset(0, zcu))), | |
| 2158 | }, | |
| 2159 | add_result_mcv, | |
| 2160 | ); | |
| 2161 | ||
| 2162 | 2150 | if (int_info.bits >= 8 and math.isPowerOfTwo(int_info.bits)) { |
| 2163 | if (int_info.signedness == .unsigned) { | |
| 2164 | switch (int_info.bits) { | |
| 2165 | 1...8 => { | |
| 2166 | const max_val = std.math.pow(u16, 2, int_info.bits) - 1; | |
| 2151 | const add_result = try self.binOp(.add, lhs, lhs_ty, rhs, rhs_ty); | |
| 2152 | const add_result_reg = try self.copyToTmpRegister(lhs_ty, add_result); | |
| 2153 | const add_result_reg_lock = self.register_manager.lockRegAssumeUnused(add_result_reg); | |
| 2154 | defer self.register_manager.unlockReg(add_result_reg_lock); | |
| 2167 | 2155 | |
| 2168 | const overflow_reg, const overflow_lock = try self.allocReg(); | |
| 2169 | defer self.register_manager.unlockReg(overflow_lock); | |
| 2156 | const shift_amount: u6 = @intCast(Type.usize.bitSize(zcu) - int_info.bits); | |
| 2170 | 2157 | |
| 2171 | const add_reg, const add_lock = blk: { | |
| 2172 | if (add_result_mcv == .register) break :blk .{ add_result_mcv.register, null }; | |
| 2158 | const shift_reg, const shift_lock = try self.allocReg(); | |
| 2159 | defer self.register_manager.unlockReg(shift_lock); | |
| 2173 | 2160 | |
| 2174 | const add_reg, const add_lock = try self.allocReg(); | |
| 2175 | try self.genSetReg(lhs_ty, add_reg, add_result_mcv); | |
| 2176 | break :blk .{ add_reg, add_lock }; | |
| 2177 | }; | |
| 2178 | defer if (add_lock) |lock| self.register_manager.unlockReg(lock); | |
| 2179 | ||
| 2180 | _ = try self.addInst(.{ | |
| 2181 | .tag = .andi, | |
| 2182 | .ops = .rri, | |
| 2183 | .data = .{ .i_type = .{ | |
| 2184 | .rd = overflow_reg, | |
| 2185 | .rs1 = add_reg, | |
| 2186 | .imm12 = Immediate.s(max_val), | |
| 2187 | } }, | |
| 2188 | }); | |
| 2189 | ||
| 2190 | const overflow_mcv = try self.binOp( | |
| 2191 | .cmp_neq, | |
| 2192 | .{ .register = overflow_reg }, | |
| 2193 | lhs_ty, | |
| 2194 | .{ .register = add_reg }, | |
| 2195 | lhs_ty, | |
| 2196 | ); | |
| 2197 | ||
| 2198 | try self.genSetStack( | |
| 2199 | Type.u1, | |
| 2200 | .{ | |
| 2201 | .index = offset.index, | |
| 2202 | .off = offset.off + @as(i32, @intCast(tuple_ty.structFieldOffset(1, zcu))), | |
| 2203 | }, | |
| 2204 | overflow_mcv, | |
| 2205 | ); | |
| 2161 | _ = try self.addInst(.{ | |
| 2162 | .tag = .slli, | |
| 2163 | .ops = .rri, | |
| 2164 | .data = .{ | |
| 2165 | .i_type = .{ | |
| 2166 | .rd = shift_reg, | |
| 2167 | .rs1 = add_result_reg, | |
| 2168 | .imm12 = Immediate.s(shift_amount), | |
| 2169 | }, | |
| 2170 | }, | |
| 2171 | }); | |
| 2206 | 2172 | |
| 2207 | break :result result_mcv; | |
| 2173 | _ = try self.addInst(.{ | |
| 2174 | .tag = if (int_info.signedness == .unsigned) .srli else .srai, | |
| 2175 | .ops = .rri, | |
| 2176 | .data = .{ | |
| 2177 | .i_type = .{ | |
| 2178 | .rd = shift_reg, | |
| 2179 | .rs1 = shift_reg, | |
| 2180 | .imm12 = Immediate.s(shift_amount), | |
| 2208 | 2181 | }, |
| 2182 | }, | |
| 2183 | }); | |
| 2209 | 2184 | |
| 2210 | else => return self.fail("TODO: addWithOverflow check for size {d}", .{int_info.bits}), | |
| 2211 | } | |
| 2212 | } else { | |
| 2213 | return self.fail("TODO: airAddWithOverFlow calculate carry for signed addition", .{}); | |
| 2214 | } | |
| 2185 | const add_result_frame: FrameAddr = .{ | |
| 2186 | .index = offset.index, | |
| 2187 | .off = offset.off + @as(i32, @intCast(tuple_ty.structFieldOffset(0, zcu))), | |
| 2188 | }; | |
| 2189 | try self.genSetStack( | |
| 2190 | lhs_ty, | |
| 2191 | add_result_frame, | |
| 2192 | add_result, | |
| 2193 | ); | |
| 2194 | ||
| 2195 | const overflow_mcv = try self.binOp( | |
| 2196 | .cmp_neq, | |
| 2197 | .{ .register = shift_reg }, | |
| 2198 | lhs_ty, | |
| 2199 | .{ .register = add_result_reg }, | |
| 2200 | lhs_ty, | |
| 2201 | ); | |
| 2202 | ||
| 2203 | const overflow_frame: FrameAddr = .{ | |
| 2204 | .index = offset.index, | |
| 2205 | .off = offset.off + @as(i32, @intCast(tuple_ty.structFieldOffset(1, zcu))), | |
| 2206 | }; | |
| 2207 | try self.genSetStack( | |
| 2208 | Type.u1, | |
| 2209 | overflow_frame, | |
| 2210 | overflow_mcv, | |
| 2211 | ); | |
| 2212 | ||
| 2213 | break :result result_mcv; | |
| 2215 | 2214 | } else { |
| 2216 | return self.fail("TODO: airAddWithOverflow with < 8 bits or non-pow of 2", .{}); | |
| 2215 | return self.fail("TODO: less than 8 bit or non-pow 2 addition", .{}); | |
| 2217 | 2216 | } |
| 2218 | 2217 | }; |
| 2219 | 2218 | |
| ... | ... | @@ -3500,9 +3499,11 @@ fn genCall( |
| 3500 | 3499 | if (self.bin_file.cast(link.File.Elf)) |elf_file| { |
| 3501 | 3500 | const sym_index = try elf_file.zigObjectPtr().?.getOrCreateMetadataForDecl(elf_file, func.owner_decl); |
| 3502 | 3501 | const sym = elf_file.symbol(sym_index); |
| 3502 | ||
| 3503 | 3503 | _ = try sym.getOrCreateZigGotEntry(sym_index, elf_file); |
| 3504 | 3504 | const got_addr = sym.zigGotAddress(elf_file); |
| 3505 | 3505 | try self.genSetReg(Type.usize, .ra, .{ .memory = got_addr }); |
| 3506 | ||
| 3506 | 3507 | _ = try self.addInst(.{ |
| 3507 | 3508 | .tag = .jalr, |
| 3508 | 3509 | .ops = .rri, |
src/arch/riscv64/Encoding.zig+5-1| ... | ... | @@ -16,6 +16,7 @@ pub const Mnemonic = enum { |
| 16 | 16 | andi, |
| 17 | 17 | slli, |
| 18 | 18 | srli, |
| 19 | srai, | |
| 19 | 20 | |
| 20 | 21 | addi, |
| 21 | 22 | jalr, |
| ... | ... | @@ -69,6 +70,7 @@ pub const Mnemonic = enum { |
| 69 | 70 | .jalr => .{ .opcode = 0b1100111, .funct3 = 0b000, .funct7 = null }, |
| 70 | 71 | .slli => .{ .opcode = 0b0010011, .funct3 = 0b001, .funct7 = null }, |
| 71 | 72 | .srli => .{ .opcode = 0b0010011, .funct3 = 0b101, .funct7 = null }, |
| 73 | .srai => .{ .opcode = 0b0010011, .funct3 = 0b101, .funct7 = null, .offset = 1 << 10 }, | |
| 72 | 74 | |
| 73 | 75 | .lui => .{ .opcode = 0b0110111, .funct3 = null, .funct7 = null }, |
| 74 | 76 | |
| ... | ... | @@ -123,6 +125,7 @@ pub const InstEnc = enum { |
| 123 | 125 | .andi, |
| 124 | 126 | .slli, |
| 125 | 127 | .srli, |
| 128 | .srai, | |
| 126 | 129 | => .I, |
| 127 | 130 | |
| 128 | 131 | .lui, |
| ... | ... | @@ -299,7 +302,7 @@ pub const Data = union(InstEnc) { |
| 299 | 302 | .I = .{ |
| 300 | 303 | .rd = ops[0].reg.id(), |
| 301 | 304 | .rs1 = ops[1].reg.id(), |
| 302 | .imm0_11 = ops[2].imm.asBits(u12), | |
| 305 | .imm0_11 = ops[2].imm.asBits(u12) + enc.offset, | |
| 303 | 306 | |
| 304 | 307 | .opcode = enc.opcode, |
| 305 | 308 | .funct3 = enc.funct3.?, |
| ... | ... | @@ -374,6 +377,7 @@ const Enc = struct { |
| 374 | 377 | opcode: u7, |
| 375 | 378 | funct3: ?u3, |
| 376 | 379 | funct7: ?u7, |
| 380 | offset: u12 = 0, | |
| 377 | 381 | }; |
| 378 | 382 | |
| 379 | 383 | fn verifyOps(mnem: Mnemonic, ops: []const Operand) bool { |
src/arch/riscv64/Mir.zig+2| ... | ... | @@ -53,6 +53,8 @@ pub const Inst = struct { |
| 53 | 53 | srli, |
| 54 | 54 | /// Immediate Logical Left Shift, uses i_type payload |
| 55 | 55 | slli, |
| 56 | /// Immediate Arithmetic Right Shift, uses i_type payload. | |
| 57 | srai, | |
| 56 | 58 | /// Register Logical Left Shift, uses r_type payload |
| 57 | 59 | sllw, |
| 58 | 60 | /// Register Logical Right Shit, uses r_type payload |
test/behavior/align.zig-2| ... | ... | @@ -44,7 +44,6 @@ test "default alignment allows unspecified in type syntax" { |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | test "implicitly decreasing pointer alignment" { |
| 47 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | |
| 48 | 47 | const a: u32 align(4) = 3; |
| 49 | 48 | const b: u32 align(8) = 4; |
| 50 | 49 | try expect(addUnaligned(&a, &b) == 7); |
| ... | ... | @@ -227,7 +226,6 @@ fn fnWithAlignedStack() i32 { |
| 227 | 226 | } |
| 228 | 227 | |
| 229 | 228 | test "implicitly decreasing slice alignment" { |
| 230 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | |
| 231 | 229 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 232 | 230 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 233 | 231 |
test/behavior/array.zig-4| ... | ... | @@ -203,7 +203,6 @@ test "nested arrays of strings" { |
| 203 | 203 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 204 | 204 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 205 | 205 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 206 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 207 | 206 | |
| 208 | 207 | const array_of_strings = [_][]const u8{ "hello", "this", "is", "my", "thing" }; |
| 209 | 208 | for (array_of_strings, 0..) |s, i| { |
| ... | ... | @@ -329,7 +328,6 @@ test "read/write through global variable array of struct fields initialized via |
| 329 | 328 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 330 | 329 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 331 | 330 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 332 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 333 | 331 | |
| 334 | 332 | const S = struct { |
| 335 | 333 | fn doTheTest() !void { |
| ... | ... | @@ -738,8 +736,6 @@ test "pointer to array has ptr field" { |
| 738 | 736 | } |
| 739 | 737 | |
| 740 | 738 | test "discarded array init preserves result location" { |
| 741 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 742 | ||
| 743 | 739 | const S = struct { |
| 744 | 740 | fn f(p: *u32) u16 { |
| 745 | 741 | p.* += 1; |
test/behavior/basic.zig-19| ... | ... | @@ -85,8 +85,6 @@ test "type equality" { |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | test "pointer dereferencing" { |
| 88 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 89 | ||
| 90 | 88 | var x = @as(i32, 3); |
| 91 | 89 | const y = &x; |
| 92 | 90 | |
| ... | ... | @@ -138,21 +136,18 @@ fn first4KeysOfHomeRow() []const u8 { |
| 138 | 136 | |
| 139 | 137 | test "return string from function" { |
| 140 | 138 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 141 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 142 | 139 | |
| 143 | 140 | try expect(mem.eql(u8, first4KeysOfHomeRow(), "aoeu")); |
| 144 | 141 | } |
| 145 | 142 | |
| 146 | 143 | test "hex escape" { |
| 147 | 144 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 148 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 149 | 145 | |
| 150 | 146 | try expect(mem.eql(u8, "\x68\x65\x6c\x6c\x6f", "hello")); |
| 151 | 147 | } |
| 152 | 148 | |
| 153 | 149 | test "multiline string" { |
| 154 | 150 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 155 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 156 | 151 | |
| 157 | 152 | const s1 = |
| 158 | 153 | \\one |
| ... | ... | @@ -165,7 +160,6 @@ test "multiline string" { |
| 165 | 160 | |
| 166 | 161 | test "multiline string comments at start" { |
| 167 | 162 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 168 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 169 | 163 | |
| 170 | 164 | const s1 = |
| 171 | 165 | //\\one |
| ... | ... | @@ -178,7 +172,6 @@ test "multiline string comments at start" { |
| 178 | 172 | |
| 179 | 173 | test "multiline string comments at end" { |
| 180 | 174 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 181 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 182 | 175 | |
| 183 | 176 | const s1 = |
| 184 | 177 | \\one |
| ... | ... | @@ -191,7 +184,6 @@ test "multiline string comments at end" { |
| 191 | 184 | |
| 192 | 185 | test "multiline string comments in middle" { |
| 193 | 186 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 194 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 195 | 187 | |
| 196 | 188 | const s1 = |
| 197 | 189 | \\one |
| ... | ... | @@ -204,7 +196,6 @@ test "multiline string comments in middle" { |
| 204 | 196 | |
| 205 | 197 | test "multiline string comments at multiple places" { |
| 206 | 198 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 207 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 208 | 199 | |
| 209 | 200 | const s1 = |
| 210 | 201 | \\one |
| ... | ... | @@ -218,14 +209,11 @@ test "multiline string comments at multiple places" { |
| 218 | 209 | } |
| 219 | 210 | |
| 220 | 211 | test "string concatenation simple" { |
| 221 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 222 | ||
| 223 | 212 | try expect(mem.eql(u8, "OK" ++ " IT " ++ "WORKED", "OK IT WORKED")); |
| 224 | 213 | } |
| 225 | 214 | |
| 226 | 215 | test "array mult operator" { |
| 227 | 216 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 228 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 229 | 217 | |
| 230 | 218 | try expect(mem.eql(u8, "ab" ** 5, "ababababab")); |
| 231 | 219 | } |
| ... | ... | @@ -308,8 +296,6 @@ test "function closes over local const" { |
| 308 | 296 | } |
| 309 | 297 | |
| 310 | 298 | test "volatile load and store" { |
| 311 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 312 | ||
| 313 | 299 | var number: i32 = 1234; |
| 314 | 300 | const ptr = @as(*volatile i32, &number); |
| 315 | 301 | ptr.* += 1; |
| ... | ... | @@ -326,7 +312,6 @@ fn fB() []const u8 { |
| 326 | 312 | test "call function pointer in struct" { |
| 327 | 313 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 328 | 314 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 329 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 330 | 315 | |
| 331 | 316 | try expect(mem.eql(u8, f3(true), "a")); |
| 332 | 317 | try expect(mem.eql(u8, f3(false), "b")); |
| ... | ... | @@ -350,7 +335,6 @@ const FnPtrWrapper = struct { |
| 350 | 335 | |
| 351 | 336 | test "const ptr from var variable" { |
| 352 | 337 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 353 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 354 | 338 | |
| 355 | 339 | var x: u64 = undefined; |
| 356 | 340 | var y: u64 = undefined; |
| ... | ... | @@ -370,7 +354,6 @@ test "call result of if else expression" { |
| 370 | 354 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 371 | 355 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 372 | 356 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 373 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 374 | 357 | |
| 375 | 358 | try expect(mem.eql(u8, f2(true), "a")); |
| 376 | 359 | try expect(mem.eql(u8, f2(false), "b")); |
| ... | ... | @@ -479,7 +462,6 @@ fn nine() u8 { |
| 479 | 462 | test "struct inside function" { |
| 480 | 463 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 481 | 464 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 482 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 483 | 465 | |
| 484 | 466 | try testStructInFn(); |
| 485 | 467 | try comptime testStructInFn(); |
| ... | ... | @@ -1219,7 +1201,6 @@ test "integer compare" { |
| 1219 | 1201 | |
| 1220 | 1202 | test "reference to inferred local variable works as expected" { |
| 1221 | 1203 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1222 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 1223 | 1204 | |
| 1224 | 1205 | const Crasher = struct { |
| 1225 | 1206 | lets_crash: u64 = 0, |
test/behavior/bitcast.zig-1| ... | ... | @@ -520,7 +520,6 @@ test "@bitCast of packed struct of bools all false" { |
| 520 | 520 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| 521 | 521 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 522 | 522 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO |
| 523 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 524 | 523 | |
| 525 | 524 | const P = packed struct { |
| 526 | 525 | b0: bool, |
test/behavior/call.zig-2| ... | ... | @@ -572,8 +572,6 @@ test "call function pointer in comptime field" { |
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | test "generic function pointer can be called" { |
| 575 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 576 | ||
| 577 | 575 | const S = struct { |
| 578 | 576 | var ok = false; |
| 579 | 577 | fn foo(x: anytype) void { |
test/behavior/cast.zig-7| ... | ... | @@ -400,7 +400,6 @@ test "cast from ?[*]T to ??[*]T" { |
| 400 | 400 | test "peer type unsigned int to signed" { |
| 401 | 401 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 402 | 402 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 403 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 404 | 403 | |
| 405 | 404 | var w: u31 = 5; |
| 406 | 405 | var x: u8 = 7; |
| ... | ... | @@ -443,7 +442,6 @@ test "peer resolve array and const slice" { |
| 443 | 442 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 444 | 443 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 445 | 444 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 446 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 447 | 445 | |
| 448 | 446 | try testPeerResolveArrayConstSlice(true); |
| 449 | 447 | try comptime testPeerResolveArrayConstSlice(true); |
| ... | ... | @@ -535,7 +533,6 @@ fn peerTypeEmptyArrayAndSliceAndError(a: bool, slice: []u8) anyerror![]u8 { |
| 535 | 533 | test "implicit cast from *const [N]T to []const T" { |
| 536 | 534 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 537 | 535 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 538 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 539 | 536 | |
| 540 | 537 | try testCastConstArrayRefToConstSlice(); |
| 541 | 538 | try comptime testCastConstArrayRefToConstSlice(); |
| ... | ... | @@ -718,7 +715,6 @@ test "peer type resolution: error set supersets" { |
| 718 | 715 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 719 | 716 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 720 | 717 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 721 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 722 | 718 | |
| 723 | 719 | const a: error{ One, Two } = undefined; |
| 724 | 720 | const b: error{One} = undefined; |
| ... | ... | @@ -748,7 +744,6 @@ test "peer type resolution: disjoint error sets" { |
| 748 | 744 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 749 | 745 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 750 | 746 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 751 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 752 | 747 | |
| 753 | 748 | const a: error{ One, Two } = undefined; |
| 754 | 749 | const b: error{Three} = undefined; |
| ... | ... | @@ -813,7 +808,6 @@ test "peer type resolution: error union after non-error" { |
| 813 | 808 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 814 | 809 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 815 | 810 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 816 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 817 | 811 | |
| 818 | 812 | const a: u32 = undefined; |
| 819 | 813 | const b: error{ One, Two }!u32 = undefined; |
| ... | ... | @@ -1393,7 +1387,6 @@ test "cast between *[N]void and []void" { |
| 1393 | 1387 | test "peer resolve arrays of different size to const slice" { |
| 1394 | 1388 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1395 | 1389 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1396 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 1397 | 1390 | |
| 1398 | 1391 | try expect(mem.eql(u8, boolToStr(true), "true")); |
| 1399 | 1392 | try expect(mem.eql(u8, boolToStr(false), "false")); |
test/behavior/decltest.zig-2| ... | ... | @@ -5,7 +5,5 @@ pub fn the_add_function(a: u32, b: u32) u32 { |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | test the_add_function { |
| 8 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 9 | ||
| 10 | 8 | if (the_add_function(1, 2) != 3) unreachable; |
| 11 | 9 | } |
test/behavior/defer.zig-5| ... | ... | @@ -5,8 +5,6 @@ const expectEqual = std.testing.expectEqual; |
| 5 | 5 | const expectError = std.testing.expectError; |
| 6 | 6 | |
| 7 | 7 | test "break and continue inside loop inside defer expression" { |
| 8 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 9 | ||
| 10 | 8 | testBreakContInDefer(10); |
| 11 | 9 | comptime testBreakContInDefer(10); |
| 12 | 10 | } |
| ... | ... | @@ -23,8 +21,6 @@ fn testBreakContInDefer(x: usize) void { |
| 23 | 21 | } |
| 24 | 22 | |
| 25 | 23 | test "defer and labeled break" { |
| 26 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 27 | ||
| 28 | 24 | var i = @as(usize, 0); |
| 29 | 25 | |
| 30 | 26 | blk: { |
| ... | ... | @@ -38,7 +34,6 @@ test "defer and labeled break" { |
| 38 | 34 | test "errdefer does not apply to fn inside fn" { |
| 39 | 35 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 40 | 36 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 41 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 42 | 37 | |
| 43 | 38 | if (testNestedFnErrDefer()) |_| @panic("expected error") else |e| try expect(e == error.Bad); |
| 44 | 39 | } |
test/behavior/enum.zig-1| ... | ... | @@ -1055,7 +1055,6 @@ test "tag name with assigned enum values" { |
| 1055 | 1055 | test "@tagName on enum literals" { |
| 1056 | 1056 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1057 | 1057 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1058 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 1059 | 1058 | |
| 1060 | 1059 | try expect(mem.eql(u8, @tagName(.FooBar), "FooBar")); |
| 1061 | 1060 | comptime assert(mem.eql(u8, @tagName(.FooBar), "FooBar")); |
test/behavior/eval.zig-12| ... | ... | @@ -306,8 +306,6 @@ fn performFn(comptime prefix_char: u8, start_value: i32) i32 { |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | test "comptime iterate over fn ptr list" { |
| 309 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 310 | ||
| 311 | 309 | try expect(performFn('t', 1) == 6); |
| 312 | 310 | try expect(performFn('o', 0) == 1); |
| 313 | 311 | try expect(performFn('w', 99) == 99); |
| ... | ... | @@ -413,8 +411,6 @@ var st_init_str_foo = StInitStrFoo{ |
| 413 | 411 | }; |
| 414 | 412 | |
| 415 | 413 | test "inline for with same type but different values" { |
| 416 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 417 | ||
| 418 | 414 | var res: usize = 0; |
| 419 | 415 | inline for ([_]type{ [2]u8, [1]u8, [2]u8 }) |T| { |
| 420 | 416 | var a: T = undefined; |
| ... | ... | @@ -544,7 +540,6 @@ test "runtime 128 bit integer division" { |
| 544 | 540 | test "@tagName of @typeInfo" { |
| 545 | 541 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 546 | 542 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 547 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 548 | 543 | |
| 549 | 544 | const str = @tagName(@typeInfo(u8)); |
| 550 | 545 | try expect(std.mem.eql(u8, str, "Int")); |
| ... | ... | @@ -1007,7 +1002,6 @@ test "closure capture type of runtime-known var" { |
| 1007 | 1002 | |
| 1008 | 1003 | test "comptime break passing through runtime condition converted to runtime break" { |
| 1009 | 1004 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1010 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 1011 | 1005 | |
| 1012 | 1006 | const S = struct { |
| 1013 | 1007 | fn doTheTest() !void { |
| ... | ... | @@ -1042,7 +1036,6 @@ test "comptime break to outer loop passing through runtime condition converted t |
| 1042 | 1036 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1043 | 1037 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1044 | 1038 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1045 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 1046 | 1039 | |
| 1047 | 1040 | const S = struct { |
| 1048 | 1041 | fn doTheTest() !void { |
| ... | ... | @@ -1266,7 +1259,6 @@ test "pass pointer to field of comptime-only type as a runtime parameter" { |
| 1266 | 1259 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1267 | 1260 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1268 | 1261 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1269 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 1270 | 1262 | |
| 1271 | 1263 | const S = struct { |
| 1272 | 1264 | const Mixed = struct { |
| ... | ... | @@ -1508,7 +1500,6 @@ test "continue nested inline for loop in named block expr" { |
| 1508 | 1500 | |
| 1509 | 1501 | test "x and false is comptime-known false" { |
| 1510 | 1502 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1511 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 1512 | 1503 | |
| 1513 | 1504 | const T = struct { |
| 1514 | 1505 | var x: u32 = 0; |
| ... | ... | @@ -1536,7 +1527,6 @@ test "x and false is comptime-known false" { |
| 1536 | 1527 | |
| 1537 | 1528 | test "x or true is comptime-known true" { |
| 1538 | 1529 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1539 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 1540 | 1530 | |
| 1541 | 1531 | const T = struct { |
| 1542 | 1532 | var x: u32 = 0; |
| ... | ... | @@ -1598,8 +1588,6 @@ test "comptime function turns function value to function pointer" { |
| 1598 | 1588 | } |
| 1599 | 1589 | |
| 1600 | 1590 | test "container level const and var have unique addresses" { |
| 1601 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 1602 | ||
| 1603 | 1591 | const S = struct { |
| 1604 | 1592 | x: i32, |
| 1605 | 1593 | y: i32, |
test/behavior/export_keyword.zig-1| ... | ... | @@ -26,7 +26,6 @@ const PackedUnion = packed union { |
| 26 | 26 | test "packed struct, enum, union parameters in extern function" { |
| 27 | 27 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 28 | 28 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 29 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 30 | 29 | |
| 31 | 30 | testPackedStuff(&(PackedStruct{ |
| 32 | 31 | .a = 1, |
test/behavior/fn.zig-9| ... | ... | @@ -6,8 +6,6 @@ const expect = testing.expect; |
| 6 | 6 | const expectEqual = testing.expectEqual; |
| 7 | 7 | |
| 8 | 8 | test "params" { |
| 9 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 10 | ||
| 11 | 9 | try expect(testParamsAdd(22, 11) == 33); |
| 12 | 10 | } |
| 13 | 11 | fn testParamsAdd(a: i32, b: i32) i32 { |
| ... | ... | @@ -15,8 +13,6 @@ fn testParamsAdd(a: i32, b: i32) i32 { |
| 15 | 13 | } |
| 16 | 14 | |
| 17 | 15 | test "local variables" { |
| 18 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 19 | ||
| 20 | 16 | testLocVars(2); |
| 21 | 17 | } |
| 22 | 18 | fn testLocVars(b: i32) void { |
| ... | ... | @@ -25,8 +21,6 @@ fn testLocVars(b: i32) void { |
| 25 | 21 | } |
| 26 | 22 | |
| 27 | 23 | test "mutable local variables" { |
| 28 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 29 | ||
| 30 | 24 | var zero: i32 = 0; |
| 31 | 25 | _ = &zero; |
| 32 | 26 | try expect(zero == 0); |
| ... | ... | @@ -325,7 +319,6 @@ test "function pointers" { |
| 325 | 319 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 326 | 320 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 327 | 321 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 328 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 329 | 322 | |
| 330 | 323 | const fns = [_]*const @TypeOf(fn1){ |
| 331 | 324 | &fn1, |
| ... | ... | @@ -403,8 +396,6 @@ test "function call with anon list literal - 2D" { |
| 403 | 396 | } |
| 404 | 397 | |
| 405 | 398 | test "ability to give comptime types and non comptime types to same parameter" { |
| 406 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 407 | ||
| 408 | 399 | const S = struct { |
| 409 | 400 | fn doTheTest() !void { |
| 410 | 401 | var x: i32 = 1; |
test/behavior/for.zig-7| ... | ... | @@ -7,7 +7,6 @@ const mem = std.mem; |
| 7 | 7 | test "continue in for loop" { |
| 8 | 8 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 9 | 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 10 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 11 | 10 | |
| 12 | 11 | const array = [_]i32{ 1, 2, 3, 4, 5 }; |
| 13 | 12 | var sum: i32 = 0; |
| ... | ... | @@ -22,8 +21,6 @@ test "continue in for loop" { |
| 22 | 21 | } |
| 23 | 22 | |
| 24 | 23 | test "break from outer for loop" { |
| 25 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 26 | ||
| 27 | 24 | try testBreakOuter(); |
| 28 | 25 | try comptime testBreakOuter(); |
| 29 | 26 | } |
| ... | ... | @@ -41,8 +38,6 @@ fn testBreakOuter() !void { |
| 41 | 38 | } |
| 42 | 39 | |
| 43 | 40 | test "continue outer for loop" { |
| 44 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 45 | ||
| 46 | 41 | try testContinueOuter(); |
| 47 | 42 | try comptime testContinueOuter(); |
| 48 | 43 | } |
| ... | ... | @@ -263,7 +258,6 @@ test "for loop with else branch" { |
| 263 | 258 | test "count over fixed range" { |
| 264 | 259 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 265 | 260 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 266 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 267 | 261 | |
| 268 | 262 | var sum: usize = 0; |
| 269 | 263 | for (0..6) |i| { |
| ... | ... | @@ -276,7 +270,6 @@ test "count over fixed range" { |
| 276 | 270 | test "two counters" { |
| 277 | 271 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 278 | 272 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 279 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 280 | 273 | |
| 281 | 274 | var sum: usize = 0; |
| 282 | 275 | for (0..10, 10..20) |i, j| { |
test/behavior/generics.zig-5| ... | ... | @@ -5,8 +5,6 @@ const expect = testing.expect; |
| 5 | 5 | const expectEqual = testing.expectEqual; |
| 6 | 6 | |
| 7 | 7 | test "one param, explicit comptime" { |
| 8 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 9 | ||
| 10 | 8 | var x: usize = 0; |
| 11 | 9 | x += checkSize(i32); |
| 12 | 10 | x += checkSize(bool); |
| ... | ... | @@ -151,8 +149,6 @@ fn GenericDataThing(comptime count: isize) type { |
| 151 | 149 | } |
| 152 | 150 | |
| 153 | 151 | test "use generic param in generic param" { |
| 154 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 155 | ||
| 156 | 152 | try expect(aGenericFn(i32, 3, 4) == 7); |
| 157 | 153 | } |
| 158 | 154 | fn aGenericFn(comptime T: type, comptime a: T, b: T) T { |
| ... | ... | @@ -258,7 +254,6 @@ test "generic function instantiation turns into comptime call" { |
| 258 | 254 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 259 | 255 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 260 | 256 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 261 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 262 | 257 | |
| 263 | 258 | const S = struct { |
| 264 | 259 | fn doTheTest() !void { |
test/behavior/globals.zig-1| ... | ... | @@ -50,7 +50,6 @@ test "global loads can affect liveness" { |
| 50 | 50 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 51 | 51 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 52 | 52 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 53 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 54 | 53 | |
| 55 | 54 | const S = struct { |
| 56 | 55 | const ByRef = struct { |
test/behavior/packed-struct.zig-1| ... | ... | @@ -889,7 +889,6 @@ test "runtime init of unnamed packed struct type" { |
| 889 | 889 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 890 | 890 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 891 | 891 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 892 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 893 | 892 | |
| 894 | 893 | var z: u8 = 123; |
| 895 | 894 | _ = &z; |
test/behavior/pointers.zig-3| ... | ... | @@ -6,8 +6,6 @@ const expect = testing.expect; |
| 6 | 6 | const expectError = testing.expectError; |
| 7 | 7 | |
| 8 | 8 | test "dereference pointer" { |
| 9 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 10 | ||
| 11 | 9 | try comptime testDerefPtr(); |
| 12 | 10 | try testDerefPtr(); |
| 13 | 11 | } |
| ... | ... | @@ -55,7 +53,6 @@ fn PtrOf(comptime T: type) type { |
| 55 | 53 | |
| 56 | 54 | test "implicit cast single item pointer to C pointer and back" { |
| 57 | 55 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 58 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 59 | 56 | |
| 60 | 57 | var y: u8 = 11; |
| 61 | 58 | const x: [*c]u8 = &y; |
test/behavior/ptrcast.zig-1| ... | ... | @@ -176,7 +176,6 @@ test "reinterpret struct field at comptime" { |
| 176 | 176 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 177 | 177 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 178 | 178 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 179 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 180 | 179 | |
| 181 | 180 | const numNative = comptime Bytes.init(0x12345678); |
| 182 | 181 | if (native_endian != .little) { |
test/behavior/sizeof_and_typeof.zig-4| ... | ... | @@ -144,8 +144,6 @@ test "@sizeOf(T) == 0 doesn't force resolving struct size" { |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | test "@TypeOf() has no runtime side effects" { |
| 147 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 148 | ||
| 149 | 147 | const S = struct { |
| 150 | 148 | fn foo(comptime T: type, ptr: *T) T { |
| 151 | 149 | ptr.* += 1; |
| ... | ... | @@ -438,8 +436,6 @@ test "Extern function calls, dereferences and field access in @TypeOf" { |
| 438 | 436 | } |
| 439 | 437 | |
| 440 | 438 | test "@sizeOf struct is resolved when used as operand of slicing" { |
| 441 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 442 | ||
| 443 | 439 | const dummy = struct {}; |
| 444 | 440 | const S = struct { |
| 445 | 441 | var buf: [1]u8 = undefined; |
test/behavior/slice.zig-2| ... | ... | @@ -176,7 +176,6 @@ test "comptime pointer cast array and then slice" { |
| 176 | 176 | test "slicing zero length array" { |
| 177 | 177 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 178 | 178 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 179 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 180 | 179 | |
| 181 | 180 | const s1 = ""[0..]; |
| 182 | 181 | const s2 = ([_]u32{})[0..]; |
| ... | ... | @@ -738,7 +737,6 @@ test "array mult of slice gives ptr to array" { |
| 738 | 737 | |
| 739 | 738 | test "slice bounds in comptime concatenation" { |
| 740 | 739 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 741 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 742 | 740 | |
| 743 | 741 | const bs = comptime blk: { |
| 744 | 742 | const b = "........1........"; |
test/behavior/string_literals.zig-2| ... | ... | @@ -8,7 +8,6 @@ const ptr_tag_name: [*:0]const u8 = tag_name; |
| 8 | 8 | test "@tagName() returns a string literal" { |
| 9 | 9 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 10 | 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 11 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 12 | 11 | |
| 13 | 12 | try std.testing.expect(*const [13:0]u8 == @TypeOf(tag_name)); |
| 14 | 13 | try std.testing.expect(std.mem.eql(u8, "TestEnumValue", tag_name)); |
| ... | ... | @@ -22,7 +21,6 @@ const ptr_error_name: [*:0]const u8 = error_name; |
| 22 | 21 | test "@errorName() returns a string literal" { |
| 23 | 22 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 24 | 23 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 25 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 26 | 24 | |
| 27 | 25 | try std.testing.expect(*const [13:0]u8 == @TypeOf(error_name)); |
| 28 | 26 | try std.testing.expect(std.mem.eql(u8, "TestErrorCode", error_name)); |
test/behavior/struct.zig-5| ... | ... | @@ -12,7 +12,6 @@ top_level_field: i32, |
| 12 | 12 | test "top level fields" { |
| 13 | 13 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 14 | 14 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 15 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 16 | 15 | |
| 17 | 16 | var instance = @This(){ |
| 18 | 17 | .top_level_field = 1234, |
| ... | ... | @@ -125,8 +124,6 @@ test "struct byval assign" { |
| 125 | 124 | } |
| 126 | 125 | |
| 127 | 126 | test "call struct static method" { |
| 128 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 129 | ||
| 130 | 127 | const result = StructWithNoFields.add(3, 4); |
| 131 | 128 | try expect(result == 7); |
| 132 | 129 | } |
| ... | ... | @@ -759,7 +756,6 @@ test "packed struct with u0 field access" { |
| 759 | 756 | test "access to global struct fields" { |
| 760 | 757 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 761 | 758 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 762 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 763 | 759 | |
| 764 | 760 | g_foo.bar.value = 42; |
| 765 | 761 | try expect(g_foo.bar.value == 42); |
| ... | ... | @@ -2134,7 +2130,6 @@ test "struct field default value is a call" { |
| 2134 | 2130 | |
| 2135 | 2131 | test "aggregate initializers should allow initializing comptime fields, verifying equality" { |
| 2136 | 2132 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 2137 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 2138 | 2133 | |
| 2139 | 2134 | var x: u32 = 15; |
| 2140 | 2135 | _ = &x; |
test/behavior/this.zig-2| ... | ... | @@ -21,8 +21,6 @@ fn add(x: i32, y: i32) i32 { |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | test "this refer to module call private fn" { |
| 24 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 25 | ||
| 26 | 24 | try expect(module.add(1, 2) == 3); |
| 27 | 25 | } |
| 28 | 26 |
test/behavior/tuple.zig-2| ... | ... | @@ -258,7 +258,6 @@ test "offsetOf anon struct" { |
| 258 | 258 | test "initializing tuple with mixed comptime-runtime fields" { |
| 259 | 259 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 260 | 260 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 261 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 262 | 261 | |
| 263 | 262 | var x: u32 = 15; |
| 264 | 263 | _ = &x; |
| ... | ... | @@ -271,7 +270,6 @@ test "initializing tuple with mixed comptime-runtime fields" { |
| 271 | 270 | test "initializing anon struct with mixed comptime-runtime fields" { |
| 272 | 271 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 273 | 272 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 274 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 275 | 273 | |
| 276 | 274 | var x: u32 = 15; |
| 277 | 275 | _ = &x; |
test/behavior/type_info.zig-7| ... | ... | @@ -161,7 +161,6 @@ test "type info: error set, error union info, anyerror" { |
| 161 | 161 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 162 | 162 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 163 | 163 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 164 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 165 | 164 | |
| 166 | 165 | try testErrorSet(); |
| 167 | 166 | try comptime testErrorSet(); |
| ... | ... | @@ -193,7 +192,6 @@ test "type info: error set single value" { |
| 193 | 192 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 194 | 193 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 195 | 194 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 196 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 197 | 195 | |
| 198 | 196 | const TestSet = error.One; |
| 199 | 197 | |
| ... | ... | @@ -207,7 +205,6 @@ test "type info: error set merged" { |
| 207 | 205 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 208 | 206 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 209 | 207 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 210 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 211 | 208 | |
| 212 | 209 | const TestSet = error{ One, Two } || error{Three}; |
| 213 | 210 | |
| ... | ... | @@ -223,7 +220,6 @@ test "type info: enum info" { |
| 223 | 220 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 224 | 221 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 225 | 222 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 226 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 227 | 223 | |
| 228 | 224 | try testEnum(); |
| 229 | 225 | try comptime testEnum(); |
| ... | ... | @@ -286,7 +282,6 @@ fn testUnion() !void { |
| 286 | 282 | |
| 287 | 283 | test "type info: struct info" { |
| 288 | 284 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 289 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 290 | 285 | |
| 291 | 286 | try testStruct(); |
| 292 | 287 | try comptime testStruct(); |
| ... | ... | @@ -535,7 +530,6 @@ test "type info for async frames" { |
| 535 | 530 | |
| 536 | 531 | test "Declarations are returned in declaration order" { |
| 537 | 532 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 538 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 539 | 533 | |
| 540 | 534 | const S = struct { |
| 541 | 535 | pub const a = 1; |
| ... | ... | @@ -558,7 +552,6 @@ test "Struct.is_tuple for anon list literal" { |
| 558 | 552 | |
| 559 | 553 | test "Struct.is_tuple for anon struct literal" { |
| 560 | 554 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 561 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 562 | 555 | |
| 563 | 556 | const info = @typeInfo(@TypeOf(.{ .a = 0 })); |
| 564 | 557 | try expect(!info.Struct.is_tuple); |
test/behavior/undefined.zig-3| ... | ... | @@ -48,7 +48,6 @@ test "assign undefined to struct" { |
| 48 | 48 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 49 | 49 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 50 | 50 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 51 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 52 | 51 | |
| 53 | 52 | comptime { |
| 54 | 53 | var foo: Foo = undefined; |
| ... | ... | @@ -66,7 +65,6 @@ test "assign undefined to struct with method" { |
| 66 | 65 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 67 | 66 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 68 | 67 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 69 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 70 | 68 | |
| 71 | 69 | comptime { |
| 72 | 70 | var foo: Foo = undefined; |
| ... | ... | @@ -82,7 +80,6 @@ test "assign undefined to struct with method" { |
| 82 | 80 | |
| 83 | 81 | test "type name of undefined" { |
| 84 | 82 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 85 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 86 | 83 | |
| 87 | 84 | const x = undefined; |
| 88 | 85 | try expect(mem.eql(u8, @typeName(@TypeOf(x)), "@TypeOf(undefined)")); |
test/behavior/union.zig-4| ... | ... | @@ -486,7 +486,6 @@ test "global union with single field is correctly initialized" { |
| 486 | 486 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 487 | 487 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 488 | 488 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 489 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 490 | 489 | |
| 491 | 490 | glbl = Foo1{ |
| 492 | 491 | .f = @typeInfo(Foo1).Union.fields[0].type{ .x = 123 }, |
| ... | ... | @@ -546,7 +545,6 @@ test "union initializer generates padding only if needed" { |
| 546 | 545 | test "runtime tag name with single field" { |
| 547 | 546 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 548 | 547 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 549 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 550 | 548 | |
| 551 | 549 | const U = union(enum) { |
| 552 | 550 | A: i32, |
| ... | ... | @@ -1467,7 +1465,6 @@ test "packed union in packed struct" { |
| 1467 | 1465 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1468 | 1466 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1469 | 1467 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1470 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 1471 | 1468 | |
| 1472 | 1469 | const S = packed struct { |
| 1473 | 1470 | nested: packed union { |
| ... | ... | @@ -1556,7 +1553,6 @@ test "packed union with zero-bit field" { |
| 1556 | 1553 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1557 | 1554 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1558 | 1555 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1559 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 1560 | 1556 | |
| 1561 | 1557 | const S = packed struct { |
| 1562 | 1558 | nested: packed union { |
test/behavior/vector.zig-1| ... | ... | @@ -433,7 +433,6 @@ test "load vector elements via runtime index" { |
| 433 | 433 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 434 | 434 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 435 | 435 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 436 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 437 | 436 | |
| 438 | 437 | const S = struct { |
| 439 | 438 | fn doTheTest() !void { |
test/behavior/while.zig-10| ... | ... | @@ -5,7 +5,6 @@ const assert = std.debug.assert; |
| 5 | 5 | |
| 6 | 6 | test "while loop" { |
| 7 | 7 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 8 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 9 | 8 | |
| 10 | 9 | var i: i32 = 0; |
| 11 | 10 | while (i < 4) { |
| ... | ... | @@ -39,8 +38,6 @@ fn staticWhileLoop2() i32 { |
| 39 | 38 | } |
| 40 | 39 | |
| 41 | 40 | test "while with continue expression" { |
| 42 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 43 | ||
| 44 | 41 | var sum: i32 = 0; |
| 45 | 42 | { |
| 46 | 43 | var i: i32 = 0; |
| ... | ... | @@ -53,8 +50,6 @@ test "while with continue expression" { |
| 53 | 50 | } |
| 54 | 51 | |
| 55 | 52 | test "while with else" { |
| 56 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 57 | ||
| 58 | 53 | var sum: i32 = 0; |
| 59 | 54 | var i: i32 = 0; |
| 60 | 55 | var got_else: i32 = 0; |
| ... | ... | @@ -82,8 +77,6 @@ fn getNumberOrNull() ?i32 { |
| 82 | 77 | } |
| 83 | 78 | |
| 84 | 79 | test "continue outer while loop" { |
| 85 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 86 | ||
| 87 | 80 | testContinueOuter(); |
| 88 | 81 | comptime testContinueOuter(); |
| 89 | 82 | } |
| ... | ... | @@ -131,7 +124,6 @@ test "while copies its payload" { |
| 131 | 124 | |
| 132 | 125 | test "continue and break" { |
| 133 | 126 | if (builtin.zig_backend == .stage2_aarch64 and builtin.os.tag == .macos) return error.SkipZigTest; |
| 134 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 135 | 127 | |
| 136 | 128 | try runContinueAndBreakTest(); |
| 137 | 129 | try expect(continue_and_break_counter == 8); |
| ... | ... | @@ -349,8 +341,6 @@ test "continue inline while loop" { |
| 349 | 341 | } |
| 350 | 342 | |
| 351 | 343 | test "else continue outer while" { |
| 352 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | |
| 353 | ||
| 354 | 344 | var i: usize = 0; |
| 355 | 345 | while (true) { |
| 356 | 346 | i += 1; |