| author | |
| committer | |
| log | def373ed782112e19132be11b413a6f44608bc60 |
| tree | da93262ce8c21f7a24aac7247262213609f14397 |
| parent | 7ef64ccf55927f9e1c5b01687907c870095c8e45 |
| parent | b60a4af44cca7d3e935acd0b861e3b650714ebc1 |
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/37300
Reviewed-by: Andrew Kelley <andrew@ziglang.org>139 files changed, 2481 insertions(+), 1408 deletions(-)
lib/compiler/aro/aro/Attribute/Wip.zig+1-1| ... | @@ -1303,7 +1303,7 @@ fn applyCallingConvention(wip: *Wip) !void { | ... | @@ -1303,7 +1303,7 @@ fn applyCallingConvention(wip: *Wip) !void { |
| 1303 | .default => unreachable, | 1303 | .default => unreachable, |
| 1304 | .cdecl => !(comp.target.cpu.arch.isArm() and comp.target.os.tag != .windows) and | 1304 | .cdecl => !(comp.target.cpu.arch.isArm() and comp.target.os.tag != .windows) and |
| 1305 | !comp.target.cpu.arch.isPowerPC64() and | 1305 | !comp.target.cpu.arch.isPowerPC64() and |
| 1306 | !comp.target.cpu.arch.isSpirV(), | 1306 | !comp.target.cpu.arch.isSpirv(), |
| 1307 | .aarch64_sve_pcs, .aarch64_vector_pcs => comp.target.cpu.arch.isAARCH64(), | 1307 | .aarch64_sve_pcs, .aarch64_vector_pcs => comp.target.cpu.arch.isAARCH64(), |
| 1308 | .arm_aapcs_vfp, .arm_aapcs => comp.target.cpu.arch.isArm(), | 1308 | .arm_aapcs_vfp, .arm_aapcs => comp.target.cpu.arch.isArm(), |
| 1309 | .riscv_vector_cc, .riscv_vls_cc => comp.target.cpu.arch.isRISCV(), | 1309 | .riscv_vector_cc, .riscv_vls_cc => comp.target.cpu.arch.isRISCV(), |
lib/compiler/aro/aro/Target.zig+1-1| ... | @@ -113,7 +113,7 @@ pub const SubArch = enum { | ... | @@ -113,7 +113,7 @@ pub const SubArch = enum { |
| 113 | return @backingInt(std.Target.mips.Feature.mips32r6); | 113 | return @backingInt(std.Target.mips.Feature.mips32r6); |
| 114 | } else if (arch.isMIPS64()) { | 114 | } else if (arch.isMIPS64()) { |
| 115 | return @backingInt(std.Target.mips.Feature.mips64r6); | 115 | return @backingInt(std.Target.mips.Feature.mips64r6); |
| 116 | } else if (arch.isSpirV()) { | 116 | } else if (arch.isSpirv()) { |
| 117 | const spirv = std.Target.spirv.Feature; | 117 | const spirv = std.Target.spirv.Feature; |
| 118 | return @backingInt(switch (sub) { | 118 | return @backingInt(switch (sub) { |
| 119 | .spirv_v10 => spirv.v1_0, | 119 | .spirv_v10 => spirv.v1_0, |
lib/compiler/test_runner.zig+1-1| ... | @@ -36,7 +36,7 @@ const need_simple = switch (builtin.zig_backend) { | ... | @@ -36,7 +36,7 @@ const need_simple = switch (builtin.zig_backend) { |
| 36 | pub fn main(init: std.process.Init.Minimal) void { | 36 | pub fn main(init: std.process.Init.Minimal) void { |
| 37 | @disableInstrumentation(); | 37 | @disableInstrumentation(); |
| 38 | 38 | ||
| 39 | if (builtin.cpu.arch.isSpirV()) { | 39 | if (builtin.cpu.arch.isSpirv()) { |
| 40 | // SPIR-V needs an special test-runner | 40 | // SPIR-V needs an special test-runner |
| 41 | return; | 41 | return; |
| 42 | } | 42 | } |
lib/std/Target.zig+1-1| ... | @@ -2381,7 +2381,7 @@ pub fn supportsAddressSpace( | ... | @@ -2381,7 +2381,7 @@ pub fn supportsAddressSpace( |
| 2381 | const arch = target.cpu.arch; | 2381 | const arch = target.cpu.arch; |
| 2382 | 2382 | ||
| 2383 | const is_nvptx = arch.isNvptx(); | 2383 | const is_nvptx = arch.isNvptx(); |
| 2384 | const is_spirv = arch.isSpirV(); | 2384 | const is_spirv = arch.isSpirv(); |
| 2385 | const is_gpu = is_nvptx or is_spirv or arch == .amdgcn; | 2385 | const is_gpu = is_nvptx or is_spirv or arch == .amdgcn; |
| 2386 | 2386 | ||
| 2387 | return switch (address_space) { | 2387 | return switch (address_space) { |
lib/std/debug.zig+1| ... | @@ -500,6 +500,7 @@ const use_trap_panic = switch (builtin.zig_backend) { | ... | @@ -500,6 +500,7 @@ const use_trap_panic = switch (builtin.zig_backend) { |
| 500 | .stage2_spirv, | 500 | .stage2_spirv, |
| 501 | .stage2_x86, | 501 | .stage2_x86, |
| 502 | => true, | 502 | => true, |
| 503 | .stage2_llvm => builtin.cpu.arch.isSpirv(), | ||
| 503 | else => false, | 504 | else => false, |
| 504 | }; | 505 | }; |
| 505 | 506 |
lib/std/lang.zig+5| ... | @@ -1363,6 +1363,11 @@ pub const panic: type = p: { | ... | @@ -1363,6 +1363,11 @@ pub const panic: type = p: { |
| 1363 | .stage2_powerpc, | 1363 | .stage2_powerpc, |
| 1364 | .stage2_riscv64, | 1364 | .stage2_riscv64, |
| 1365 | => std.debug.simple_panic, | 1365 | => std.debug.simple_panic, |
| 1366 | .stage2_spirv => std.debug.no_panic, | ||
| 1367 | .stage2_llvm => { | ||
| 1368 | if (builtin.cpu.arch.isSpirv()) break :p std.debug.no_panic; | ||
| 1369 | break :p std.debug.FullPanic(std.debug.defaultPanic); | ||
| 1370 | }, | ||
| 1366 | else => std.debug.FullPanic(std.debug.defaultPanic), | 1371 | else => std.debug.FullPanic(std.debug.defaultPanic), |
| 1367 | }; | 1372 | }; |
| 1368 | }; | 1373 | }; |
lib/std/mem.zig+1-1| ... | @@ -4889,7 +4889,7 @@ pub fn doNotOptimizeAway(val: anytype) void { | ... | @@ -4889,7 +4889,7 @@ pub fn doNotOptimizeAway(val: anytype) void { |
| 4889 | // tied to IDs that can be passed to valid instructions. Some | 4889 | // tied to IDs that can be passed to valid instructions. Some |
| 4890 | // SPIR-V targets do not define c_long, so we just allow any sized | 4890 | // SPIR-V targets do not define c_long, so we just allow any sized |
| 4891 | // integer on these targets | 4891 | // integer on these targets |
| 4892 | const val_fits_in_gp_register = builtin.target.cpu.arch.isSpirV() or fits: { | 4892 | const val_fits_in_gp_register = builtin.target.cpu.arch.isSpirv() or fits: { |
| 4893 | const max_gp_register_bits = @bitSizeOf(c_long); | 4893 | const max_gp_register_bits = @bitSizeOf(c_long); |
| 4894 | break :fits int.bits <= max_gp_register_bits; | 4894 | break :fits int.bits <= max_gp_register_bits; |
| 4895 | }; | 4895 | }; |
lib/std/testing.zig+1| ... | @@ -36,6 +36,7 @@ pub const backend_can_print = switch (builtin.zig_backend) { | ... | @@ -36,6 +36,7 @@ pub const backend_can_print = switch (builtin.zig_backend) { |
| 36 | .stage2_riscv64, | 36 | .stage2_riscv64, |
| 37 | .stage2_spirv, | 37 | .stage2_spirv, |
| 38 | => false, | 38 | => false, |
| 39 | .stage2_llvm => !builtin.cpu.arch.isSpirv(), | ||
| 39 | else => true, | 40 | else => true, |
| 40 | }; | 41 | }; |
| 41 | 42 |
lib/std/zig/llvm/Builder.zig+70-7| ... | @@ -212,13 +212,27 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const | ... | @@ -212,13 +212,27 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const |
| 212 | .powerpc => subArchName(target, .powerpc, .{ | 212 | .powerpc => subArchName(target, .powerpc, .{ |
| 213 | .{ .spe, "spe" }, | 213 | .{ .spe, "spe" }, |
| 214 | }), | 214 | }), |
| 215 | .spirv32, .spirv64 => subArchName(target, .spirv, .{ | 215 | .spirv32 => switch (target.os.tag) { |
| 216 | .{ .v1_6, "1.6" }, | 216 | .vulkan, .opengl => subArchName(target, .spirv, .{ |
| 217 | .{ .v1_5, "1.5" }, | 217 | .{ .v1_6, "1.6" }, |
| 218 | .{ .v1_4, "1.4" }, | 218 | .{ .v1_5, "1.5" }, |
| 219 | .{ .v1_3, "1.3" }, | 219 | }), |
| 220 | .{ .v1_2, "1.2" }, | 220 | else => subArchName(target, .spirv, .{ |
| 221 | .{ .v1_1, "1.1" }, | 221 | .{ .v1_6, "v1.6" }, |
| 222 | .{ .v1_5, "v1.5" }, | ||
| 223 | .{ .v1_4, "v1.4" }, | ||
| 224 | .{ .v1_3, "v1.3" }, | ||
| 225 | .{ .v1_2, "v1.2" }, | ||
| 226 | .{ .v1_1, "v1.1" }, | ||
| 227 | }), | ||
| 228 | }, | ||
| 229 | .spirv64 => subArchName(target, .spirv, .{ | ||
| 230 | .{ .v1_6, "v1.6" }, | ||
| 231 | .{ .v1_5, "v1.5" }, | ||
| 232 | .{ .v1_4, "v1.4" }, | ||
| 233 | .{ .v1_3, "v1.3" }, | ||
| 234 | .{ .v1_2, "v1.2" }, | ||
| 235 | .{ .v1_1, "v1.1" }, | ||
| 222 | }), | 236 | }), |
| 223 | else => null, | 237 | else => null, |
| 224 | }; | 238 | }; |
| ... | @@ -10234,6 +10248,55 @@ pub fn opaqueType(self: *Builder, name: String) Allocator.Error!Type { | ... | @@ -10234,6 +10248,55 @@ pub fn opaqueType(self: *Builder, name: String) Allocator.Error!Type { |
| 10234 | return self.opaqueTypeAssumeCapacity(name); | 10248 | return self.opaqueTypeAssumeCapacity(name); |
| 10235 | } | 10249 | } |
| 10236 | 10250 | ||
| 10251 | pub fn targetType( | ||
| 10252 | self: *Builder, | ||
| 10253 | name: String, | ||
| 10254 | types: []const Type, | ||
| 10255 | ints: []const u32, | ||
| 10256 | ) Allocator.Error!Type { | ||
| 10257 | try self.ensureUnusedTypeCapacity(1, Type.Target, types.len + ints.len); | ||
| 10258 | const Key = struct { name: String, types: []const Type, ints: []const u32 }; | ||
| 10259 | const Adapter = struct { | ||
| 10260 | builder: *const Builder, | ||
| 10261 | pub fn hash(_: @This(), key: Key) u32 { | ||
| 10262 | var hasher: std.hash.Wyhash = .init(comptime std.hash.int(@backingInt(Type.Tag.target))); | ||
| 10263 | hasher.update(std.mem.asBytes(&key.name)); | ||
| 10264 | hasher.update(std.mem.sliceAsBytes(key.types)); | ||
| 10265 | hasher.update(std.mem.sliceAsBytes(key.ints)); | ||
| 10266 | return @truncate(hasher.final()); | ||
| 10267 | } | ||
| 10268 | pub fn eql(ctx: @This(), lhs_key: Key, _: void, rhs_index: usize) bool { | ||
| 10269 | const rhs_data = ctx.builder.type_items.items[rhs_index]; | ||
| 10270 | if (rhs_data.tag != .target) return false; | ||
| 10271 | var extra = ctx.builder.typeExtraDataTrail(Type.Target, rhs_data.data); | ||
| 10272 | if (lhs_key.name != extra.data.name) return false; | ||
| 10273 | const rhs_types = extra.trail.next(extra.data.types_len, Type, ctx.builder); | ||
| 10274 | const rhs_ints = extra.trail.next(extra.data.ints_len, u32, ctx.builder); | ||
| 10275 | return std.mem.eql(Type, lhs_key.types, rhs_types) and | ||
| 10276 | std.mem.eql(u32, lhs_key.ints, rhs_ints); | ||
| 10277 | } | ||
| 10278 | }; | ||
| 10279 | const gop = self.type_map.getOrPutAssumeCapacityAdapted( | ||
| 10280 | Key{ .name = name, .types = types, .ints = ints }, | ||
| 10281 | Adapter{ .builder = self }, | ||
| 10282 | ); | ||
| 10283 | if (!gop.found_existing) { | ||
| 10284 | gop.key_ptr.* = {}; | ||
| 10285 | gop.value_ptr.* = {}; | ||
| 10286 | self.type_items.appendAssumeCapacity(.{ | ||
| 10287 | .tag = .target, | ||
| 10288 | .data = self.addTypeExtraAssumeCapacity(Type.Target{ | ||
| 10289 | .name = name, | ||
| 10290 | .types_len = @intCast(types.len), | ||
| 10291 | .ints_len = @intCast(ints.len), | ||
| 10292 | }), | ||
| 10293 | }); | ||
| 10294 | self.type_extra.appendSliceAssumeCapacity(@ptrCast(types)); | ||
| 10295 | self.type_extra.appendSliceAssumeCapacity(ints); | ||
| 10296 | } | ||
| 10297 | return @fromBackingInt(@intCast(gop.index)); | ||
| 10298 | } | ||
| 10299 | |||
| 10237 | pub fn namedTypeSetBody( | 10300 | pub fn namedTypeSetBody( |
| 10238 | self: *Builder, | 10301 | self: *Builder, |
| 10239 | named_type: Type, | 10302 | named_type: Type, |
src/Compilation.zig+2-1| ... | @@ -1300,7 +1300,7 @@ pub const cache_helpers = struct { | ... | @@ -1300,7 +1300,7 @@ pub const cache_helpers = struct { |
| 1300 | const tag: @typeInfo(Config.DebugFormat).@"union".tag_type.? = x; | 1300 | const tag: @typeInfo(Config.DebugFormat).@"union".tag_type.? = x; |
| 1301 | hh.add(tag); | 1301 | hh.add(tag); |
| 1302 | switch (x) { | 1302 | switch (x) { |
| 1303 | .strip, .code_view => {}, | 1303 | .strip, .code_view, .nsdi => {}, |
| 1304 | .dwarf => |f| hh.add(f), | 1304 | .dwarf => |f| hh.add(f), |
| 1305 | } | 1305 | } |
| 1306 | } | 1306 | } |
| ... | @@ -6303,6 +6303,7 @@ fn addCommonCCArgs( | ... | @@ -6303,6 +6303,7 @@ fn addCommonCCArgs( |
| 6303 | try argv.ensureUnusedCapacity(2); | 6303 | try argv.ensureUnusedCapacity(2); |
| 6304 | switch (comp.config.debug_format) { | 6304 | switch (comp.config.debug_format) { |
| 6305 | .strip => {}, | 6305 | .strip => {}, |
| 6306 | .nsdi => argv.appendAssumeCapacity("-g"), | ||
| 6306 | .code_view => { | 6307 | .code_view => { |
| 6307 | // -g is required here because -gcodeview doesn't trigger debug info | 6308 | // -g is required here because -gcodeview doesn't trigger debug info |
| 6308 | // generation, it only changes the type of information generated. | 6309 | // generation, it only changes the type of information generated. |
src/Compilation/Config.zig+4-1| ... | @@ -72,6 +72,8 @@ pub const DebugFormat = union(enum) { | ... | @@ -72,6 +72,8 @@ pub const DebugFormat = union(enum) { |
| 72 | strip, | 72 | strip, |
| 73 | dwarf: std.dwarf.Format, | 73 | dwarf: std.dwarf.Format, |
| 74 | code_view, | 74 | code_view, |
| 75 | /// Non-semantic Shader Debug Info | ||
| 76 | nsdi, | ||
| 75 | }; | 77 | }; |
| 76 | 78 | ||
| 77 | pub const Options = struct { | 79 | pub const Options = struct { |
| ... | @@ -517,7 +519,8 @@ pub fn resolve(options: Options) ResolveError!Config { | ... | @@ -517,7 +519,8 @@ pub fn resolve(options: Options) ResolveError!Config { |
| 517 | .windows, .uefi => .code_view, | 519 | .windows, .uefi => .code_view, |
| 518 | else => .{ .dwarf = .@"32" }, | 520 | else => .{ .dwarf = .@"32" }, |
| 519 | }, | 521 | }, |
| 520 | .spirv, .hex, .raw, .plan9 => .strip, | 522 | .spirv => .nsdi, |
| 523 | .hex, .raw, .plan9 => .strip, | ||
| 521 | }; | 524 | }; |
| 522 | }; | 525 | }; |
| 523 | 526 |
src/Sema.zig+23-48| ... | @@ -6977,7 +6977,7 @@ fn analyzeCall( | ... | @@ -6977,7 +6977,7 @@ fn analyzeCall( |
| 6977 | const is_inline_call = block.isComptime() or inline_requested; | 6977 | const is_inline_call = block.isComptime() or inline_requested; |
| 6978 | 6978 | ||
| 6979 | if (!is_inline_call) { | 6979 | if (!is_inline_call) { |
| 6980 | if (func_val == null and !func_is_extern and !block.is_typeof and zcu.getTarget().cpu.arch.isSpirV()) { | 6980 | if (func_val == null and !func_is_extern and !block.is_typeof and zcu.getTarget().cpu.arch.isSpirv()) { |
| 6981 | return sema.fail(block, func_src, "SPIR-V does not support calling function pointers", .{}); | 6981 | return sema.fail(block, func_src, "SPIR-V does not support calling function pointers", .{}); |
| 6982 | } | 6982 | } |
| 6983 | if (sema.func_is_naked) return sema.failWithOwnedErrorMsg(block, msg: { | 6983 | if (sema.func_is_naked) return sema.failWithOwnedErrorMsg(block, msg: { |
| ... | @@ -8695,19 +8695,17 @@ fn checkParamType( | ... | @@ -8695,19 +8695,17 @@ fn checkParamType( |
| 8695 | if (param_is_noalias and !param_ty.isGenericPoison() and !param_ty.isPtrAtRuntime(zcu) and !param_ty.isSliceAtRuntime(zcu)) { | 8695 | if (param_is_noalias and !param_ty.isGenericPoison() and !param_ty.isPtrAtRuntime(zcu) and !param_ty.isSliceAtRuntime(zcu)) { |
| 8696 | return sema.fail(block, param_src, "non-pointer parameter declared noalias", .{}); | 8696 | return sema.fail(block, param_src, "non-pointer parameter declared noalias", .{}); |
| 8697 | } | 8697 | } |
| 8698 | switch (target.os.tag) { | 8698 | if (cc != .@"inline" and param_ty.isPtrAtRuntime(zcu)) { |
| 8699 | .vulkan, .opengl => if (cc != .@"inline" and param_ty.isPtrAtRuntime(zcu)) { | 8699 | const as = param_ty.ptrAddressSpace(zcu); |
| 8700 | switch (param_ty.ptrAddressSpace(zcu)) { | 8700 | if (target_util.addrSpaceIsLogical(target, as)) switch (as) { |
| 8701 | .input, .output => |as| return sema.failWithOwnedErrorMsg(block, msg: { | 8701 | .input, .output => return sema.failWithOwnedErrorMsg(block, msg: { |
| 8702 | const msg = try sema.errMsg(param_src, "function parameter cannot be a pointer in '{s}' address space", .{@tagName(as)}); | 8702 | const msg = try sema.errMsg(param_src, "function parameter cannot be a pointer in '{s}' address space", .{@tagName(as)}); |
| 8703 | errdefer msg.destroy(sema.gpa); | 8703 | errdefer msg.destroy(sema.gpa); |
| 8704 | try sema.errNote(param_src, msg, "mark the function as 'inline' so the parameter is substituted at call sites", .{}); | 8704 | try sema.errNote(param_src, msg, "mark the function as 'inline' so the parameter is substituted at call sites", .{}); |
| 8705 | break :msg msg; | 8705 | break :msg msg; |
| 8706 | }), | 8706 | }), |
| 8707 | else => {}, | 8707 | else => {}, |
| 8708 | } | 8708 | }; |
| 8709 | }, | ||
| 8710 | else => {}, | ||
| 8711 | } | 8709 | } |
| 8712 | } | 8710 | } |
| 8713 | 8711 | ||
| ... | @@ -8944,9 +8942,7 @@ fn checkMergeAllowed(sema: *Sema, block: *Block, src: LazySrcLoc, peer_ty: Type) | ... | @@ -8944,9 +8942,7 @@ fn checkMergeAllowed(sema: *Sema, block: *Block, src: LazySrcLoc, peer_ty: Type) |
| 8944 | } | 8942 | } |
| 8945 | 8943 | ||
| 8946 | const as = peer_ty.ptrAddressSpace(zcu); | 8944 | const as = peer_ty.ptrAddressSpace(zcu); |
| 8947 | if (!target_util.shouldBlockPointerOps(target, as)) { | 8945 | if (!target_util.addrSpaceIsLogical(target, as)) return; |
| 8948 | return; | ||
| 8949 | } | ||
| 8950 | 8946 | ||
| 8951 | return sema.failWithOwnedErrorMsg(block, msg: { | 8947 | return sema.failWithOwnedErrorMsg(block, msg: { |
| 8952 | const msg = try sema.errMsg(src, "value with non-mergable pointer type '{f}' depends on runtime control flow", .{peer_ty.fmt(zcu)}); | 8948 | const msg = try sema.errMsg(src, "value with non-mergable pointer type '{f}' depends on runtime control flow", .{peer_ty.fmt(zcu)}); |
| ... | @@ -15535,7 +15531,7 @@ fn zirAsm( | ... | @@ -15535,7 +15531,7 @@ fn zirAsm( |
| 15535 | } | 15531 | } |
| 15536 | 15532 | ||
| 15537 | const constraint = sema.code.nullTerminatedString(input.data.constraint); | 15533 | const constraint = sema.code.nullTerminatedString(input.data.constraint); |
| 15538 | if (zcu.getTarget().cpu.arch.isSpirV() and std.mem.eql(u8, constraint, "c")) { | 15534 | if (zcu.getTarget().cpu.arch.isSpirv() and std.mem.eql(u8, constraint, "c")) { |
| 15539 | const val = sema.resolveValue(arg.*) orelse { | 15535 | const val = sema.resolveValue(arg.*) orelse { |
| 15540 | return sema.fail(block, input_src, "assembly input with 'c' constraint must be compile-time known", .{}); | 15536 | return sema.fail(block, input_src, "assembly input with 'c' constraint must be compile-time known", .{}); |
| 15541 | }; | 15537 | }; |
| ... | @@ -20925,7 +20921,7 @@ fn zirReifySpirvType( | ... | @@ -20925,7 +20921,7 @@ fn zirReifySpirvType( |
| 20925 | } }, | 20921 | } }, |
| 20926 | }; | 20922 | }; |
| 20927 | 20923 | ||
| 20928 | if (!target.cpu.arch.isSpirV()) { | 20924 | if (!target.cpu.arch.isSpirv()) { |
| 20929 | return sema.fail( | 20925 | return sema.fail( |
| 20930 | block, | 20926 | block, |
| 20931 | src, | 20927 | src, |
| ... | @@ -22245,7 +22241,7 @@ fn ptrCastFull( | ... | @@ -22245,7 +22241,7 @@ fn ptrCastFull( |
| 22245 | try sema.validateRuntimeValue(block, operand_src, operand); | 22241 | try sema.validateRuntimeValue(block, operand_src, operand); |
| 22246 | try sema.checkLogicalPtrCast(block, src, operand_ty, dest_ty); | 22242 | try sema.checkLogicalPtrCast(block, src, operand_ty, dest_ty); |
| 22247 | 22243 | ||
| 22248 | const can_cast_to_int = !target_util.shouldBlockPointerOps(zcu.getTarget(), operand_ty.ptrAddressSpace(zcu)); | 22244 | const can_cast_to_int = !target_util.addrSpaceIsLogical(zcu.getTarget(), operand_ty.ptrAddressSpace(zcu)); |
| 22249 | const need_null_check = can_cast_to_int and block.wantSafety() and operand_ty.ptrAllowsZero(zcu) and !dest_ty.ptrAllowsZero(zcu); | 22245 | const need_null_check = can_cast_to_int and block.wantSafety() and operand_ty.ptrAllowsZero(zcu) and !dest_ty.ptrAllowsZero(zcu); |
| 22250 | const need_align_check = can_cast_to_int and block.wantSafety() and dest_align.compare(.gt, src_align); | 22246 | const need_align_check = can_cast_to_int and block.wantSafety() and dest_align.compare(.gt, src_align); |
| 22251 | 22247 | ||
| ... | @@ -22791,7 +22787,7 @@ fn checkLogicalPtrOperation(sema: *Sema, block: *Block, src: LazySrcLoc, ty: Typ | ... | @@ -22791,7 +22787,7 @@ fn checkLogicalPtrOperation(sema: *Sema, block: *Block, src: LazySrcLoc, ty: Typ |
| 22791 | if (zcu.intern_pool.indexToKey(ty.toIntern()) == .ptr_type) { | 22787 | if (zcu.intern_pool.indexToKey(ty.toIntern()) == .ptr_type) { |
| 22792 | const target = zcu.getTarget(); | 22788 | const target = zcu.getTarget(); |
| 22793 | const as = ty.ptrAddressSpace(zcu); | 22789 | const as = ty.ptrAddressSpace(zcu); |
| 22794 | if (target_util.shouldBlockPointerOps(target, as)) { | 22790 | if (target_util.addrSpaceIsLogical(target, as)) { |
| 22795 | return sema.failWithOwnedErrorMsg(block, msg: { | 22791 | return sema.failWithOwnedErrorMsg(block, msg: { |
| 22796 | const msg = try sema.errMsg(src, "illegal operation on logical pointer of type '{f}'", .{ty.fmt(zcu)}); | 22792 | const msg = try sema.errMsg(src, "illegal operation on logical pointer of type '{f}'", .{ty.fmt(zcu)}); |
| 22797 | errdefer msg.destroy(sema.gpa); | 22793 | errdefer msg.destroy(sema.gpa); |
| ... | @@ -22822,11 +22818,7 @@ fn checkLogicalPtrCast( | ... | @@ -22822,11 +22818,7 @@ fn checkLogicalPtrCast( |
| 22822 | const dest_child: Type = .fromInterned(dest_info.child); | 22818 | const dest_child: Type = .fromInterned(dest_info.child); |
| 22823 | 22819 | ||
| 22824 | if (block.isComptime() or block.is_typeof) return; | 22820 | if (block.isComptime() or block.is_typeof) return; |
| 22825 | switch (zcu.getTarget().os.tag) { | 22821 | if (!target_util.addrSpaceIsLogical(zcu.getTarget(), src_info.flags.address_space)) return; |
| 22826 | .vulkan, .opengl => {}, | ||
| 22827 | else => return, | ||
| 22828 | } | ||
| 22829 | if (src_info.flags.address_space == .physical_storage_buffer) return; | ||
| 22830 | if (!dest_child.hasRuntimeBits(zcu)) return; | 22822 | if (!dest_child.hasRuntimeBits(zcu)) return; |
| 22831 | 22823 | ||
| 22832 | var cur = src_child; | 22824 | var cur = src_child; |
| ... | @@ -30294,28 +30286,11 @@ fn checkSpirvSliceAllowed( | ... | @@ -30294,28 +30286,11 @@ fn checkSpirvSliceAllowed( |
| 30294 | const zcu = sema.pt.zcu; | 30286 | const zcu = sema.pt.zcu; |
| 30295 | const target = zcu.getTarget(); | 30287 | const target = zcu.getTarget(); |
| 30296 | 30288 | ||
| 30297 | if (!target.cpu.arch.isSpirV()) return; | 30289 | if (!target.cpu.arch.isSpirv()) return; |
| 30298 | if (block.isComptime()) return; | 30290 | if (block.isComptime()) return; |
| 30299 | 30291 | ||
| 30300 | // This probably lets some invalid OpPtrAccessChains slip through, but it's better than nothing | 30292 | if (!target_util.addrSpaceIsLogical(target, address_space)) return; |
| 30301 | if (!target.cpu.has(.spirv, .variable_pointers) and !target.cpu.has(.spirv, .variable_pointers_storage_buffer)) { | 30293 | return sema.fail(block, src, "cannot construct slice from logical address space '{t}'", .{address_space}); |
| 30302 | return sema.failWithOwnedErrorMsg( | ||
| 30303 | block, | ||
| 30304 | try sema.errMsg(src, "cannot construct slices without the 'variable_pointers' or 'variable_pointers_storage_buffer' features", .{}), | ||
| 30305 | ); | ||
| 30306 | } | ||
| 30307 | |||
| 30308 | switch (address_space) { | ||
| 30309 | .shared, .storage_buffer => {}, | ||
| 30310 | else => { | ||
| 30311 | return sema.failWithOwnedErrorMsg(block, msg: { | ||
| 30312 | const msg = try sema.errMsg(src, "cannot construct slice from address space '{t}'", .{address_space}); | ||
| 30313 | errdefer msg.destroy(sema.gpa); | ||
| 30314 | try sema.errNote(src, msg, "only 'shared' and 'storage_buffer' address spaces support slicing on SPIR-V", .{}); | ||
| 30315 | break :msg msg; | ||
| 30316 | }); | ||
| 30317 | }, | ||
| 30318 | } | ||
| 30319 | } | 30294 | } |
| 30320 | 30295 | ||
| 30321 | fn coerceArrayPtrToSlice( | 30296 | fn coerceArrayPtrToSlice( |
| ... | @@ -35094,7 +35069,7 @@ pub fn resolveNavPtrModifiers( | ... | @@ -35094,7 +35069,7 @@ pub fn resolveNavPtrModifiers( |
| 35094 | }; | 35069 | }; |
| 35095 | const addrspace_body = zir_decl.addrspace_body orelse { | 35070 | const addrspace_body = zir_decl.addrspace_body orelse { |
| 35096 | if (zir_decl.linkage == .@"extern" and | 35071 | if (zir_decl.linkage == .@"extern" and |
| 35097 | target.cpu.arch.isSpirV() and | 35072 | target.cpu.arch.isSpirv() and |
| 35098 | nav_ty.zigTypeTag(zcu) != .@"fn") | 35073 | nav_ty.zigTypeTag(zcu) != .@"fn") |
| 35099 | { | 35074 | { |
| 35100 | return sema.fail( | 35075 | return sema.fail( |
| ... | @@ -35115,7 +35090,7 @@ pub fn resolveNavPtrModifiers( | ... | @@ -35115,7 +35090,7 @@ pub fn resolveNavPtrModifiers( |
| 35115 | break :as try sema.analyzeAsAddressSpace(block, addrspace_src, addrspace_ref, addrspace_ctx); | 35090 | break :as try sema.analyzeAsAddressSpace(block, addrspace_src, addrspace_ref, addrspace_ctx); |
| 35116 | }; | 35091 | }; |
| 35117 | 35092 | ||
| 35118 | if (target.cpu.arch.isSpirV()) { | 35093 | if (target.cpu.arch.isSpirv()) { |
| 35119 | if (zir_decl.kind == .@"var" and zir_decl.linkage != .@"extern" and !zir_decl.is_threadlocal) { | 35094 | if (zir_decl.kind == .@"var" and zir_decl.linkage != .@"extern" and !zir_decl.is_threadlocal) { |
| 35120 | return sema.failWithOwnedErrorMsg(block, msg: { | 35095 | return sema.failWithOwnedErrorMsg(block, msg: { |
| 35121 | const decl_src = block.nodeOffset(.zero); | 35096 | const decl_src = block.nodeOffset(.zero); |
src/Type.zig+1-1| ... | @@ -3135,7 +3135,7 @@ pub fn validateExtern(ty: Type, position: ExternPosition, zcu: *const Zcu) bool | ... | @@ -3135,7 +3135,7 @@ pub fn validateExtern(ty: Type, position: ExternPosition, zcu: *const Zcu) bool |
| 3135 | => false, | 3135 | => false, |
| 3136 | 3136 | ||
| 3137 | .vector => { | 3137 | .vector => { |
| 3138 | if (zcu.getTarget().cpu.arch.isSpirV()) return true; | 3138 | if (zcu.getTarget().cpu.arch.isSpirv()) return true; |
| 3139 | return position == .param_ty or position == .ret_ty; | 3139 | return position == .param_ty or position == .ret_ty; |
| 3140 | }, | 3140 | }, |
| 3141 | 3141 |
src/Zcu.zig+1-1| ... | @@ -4101,7 +4101,7 @@ pub fn errorSetBits(zcu: *const Zcu) u16 { | ... | @@ -4101,7 +4101,7 @@ pub fn errorSetBits(zcu: *const Zcu) u16 { |
| 4101 | const target = zcu.getTarget(); | 4101 | const target = zcu.getTarget(); |
| 4102 | 4102 | ||
| 4103 | if (zcu.error_limit == 0) return 0; | 4103 | if (zcu.error_limit == 0) return 0; |
| 4104 | if (target.cpu.arch.isSpirV()) { | 4104 | if (target.cpu.arch.isSpirv()) { |
| 4105 | // As expected by https://github.com/Snektron/zig-spirv-test-executor | 4105 | // As expected by https://github.com/Snektron/zig-spirv-test-executor |
| 4106 | if (zcu.comp.config.is_test) return 32; | 4106 | if (zcu.comp.config.is_test) return 32; |
| 4107 | } | 4107 | } |
src/codegen/llvm.zig+133-6| ... | @@ -455,6 +455,7 @@ pub const Object = struct { | ... | @@ -455,6 +455,7 @@ pub const Object = struct { |
| 455 | 455 | ||
| 456 | switch (comp.config.debug_format) { | 456 | switch (comp.config.debug_format) { |
| 457 | .strip => unreachable, | 457 | .strip => unreachable, |
| 458 | .nsdi => {}, | ||
| 458 | .dwarf => |f| { | 459 | .dwarf => |f| { |
| 459 | module_flags.appendAssumeCapacity(try o.builder.metadataTuple(&.{ | 460 | module_flags.appendAssumeCapacity(try o.builder.metadataTuple(&.{ |
| 460 | behavior_max, | 461 | behavior_max, |
| ... | @@ -994,6 +995,13 @@ pub const Object = struct { | ... | @@ -994,6 +995,13 @@ pub const Object = struct { |
| 994 | } | 995 | } |
| 995 | 996 | ||
| 996 | try fg.wip.finish(); | 997 | try fg.wip.finish(); |
| 998 | |||
| 999 | // We don't use `builtin.test_functions` for running the SPIR-V tests so here is | ||
| 1000 | // a workaround to not optimize away test functions from the final module. | ||
| 1001 | if (target.cpu.arch.isSpirv() and zcu.test_functions.contains(func.owner_nav)) { | ||
| 1002 | try o.used.append(gpa, llvm_function.ptrConst(&o.builder).global.toConst()); | ||
| 1003 | } | ||
| 1004 | |||
| 997 | try o.flushTypePool(pt); | 1005 | try o.flushTypePool(pt); |
| 998 | } | 1006 | } |
| 999 | 1007 | ||
| ... | @@ -1002,6 +1010,7 @@ pub const Object = struct { | ... | @@ -1002,6 +1010,7 @@ pub const Object = struct { |
| 1002 | const ip = &zcu.intern_pool; | 1010 | const ip = &zcu.intern_pool; |
| 1003 | const comp = zcu.comp; | 1011 | const comp = zcu.comp; |
| 1004 | const gpa = comp.gpa; | 1012 | const gpa = comp.gpa; |
| 1013 | const arch = comp.root_mod.resolved_target.result.cpu.arch; | ||
| 1005 | 1014 | ||
| 1006 | const nav = ip.getNav(nav_id); | 1015 | const nav = ip.getNav(nav_id); |
| 1007 | const resolved = nav.resolved.?; | 1016 | const resolved = nav.resolved.?; |
| ... | @@ -1011,6 +1020,19 @@ pub const Object = struct { | ... | @@ -1011,6 +1020,19 @@ pub const Object = struct { |
| 1011 | else => null, | 1020 | else => null, |
| 1012 | }; | 1021 | }; |
| 1013 | const nav_ty: Type = .fromInterned(resolved.type); | 1022 | const nav_ty: Type = .fromInterned(resolved.type); |
| 1023 | |||
| 1024 | // Workaround for SPIR-V not supporting references to global constants. | ||
| 1025 | // Our choices here are only between bad (defaulting constant globals | ||
| 1026 | // address space to .private) and ugly (this). I went with ugly since | ||
| 1027 | // it's scoped and doesn't break anything for other targets. | ||
| 1028 | if (arch.isSpirv() and resolved.@"const" and opt_extern == null and nav_ty.zigTypeTag(zcu) != .@"fn") { | ||
| 1029 | if (o.nav_map.get(nav_id)) |llvm_global| { | ||
| 1030 | const llvm_ref = try o.lowerNavRef(nav_id); | ||
| 1031 | try llvm_global.replace(llvm_ref.unwrap().global, &o.builder); | ||
| 1032 | } | ||
| 1033 | return; | ||
| 1034 | } | ||
| 1035 | |||
| 1014 | const llvm_ty: Builder.Type = if (opt_extern != null) ty: { | 1036 | const llvm_ty: Builder.Type = if (opt_extern != null) ty: { |
| 1015 | // We *must* lower this declaration no matter what. If it has a type we can't actually | 1037 | // We *must* lower this declaration no matter what. If it has a type we can't actually |
| 1016 | // represent (because it doesn't have runtime bits), we instead lower as the zero-size | 1038 | // represent (because it doesn't have runtime bits), we instead lower as the zero-size |
| ... | @@ -1461,6 +1483,7 @@ pub const Object = struct { | ... | @@ -1461,6 +1483,7 @@ pub const Object = struct { |
| 1461 | .undefined, | 1483 | .undefined, |
| 1462 | .null, | 1484 | .null, |
| 1463 | .enum_literal, | 1485 | .enum_literal, |
| 1486 | .spirv, | ||
| 1464 | => return o.builder.debugSignedType(name, 0), | 1487 | => return o.builder.debugSignedType(name, 0), |
| 1465 | 1488 | ||
| 1466 | .float => return o.builder.debugFloatType(name, ty.floatBits(target)), | 1489 | .float => return o.builder.debugFloatType(name, ty.floatBits(target)), |
| ... | @@ -1822,7 +1845,13 @@ pub const Object = struct { | ... | @@ -1822,7 +1845,13 @@ pub const Object = struct { |
| 1822 | while (it.next()) |field_index| { | 1845 | while (it.next()) |field_index| { |
| 1823 | const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]); | 1846 | const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]); |
| 1824 | if (!field_ty.hasRuntimeBits(zcu)) continue; | 1847 | if (!field_ty.hasRuntimeBits(zcu)) continue; |
| 1825 | const field_size = field_ty.abiSize(zcu); | 1848 | const field_size = field_size: { |
| 1849 | if (field_ty.isSpirvRuntimeArray(zcu)) { | ||
| 1850 | assert(field_index == it.fields_len - 1); | ||
| 1851 | break :field_size 0; | ||
| 1852 | } | ||
| 1853 | break :field_size field_ty.abiSize(zcu); | ||
| 1854 | }; | ||
| 1826 | const field_align = switch (ty.explicitFieldAlignment(field_index, zcu)) { | 1855 | const field_align = switch (ty.explicitFieldAlignment(field_index, zcu)) { |
| 1827 | .none => field_ty.abiAlignment(zcu), | 1856 | .none => field_ty.abiAlignment(zcu), |
| 1828 | else => |a| a, | 1857 | else => |a| a, |
| ... | @@ -2097,7 +2126,6 @@ pub const Object = struct { | ... | @@ -2097,7 +2126,6 @@ pub const Object = struct { |
| 2097 | }, | 2126 | }, |
| 2098 | .frame => @panic("TODO implement lowerDebugType for Frame types"), | 2127 | .frame => @panic("TODO implement lowerDebugType for Frame types"), |
| 2099 | .@"anyframe" => @panic("TODO implement lowerDebugType for AnyFrame types"), | 2128 | .@"anyframe" => @panic("TODO implement lowerDebugType for AnyFrame types"), |
| 2100 | .spirv => unreachable, | ||
| 2101 | } | 2129 | } |
| 2102 | } | 2130 | } |
| 2103 | 2131 | ||
| ... | @@ -2855,7 +2883,8 @@ pub const Object = struct { | ... | @@ -2855,7 +2883,8 @@ pub const Object = struct { |
| 2855 | 2883 | ||
| 2856 | if (o.type_map.get(t.toIntern())) |value| return value; | 2884 | if (o.type_map.get(t.toIntern())) |value| return value; |
| 2857 | 2885 | ||
| 2858 | assert(struct_type.size > 0); | 2886 | // @SpirvType() can create opaque types which are zero-sized but cannot be ignored here. |
| 2887 | assert(struct_type.size > 0 or target.cpu.arch.isSpirv()); | ||
| 2859 | 2888 | ||
| 2860 | var llvm_field_types: std.ArrayList(Builder.Type) = .empty; | 2889 | var llvm_field_types: std.ArrayList(Builder.Type) = .empty; |
| 2861 | defer llvm_field_types.deinit(o.gpa); | 2890 | defer llvm_field_types.deinit(o.gpa); |
| ... | @@ -2890,7 +2919,11 @@ pub const Object = struct { | ... | @@ -2890,7 +2919,11 @@ pub const Object = struct { |
| 2890 | 2919 | ||
| 2891 | try llvm_field_types.append(o.gpa, try o.lowerType(field_ty, repr)); | 2920 | try llvm_field_types.append(o.gpa, try o.lowerType(field_ty, repr)); |
| 2892 | 2921 | ||
| 2893 | offset += field_ty.abiSize(zcu); | 2922 | if (field_ty.isSpirvRuntimeArray(zcu)) { |
| 2923 | assert(field_index == it.fields_len - 1); | ||
| 2924 | } else { | ||
| 2925 | offset += field_ty.abiSize(zcu); | ||
| 2926 | } | ||
| 2894 | } | 2927 | } |
| 2895 | { | 2928 | { |
| 2896 | const prev_offset = offset; | 2929 | const prev_offset = offset; |
| ... | @@ -3032,7 +3065,8 @@ pub const Object = struct { | ... | @@ -3032,7 +3065,8 @@ pub const Object = struct { |
| 3032 | ); | 3065 | ); |
| 3033 | return ty; | 3066 | return ty; |
| 3034 | }, | 3067 | }, |
| 3035 | .opaque_type, .spirv_type => unreachable, // no runtime bits | 3068 | .opaque_type => unreachable, |
| 3069 | .spirv_type => try o.lowerSpirvType(t), | ||
| 3036 | .enum_type => try o.intType(t.backingIntType(zcu).intInfo(zcu).bits, repr), | 3070 | .enum_type => try o.intType(t.backingIntType(zcu).intInfo(zcu).bits, repr), |
| 3037 | .func_type => |func_type| { | 3071 | .func_type => |func_type| { |
| 3038 | assert(t.fnHasRuntimeBits(zcu)); | 3072 | assert(t.fnHasRuntimeBits(zcu)); |
| ... | @@ -3063,6 +3097,74 @@ pub const Object = struct { | ... | @@ -3063,6 +3097,74 @@ pub const Object = struct { |
| 3063 | }; | 3097 | }; |
| 3064 | } | 3098 | } |
| 3065 | 3099 | ||
| 3100 | fn lowerSpirvType(o: *Object, t: Type) Allocator.Error!Builder.Type { | ||
| 3101 | const zcu = o.zcu; | ||
| 3102 | const ip = &zcu.intern_pool; | ||
| 3103 | const os_tag = zcu.comp.root_mod.resolved_target.result.os.tag; | ||
| 3104 | |||
| 3105 | const spirv_ty = ip.loadSpirvType(t.toIntern()); | ||
| 3106 | switch (spirv_ty.flags.tag) { | ||
| 3107 | .sampler => return o.builder.targetType(try o.builder.string("spirv.Sampler"), &.{}, &.{}), | ||
| 3108 | .image, .sampled_image => { | ||
| 3109 | const image_ty = if (spirv_ty.flags.tag == .image) spirv_ty else ip.loadSpirvType(spirv_ty.ty); | ||
| 3110 | const sampled_ty = sampled_ty: { | ||
| 3111 | if (image_ty.ty == .void_type) break :sampled_ty .void; | ||
| 3112 | break :sampled_ty try o.lowerType(.fromInterned(image_ty.ty), .in_memory); | ||
| 3113 | }; | ||
| 3114 | const image_flags = image_ty.flags; | ||
| 3115 | const ints = [_]u32{ | ||
| 3116 | switch (image_flags.dim) { | ||
| 3117 | .@"1d" => 0, | ||
| 3118 | .@"2d" => 1, | ||
| 3119 | .@"3d" => 2, | ||
| 3120 | .cube => 3, | ||
| 3121 | }, | ||
| 3122 | switch (image_flags.depth) { | ||
| 3123 | .not_depth => 0, | ||
| 3124 | .depth => 1, | ||
| 3125 | .unknown => 2, | ||
| 3126 | }, | ||
| 3127 | @intFromBool(image_flags.is_arrayed), | ||
| 3128 | @intFromBool(image_flags.is_multisampled), | ||
| 3129 | switch (image_flags.usage) { | ||
| 3130 | .unknown => 0, | ||
| 3131 | .sampled => 1, | ||
| 3132 | .storage => 2, | ||
| 3133 | }, | ||
| 3134 | switch (image_flags.format) { | ||
| 3135 | .unknown => 0, | ||
| 3136 | .rgba32f => 1, | ||
| 3137 | .rgba16f => 2, | ||
| 3138 | .r32f => 3, | ||
| 3139 | .rgba8unorm => 4, | ||
| 3140 | .rgba8snorm => 5, | ||
| 3141 | .rgba32i => 21, | ||
| 3142 | .rgba16i => 22, | ||
| 3143 | .rgba8i => 23, | ||
| 3144 | .r32i => 24, | ||
| 3145 | .rgba32u => 30, | ||
| 3146 | .rgba16u => 31, | ||
| 3147 | .rgba8u => 32, | ||
| 3148 | .r32u => 33, | ||
| 3149 | }, | ||
| 3150 | switch (image_flags.access) { | ||
| 3151 | .unknown => 0, | ||
| 3152 | .read_only => 0, | ||
| 3153 | .write_only => 1, | ||
| 3154 | .read_write => 2, | ||
| 3155 | }, | ||
| 3156 | }; | ||
| 3157 | const name = if (spirv_ty.flags.tag == .image) "spirv.Image" else "spirv.SampledImage"; | ||
| 3158 | const ints_len: usize = if (os_tag == .opencl) 7 else 6; | ||
| 3159 | return o.builder.targetType(try o.builder.string(name), &.{sampled_ty}, ints[0..ints_len]); | ||
| 3160 | }, | ||
| 3161 | .runtime_array => { | ||
| 3162 | const elem_ty = try o.lowerType(.fromInterned(spirv_ty.ty), .in_memory); | ||
| 3163 | return o.builder.arrayType(0, elem_ty); | ||
| 3164 | }, | ||
| 3165 | } | ||
| 3166 | } | ||
| 3167 | |||
| 3066 | pub const FuncInfo = struct { | 3168 | pub const FuncInfo = struct { |
| 3067 | cc: std.lang.CallingConvention, | 3169 | cc: std.lang.CallingConvention, |
| 3068 | noalias_bits: u32 = 0, | 3170 | noalias_bits: u32 = 0, |
| ... | @@ -3890,6 +3992,7 @@ pub const Object = struct { | ... | @@ -3890,6 +3992,7 @@ pub const Object = struct { |
| 3890 | const zcu = o.zcu; | 3992 | const zcu = o.zcu; |
| 3891 | const ip = &zcu.intern_pool; | 3993 | const ip = &zcu.intern_pool; |
| 3892 | const gpa = zcu.comp.gpa; | 3994 | const gpa = zcu.comp.gpa; |
| 3995 | const target = &zcu.comp.root_mod.resolved_target.result; | ||
| 3893 | 3996 | ||
| 3894 | const nav = ip.getNav(nav_id); | 3997 | const nav = ip.getNav(nav_id); |
| 3895 | const nav_ty: Type = .fromInterned(nav.resolved.?.type); | 3998 | const nav_ty: Type = .fromInterned(nav.resolved.?.type); |
| ... | @@ -3901,6 +4004,17 @@ pub const Object = struct { | ... | @@ -3901,6 +4004,17 @@ pub const Object = struct { |
| 3901 | return o.lowerPtrToVoid(nav_align.toLlvm(), nav.resolved.?.@"addrspace"); | 4004 | return o.lowerPtrToVoid(nav_align.toLlvm(), nav.resolved.?.@"addrspace"); |
| 3902 | } | 4005 | } |
| 3903 | 4006 | ||
| 4007 | // Workaround for SPIR-V not supporting references to global constants. | ||
| 4008 | if (target.cpu.arch.isSpirv() and nav.resolved.?.@"const" and nav.getExtern(ip) == null and | ||
| 4009 | nav_ty.zigTypeTag(zcu) != .@"fn" and nav.resolved.?.value != .none) | ||
| 4010 | { | ||
| 4011 | const nav_align = switch (nav.resolved.?.@"align") { | ||
| 4012 | .none => nav_ty.abiAlignment(zcu), | ||
| 4013 | else => |a| a, | ||
| 4014 | }; | ||
| 4015 | return o.lowerUavRef(nav.resolved.?.value, nav_align.toLlvm(), nav.resolved.?.@"addrspace"); | ||
| 4016 | } | ||
| 4017 | |||
| 3904 | const gop = try o.nav_map.getOrPut(gpa, nav_id); | 4018 | const gop = try o.nav_map.getOrPut(gpa, nav_id); |
| 3905 | if (!gop.found_existing) { | 4019 | if (!gop.found_existing) { |
| 3906 | errdefer assert(o.nav_map.remove(nav_id)); | 4020 | errdefer assert(o.nav_map.remove(nav_id)); |
| ... | @@ -3917,7 +4031,7 @@ pub const Object = struct { | ... | @@ -3917,7 +4031,7 @@ pub const Object = struct { |
| 3917 | // We need to make sure the global's address space is up to date, because that affects the | 4031 | // We need to make sure the global's address space is up to date, because that affects the |
| 3918 | // type of a pointer to this global. But everything else about the global will be populated | 4032 | // type of a pointer to this global. But everything else about the global will be populated |
| 3919 | // by `updateNav` or `updateFunc`. | 4033 | // by `updateNav` or `updateFunc`. |
| 3920 | llvm_global.ptr(&o.builder).addr_space = toLlvmAddressSpace(nav.resolved.?.@"addrspace", zcu.getTarget()); | 4034 | llvm_global.ptr(&o.builder).addr_space = toLlvmAddressSpace(nav.resolved.?.@"addrspace", target); |
| 3921 | return llvm_global.toConst(); | 4035 | return llvm_global.toConst(); |
| 3922 | } | 4036 | } |
| 3923 | 4037 | ||
| ... | @@ -4445,6 +4559,19 @@ pub fn toLlvmAddressSpace(address_space: std.lang.AddressSpace, target: *const s | ... | @@ -4445,6 +4559,19 @@ pub fn toLlvmAddressSpace(address_space: std.lang.AddressSpace, target: *const s |
| 4445 | .local => Builder.AddrSpace.nvptx.local, | 4559 | .local => Builder.AddrSpace.nvptx.local, |
| 4446 | else => unreachable, | 4560 | else => unreachable, |
| 4447 | }, | 4561 | }, |
| 4562 | .spirv32, .spirv64 => switch (address_space) { | ||
| 4563 | .generic, .local => Builder.AddrSpace.spirv.function, | ||
| 4564 | .global => Builder.AddrSpace.spirv.cross_workgroup, | ||
| 4565 | .constant => Builder.AddrSpace.spirv.uniform_constant, | ||
| 4566 | .shared => Builder.AddrSpace.spirv.workgroup, | ||
| 4567 | .private => Builder.AddrSpace.spirv.private, | ||
| 4568 | .input => Builder.AddrSpace.spirv.input, | ||
| 4569 | .output => Builder.AddrSpace.spirv.output, | ||
| 4570 | .storage_buffer => Builder.AddrSpace.spirv.storage_buffer, | ||
| 4571 | .uniform => Builder.AddrSpace.spirv.uniform, | ||
| 4572 | .push_constant => Builder.AddrSpace.spirv.push_constant, | ||
| 4573 | else => unreachable, | ||
| 4574 | }, | ||
| 4448 | .x86, .x86_64 => switch (address_space) { | 4575 | .x86, .x86_64 => switch (address_space) { |
| 4449 | .generic => .default, | 4576 | .generic => .default, |
| 4450 | .gs => Builder.AddrSpace.x86.gs, | 4577 | .gs => Builder.AddrSpace.x86.gs, |
src/codegen/llvm/FuncGen.zig+4| ... | @@ -1780,6 +1780,10 @@ fn airSwitchBr(self: *FuncGen, inst: Air.Inst.Index, is_dispatch_loop: bool) Tod | ... | @@ -1780,6 +1780,10 @@ fn airSwitchBr(self: *FuncGen, inst: Air.Inst.Index, is_dispatch_loop: bool) Tod |
| 1780 | // * https://github.com/llvm/llvm-project/blob/56905dab7da50bccfcceaeb496b206ff476127e1/llvm/test/MC/WebAssembly/blockaddress.ll | 1780 | // * https://github.com/llvm/llvm-project/blob/56905dab7da50bccfcceaeb496b206ff476127e1/llvm/test/MC/WebAssembly/blockaddress.ll |
| 1781 | if (zcu.comp.getTarget().cpu.arch.isWasm()) break :jmp_table null; | 1781 | if (zcu.comp.getTarget().cpu.arch.isWasm()) break :jmp_table null; |
| 1782 | 1782 | ||
| 1783 | // Workaround for: | ||
| 1784 | // * https://github.com/llvm/llvm-project/blob/0cd28174a1f64e5a8df194422ebf46e88cff33ad/llvm/lib/Target/SPIRV/SPIRVStructurizer.cpp#L279 | ||
| 1785 | if (zcu.comp.getTarget().cpu.arch.isSpirv()) break :jmp_table null; | ||
| 1786 | |||
| 1783 | // On a 64-bit target, 1024 pointers in our jump table is about 8K of pointers. This seems just | 1787 | // On a 64-bit target, 1024 pointers in our jump table is about 8K of pointers. This seems just |
| 1784 | // about acceptable - it won't fill L1d cache on most CPUs. | 1788 | // about acceptable - it won't fill L1d cache on most CPUs. |
| 1785 | const max_table_len = 1024; | 1789 | const max_table_len = 1024; |
src/codegen/spirv/Assembler.zig+9-13| ... | @@ -784,21 +784,17 @@ fn parseNumber(ass: *Assembler) !void { | ... | @@ -784,21 +784,17 @@ fn parseNumber(ass: *Assembler) !void { |
| 784 | const result = try ass.resolveRef(ass.inst.operands.items[0].ref_id); | 784 | const result = try ass.resolveRef(ass.inst.operands.items[0].ref_id); |
| 785 | const result_id = result.resultId(); | 785 | const result_id = result.resultId(); |
| 786 | 786 | ||
| 787 | const words = cg.module.instructions.items; | 787 | var it = cg.module.iterate(); |
| 788 | var offset: usize = 0; | 788 | while (it.next()) |instruction| { |
| 789 | while (offset < words.len) { | 789 | const words = instruction.words; |
| 790 | const header: spec.InstructionHeader = @bitCast(words[offset]); | 790 | switch (instruction.opcode) { |
| 791 | const word_count = header.word_count; | 791 | .OpTypeInt => if (words.len >= 4 and @as(Id, @fromBackingInt(@intCast(words[1]))) == result_id) { |
| 792 | defer offset += word_count; | 792 | const width: u16 = @intCast(words[2]); |
| 793 | if (word_count == 0) break; | 793 | const signedness: std.lang.Signedness = if (words[3] == 0) .unsigned else .signed; |
| 794 | switch (header.opcode) { | ||
| 795 | .OpTypeInt => if (word_count >= 4 and @as(Id, @fromBackingInt(@intCast(words[offset + 1]))) == result_id) { | ||
| 796 | const width: u16 = @intCast(words[offset + 2]); | ||
| 797 | const signedness: std.lang.Signedness = if (words[offset + 3] == 0) .unsigned else .signed; | ||
| 798 | return ass.parseContextDependentInt(signedness, width); | 794 | return ass.parseContextDependentInt(signedness, width); |
| 799 | }, | 795 | }, |
| 800 | .OpTypeFloat => if (word_count >= 3 and @as(Id, @fromBackingInt(@intCast(words[offset + 1]))) == result_id) { | 796 | .OpTypeFloat => if (words.len >= 3 and @as(Id, @fromBackingInt(@intCast(words[1]))) == result_id) { |
| 801 | const bits = words[offset + 2]; | 797 | const bits = words[2]; |
| 802 | return switch (bits) { | 798 | return switch (bits) { |
| 803 | 16 => ass.parseContextDependentFloat(16), | 799 | 16 => ass.parseContextDependentFloat(16), |
| 804 | 32 => ass.parseContextDependentFloat(32), | 800 | 32 => ass.parseContextDependentFloat(32), |
src/codegen/spirv/CodeGen.zig+83-255| ... | @@ -13,7 +13,6 @@ next_result_id: Word = 1, | ... | @@ -13,7 +13,6 @@ next_result_id: Word = 1, |
| 13 | navs: std.array_hash_map.Auto(InternPool.Nav.Index, Id) = .empty, | 13 | navs: std.array_hash_map.Auto(InternPool.Nav.Index, Id) = .empty, |
| 14 | externs: std.array_hash_map.Auto(InternPool.Nav.Index, Mir.Extern) = .empty, | 14 | externs: std.array_hash_map.Auto(InternPool.Nav.Index, Mir.Extern) = .empty, |
| 15 | entry_points: std.ArrayList(Mir.EntryPoint) = .empty, | 15 | entry_points: std.ArrayList(Mir.EntryPoint) = .empty, |
| 16 | error_buffer: ?Id = null, | ||
| 17 | struct_types: std.array_hash_map.Custom(StructType, Id, StructType.HashContext, true) = .empty, | 16 | struct_types: std.array_hash_map.Custom(StructType, Id, StructType.HashContext, true) = .empty, |
| 18 | /// SPIR-V ids of OpVariables whose pointee is a Block struct | 17 | /// SPIR-V ids of OpVariables whose pointee is a Block struct |
| 19 | block_var_ids: std.AutoHashMapUnmanaged(Id, void) = .empty, | 18 | block_var_ids: std.AutoHashMapUnmanaged(Id, void) = .empty, |
| ... | @@ -202,9 +201,7 @@ pub fn generate( | ... | @@ -202,9 +201,7 @@ pub fn generate( |
| 202 | defer cg.deinit(); | 201 | defer cg.deinit(); |
| 203 | 202 | ||
| 204 | const return_ty_id = try cg.resolveFnReturnType(.fromInterned(fn_info.return_type)); | 203 | const return_ty_id = try cg.resolveFnReturnType(.fromInterned(fn_info.return_type)); |
| 205 | const is_test = zcu.test_functions.contains(nav_index); | ||
| 206 | const nav_id = try cg.resolveNav(nav_index); | 204 | const nav_id = try cg.resolveNav(nav_index); |
| 207 | const function_id = if (is_test) cg.allocId() else nav_id; | ||
| 208 | 205 | ||
| 209 | try cg.args.ensureUnusedCapacity(gpa, fn_info.param_types.len); | 206 | try cg.args.ensureUnusedCapacity(gpa, fn_info.param_types.len); |
| 210 | for (fn_info.param_types.get(ip)) |param_ty_index| { | 207 | for (fn_info.param_types.get(ip)) |param_ty_index| { |
| ... | @@ -224,7 +221,7 @@ pub fn generate( | ... | @@ -224,7 +221,7 @@ pub fn generate( |
| 224 | const fn_ty_id = try cg.functionType(return_ty_id, cg.args.items(.ty)); | 221 | const fn_ty_id = try cg.functionType(return_ty_id, cg.args.items(.ty)); |
| 225 | try cg.module.emit(gpa, .OpFunction, .{ | 222 | try cg.module.emit(gpa, .OpFunction, .{ |
| 226 | .id_result_type = return_ty_id, | 223 | .id_result_type = return_ty_id, |
| 227 | .id_result = function_id, | 224 | .id_result = nav_id, |
| 228 | .function_control = .{}, | 225 | .function_control = .{}, |
| 229 | .function_type = fn_ty_id, | 226 | .function_type = fn_ty_id, |
| 230 | }); | 227 | }); |
| ... | @@ -236,8 +233,7 @@ pub fn generate( | ... | @@ -236,8 +233,7 @@ pub fn generate( |
| 236 | } | 233 | } |
| 237 | try cg.module.append(gpa, cg.prologue); | 234 | try cg.module.append(gpa, cg.prologue); |
| 238 | try cg.module.append(gpa, cg.body); | 235 | try cg.module.append(gpa, cg.body); |
| 239 | if (is_test) try cg.generateTestEntryPoint(nav.fqn.toSlice(ip), nav_id, function_id); | 236 | try cg.debugName(nav_id, nav.fqn.toSlice(ip)); |
| 240 | try cg.debugName(function_id, nav.fqn.toSlice(ip)); | ||
| 241 | 237 | ||
| 242 | return cg.toOwnedMir(); | 238 | return cg.toOwnedMir(); |
| 243 | } | 239 | } |
| ... | @@ -816,21 +812,20 @@ pub fn memberDebugName(cg: *CodeGen, target: Id, member: u32, name: []const u8) | ... | @@ -816,21 +812,20 @@ pub fn memberDebugName(cg: *CodeGen, target: Id, member: u32, name: []const u8) |
| 816 | pub fn storageClass(cg: *const CodeGen, as: std.lang.AddressSpace) spec.StorageClass { | 812 | pub fn storageClass(cg: *const CodeGen, as: std.lang.AddressSpace) spec.StorageClass { |
| 817 | const target = cg.zcu.getTarget(); | 813 | const target = cg.zcu.getTarget(); |
| 818 | return switch (as) { | 814 | return switch (as) { |
| 819 | .generic => .function, | ||
| 820 | .global => switch (target.os.tag) { | 815 | .global => switch (target.os.tag) { |
| 821 | .opencl, .amdhsa => .cross_workgroup, | 816 | .opencl, .amdhsa => .cross_workgroup, |
| 822 | else => .storage_buffer, | 817 | else => unreachable, |
| 823 | }, | 818 | }, |
| 819 | .local, .generic => .function, | ||
| 824 | .push_constant => .push_constant, | 820 | .push_constant => .push_constant, |
| 825 | .output => .output, | ||
| 826 | .uniform => .uniform, | 821 | .uniform => .uniform, |
| 827 | .storage_buffer => .storage_buffer, | 822 | .storage_buffer => .storage_buffer, |
| 828 | .physical_storage_buffer => .physical_storage_buffer, | 823 | .physical_storage_buffer => .physical_storage_buffer, |
| 829 | .constant => .uniform_constant, | 824 | .constant => .uniform_constant, |
| 830 | .shared => .workgroup, | 825 | .shared => .workgroup, |
| 831 | .local => .function, | ||
| 832 | .private => .private, | 826 | .private => .private, |
| 833 | .input => .input, | 827 | .input => .input, |
| 828 | .output => .output, | ||
| 834 | .gs, | 829 | .gs, |
| 835 | .fs, | 830 | .fs, |
| 836 | .ss, | 831 | .ss, |
| ... | @@ -1689,14 +1684,14 @@ fn constantPtr(cg: *CodeGen, ptr_val: Value) !Id { | ... | @@ -1689,14 +1684,14 @@ fn constantPtr(cg: *CodeGen, ptr_val: Value) !Id { |
| 1689 | /// This function emits instructions on every call, and they stay in the module whether or not they | 1684 | /// This function emits instructions on every call, and they stay in the module whether or not they |
| 1690 | /// are read, so it should only be called where the resulting type is used: a buffer struct emitted | 1685 | /// are read, so it should only be called where the resulting type is used: a buffer struct emitted |
| 1691 | /// without `Block` fails validation even when nothing refers to it. | 1686 | /// without `Block` fails validation even when nothing refers to it. |
| 1692 | fn derivedPtrType(cg: *CodeGen, @"addrspace": std.lang.AddressSpace, derivation: Value.PointerDerivation) !Id { | 1687 | fn derivedPtrType(cg: *CodeGen, as: std.lang.AddressSpace, derivation: Value.PointerDerivation) !Id { |
| 1693 | return cg.ptrType( | 1688 | return cg.ptrType( |
| 1694 | try cg.pointeeType(@"addrspace", derivation.elem_ty, false), | 1689 | try cg.pointeeType(as, derivation.elem_ty, false), |
| 1695 | cg.storageClass(@"addrspace"), | 1690 | cg.storageClass(as), |
| 1696 | ); | 1691 | ); |
| 1697 | } | 1692 | } |
| 1698 | 1693 | ||
| 1699 | fn derivePtr(cg: *CodeGen, @"addrspace": std.lang.AddressSpace, derivation: Value.PointerDerivation) !Id { | 1694 | fn derivePtr(cg: *CodeGen, as: std.lang.AddressSpace, derivation: Value.PointerDerivation) !Id { |
| 1700 | const gpa = cg.gpa; | 1695 | const gpa = cg.gpa; |
| 1701 | const zcu = cg.zcu; | 1696 | const zcu = cg.zcu; |
| 1702 | const target = zcu.getTarget(); | 1697 | const target = zcu.getTarget(); |
| ... | @@ -1704,18 +1699,16 @@ fn derivePtr(cg: *CodeGen, @"addrspace": std.lang.AddressSpace, derivation: Valu | ... | @@ -1704,18 +1699,16 @@ fn derivePtr(cg: *CodeGen, @"addrspace": std.lang.AddressSpace, derivation: Valu |
| 1704 | switch (derivation.addr) { | 1699 | switch (derivation.addr) { |
| 1705 | .comptime_alloc, .comptime_field => unreachable, | 1700 | .comptime_alloc, .comptime_field => unreachable, |
| 1706 | .int => |int| { | 1701 | .int => |int| { |
| 1707 | if (target.os.tag != .opencl) { | 1702 | if (target_util.addrSpaceIsLogical(target, as)) { |
| 1708 | if (@"addrspace" != .physical_storage_buffer) { | 1703 | return cg.fail( |
| 1709 | return cg.fail( | 1704 | "cannot cast integer to pointer with address space '{s}'", |
| 1710 | "cannot cast integer to pointer with address space '{s}'", | 1705 | .{@tagName(as)}, |
| 1711 | .{@tagName(@"addrspace")}, | 1706 | ); |
| 1712 | ); | ||
| 1713 | } | ||
| 1714 | } | 1707 | } |
| 1715 | // TODO: This can probably be an OpSpecConstantOp Bitcast, but | 1708 | // TODO: This can probably be an OpSpecConstantOp Bitcast, but |
| 1716 | // that is not implemented by Mesa yet. Therefore, just generate it | 1709 | // that is not implemented by Mesa yet. Therefore, just generate it |
| 1717 | // as a runtime operation. | 1710 | // as a runtime operation. |
| 1718 | const result_ty_id = try cg.derivedPtrType(@"addrspace", derivation); | 1711 | const result_ty_id = try cg.derivedPtrType(as, derivation); |
| 1719 | const result_ptr_id = cg.allocId(); | 1712 | const result_ptr_id = cg.allocId(); |
| 1720 | const value_id = try cg.constInt(.usize, int); | 1713 | const value_id = try cg.constInt(.usize, int); |
| 1721 | try cg.body.emit(gpa, .OpConvertUToPtr, .{ | 1714 | try cg.body.emit(gpa, .OpConvertUToPtr, .{ |
| ... | @@ -1735,30 +1728,26 @@ fn derivePtr(cg: *CodeGen, @"addrspace": std.lang.AddressSpace, derivation: Valu | ... | @@ -1735,30 +1728,26 @@ fn derivePtr(cg: *CodeGen, @"addrspace": std.lang.AddressSpace, derivation: Valu |
| 1735 | 1728 | ||
| 1736 | if (ip.isFunctionType(nav_ty.toIntern())) { | 1729 | if (ip.isFunctionType(nav_ty.toIntern())) { |
| 1737 | if (is_extern) return try cg.resolveExternFn(nav_index); | 1730 | if (is_extern) return try cg.resolveExternFn(nav_index); |
| 1738 | return try cg.constUndef(try cg.derivedPtrType(@"addrspace", derivation)); | 1731 | return try cg.constUndef(try cg.derivedPtrType(as, derivation)); |
| 1739 | } | 1732 | } |
| 1740 | if (!nav_ty.hasRuntimeBits(zcu) and nav_ty.zigTypeTag(zcu) != .spirv) { | 1733 | if (!nav_ty.hasRuntimeBits(zcu) and nav_ty.zigTypeTag(zcu) != .spirv) { |
| 1741 | return cg.constUndef(try cg.derivedPtrType(@"addrspace", derivation)); | 1734 | return cg.constUndef(try cg.derivedPtrType(as, derivation)); |
| 1742 | } | 1735 | } |
| 1743 | if (!is_extern) { | 1736 | if (!is_extern) { |
| 1744 | return cg.todo("pointer to constant '{f}'", .{nav.fqn.fmt(ip)}); | 1737 | return cg.todo("pointer to constant '{f}'", .{nav.fqn.fmt(ip)}); |
| 1745 | } | 1738 | } |
| 1746 | 1739 | ||
| 1747 | const as = nav.resolved.?.@"addrspace"; | 1740 | assert(nav.resolved.?.@"addrspace" != .generic); |
| 1748 | assert(as != .generic); | ||
| 1749 | 1741 | ||
| 1750 | const var_id = try cg.resolveNav(nav_index); | 1742 | const var_id = try cg.resolveNav(nav_index); |
| 1751 | if (cg.needsLayout(as, nav_ty)) { | 1743 | if (cg.needsLayout(as, nav_ty)) { |
| 1752 | try cg.block_var_ids.put(gpa, var_id, {}); | 1744 | try cg.block_var_ids.put(gpa, var_id, {}); |
| 1753 | } | 1745 | } |
| 1754 | switch (target.os.tag) { | 1746 | if (target_util.addrSpaceIsLogical(target, as)) return var_id; |
| 1755 | .vulkan, .opengl => return var_id, | ||
| 1756 | else => {}, | ||
| 1757 | } | ||
| 1758 | 1747 | ||
| 1759 | const nav_ty_id = try cg.resolveType(nav_ty, .indirect); | 1748 | const nav_ty_id = try cg.resolveType(nav_ty, .indirect); |
| 1760 | const decl_ptr_ty_id = try cg.ptrType(nav_ty_id, cg.storageClass(as)); | 1749 | const decl_ptr_ty_id = try cg.ptrType(nav_ty_id, cg.storageClass(as)); |
| 1761 | const result_ty_id = try cg.derivedPtrType(@"addrspace", derivation); | 1750 | const result_ty_id = try cg.derivedPtrType(as, derivation); |
| 1762 | if (decl_ptr_ty_id == result_ty_id) return var_id; | 1751 | if (decl_ptr_ty_id == result_ty_id) return var_id; |
| 1763 | 1752 | ||
| 1764 | const casted_ptr_id = cg.allocId(); | 1753 | const casted_ptr_id = cg.allocId(); |
| ... | @@ -1780,10 +1769,10 @@ fn derivePtr(cg: *CodeGen, @"addrspace": std.lang.AddressSpace, derivation: Valu | ... | @@ -1780,10 +1769,10 @@ fn derivePtr(cg: *CodeGen, @"addrspace": std.lang.AddressSpace, derivation: Valu |
| 1780 | } | 1769 | } |
| 1781 | 1770 | ||
| 1782 | if (!uav_ty.hasRuntimeBits(zcu) and uav_ty.zigTypeTag(zcu) != .spirv) { | 1771 | if (!uav_ty.hasRuntimeBits(zcu) and uav_ty.zigTypeTag(zcu) != .spirv) { |
| 1783 | return cg.constUndef(try cg.derivedPtrType(@"addrspace", derivation)); | 1772 | return cg.constUndef(try cg.derivedPtrType(as, derivation)); |
| 1784 | } | 1773 | } |
| 1785 | 1774 | ||
| 1786 | if (cg.storageClass(@"addrspace") != .function) { | 1775 | if (cg.storageClass(as) != .function) { |
| 1787 | return cg.todo("pointer to an anonymous constant of type '{f}'", .{uav_ty.fmt(zcu)}); | 1776 | return cg.todo("pointer to an anonymous constant of type '{f}'", .{uav_ty.fmt(zcu)}); |
| 1788 | } | 1777 | } |
| 1789 | 1778 | ||
| ... | @@ -1796,11 +1785,11 @@ fn derivePtr(cg: *CodeGen, @"addrspace": std.lang.AddressSpace, derivation: Valu | ... | @@ -1796,11 +1785,11 @@ fn derivePtr(cg: *CodeGen, @"addrspace": std.lang.AddressSpace, derivation: Valu |
| 1796 | .eu_payload => @panic("TODO"), | 1785 | .eu_payload => @panic("TODO"), |
| 1797 | .opt_payload => @panic("TODO"), | 1786 | .opt_payload => @panic("TODO"), |
| 1798 | .field => |derived| return cg.structFieldPtr( | 1787 | .field => |derived| return cg.structFieldPtr( |
| 1799 | @"addrspace", | 1788 | as, |
| 1800 | try cg.derivedPtrType(@"addrspace", derivation), | 1789 | try cg.derivedPtrType(as, derivation), |
| 1801 | derivation.elem_ty, | 1790 | derivation.elem_ty, |
| 1802 | derived.parent.elem_ty, | 1791 | derived.parent.elem_ty, |
| 1803 | try cg.derivePtr(@"addrspace", derived.parent.*), | 1792 | try cg.derivePtr(as, derived.parent.*), |
| 1804 | derived.field_index, | 1793 | derived.field_index, |
| 1805 | ), | 1794 | ), |
| 1806 | .elem => |derived| return cg.ptrElemPtr( | 1795 | .elem => |derived| return cg.ptrElemPtr( |
| ... | @@ -1808,13 +1797,13 @@ fn derivePtr(cg: *CodeGen, @"addrspace": std.lang.AddressSpace, derivation: Valu | ... | @@ -1808,13 +1797,13 @@ fn derivePtr(cg: *CodeGen, @"addrspace": std.lang.AddressSpace, derivation: Valu |
| 1808 | .one => .single_array_ptr, | 1797 | .one => .single_array_ptr, |
| 1809 | .many => .many_ptr, | 1798 | .many => .many_ptr, |
| 1810 | }, | 1799 | }, |
| 1811 | @"addrspace", | 1800 | as, |
| 1812 | derivation.elem_ty, | 1801 | derivation.elem_ty, |
| 1813 | try cg.derivePtr(@"addrspace", derived.parent.*), | 1802 | try cg.derivePtr(as, derived.parent.*), |
| 1814 | try cg.constInt(.usize, derived.elem_index), | 1803 | try cg.constInt(.usize, derived.elem_index), |
| 1815 | ), | 1804 | ), |
| 1816 | .offset_and_cast => |derived| { | 1805 | .offset_and_cast => |derived| { |
| 1817 | const parent_ptr_id = try cg.derivePtr(@"addrspace", derived.parent.*); | 1806 | const parent_ptr_id = try cg.derivePtr(as, derived.parent.*); |
| 1818 | 1807 | ||
| 1819 | if (derived.byte_offset == 0) { | 1808 | if (derived.byte_offset == 0) { |
| 1820 | var depth: u32 = 0; | 1809 | var depth: u32 = 0; |
| ... | @@ -1849,13 +1838,13 @@ fn derivePtr(cg: *CodeGen, @"addrspace": std.lang.AddressSpace, derivation: Valu | ... | @@ -1849,13 +1838,13 @@ fn derivePtr(cg: *CodeGen, @"addrspace": std.lang.AddressSpace, derivation: Valu |
| 1849 | const zero = try cg.constInt(.u32, 0); | 1838 | const zero = try cg.constInt(.u32, 0); |
| 1850 | const ids = try cg.id_scratch.addManyAsSlice(gpa, depth); | 1839 | const ids = try cg.id_scratch.addManyAsSlice(gpa, depth); |
| 1851 | @memset(ids, zero); | 1840 | @memset(ids, zero); |
| 1852 | return cg.accessChainId(try cg.derivedPtrType(@"addrspace", derivation), parent_ptr_id, ids); | 1841 | return cg.accessChainId(try cg.derivedPtrType(as, derivation), parent_ptr_id, ids); |
| 1853 | } else { | 1842 | } else { |
| 1854 | return parent_ptr_id; | 1843 | return parent_ptr_id; |
| 1855 | } | 1844 | } |
| 1856 | } | 1845 | } |
| 1857 | if (target.os.tag == .opencl) { | 1846 | if (!target_util.addrSpaceIsLogical(target, as)) { |
| 1858 | const result_ty_id = try cg.derivedPtrType(@"addrspace", derivation); | 1847 | const result_ty_id = try cg.derivedPtrType(as, derivation); |
| 1859 | const result_ptr_id = cg.allocId(); | 1848 | const result_ptr_id = cg.allocId(); |
| 1860 | try cg.body.emit(gpa, .OpBitcast, .{ | 1849 | try cg.body.emit(gpa, .OpBitcast, .{ |
| 1861 | .id_result_type = result_ty_id, | 1850 | .id_result_type = result_ty_id, |
| ... | @@ -3788,149 +3777,6 @@ fn buildWideMul( | ... | @@ -3788,149 +3777,6 @@ fn buildWideMul( |
| 3788 | } | 3777 | } |
| 3789 | 3778 | ||
| 3790 | /// The SPIR-V backend is not yet advanced enough to support the std testing infrastructure. | 3779 | /// The SPIR-V backend is not yet advanced enough to support the std testing infrastructure. |
| 3791 | /// In order to be able to run tests, we "temporarily" lower test kernels into separate entry- | ||
| 3792 | /// points. The test executor will then be able to invoke these to run the tests. | ||
| 3793 | /// Note that tests are lowered according to std.lang.TestFn, which is `fn () anyerror!void`. | ||
| 3794 | /// (anyerror!void has the same layout as anyerror). | ||
| 3795 | /// Each test declaration generates a function like. | ||
| 3796 | /// %anyerror = OpTypeInt 0 16 | ||
| 3797 | /// %p_invocation_globals_struct_ty = ... | ||
| 3798 | /// %p_anyerror = OpTypePointer CrossWorkgroup %anyerror | ||
| 3799 | /// %K = OpTypeFunction %void %p_invocation_globals_struct_ty %p_anyerror | ||
| 3800 | /// | ||
| 3801 | /// %test = OpFunction %void %K | ||
| 3802 | /// %p_invocation_globals = OpFunctionParameter p_invocation_globals_struct_ty | ||
| 3803 | /// %p_err = OpFunctionParameter %p_anyerror | ||
| 3804 | /// %lbl = OpLabel | ||
| 3805 | /// %result = OpFunctionCall %anyerror %func %p_invocation_globals | ||
| 3806 | /// OpStore %p_err %result | ||
| 3807 | /// OpFunctionEnd | ||
| 3808 | /// TODO is to also write out the error as a function call parameter, and to somehow fetch | ||
| 3809 | /// the name of an error in the text executor. | ||
| 3810 | fn generateTestEntryPoint( | ||
| 3811 | cg: *CodeGen, | ||
| 3812 | name: []const u8, | ||
| 3813 | kernel_id: Id, | ||
| 3814 | test_id: Id, | ||
| 3815 | ) !void { | ||
| 3816 | const gpa = cg.gpa; | ||
| 3817 | const zcu = cg.zcu; | ||
| 3818 | const target = cg.zcu.getTarget(); | ||
| 3819 | |||
| 3820 | const anyerror_ty_id = try cg.resolveType(.anyerror, .direct); | ||
| 3821 | const ptr_anyerror_ty = try cg.pt.ptrType(.{ | ||
| 3822 | .child = .anyerror_type, | ||
| 3823 | .flags = .{ .address_space = .global }, | ||
| 3824 | }); | ||
| 3825 | const ptr_anyerror_ty_id = try cg.resolveType(ptr_anyerror_ty, .direct); | ||
| 3826 | |||
| 3827 | var section: Section = .empty; | ||
| 3828 | defer section.deinit(gpa); | ||
| 3829 | |||
| 3830 | const p_error_id = cg.allocId(); | ||
| 3831 | switch (target.os.tag) { | ||
| 3832 | .opencl, .amdhsa => { | ||
| 3833 | const void_ty_id = try cg.resolveType(.void, .direct); | ||
| 3834 | const kernel_proto_ty_id = try cg.functionType(void_ty_id, &.{ptr_anyerror_ty_id}); | ||
| 3835 | |||
| 3836 | try section.emit(gpa, .OpFunction, .{ | ||
| 3837 | .id_result_type = try cg.resolveType(.void, .direct), | ||
| 3838 | .id_result = kernel_id, | ||
| 3839 | .function_control = .{}, | ||
| 3840 | .function_type = kernel_proto_ty_id, | ||
| 3841 | }); | ||
| 3842 | |||
| 3843 | try section.emit(gpa, .OpFunctionParameter, .{ | ||
| 3844 | .id_result_type = ptr_anyerror_ty_id, | ||
| 3845 | .id_result = p_error_id, | ||
| 3846 | }); | ||
| 3847 | |||
| 3848 | try section.emit(gpa, .OpLabel, .{ | ||
| 3849 | .id_result = cg.allocId(), | ||
| 3850 | }); | ||
| 3851 | }, | ||
| 3852 | .vulkan, .opengl => { | ||
| 3853 | if (cg.error_buffer == null) { | ||
| 3854 | const buffer_struct_ty_id = cg.allocId(); | ||
| 3855 | try cg.module.emit(gpa, .OpTypeStruct, .{ | ||
| 3856 | .id_result = buffer_struct_ty_id, | ||
| 3857 | .id_ref = &.{anyerror_ty_id}, | ||
| 3858 | }); | ||
| 3859 | try cg.memberDebugName(buffer_struct_ty_id, 0, "error_out"); | ||
| 3860 | try cg.decorate(buffer_struct_ty_id, .block); | ||
| 3861 | try cg.decorateMember(buffer_struct_ty_id, 0, .{ .offset = .{ .byte_offset = 0 } }); | ||
| 3862 | |||
| 3863 | const ptr_buffer_struct_ty_id = cg.allocId(); | ||
| 3864 | try cg.module.emit(gpa, .OpTypePointer, .{ | ||
| 3865 | .id_result = ptr_buffer_struct_ty_id, | ||
| 3866 | .storage_class = cg.storageClass(.global), | ||
| 3867 | .type = buffer_struct_ty_id, | ||
| 3868 | }); | ||
| 3869 | |||
| 3870 | const error_buffer_id = cg.allocId(); | ||
| 3871 | cg.error_buffer = error_buffer_id; | ||
| 3872 | try cg.module.emit(gpa, .OpVariable, .{ | ||
| 3873 | .id_result_type = ptr_buffer_struct_ty_id, | ||
| 3874 | .id_result = error_buffer_id, | ||
| 3875 | .storage_class = cg.storageClass(.global), | ||
| 3876 | }); | ||
| 3877 | try cg.decorate(error_buffer_id, .{ .descriptor_set = .{ .descriptor_set = 0 } }); | ||
| 3878 | try cg.decorate(error_buffer_id, .{ .binding = .{ .binding_point = 0 } }); | ||
| 3879 | } | ||
| 3880 | |||
| 3881 | const void_ty_id = try cg.resolveType(.void, .direct); | ||
| 3882 | const kernel_proto_ty_id = try cg.functionType(void_ty_id, &.{}); | ||
| 3883 | try section.emit(gpa, .OpFunction, .{ | ||
| 3884 | .id_result_type = try cg.resolveType(.void, .direct), | ||
| 3885 | .id_result = kernel_id, | ||
| 3886 | .function_control = .{}, | ||
| 3887 | .function_type = kernel_proto_ty_id, | ||
| 3888 | }); | ||
| 3889 | try section.emit(gpa, .OpLabel, .{ | ||
| 3890 | .id_result = cg.allocId(), | ||
| 3891 | }); | ||
| 3892 | |||
| 3893 | const buffer_id = cg.error_buffer.?; | ||
| 3894 | const zero_id = try cg.constInt(.u32, 0); | ||
| 3895 | try section.emit(gpa, .OpInBoundsAccessChain, .{ | ||
| 3896 | .id_result_type = ptr_anyerror_ty_id, | ||
| 3897 | .id_result = p_error_id, | ||
| 3898 | .base = buffer_id, | ||
| 3899 | .indexes = &.{zero_id}, | ||
| 3900 | }); | ||
| 3901 | }, | ||
| 3902 | else => unreachable, | ||
| 3903 | } | ||
| 3904 | |||
| 3905 | const error_id = cg.allocId(); | ||
| 3906 | try section.emit(gpa, .OpFunctionCall, .{ | ||
| 3907 | .id_result_type = anyerror_ty_id, | ||
| 3908 | .id_result = error_id, | ||
| 3909 | .function = test_id, | ||
| 3910 | }); | ||
| 3911 | // Note: Convert to direct not required. | ||
| 3912 | try section.emit(gpa, .OpStore, .{ | ||
| 3913 | .pointer = p_error_id, | ||
| 3914 | .object = error_id, | ||
| 3915 | .memory_access = .{ | ||
| 3916 | .aligned = .{ .literal_integer = @intCast(Type.abiAlignment(.anyerror, zcu).toByteUnits().?) }, | ||
| 3917 | }, | ||
| 3918 | }); | ||
| 3919 | try section.emit(gpa, .OpReturn, {}); | ||
| 3920 | try section.emit(gpa, .OpFunctionEnd, {}); | ||
| 3921 | try cg.module.append(gpa, section); | ||
| 3922 | |||
| 3923 | // Just generate a quick other name because the intel runtime crashes when the entry- | ||
| 3924 | // point name is the same as a different OpName. | ||
| 3925 | const test_name = try std.fmt.allocPrint(gpa, "test {s}", .{name}); | ||
| 3926 | errdefer gpa.free(test_name); | ||
| 3927 | try cg.entry_points.append(gpa, .{ | ||
| 3928 | .id = kernel_id, | ||
| 3929 | .name = test_name, | ||
| 3930 | .cc = .{ .spirv_kernel = .{ .x = 1, .y = 1, .z = 1 } }, | ||
| 3931 | }); | ||
| 3932 | } | ||
| 3933 | |||
| 3934 | fn intFromBool(cg: *CodeGen, value: Temporary, result_ty: Type) !Temporary { | 3780 | fn intFromBool(cg: *CodeGen, value: Temporary, result_ty: Type) !Temporary { |
| 3935 | const zero_id = try cg.constInt(result_ty, 0); | 3781 | const zero_id = try cg.constInt(result_ty, 0); |
| 3936 | const one_id = try cg.constInt(result_ty, 1); | 3782 | const one_id = try cg.constInt(result_ty, 1); |
| ... | @@ -5464,6 +5310,7 @@ fn accessChain( | ... | @@ -5464,6 +5310,7 @@ fn accessChain( |
| 5464 | 5310 | ||
| 5465 | fn ptrAccessChain( | 5311 | fn ptrAccessChain( |
| 5466 | cg: *CodeGen, | 5312 | cg: *CodeGen, |
| 5313 | as: std.lang.AddressSpace, | ||
| 5467 | result_ty_id: Id, | 5314 | result_ty_id: Id, |
| 5468 | base: Id, | 5315 | base: Id, |
| 5469 | element: Id, | 5316 | element: Id, |
| ... | @@ -5491,8 +5338,7 @@ fn ptrAccessChain( | ... | @@ -5491,8 +5338,7 @@ fn ptrAccessChain( |
| 5491 | }); | 5338 | }); |
| 5492 | }, | 5339 | }, |
| 5493 | .vulkan, .opengl => { | 5340 | .vulkan, .opengl => { |
| 5494 | assert(target.cpu.has(.spirv, .variable_pointers) or | 5341 | assert(!target_util.addrSpaceIsLogical(target, as)); |
| 5495 | target.cpu.has(.spirv, .variable_pointers_storage_buffer)); | ||
| 5496 | try cg.body.emit(gpa, .OpPtrAccessChain, .{ | 5342 | try cg.body.emit(gpa, .OpPtrAccessChain, .{ |
| 5497 | .id_result_type = result_ty_id, | 5343 | .id_result_type = result_ty_id, |
| 5498 | .id_result = result_id, | 5344 | .id_result = result_id, |
| ... | @@ -5513,11 +5359,11 @@ fn ptrAdd(cg: *CodeGen, result_ty: Type, ptr_ty: Type, ptr_id: Id, offset_id: Id | ... | @@ -5513,11 +5359,11 @@ fn ptrAdd(cg: *CodeGen, result_ty: Type, ptr_ty: Type, ptr_id: Id, offset_id: Id |
| 5513 | const result_ty_id = try cg.ptrType(child_ty_id, cg.storageClass(as)); | 5359 | const result_ty_id = try cg.ptrType(child_ty_id, cg.storageClass(as)); |
| 5514 | return switch (ptr_ty.ptrSize(zcu)) { | 5360 | return switch (ptr_ty.ptrSize(zcu)) { |
| 5515 | .one => cg.accessChainId(result_ty_id, ptr_id, &.{offset_id}), | 5361 | .one => cg.accessChainId(result_ty_id, ptr_id, &.{offset_id}), |
| 5516 | .c, .many => cg.ptrAccessChain(result_ty_id, ptr_id, offset_id, &.{}), | 5362 | .c, .many => cg.ptrAccessChain(as, result_ty_id, ptr_id, offset_id, &.{}), |
| 5517 | .slice => blk: { | 5363 | .slice => blk: { |
| 5518 | // TODO: This is probably incorrect. A slice should be returned here, though this is what llvm does. | 5364 | // TODO: This is probably incorrect. A slice should be returned here, though this is what llvm does. |
| 5519 | const slice_ptr_id = try cg.extractField(result_ty, ptr_id, 0); | 5365 | const slice_ptr_id = try cg.extractField(result_ty, ptr_id, 0); |
| 5520 | break :blk cg.ptrAccessChain(result_ty_id, slice_ptr_id, offset_id, &.{}); | 5366 | break :blk cg.ptrAccessChain(as, result_ty_id, slice_ptr_id, offset_id, &.{}); |
| 5521 | }, | 5367 | }, |
| 5522 | }; | 5368 | }; |
| 5523 | } | 5369 | } |
| ... | @@ -5770,8 +5616,8 @@ fn bitCast( | ... | @@ -5770,8 +5616,8 @@ fn bitCast( |
| 5770 | const target = zcu.getTarget(); | 5616 | const target = zcu.getTarget(); |
| 5771 | 5617 | ||
| 5772 | if (src_ty.toIntern() == dst_ty.toIntern()) return src_id; | 5618 | if (src_ty.toIntern() == dst_ty.toIntern()) return src_id; |
| 5773 | if (src_ty.isPtrAtRuntime(zcu) and dst_ty.isPtrAtRuntime(zcu)) switch (target.os.tag) { | 5619 | if (src_ty.isPtrAtRuntime(zcu) and dst_ty.isPtrAtRuntime(zcu)) { |
| 5774 | .vulkan, .opengl => if (src_ty.ptrAddressSpace(zcu) != .physical_storage_buffer) { | 5620 | if (target_util.addrSpaceIsLogical(target, src_ty.ptrAddressSpace(zcu))) { |
| 5775 | const src_child = src_ty.childType(zcu); | 5621 | const src_child = src_ty.childType(zcu); |
| 5776 | const dst_child = dst_ty.childType(zcu); | 5622 | const dst_child = dst_ty.childType(zcu); |
| 5777 | if (!dst_child.hasRuntimeBits(zcu)) return src_id; | 5623 | if (!dst_child.hasRuntimeBits(zcu)) return src_id; |
| ... | @@ -5797,9 +5643,8 @@ fn bitCast( | ... | @@ -5797,9 +5643,8 @@ fn bitCast( |
| 5797 | } | 5643 | } |
| 5798 | const dst_ty_id = try cg.resolveType(dst_ty, .direct); | 5644 | const dst_ty_id = try cg.resolveType(dst_ty, .direct); |
| 5799 | return try cg.accessChain(dst_ty_id, src_id, indices.items); | 5645 | return try cg.accessChain(dst_ty_id, src_id, indices.items); |
| 5800 | }, | 5646 | } |
| 5801 | else => {}, | 5647 | } |
| 5802 | }; | ||
| 5803 | 5648 | ||
| 5804 | const dst_ty_id = try cg.resolveType(dst_ty, .direct); | 5649 | const dst_ty_id = try cg.resolveType(dst_ty, .direct); |
| 5805 | const result_id = blk: { | 5650 | const result_id = blk: { |
| ... | @@ -5836,13 +5681,11 @@ fn bitCast( | ... | @@ -5836,13 +5681,11 @@ fn bitCast( |
| 5836 | } | 5681 | } |
| 5837 | 5682 | ||
| 5838 | if (src_ty.zigTypeTag(zcu) == .int and dst_ty.isPtrAtRuntime(zcu)) { | 5683 | if (src_ty.zigTypeTag(zcu) == .int and dst_ty.isPtrAtRuntime(zcu)) { |
| 5839 | if (target.os.tag != .opencl) { | 5684 | if (target_util.addrSpaceIsLogical(target, dst_ty.ptrAddressSpace(zcu))) { |
| 5840 | if (dst_ty.ptrAddressSpace(zcu) != .physical_storage_buffer) { | 5685 | return cg.fail( |
| 5841 | return cg.fail( | 5686 | "cannot cast integer to pointer with address space '{s}'", |
| 5842 | "cannot cast integer to pointer with address space '{s}'", | 5687 | .{@tagName(dst_ty.ptrAddressSpace(zcu))}, |
| 5843 | .{@tagName(dst_ty.ptrAddressSpace(zcu))}, | 5688 | ); |
| 5844 | ); | ||
| 5845 | } | ||
| 5846 | } | 5689 | } |
| 5847 | 5690 | ||
| 5848 | const result_id = cg.allocId(); | 5691 | const result_id = cg.allocId(); |
| ... | @@ -5869,16 +5712,13 @@ fn bitCast( | ... | @@ -5869,16 +5712,13 @@ fn bitCast( |
| 5869 | break :blk result_id; | 5712 | break :blk result_id; |
| 5870 | } | 5713 | } |
| 5871 | 5714 | ||
| 5872 | switch (target.os.tag) { | 5715 | if (target_util.addrSpaceIsLogical(target, .local)) { |
| 5873 | .vulkan, .opengl => { | 5716 | // Logical addressing forbids OpBitcast on pointers. Allocate |
| 5874 | // Logical addressing forbids OpBitcast on pointers. Allocate | 5717 | // the temp with dst_ty so the load reads through a slot of the right type. |
| 5875 | // the temp with dst_ty so the load reads through a slot of the right type. | 5718 | const dst_ty_indirect_id = try cg.resolveType(dst_ty, .indirect); |
| 5876 | const dst_ty_indirect_id = try cg.resolveType(dst_ty, .indirect); | 5719 | const tmp_id = try cg.alloc(dst_ty_indirect_id, null); |
| 5877 | const tmp_id = try cg.alloc(dst_ty_indirect_id, null); | 5720 | try cg.store(dst_ty, tmp_id, src_id, .{}); |
| 5878 | try cg.store(dst_ty, tmp_id, src_id, .{}); | 5721 | break :blk try cg.load(dst_ty, tmp_id, .{}); |
| 5879 | break :blk try cg.load(dst_ty, tmp_id, .{}); | ||
| 5880 | }, | ||
| 5881 | else => {}, | ||
| 5882 | } | 5722 | } |
| 5883 | 5723 | ||
| 5884 | const dst_ptr_ty_id = try cg.ptrType(dst_ty_id, .function); | 5724 | const dst_ptr_ty_id = try cg.ptrType(dst_ty_id, .function); |
| ... | @@ -6463,7 +6303,7 @@ fn airSliceElemPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id { | ... | @@ -6463,7 +6303,7 @@ fn airSliceElemPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id { |
| 6463 | const ptr_ty_id = try cg.resolveType(ptr_ty, .direct); | 6303 | const ptr_ty_id = try cg.resolveType(ptr_ty, .direct); |
| 6464 | 6304 | ||
| 6465 | const slice_ptr = try cg.extractField(ptr_ty, slice_id, 0); | 6305 | const slice_ptr = try cg.extractField(ptr_ty, slice_id, 0); |
| 6466 | return try cg.ptrAccessChain(ptr_ty_id, slice_ptr, index_id, &.{}); | 6306 | return try cg.ptrAccessChain(ptr_ty.ptrAddressSpace(zcu), ptr_ty_id, slice_ptr, index_id, &.{}); |
| 6467 | } | 6307 | } |
| 6468 | 6308 | ||
| 6469 | fn airSliceElemVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id { | 6309 | fn airSliceElemVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id { |
| ... | @@ -6479,22 +6319,22 @@ fn airSliceElemVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id { | ... | @@ -6479,22 +6319,22 @@ fn airSliceElemVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id { |
| 6479 | const ptr_ty_id = try cg.resolveType(ptr_ty, .direct); | 6319 | const ptr_ty_id = try cg.resolveType(ptr_ty, .direct); |
| 6480 | 6320 | ||
| 6481 | const slice_ptr = try cg.extractField(ptr_ty, slice_id, 0); | 6321 | const slice_ptr = try cg.extractField(ptr_ty, slice_id, 0); |
| 6482 | const elem_ptr = try cg.ptrAccessChain(ptr_ty_id, slice_ptr, index_id, &.{}); | 6322 | const elem_ptr = try cg.ptrAccessChain(ptr_ty.ptrAddressSpace(zcu), ptr_ty_id, slice_ptr, index_id, &.{}); |
| 6483 | return try cg.load(slice_ty.childType(zcu), elem_ptr, .{ .is_volatile = slice_ty.isVolatilePtr(zcu) }); | 6323 | return try cg.load(slice_ty.childType(zcu), elem_ptr, .{ .is_volatile = slice_ty.isVolatilePtr(zcu) }); |
| 6484 | } | 6324 | } |
| 6485 | 6325 | ||
| 6486 | fn ptrElemPtr( | 6326 | fn ptrElemPtr( |
| 6487 | cg: *CodeGen, | 6327 | cg: *CodeGen, |
| 6488 | mode: enum { single_array_ptr, many_ptr }, | 6328 | mode: enum { single_array_ptr, many_ptr }, |
| 6489 | @"addrspace": std.lang.AddressSpace, | 6329 | as: std.lang.AddressSpace, |
| 6490 | elem_ty: Type, | 6330 | elem_ty: Type, |
| 6491 | ptr_id: Id, | 6331 | ptr_id: Id, |
| 6492 | index_id: Id, | 6332 | index_id: Id, |
| 6493 | ) !Id { | 6333 | ) !Id { |
| 6494 | // Construct new pointer type for the resulting pointer | 6334 | // Construct new pointer type for the resulting pointer |
| 6495 | const elem_is_block = cg.block_var_ids.contains(ptr_id); | 6335 | const elem_is_block = cg.block_var_ids.contains(ptr_id); |
| 6496 | const elem_ty_id = try cg.pointeeType(@"addrspace", elem_ty, elem_is_block); | 6336 | const elem_ty_id = try cg.pointeeType(as, elem_ty, elem_is_block); |
| 6497 | const elem_ptr_ty_id = try cg.ptrType(elem_ty_id, cg.storageClass(@"addrspace")); | 6337 | const elem_ptr_ty_id = try cg.ptrType(elem_ty_id, cg.storageClass(as)); |
| 6498 | switch (mode) { | 6338 | switch (mode) { |
| 6499 | .single_array_ptr => { | 6339 | .single_array_ptr => { |
| 6500 | // Pointer-to-array. In this case, the resulting pointer is not of the same type | 6340 | // Pointer-to-array. In this case, the resulting pointer is not of the same type |
| ... | @@ -6503,7 +6343,7 @@ fn ptrElemPtr( | ... | @@ -6503,7 +6343,7 @@ fn ptrElemPtr( |
| 6503 | }, | 6343 | }, |
| 6504 | .many_ptr => { | 6344 | .many_ptr => { |
| 6505 | // Resulting pointer type is the same as the ptr_ty, so use ptrAccessChain | 6345 | // Resulting pointer type is the same as the ptr_ty, so use ptrAccessChain |
| 6506 | return cg.ptrAccessChain(elem_ptr_ty_id, ptr_id, index_id, &.{}); | 6346 | return cg.ptrAccessChain(as, elem_ptr_ty_id, ptr_id, index_id, &.{}); |
| 6507 | }, | 6347 | }, |
| 6508 | } | 6348 | } |
| 6509 | } | 6349 | } |
| ... | @@ -6821,14 +6661,11 @@ fn airAggFieldVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id { | ... | @@ -6821,14 +6661,11 @@ fn airAggFieldVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id { |
| 6821 | return try cg.load(field_ty, pl_ptr_id, .{}); | 6661 | return try cg.load(field_ty, pl_ptr_id, .{}); |
| 6822 | } | 6662 | } |
| 6823 | 6663 | ||
| 6824 | switch (zcu.getTarget().os.tag) { | 6664 | if (target_util.addrSpaceIsLogical(zcu.getTarget(), .local)) { |
| 6825 | .vulkan, .opengl => { | 6665 | // Logical addressing forbids OpBitcast on pointers. Load the |
| 6826 | // Logical addressing forbids OpBitcast on pointers. Load the | 6666 | // payload as its type and bitcast the value instead. |
| 6827 | // payload as its type and bitcast the value instead. | 6667 | const payload_id = try cg.load(layout.payload_ty, pl_ptr_id, .{}); |
| 6828 | const payload_id = try cg.load(layout.payload_ty, pl_ptr_id, .{}); | 6668 | return try cg.bitCast(field_ty, layout.payload_ty, payload_id); |
| 6829 | return try cg.bitCast(field_ty, layout.payload_ty, payload_id); | ||
| 6830 | }, | ||
| 6831 | else => {}, | ||
| 6832 | } | 6669 | } |
| 6833 | 6670 | ||
| 6834 | const field_ty_id = try cg.resolveType(field_ty, .indirect); | 6671 | const field_ty_id = try cg.resolveType(field_ty, .indirect); |
| ... | @@ -6871,13 +6708,11 @@ fn airFieldParentPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id { | ... | @@ -6871,13 +6708,11 @@ fn airFieldParentPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id { |
| 6871 | break :base_ptr_int try result.materialize(cg); | 6708 | break :base_ptr_int try result.materialize(cg); |
| 6872 | }; | 6709 | }; |
| 6873 | 6710 | ||
| 6874 | if (target.os.tag != .opencl) { | 6711 | if (target_util.addrSpaceIsLogical(target, field_ptr_ty.ptrAddressSpace(zcu))) { |
| 6875 | if (field_ptr_ty.ptrAddressSpace(zcu) != .physical_storage_buffer) { | 6712 | return cg.fail( |
| 6876 | return cg.fail( | 6713 | "cannot cast integer to pointer with address space '{s}'", |
| 6877 | "cannot cast integer to pointer with address space '{s}'", | 6714 | .{@tagName(field_ptr_ty.ptrAddressSpace(zcu))}, |
| 6878 | .{@tagName(field_ptr_ty.ptrAddressSpace(zcu))}, | 6715 | ); |
| 6879 | ); | ||
| 6880 | } | ||
| 6881 | } | 6716 | } |
| 6882 | 6717 | ||
| 6883 | const base_ptr = cg.allocId(); | 6718 | const base_ptr = cg.allocId(); |
| ... | @@ -6892,7 +6727,7 @@ fn airFieldParentPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id { | ... | @@ -6892,7 +6727,7 @@ fn airFieldParentPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id { |
| 6892 | 6727 | ||
| 6893 | fn structFieldPtr( | 6728 | fn structFieldPtr( |
| 6894 | cg: *CodeGen, | 6729 | cg: *CodeGen, |
| 6895 | @"addrspace": std.lang.AddressSpace, | 6730 | as: std.lang.AddressSpace, |
| 6896 | result_ptr_ty_id: Id, | 6731 | result_ptr_ty_id: Id, |
| 6897 | field_ty: Type, | 6732 | field_ty: Type, |
| 6898 | object_ty: Type, | 6733 | object_ty: Type, |
| ... | @@ -6926,21 +6761,18 @@ fn structFieldPtr( | ... | @@ -6926,21 +6761,18 @@ fn structFieldPtr( |
| 6926 | return try cg.constUndef(result_ptr_ty_id); | 6761 | return try cg.constUndef(result_ptr_ty_id); |
| 6927 | } | 6762 | } |
| 6928 | 6763 | ||
| 6929 | const storage_class = cg.storageClass(@"addrspace"); | 6764 | const storage_class = cg.storageClass(as); |
| 6930 | if (field_ty.toIntern() == layout.payload_ty.toIntern()) { | 6765 | if (field_ty.toIntern() == layout.payload_ty.toIntern()) { |
| 6931 | if (object_ty.containerLayout(zcu) == .@"packed") return object_ptr; | 6766 | if (object_ty.containerLayout(zcu) == .@"packed") return object_ptr; |
| 6932 | return try cg.accessChain(result_ptr_ty_id, object_ptr, &.{layout.payload_index}); | 6767 | return try cg.accessChain(result_ptr_ty_id, object_ptr, &.{layout.payload_index}); |
| 6933 | } | 6768 | } |
| 6934 | 6769 | ||
| 6935 | switch (zcu.getTarget().os.tag) { | 6770 | if (target_util.addrSpaceIsLogical(zcu.getTarget(), as)) { |
| 6936 | .vulkan, .opengl => { | 6771 | // Logical addressing forbids OpBitcast on pointers. If the field |
| 6937 | // Logical addressing forbids OpBitcast on pointers. If the field | 6772 | // type is structurally identical to the payload type (dedup will |
| 6938 | // type is structurally identical to the payload type (dedup will | 6773 | // unify them) the access chain typed as the field type is valid. |
| 6939 | // unify them) the access chain typed as the field type is valid. | 6774 | if (object_ty.containerLayout(zcu) == .@"packed") return object_ptr; |
| 6940 | if (object_ty.containerLayout(zcu) == .@"packed") return object_ptr; | 6775 | return try cg.accessChain(result_ptr_ty_id, object_ptr, &.{layout.payload_index}); |
| 6941 | return try cg.accessChain(result_ptr_ty_id, object_ptr, &.{layout.payload_index}); | ||
| 6942 | }, | ||
| 6943 | else => {}, | ||
| 6944 | } | 6776 | } |
| 6945 | 6777 | ||
| 6946 | const layout_payload_ty_id = try cg.resolveType(layout.payload_ty, .indirect); | 6778 | const layout_payload_ty_id = try cg.resolveType(layout.payload_ty, .indirect); |
| ... | @@ -7039,18 +6871,13 @@ fn airAlloc(cg: *CodeGen, inst: Air.Inst.Index) !?Id { | ... | @@ -7039,18 +6871,13 @@ fn airAlloc(cg: *CodeGen, inst: Air.Inst.Index) !?Id { |
| 7039 | const ptr_ty = cg.typeOfIndex(inst); | 6871 | const ptr_ty = cg.typeOfIndex(inst); |
| 7040 | const child_ty = ptr_ty.childType(zcu); | 6872 | const child_ty = ptr_ty.childType(zcu); |
| 7041 | 6873 | ||
| 7042 | switch (target.os.tag) { | 6874 | if (child_ty.zigTypeTag(zcu) == .pointer and !child_ty.isSlice(zcu)) { |
| 7043 | .vulkan, .opengl => { | 6875 | const as = child_ty.ptrAddressSpace(zcu); |
| 7044 | if (child_ty.zigTypeTag(zcu) == .pointer and !child_ty.isSlice(zcu)) { | 6876 | if (target_util.addrSpaceIsLogical(target, as) and cg.storageClass(as) == .function) { |
| 7045 | const as = child_ty.ptrAddressSpace(zcu); | 6877 | const result_id = cg.allocId(); |
| 7046 | if (cg.storageClass(as) == .function) { | 6878 | try cg.tracked_allocas.put(cg.gpa, result_id, null); |
| 7047 | const result_id = cg.allocId(); | 6879 | return result_id; |
| 7048 | try cg.tracked_allocas.put(cg.gpa, result_id, null); | 6880 | } |
| 7049 | return result_id; | ||
| 7050 | } | ||
| 7051 | } | ||
| 7052 | }, | ||
| 7053 | else => {}, | ||
| 7054 | } | 6881 | } |
| 7055 | 6882 | ||
| 7056 | const child_ty_id = try cg.resolveType(child_ty, .indirect); | 6883 | const child_ty_id = try cg.resolveType(child_ty, .indirect); |
| ... | @@ -8790,6 +8617,7 @@ const log = std.log.scoped(.codegen); | ... | @@ -8790,6 +8617,7 @@ const log = std.log.scoped(.codegen); |
| 8790 | const builtin = @import("builtin"); | 8617 | const builtin = @import("builtin"); |
| 8791 | const link = @import("../../link.zig"); | 8618 | const link = @import("../../link.zig"); |
| 8792 | const codegen = @import("../../codegen.zig"); | 8619 | const codegen = @import("../../codegen.zig"); |
| 8620 | const target_util = @import("../../target.zig"); | ||
| 8793 | const Zcu = @import("../../Zcu.zig"); | 8621 | const Zcu = @import("../../Zcu.zig"); |
| 8794 | const Type = @import("../../Type.zig"); | 8622 | const Type = @import("../../Type.zig"); |
| 8795 | const Value = @import("../../Value.zig"); | 8623 | const Value = @import("../../Value.zig"); |
src/codegen/spirv/Section.zig+46-7| ... | @@ -14,6 +14,38 @@ ids: std.bit_set.Dynamic, | ... | @@ -14,6 +14,38 @@ ids: std.bit_set.Dynamic, |
| 14 | 14 | ||
| 15 | pub const empty: Section = .{ .instructions = .empty, .ids = .{} }; | 15 | pub const empty: Section = .{ .instructions = .empty, .ids = .{} }; |
| 16 | 16 | ||
| 17 | pub const InstructionIterator = struct { | ||
| 18 | words: []const Word, | ||
| 19 | offset: usize = 0, | ||
| 20 | |||
| 21 | pub const Instruction = struct { | ||
| 22 | opcode: Opcode, | ||
| 23 | words: []const Word, | ||
| 24 | start: usize, | ||
| 25 | end: usize, | ||
| 26 | result_id: Id, | ||
| 27 | }; | ||
| 28 | |||
| 29 | pub fn next(it: *InstructionIterator) ?Instruction { | ||
| 30 | if (it.offset >= it.words.len) return null; | ||
| 31 | const start = it.offset; | ||
| 32 | const header: InstructionHeader = @bitCast(it.words[start]); | ||
| 33 | const words = it.words[start..][0..header.word_count]; | ||
| 34 | it.offset += words.len; | ||
| 35 | return .{ | ||
| 36 | .opcode = header.opcode, | ||
| 37 | .words = words, | ||
| 38 | .start = start, | ||
| 39 | .end = it.offset, | ||
| 40 | .result_id = if (header.opcode.resultIndex()) |i| @fromBackingInt(words[i]) else .none, | ||
| 41 | }; | ||
| 42 | } | ||
| 43 | }; | ||
| 44 | |||
| 45 | pub fn iterate(section: *const Section) InstructionIterator { | ||
| 46 | return .{ .words = section.instructions.items }; | ||
| 47 | } | ||
| 48 | |||
| 17 | pub const Error = error{ | 49 | pub const Error = error{ |
| 18 | OutOfMemory, | 50 | OutOfMemory, |
| 19 | UnknownOpcode, | 51 | UnknownOpcode, |
| ... | @@ -31,7 +63,7 @@ pub fn fromWords(gpa: Allocator, words: []const Word, id_bound: Word) Error!Sect | ... | @@ -31,7 +63,7 @@ pub fn fromWords(gpa: Allocator, words: []const Word, id_bound: Word) Error!Sect |
| 31 | const type_widths = try gpa.alloc(u16, id_bound); | 63 | const type_widths = try gpa.alloc(u16, id_bound); |
| 32 | defer gpa.free(type_widths); | 64 | defer gpa.free(type_widths); |
| 33 | @memset(type_widths, 0); | 65 | @memset(type_widths, 0); |
| 34 | var instruction_sets: std.array_hash_map.Auto(Word, spec.InstructionSet) = .empty; | 66 | var instruction_sets: std.array_hash_map.Auto(Word, ?spec.InstructionSet) = .empty; |
| 35 | defer instruction_sets.deinit(gpa); | 67 | defer instruction_sets.deinit(gpa); |
| 36 | var results: std.bit_set.Dynamic = try .initEmpty(gpa, id_bound); | 68 | var results: std.bit_set.Dynamic = try .initEmpty(gpa, id_bound); |
| 37 | defer results.deinit(gpa); | 69 | defer results.deinit(gpa); |
| ... | @@ -48,18 +80,18 @@ pub fn fromWords(gpa: Allocator, words: []const Word, id_bound: Word) Error!Sect | ... | @@ -48,18 +80,18 @@ pub fn fromWords(gpa: Allocator, words: []const Word, id_bound: Word) Error!Sect |
| 48 | return error.UnknownOpcode; | 80 | return error.UnknownOpcode; |
| 49 | const end = offset + len; | 81 | const end = offset + len; |
| 50 | var index = offset + 1; | 82 | var index = offset + 1; |
| 51 | const list: []const spec.Operand = switch (op) { | 83 | const list: []const spec.Operand = list: switch (op) { |
| 52 | .OpFunction => list: { | 84 | .OpFunction => { |
| 53 | if (in_function) return error.NestedFunction; | 85 | if (in_function) return error.NestedFunction; |
| 54 | in_function = true; | 86 | in_function = true; |
| 55 | break :list op.operands(); | 87 | break :list op.operands(); |
| 56 | }, | 88 | }, |
| 57 | .OpFunctionEnd => list: { | 89 | .OpFunctionEnd => { |
| 58 | if (!in_function) return error.InvalidInstruction; | 90 | if (!in_function) return error.InvalidInstruction; |
| 59 | in_function = false; | 91 | in_function = false; |
| 60 | break :list op.operands(); | 92 | break :list op.operands(); |
| 61 | }, | 93 | }, |
| 62 | .OpSpecConstantOp => list: { | 94 | .OpSpecConstantOp => { |
| 63 | const prefix = op.operands()[0..2]; | 95 | const prefix = op.operands()[0..2]; |
| 64 | index = try section.parseOperands(type_widths, offset, end, prefix, index); | 96 | index = try section.parseOperands(type_widths, offset, end, prefix, index); |
| 65 | if (index >= end) return error.InvalidInstruction; | 97 | if (index >= end) return error.InvalidInstruction; |
| ... | @@ -68,9 +100,14 @@ pub fn fromWords(gpa: Allocator, words: []const Word, id_bound: Word) Error!Sect | ... | @@ -68,9 +100,14 @@ pub fn fromWords(gpa: Allocator, words: []const Word, id_bound: Word) Error!Sect |
| 68 | index += 1; | 100 | index += 1; |
| 69 | break :list inner.operands()[2..]; | 101 | break :list inner.operands()[2..]; |
| 70 | }, | 102 | }, |
| 71 | .OpExtInst => list: { | 103 | .OpExtInst => { |
| 72 | if (len < 5) return error.InvalidInstruction; | 104 | if (len < 5) return error.InvalidInstruction; |
| 73 | const set = instruction_sets.get(inst[3]) orelse return error.InvalidInstruction; | 105 | const maybe_set = instruction_sets.get(inst[3]) orelse return error.InvalidInstruction; |
| 106 | const set = maybe_set orelse { | ||
| 107 | const prefix = op.operands()[0..4]; | ||
| 108 | index = try section.parseOperands(type_widths, offset, end, prefix, index); | ||
| 109 | break :list &.{.{ .kind = .id_ref, .quantifier = .variadic }}; | ||
| 110 | }; | ||
| 74 | const prefix = op.operands()[0..4]; | 111 | const prefix = op.operands()[0..4]; |
| 75 | index = try section.parseOperands(type_widths, offset, end, prefix, index); | 112 | index = try section.parseOperands(type_widths, offset, end, prefix, index); |
| 76 | break :list set.operands(inst[4]) orelse return error.InvalidInstruction; | 113 | break :list set.operands(inst[4]) orelse return error.InvalidInstruction; |
| ... | @@ -93,6 +130,8 @@ pub fn fromWords(gpa: Allocator, words: []const Word, id_bound: Word) Error!Sect | ... | @@ -93,6 +130,8 @@ pub fn fromWords(gpa: Allocator, words: []const Word, id_bound: Word) Error!Sect |
| 93 | const set_name = std.mem.sliceTo(std.mem.sliceAsBytes(inst[2..]), 0); | 130 | const set_name = std.mem.sliceTo(std.mem.sliceAsBytes(inst[2..]), 0); |
| 94 | if (std.meta.stringToEnum(spec.InstructionSet, set_name)) |set| { | 131 | if (std.meta.stringToEnum(spec.InstructionSet, set_name)) |set| { |
| 95 | if (set != .core) try instruction_sets.put(gpa, inst[1], set); | 132 | if (set != .core) try instruction_sets.put(gpa, inst[1], set); |
| 133 | } else if (std.mem.startsWith(u8, set_name, "NonSemantic.")) { | ||
| 134 | try instruction_sets.put(gpa, inst[1], null); | ||
| 96 | } | 135 | } |
| 97 | }, | 136 | }, |
| 98 | else => if (op.resultIndex() == 2) { | 137 | else => if (op.resultIndex() == 2) { |
src/codegen/spirv/spec.zig+248| ... | @@ -190,6 +190,13 @@ pub const OperandKind = enum { | ... | @@ -190,6 +190,13 @@ pub const OperandKind = enum { |
| 190 | pair_id_ref_literal_integer, | 190 | pair_id_ref_literal_integer, |
| 191 | pair_id_ref_id_ref, | 191 | pair_id_ref_id_ref, |
| 192 | tensor_operands, | 192 | tensor_operands, |
| 193 | non_semantic_shader_debug_info_100_debug_info_flags, | ||
| 194 | non_semantic_shader_debug_info_100_build_identifier_flags, | ||
| 195 | non_semantic_shader_debug_info_100_debug_base_type_attribute_encoding, | ||
| 196 | non_semantic_shader_debug_info_100_debug_composite_type, | ||
| 197 | non_semantic_shader_debug_info_100_debug_type_qualifier, | ||
| 198 | non_semantic_shader_debug_info_100_debug_operation, | ||
| 199 | non_semantic_shader_debug_info_100_debug_imported_entity, | ||
| 193 | 200 | ||
| 194 | pub fn category(operand_kind: OperandKind) OperandCategory { | 201 | pub fn category(operand_kind: OperandKind) OperandCategory { |
| 195 | return switch (operand_kind) { | 202 | return switch (operand_kind) { |
| ... | @@ -265,6 +272,13 @@ pub const OperandKind = enum { | ... | @@ -265,6 +272,13 @@ pub const OperandKind = enum { |
| 265 | .pair_id_ref_literal_integer => .composite, | 272 | .pair_id_ref_literal_integer => .composite, |
| 266 | .pair_id_ref_id_ref => .composite, | 273 | .pair_id_ref_id_ref => .composite, |
| 267 | .tensor_operands => .bit_enum, | 274 | .tensor_operands => .bit_enum, |
| 275 | .non_semantic_shader_debug_info_100_debug_info_flags => .bit_enum, | ||
| 276 | .non_semantic_shader_debug_info_100_build_identifier_flags => .bit_enum, | ||
| 277 | .non_semantic_shader_debug_info_100_debug_base_type_attribute_encoding => .value_enum, | ||
| 278 | .non_semantic_shader_debug_info_100_debug_composite_type => .value_enum, | ||
| 279 | .non_semantic_shader_debug_info_100_debug_type_qualifier => .value_enum, | ||
| 280 | .non_semantic_shader_debug_info_100_debug_operation => .value_enum, | ||
| 281 | .non_semantic_shader_debug_info_100_debug_imported_entity => .value_enum, | ||
| 268 | }; | 282 | }; |
| 269 | } | 283 | } |
| 270 | pub fn enumerants(operand_kind: OperandKind) []const Enumerant { | 284 | pub fn enumerants(operand_kind: OperandKind) []const Enumerant { |
| ... | @@ -1112,6 +1126,67 @@ pub const OperandKind = enum { | ... | @@ -1112,6 +1126,67 @@ pub const OperandKind = enum { |
| 1112 | .pair_id_ref_literal_integer => unreachable, | 1126 | .pair_id_ref_literal_integer => unreachable, |
| 1113 | .pair_id_ref_id_ref => unreachable, | 1127 | .pair_id_ref_id_ref => unreachable, |
| 1114 | .tensor_operands => &.{}, | 1128 | .tensor_operands => &.{}, |
| 1129 | .non_semantic_shader_debug_info_100_debug_info_flags => &.{ | ||
| 1130 | .{ .name = "FlagIsProtected", .value = 0x01, .parameters = &.{} }, | ||
| 1131 | .{ .name = "FlagIsPrivate", .value = 0x02, .parameters = &.{} }, | ||
| 1132 | .{ .name = "FlagIsPublic", .value = 0x03, .parameters = &.{} }, | ||
| 1133 | .{ .name = "FlagIsLocal", .value = 0x04, .parameters = &.{} }, | ||
| 1134 | .{ .name = "FlagIsDefinition", .value = 0x08, .parameters = &.{} }, | ||
| 1135 | .{ .name = "FlagFwdDecl", .value = 0x10, .parameters = &.{} }, | ||
| 1136 | .{ .name = "FlagArtificial", .value = 0x20, .parameters = &.{} }, | ||
| 1137 | .{ .name = "FlagExplicit", .value = 0x40, .parameters = &.{} }, | ||
| 1138 | .{ .name = "FlagPrototyped", .value = 0x80, .parameters = &.{} }, | ||
| 1139 | .{ .name = "FlagObjectPointer", .value = 0x100, .parameters = &.{} }, | ||
| 1140 | .{ .name = "FlagStaticMember", .value = 0x200, .parameters = &.{} }, | ||
| 1141 | .{ .name = "FlagIndirectVariable", .value = 0x400, .parameters = &.{} }, | ||
| 1142 | .{ .name = "FlagLValueReference", .value = 0x800, .parameters = &.{} }, | ||
| 1143 | .{ .name = "FlagRValueReference", .value = 0x1000, .parameters = &.{} }, | ||
| 1144 | .{ .name = "FlagIsOptimized", .value = 0x2000, .parameters = &.{} }, | ||
| 1145 | .{ .name = "FlagIsEnumClass", .value = 0x4000, .parameters = &.{} }, | ||
| 1146 | .{ .name = "FlagTypePassByValue", .value = 0x8000, .parameters = &.{} }, | ||
| 1147 | .{ .name = "FlagTypePassByReference", .value = 0x10000, .parameters = &.{} }, | ||
| 1148 | .{ .name = "FlagUnknownPhysicalLayout", .value = 0x20000, .parameters = &.{} }, | ||
| 1149 | }, | ||
| 1150 | .non_semantic_shader_debug_info_100_build_identifier_flags => &.{ | ||
| 1151 | .{ .name = "IdentifierPossibleDuplicates", .value = 0x01, .parameters = &.{} }, | ||
| 1152 | }, | ||
| 1153 | .non_semantic_shader_debug_info_100_debug_base_type_attribute_encoding => &.{ | ||
| 1154 | .{ .name = "Unspecified", .value = 0, .parameters = &.{} }, | ||
| 1155 | .{ .name = "Address", .value = 1, .parameters = &.{} }, | ||
| 1156 | .{ .name = "Boolean", .value = 2, .parameters = &.{} }, | ||
| 1157 | .{ .name = "Float", .value = 3, .parameters = &.{} }, | ||
| 1158 | .{ .name = "Signed", .value = 4, .parameters = &.{} }, | ||
| 1159 | .{ .name = "SignedChar", .value = 5, .parameters = &.{} }, | ||
| 1160 | .{ .name = "Unsigned", .value = 6, .parameters = &.{} }, | ||
| 1161 | .{ .name = "UnsignedChar", .value = 7, .parameters = &.{} }, | ||
| 1162 | }, | ||
| 1163 | .non_semantic_shader_debug_info_100_debug_composite_type => &.{ | ||
| 1164 | .{ .name = "Class", .value = 0, .parameters = &.{} }, | ||
| 1165 | .{ .name = "Structure", .value = 1, .parameters = &.{} }, | ||
| 1166 | .{ .name = "Union", .value = 2, .parameters = &.{} }, | ||
| 1167 | }, | ||
| 1168 | .non_semantic_shader_debug_info_100_debug_type_qualifier => &.{ | ||
| 1169 | .{ .name = "ConstType", .value = 0, .parameters = &.{} }, | ||
| 1170 | .{ .name = "VolatileType", .value = 1, .parameters = &.{} }, | ||
| 1171 | .{ .name = "RestrictType", .value = 2, .parameters = &.{} }, | ||
| 1172 | .{ .name = "AtomicType", .value = 3, .parameters = &.{} }, | ||
| 1173 | }, | ||
| 1174 | .non_semantic_shader_debug_info_100_debug_operation => &.{ | ||
| 1175 | .{ .name = "Deref", .value = 0, .parameters = &.{} }, | ||
| 1176 | .{ .name = "Plus", .value = 1, .parameters = &.{} }, | ||
| 1177 | .{ .name = "Minus", .value = 2, .parameters = &.{} }, | ||
| 1178 | .{ .name = "PlusUconst", .value = 3, .parameters = &.{.{ .kind = .id_ref }} }, | ||
| 1179 | .{ .name = "BitPiece", .value = 4, .parameters = &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } } }, | ||
| 1180 | .{ .name = "Swap", .value = 5, .parameters = &.{} }, | ||
| 1181 | .{ .name = "Xderef", .value = 6, .parameters = &.{} }, | ||
| 1182 | .{ .name = "StackValue", .value = 7, .parameters = &.{} }, | ||
| 1183 | .{ .name = "Constu", .value = 8, .parameters = &.{.{ .kind = .id_ref }} }, | ||
| 1184 | .{ .name = "Fragment", .value = 9, .parameters = &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } } }, | ||
| 1185 | }, | ||
| 1186 | .non_semantic_shader_debug_info_100_debug_imported_entity => &.{ | ||
| 1187 | .{ .name = "ImportedModule", .value = 0, .parameters = &.{} }, | ||
| 1188 | .{ .name = "ImportedDeclaration", .value = 1, .parameters = &.{} }, | ||
| 1189 | }, | ||
| 1115 | }; | 1190 | }; |
| 1116 | } | 1191 | } |
| 1117 | 1192 | ||
| ... | @@ -3256,6 +3331,102 @@ pub const GlslOpcode = enum(u16) { | ... | @@ -3256,6 +3331,102 @@ pub const GlslOpcode = enum(u16) { |
| 3256 | }; | 3331 | }; |
| 3257 | } | 3332 | } |
| 3258 | }; | 3333 | }; |
| 3334 | |||
| 3335 | pub const ShaderDebugInfoOpCode = enum(u16) { | ||
| 3336 | DebugInfoNone = 0, | ||
| 3337 | DebugCompilationUnit = 1, | ||
| 3338 | DebugTypeBasic = 2, | ||
| 3339 | DebugTypePointer = 3, | ||
| 3340 | DebugTypeQualifier = 4, | ||
| 3341 | DebugTypeArray = 5, | ||
| 3342 | DebugTypeVector = 6, | ||
| 3343 | DebugTypedef = 7, | ||
| 3344 | DebugTypeFunction = 8, | ||
| 3345 | DebugTypeEnum = 9, | ||
| 3346 | DebugTypeComposite = 10, | ||
| 3347 | DebugTypeMember = 11, | ||
| 3348 | DebugTypeInheritance = 12, | ||
| 3349 | DebugTypePtrToMember = 13, | ||
| 3350 | DebugTypeTemplate = 14, | ||
| 3351 | DebugTypeTemplateParameter = 15, | ||
| 3352 | DebugTypeTemplateTemplateParameter = 16, | ||
| 3353 | DebugTypeTemplateParameterPack = 17, | ||
| 3354 | DebugGlobalVariable = 18, | ||
| 3355 | DebugFunctionDeclaration = 19, | ||
| 3356 | DebugFunction = 20, | ||
| 3357 | DebugLexicalBlock = 21, | ||
| 3358 | DebugLexicalBlockDiscriminator = 22, | ||
| 3359 | DebugScope = 23, | ||
| 3360 | DebugNoScope = 24, | ||
| 3361 | DebugInlinedAt = 25, | ||
| 3362 | DebugLocalVariable = 26, | ||
| 3363 | DebugInlinedVariable = 27, | ||
| 3364 | DebugDeclare = 28, | ||
| 3365 | DebugValue = 29, | ||
| 3366 | DebugOperation = 30, | ||
| 3367 | DebugExpression = 31, | ||
| 3368 | DebugMacroDef = 32, | ||
| 3369 | DebugMacroUndef = 33, | ||
| 3370 | DebugImportedEntity = 34, | ||
| 3371 | DebugSource = 35, | ||
| 3372 | DebugFunctionDefinition = 101, | ||
| 3373 | DebugSourceContinued = 102, | ||
| 3374 | DebugLine = 103, | ||
| 3375 | DebugNoLine = 104, | ||
| 3376 | DebugBuildIdentifier = 105, | ||
| 3377 | DebugStoragePath = 106, | ||
| 3378 | DebugEntryPoint = 107, | ||
| 3379 | DebugTypeMatrix = 108, | ||
| 3380 | |||
| 3381 | pub fn operands(opcode: ShaderDebugInfoOpCode) []const Operand { | ||
| 3382 | return switch (opcode) { | ||
| 3383 | .DebugInfoNone => &.{}, | ||
| 3384 | .DebugCompilationUnit => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3385 | .DebugTypeBasic => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3386 | .DebugTypePointer => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3387 | .DebugTypeQualifier => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3388 | .DebugTypeArray => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } }, | ||
| 3389 | .DebugTypeVector => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3390 | .DebugTypedef => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3391 | .DebugTypeFunction => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } }, | ||
| 3392 | .DebugTypeEnum => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic } }, | ||
| 3393 | .DebugTypeComposite => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } }, | ||
| 3394 | .DebugTypeMember => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } }, | ||
| 3395 | .DebugTypeInheritance => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3396 | .DebugTypePtrToMember => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3397 | .DebugTypeTemplate => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } }, | ||
| 3398 | .DebugTypeTemplateParameter => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3399 | .DebugTypeTemplateTemplateParameter => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3400 | .DebugTypeTemplateParameterPack => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } }, | ||
| 3401 | .DebugGlobalVariable => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } }, | ||
| 3402 | .DebugFunctionDeclaration => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3403 | .DebugFunction => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } }, | ||
| 3404 | .DebugLexicalBlock => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } }, | ||
| 3405 | .DebugLexicalBlockDiscriminator => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3406 | .DebugScope => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } }, | ||
| 3407 | .DebugNoScope => &.{}, | ||
| 3408 | .DebugInlinedAt => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } }, | ||
| 3409 | .DebugLocalVariable => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } }, | ||
| 3410 | .DebugInlinedVariable => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3411 | .DebugDeclare => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } }, | ||
| 3412 | .DebugValue => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } }, | ||
| 3413 | .DebugOperation => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } }, | ||
| 3414 | .DebugExpression => &.{.{ .kind = .id_ref, .quantifier = .variadic }}, | ||
| 3415 | .DebugMacroDef => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } }, | ||
| 3416 | .DebugMacroUndef => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3417 | .DebugImportedEntity => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3418 | .DebugSource => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } }, | ||
| 3419 | .DebugFunctionDefinition => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3420 | .DebugSourceContinued => &.{.{ .kind = .id_ref }}, | ||
| 3421 | .DebugLine => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3422 | .DebugNoLine => &.{}, | ||
| 3423 | .DebugBuildIdentifier => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3424 | .DebugStoragePath => &.{.{ .kind = .id_ref }}, | ||
| 3425 | .DebugEntryPoint => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3426 | .DebugTypeMatrix => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } }, | ||
| 3427 | }; | ||
| 3428 | } | ||
| 3429 | }; | ||
| 3259 | pub const ImageOperands = packed struct(Word) { | 3430 | pub const ImageOperands = packed struct(Word) { |
| 3260 | bias: bool = false, | 3431 | bias: bool = false, |
| 3261 | lod: bool = false, | 3432 | lod: bool = false, |
| ... | @@ -4460,16 +4631,93 @@ pub const ComponentType = enum(u32) { | ... | @@ -4460,16 +4631,93 @@ pub const ComponentType = enum(u32) { |
| 4460 | pub const TensorOperands = packed struct(Word) { | 4631 | pub const TensorOperands = packed struct(Word) { |
| 4461 | _reserved_bits_0_to_31: u32 = 0, | 4632 | _reserved_bits_0_to_31: u32 = 0, |
| 4462 | }; | 4633 | }; |
| 4634 | pub const @"NonSemantic.Shader.DebugInfo.100.DebugInfoFlags" = packed struct(Word) { | ||
| 4635 | flag_is_protected: bool = false, | ||
| 4636 | flag_is_private: bool = false, | ||
| 4637 | flag_is_local: bool = false, | ||
| 4638 | flag_is_definition: bool = false, | ||
| 4639 | flag_fwd_decl: bool = false, | ||
| 4640 | flag_artificial: bool = false, | ||
| 4641 | flag_explicit: bool = false, | ||
| 4642 | flag_prototyped: bool = false, | ||
| 4643 | flag_object_pointer: bool = false, | ||
| 4644 | flag_static_member: bool = false, | ||
| 4645 | flag_indirect_variable: bool = false, | ||
| 4646 | flag_l_value_reference: bool = false, | ||
| 4647 | flag_r_value_reference: bool = false, | ||
| 4648 | flag_is_optimized: bool = false, | ||
| 4649 | flag_is_enum_class: bool = false, | ||
| 4650 | flag_type_pass_by_value: bool = false, | ||
| 4651 | flag_type_pass_by_reference: bool = false, | ||
| 4652 | flag_unknown_physical_layout: bool = false, | ||
| 4653 | _reserved_bits_18_to_31: u14 = 0, | ||
| 4654 | }; | ||
| 4655 | pub const @"NonSemantic.Shader.DebugInfo.100.BuildIdentifierFlags" = packed struct(Word) { | ||
| 4656 | identifier_possible_duplicates: bool = false, | ||
| 4657 | _reserved_bits_1_to_31: u31 = 0, | ||
| 4658 | }; | ||
| 4659 | pub const @"NonSemantic.Shader.DebugInfo.100.DebugBaseTypeAttributeEncoding" = enum(u32) { | ||
| 4660 | unspecified = 0, | ||
| 4661 | address = 1, | ||
| 4662 | boolean = 2, | ||
| 4663 | float = 3, | ||
| 4664 | signed = 4, | ||
| 4665 | signed_char = 5, | ||
| 4666 | unsigned = 6, | ||
| 4667 | unsigned_char = 7, | ||
| 4668 | }; | ||
| 4669 | pub const @"NonSemantic.Shader.DebugInfo.100.DebugCompositeType" = enum(u32) { | ||
| 4670 | class = 0, | ||
| 4671 | structure = 1, | ||
| 4672 | @"union" = 2, | ||
| 4673 | }; | ||
| 4674 | pub const @"NonSemantic.Shader.DebugInfo.100.DebugTypeQualifier" = enum(u32) { | ||
| 4675 | const_type = 0, | ||
| 4676 | volatile_type = 1, | ||
| 4677 | restrict_type = 2, | ||
| 4678 | atomic_type = 3, | ||
| 4679 | }; | ||
| 4680 | pub const @"NonSemantic.Shader.DebugInfo.100.DebugOperation" = enum(u32) { | ||
| 4681 | deref = 0, | ||
| 4682 | plus = 1, | ||
| 4683 | minus = 2, | ||
| 4684 | plus_uconst = 3, | ||
| 4685 | bit_piece = 4, | ||
| 4686 | swap = 5, | ||
| 4687 | xderef = 6, | ||
| 4688 | stack_value = 7, | ||
| 4689 | constu = 8, | ||
| 4690 | fragment = 9, | ||
| 4691 | |||
| 4692 | pub const Extended = union(@"NonSemantic.Shader.DebugInfo.100.DebugOperation") { | ||
| 4693 | deref, | ||
| 4694 | plus, | ||
| 4695 | minus, | ||
| 4696 | plus_uconst: struct { id_ref: Id }, | ||
| 4697 | bit_piece: struct { id_ref_0: Id, id_ref_1: Id }, | ||
| 4698 | swap, | ||
| 4699 | xderef, | ||
| 4700 | stack_value, | ||
| 4701 | constu: struct { id_ref: Id }, | ||
| 4702 | fragment: struct { id_ref_0: Id, id_ref_1: Id }, | ||
| 4703 | }; | ||
| 4704 | }; | ||
| 4705 | pub const @"NonSemantic.Shader.DebugInfo.100.DebugImportedEntity" = enum(u32) { | ||
| 4706 | imported_module = 0, | ||
| 4707 | imported_declaration = 1, | ||
| 4708 | }; | ||
| 4463 | pub const InstructionSet = enum { | 4709 | pub const InstructionSet = enum { |
| 4464 | core, | 4710 | core, |
| 4465 | @"OpenCL.std", | 4711 | @"OpenCL.std", |
| 4466 | @"GLSL.std.450", | 4712 | @"GLSL.std.450", |
| 4713 | @"NonSemantic.Shader.DebugInfo.100", | ||
| 4467 | 4714 | ||
| 4468 | pub fn operands(inst_set: InstructionSet, opcode: Word) ?[]const Operand { | 4715 | pub fn operands(inst_set: InstructionSet, opcode: Word) ?[]const Operand { |
| 4469 | return switch (inst_set) { | 4716 | return switch (inst_set) { |
| 4470 | .core => if (std.enums.fromInt(Opcode, opcode)) |op| op.operands() else null, | 4717 | .core => if (std.enums.fromInt(Opcode, opcode)) |op| op.operands() else null, |
| 4471 | .@"OpenCL.std" => if (std.enums.fromInt(OpenClOpcode, opcode)) |op| op.operands() else null, | 4718 | .@"OpenCL.std" => if (std.enums.fromInt(OpenClOpcode, opcode)) |op| op.operands() else null, |
| 4472 | .@"GLSL.std.450" => if (std.enums.fromInt(GlslOpcode, opcode)) |op| op.operands() else null, | 4719 | .@"GLSL.std.450" => if (std.enums.fromInt(GlslOpcode, opcode)) |op| op.operands() else null, |
| 4720 | .@"NonSemantic.Shader.DebugInfo.100" => if (std.enums.fromInt(ShaderDebugInfoOpCode, opcode)) |op| op.operands() else null, | ||
| 4473 | }; | 4721 | }; |
| 4474 | } | 4722 | } |
| 4475 | }; | 4723 | }; |
src/link/Elf/ZigObject.zig+1-1| ... | @@ -224,7 +224,7 @@ pub fn init(self: *ZigObject, elf_file: *Elf, options: InitOptions) !void { | ... | @@ -224,7 +224,7 @@ pub fn init(self: *ZigObject, elf_file: *Elf, options: InitOptions) !void { |
| 224 | try dwarf.initMetadata(); | 224 | try dwarf.initMetadata(); |
| 225 | self.dwarf = dwarf; | 225 | self.dwarf = dwarf; |
| 226 | }, | 226 | }, |
| 227 | .code_view => unreachable, | 227 | .code_view, .nsdi => unreachable, |
| 228 | } | 228 | } |
| 229 | } | 229 | } |
| 230 | 230 |
src/link/Elf2.zig+8-8| ... | @@ -5146,7 +5146,7 @@ fn create( | ... | @@ -5146,7 +5146,7 @@ fn create( |
| 5146 | .dwarf = .init(&elf.base, switch (comp.config.debug_format) { | 5146 | .dwarf = .init(&elf.base, switch (comp.config.debug_format) { |
| 5147 | .strip => .@"32", // for .eh_frame | 5147 | .strip => .@"32", // for .eh_frame |
| 5148 | .dwarf => |v| v, | 5148 | .dwarf => |v| v, |
| 5149 | .code_view => unreachable, | 5149 | .code_view, .nsdi => unreachable, |
| 5150 | }), | 5150 | }), |
| 5151 | .dwarf_shared = comptime .initFill(.{ | 5151 | .dwarf_shared = comptime .initFill(.{ |
| 5152 | .first_target_reloc = .none, | 5152 | .first_target_reloc = .none, |
| ... | @@ -5261,7 +5261,7 @@ fn initHeaders( | ... | @@ -5261,7 +5261,7 @@ fn initHeaders( |
| 5261 | const have_debug_frame = machine == .X86_64 and switch (comp.config.debug_format) { | 5261 | const have_debug_frame = machine == .X86_64 and switch (comp.config.debug_format) { |
| 5262 | .strip => false, | 5262 | .strip => false, |
| 5263 | .dwarf => !comp.config.any_unwind_tables, | 5263 | .dwarf => !comp.config.any_unwind_tables, |
| 5264 | .code_view => unreachable, | 5264 | .code_view, .nsdi => unreachable, |
| 5265 | }; | 5265 | }; |
| 5266 | const addr_align: Alignment = switch (class) { | 5266 | const addr_align: Alignment = switch (class) { |
| 5267 | .NONE, _ => unreachable, | 5267 | .NONE, _ => unreachable, |
| ... | @@ -5322,7 +5322,7 @@ fn initHeaders( | ... | @@ -5322,7 +5322,7 @@ fn initHeaders( |
| 5322 | shnum += 1; // .debug_str | 5322 | shnum += 1; // .debug_str |
| 5323 | shnum += 1; // .debug_str_offsets | 5323 | shnum += 1; // .debug_str_offsets |
| 5324 | }, | 5324 | }, |
| 5325 | .code_view => unreachable, | 5325 | .code_view, .nsdi => unreachable, |
| 5326 | } | 5326 | } |
| 5327 | if (@"type" != .REL) { | 5327 | if (@"type" != .REL) { |
| 5328 | shnum += 1; // .got | 5328 | shnum += 1; // .got |
| ... | @@ -6548,7 +6548,7 @@ fn initHeaders( | ... | @@ -6548,7 +6548,7 @@ fn initHeaders( |
| 6548 | .node_align = elf.mf.flags.block_size, | 6548 | .node_align = elf.mf.flags.block_size, |
| 6549 | }); | 6549 | }); |
| 6550 | }, | 6550 | }, |
| 6551 | .code_view => unreachable, | 6551 | .code_view, .nsdi => unreachable, |
| 6552 | } | 6552 | } |
| 6553 | 6553 | ||
| 6554 | // If we have an entry point symbol, create the undefined reference now. | 6554 | // If we have an entry point symbol, create the undefined reference now. |
| ... | @@ -10400,7 +10400,7 @@ fn updateContainerTypeInner( | ... | @@ -10400,7 +10400,7 @@ fn updateContainerTypeInner( |
| 10400 | try elf.dwarf.const_pool.updateContainerType(pt, .{ .elf2 = elf }, ty, success); | 10400 | try elf.dwarf.const_pool.updateContainerType(pt, .{ .elf2 = elf }, ty, success); |
| 10401 | try elf.dwarf.const_pool.flushPending(pt, .{ .elf2 = elf }); | 10401 | try elf.dwarf.const_pool.flushPending(pt, .{ .elf2 = elf }); |
| 10402 | }, | 10402 | }, |
| 10403 | .code_view => unreachable, | 10403 | .code_view, .nsdi => unreachable, |
| 10404 | } | 10404 | } |
| 10405 | if (!success) return; | 10405 | if (!success) return; |
| 10406 | var lazy_it = elf.lazy.iterator(); | 10406 | var lazy_it = elf.lazy.iterator(); |
| ... | @@ -10426,7 +10426,7 @@ pub fn addConst( | ... | @@ -10426,7 +10426,7 @@ pub fn addConst( |
| 10426 | try elf.dwarf_consts.ensureUnusedCapacity(gpa, 1); | 10426 | try elf.dwarf_consts.ensureUnusedCapacity(gpa, 1); |
| 10427 | try elf.dwarf.addConst(cpi, val, &addConstNode); | 10427 | try elf.dwarf.addConst(cpi, val, &addConstNode); |
| 10428 | }, | 10428 | }, |
| 10429 | .code_view => unreachable, | 10429 | .code_view, .nsdi => unreachable, |
| 10430 | } | 10430 | } |
| 10431 | } | 10431 | } |
| 10432 | fn addConstNode( | 10432 | fn addConstNode( |
| ... | @@ -10502,7 +10502,7 @@ fn updateConstInner( | ... | @@ -10502,7 +10502,7 @@ fn updateConstInner( |
| 10502 | } | 10502 | } |
| 10503 | try elf.genPending(pt); | 10503 | try elf.genPending(pt); |
| 10504 | }, | 10504 | }, |
| 10505 | .code_view => unreachable, | 10505 | .code_view, .nsdi => unreachable, |
| 10506 | } | 10506 | } |
| 10507 | } | 10507 | } |
| 10508 | 10508 | ||
| ... | @@ -11259,7 +11259,7 @@ fn genPending(elf: *Elf, pt: Zcu.PerThread) link.Error!void { | ... | @@ -11259,7 +11259,7 @@ fn genPending(elf: *Elf, pt: Zcu.PerThread) link.Error!void { |
| 11259 | elf.resetNodeRelocs(debug_info_ni); | 11259 | elf.resetNodeRelocs(debug_info_ni); |
| 11260 | try elf.dwarf.genDecl(pt, &di_nw, pending.instance); | 11260 | try elf.dwarf.genDecl(pt, &di_nw, pending.instance); |
| 11261 | }, | 11261 | }, |
| 11262 | .code_view => unreachable, | 11262 | .code_view, .nsdi => unreachable, |
| 11263 | } | 11263 | } |
| 11264 | try elf.genPendingDebug(gpa); | 11264 | try elf.genPendingDebug(gpa); |
| 11265 | assert(elf.pending_uavs.items.len == 0); // no UAVs added by lazy code/data or by debug info | 11265 | assert(elf.pending_uavs.items.len == 0); // no UAVs added by lazy code/data or by debug info |
src/link/MachO/ZigObject.zig+1-1| ... | @@ -62,7 +62,7 @@ pub fn init(self: *ZigObject, macho_file: *MachO) !void { | ... | @@ -62,7 +62,7 @@ pub fn init(self: *ZigObject, macho_file: *MachO) !void { |
| 62 | self.debug_info_header_dirty = true; | 62 | self.debug_info_header_dirty = true; |
| 63 | self.debug_line_header_dirty = true; | 63 | self.debug_line_header_dirty = true; |
| 64 | }, | 64 | }, |
| 65 | .code_view => unreachable, | 65 | .code_view, .nsdi => unreachable, |
| 66 | } | 66 | } |
| 67 | } | 67 | } |
| 68 | 68 |
src/link/Spirv.zig+2-1| ... | @@ -218,11 +218,12 @@ pub fn flush( | ... | @@ -218,11 +218,12 @@ pub fn flush( |
| 218 | .linker = linker, | 218 | .linker = linker, |
| 219 | .arena = arena, | 219 | .arena = arena, |
| 220 | .id_bound = 1, | 220 | .id_bound = 1, |
| 221 | .nonsemantic_info = false, | ||
| 221 | .navs = .empty, | 222 | .navs = .empty, |
| 222 | .symbols = .empty, | 223 | .symbols = .empty, |
| 223 | .interned = .empty, | 224 | .interned = .empty, |
| 224 | .variables = .empty, | 225 | .variables = .empty, |
| 225 | .function_references = .empty, | 226 | .fn_refs = .empty, |
| 226 | .entry_points = .empty, | 227 | .entry_points = .empty, |
| 227 | .deps = .empty, | 228 | .deps = .empty, |
| 228 | .scratch = .empty, | 229 | .scratch = .empty, |
src/link/Spirv/Flush.zig+141-100| ... | @@ -2,6 +2,7 @@ const std = @import("std"); | ... | @@ -2,6 +2,7 @@ const std = @import("std"); |
| 2 | const Allocator = std.mem.Allocator; | 2 | const Allocator = std.mem.Allocator; |
| 3 | const Path = std.Build.Cache.Path; | 3 | const Path = std.Build.Cache.Path; |
| 4 | const assert = std.debug.assert; | 4 | const assert = std.debug.assert; |
| 5 | const stringToEnum = std.meta.stringToEnum; | ||
| 5 | const InternPool = @import("../../InternPool.zig"); | 6 | const InternPool = @import("../../InternPool.zig"); |
| 6 | const link = @import("../../link.zig"); | 7 | const link = @import("../../link.zig"); |
| 7 | const Type = @import("../../Type.zig"); | 8 | const Type = @import("../../Type.zig"); |
| ... | @@ -17,11 +18,12 @@ const Flush = @This(); | ... | @@ -17,11 +18,12 @@ const Flush = @This(); |
| 17 | linker: *Linker, | 18 | linker: *Linker, |
| 18 | arena: Allocator, | 19 | arena: Allocator, |
| 19 | id_bound: Word, | 20 | id_bound: Word, |
| 21 | nonsemantic_info: bool, | ||
| 20 | navs: std.array_hash_map.Auto(InternPool.Nav.Index, Id), | 22 | navs: std.array_hash_map.Auto(InternPool.Nav.Index, Id), |
| 21 | symbols: std.array_hash_map.String(Symbol), | 23 | symbols: std.array_hash_map.String(Symbol), |
| 22 | interned: std.array_hash_map.String(Id), | 24 | interned: std.array_hash_map.String(Id), |
| 23 | variables: std.array_hash_map.Auto(Id, spec.StorageClass), | 25 | variables: std.array_hash_map.Auto(Id, spec.StorageClass), |
| 24 | function_references: std.array_hash_map.Auto(Id, []const Id), | 26 | fn_refs: std.array_hash_map.Auto(Id, []const Id), |
| 25 | entry_points: std.ArrayList(Mir.EntryPoint), | 27 | entry_points: std.ArrayList(Mir.EntryPoint), |
| 26 | deps: std.ArrayList(Id), | 28 | deps: std.ArrayList(Id), |
| 27 | scratch: Section, | 29 | scratch: Section, |
| ... | @@ -42,7 +44,7 @@ const Symbol = struct { | ... | @@ -42,7 +44,7 @@ const Symbol = struct { |
| 42 | }; | 44 | }; |
| 43 | 45 | ||
| 44 | const Annotation = struct { | 46 | const Annotation = struct { |
| 45 | target: Word, | 47 | target_id: Word, |
| 46 | class: spec.Class, | 48 | class: spec.Class, |
| 47 | start: usize, | 49 | start: usize, |
| 48 | end: usize, | 50 | end: usize, |
| ... | @@ -193,7 +195,6 @@ pub fn emitModule(flush: *Flush, out: *Section) link.Error!void { | ... | @@ -193,7 +195,6 @@ pub fn emitModule(flush: *Flush, out: *Section) link.Error!void { |
| 193 | }) |feature| { | 195 | }) |feature| { |
| 194 | if (target.cpu.has(.spirv, feature)) version.minor += 1; | 196 | if (target.cpu.has(.spirv, feature)) version.minor += 1; |
| 195 | } | 197 | } |
| 196 | |||
| 197 | const zig_packed_version = (zig_version.major << 12) | (zig_version.minor << 7) | zig_version.patch; | 198 | const zig_packed_version = (zig_version.major << 12) | (zig_version.minor << 7) | zig_version.patch; |
| 198 | const header: spec.Header = .{ | 199 | const header: spec.Header = .{ |
| 199 | .magic = spec.magic_number, | 200 | .magic = spec.magic_number, |
| ... | @@ -202,6 +203,7 @@ pub fn emitModule(flush: *Flush, out: *Section) link.Error!void { | ... | @@ -202,6 +203,7 @@ pub fn emitModule(flush: *Flush, out: *Section) link.Error!void { |
| 202 | .id_bound = flush.id_bound, | 203 | .id_bound = flush.id_bound, |
| 203 | .schema = 0, | 204 | .schema = 0, |
| 204 | }; | 205 | }; |
| 206 | |||
| 205 | try out.writeWords(gpa, @ptrCast(@alignCast(&header))); | 207 | try out.writeWords(gpa, @ptrCast(@alignCast(&header))); |
| 206 | try flush.emitCapabilities(out); | 208 | try flush.emitCapabilities(out); |
| 207 | try out.writeWords(gpa, flush.extended_instruction_sets.instructions.items); | 209 | try out.writeWords(gpa, flush.extended_instruction_sets.instructions.items); |
| ... | @@ -224,7 +226,7 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { | ... | @@ -224,7 +226,7 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { |
| 224 | const gpa = comp.gpa; | 226 | const gpa = comp.gpa; |
| 225 | const arena = flush.arena; | 227 | const arena = flush.arena; |
| 226 | const diags = &comp.link_diags; | 228 | const diags = &comp.link_diags; |
| 227 | 229 | const target = &comp.root_mod.resolved_target.result; | |
| 228 | const ids = try gpa.alloc(Id, mir.id_bound); | 230 | const ids = try gpa.alloc(Id, mir.id_bound); |
| 229 | defer gpa.free(ids); | 231 | defer gpa.free(ids); |
| 230 | ids[0] = .none; | 232 | ids[0] = .none; |
| ... | @@ -255,25 +257,22 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { | ... | @@ -255,25 +257,22 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { |
| 255 | try imports.put(gpa, @backingInt(ext.id), @intCast(gop.index)); | 257 | try imports.put(gpa, @backingInt(ext.id), @intCast(gop.index)); |
| 256 | } | 258 | } |
| 257 | 259 | ||
| 258 | const words = mir.module.instructions.items; | 260 | var it = mir.module.iterate(); |
| 259 | var offset: usize = 0; | 261 | while (it.next()) |inst| { |
| 260 | while (offset < words.len) { | 262 | const opcode = inst.opcode; |
| 261 | const start = offset; | 263 | const words = inst.words; |
| 262 | const header: spec.InstructionHeader = @bitCast(words[start]); | 264 | |
| 263 | const inst = words[start..][0..header.word_count]; | 265 | if (opcode == .OpDecorate) { |
| 264 | offset += inst.len; | 266 | const target_id = words[1]; |
| 265 | 267 | const decoration: spec.Decoration = @fromBackingInt(words[2]); | |
| 266 | if (header.opcode == .OpDecorate) { | ||
| 267 | const target = inst[1]; | ||
| 268 | const decoration: spec.Decoration = @fromBackingInt(inst[2]); | ||
| 269 | if (decoration == .linkage_attributes) { | 268 | if (decoration == .linkage_attributes) { |
| 270 | const parameters = inst[3..]; | 269 | const parameters = words[3..]; |
| 271 | const name_words = parameters[0 .. parameters.len - 1]; | 270 | const name_words = parameters[0 .. parameters.len - 1]; |
| 272 | const name = std.mem.sliceTo(std.mem.sliceAsBytes(name_words), 0); | 271 | const name = std.mem.sliceTo(std.mem.sliceAsBytes(name_words), 0); |
| 273 | const linkage: spec.LinkageType = @fromBackingInt(parameters[parameters.len - 1]); | 272 | const linkage: spec.LinkageType = @fromBackingInt(parameters[parameters.len - 1]); |
| 274 | const gop = try flush.symbols.getOrPut(arena, name); | 273 | const gop = try flush.symbols.getOrPut(arena, name); |
| 275 | if (!gop.found_existing) gop.value_ptr.* = .{ | 274 | if (!gop.found_existing) gop.value_ptr.* = .{ |
| 276 | .id = ids[target], | 275 | .id = ids[target_id], |
| 277 | .defined = false, | 276 | .defined = false, |
| 278 | .declaration = &.{}, | 277 | .declaration = &.{}, |
| 279 | }; | 278 | }; |
| ... | @@ -285,130 +284,171 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { | ... | @@ -285,130 +284,171 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { |
| 285 | } | 284 | } |
| 286 | gop.value_ptr.defined = true; | 285 | gop.value_ptr.defined = true; |
| 287 | }, | 286 | }, |
| 288 | .import => try imports.put(gpa, target, @intCast(gop.index)), | 287 | .import => try imports.put(gpa, target_id, @intCast(gop.index)), |
| 289 | .link_once_odr => { | 288 | .link_once_odr => { |
| 290 | return diags.failParse(path.?, "unsupported linkage '{t}'", .{linkage}); | 289 | return diags.failParse(path.?, "unsupported linkage '{t}'", .{linkage}); |
| 291 | }, | 290 | }, |
| 292 | } | 291 | } |
| 293 | 292 | ||
| 294 | ids[target] = gop.value_ptr.id; | 293 | ids[target_id] = gop.value_ptr.id; |
| 295 | continue; | 294 | continue; |
| 296 | } | 295 | } |
| 297 | } | 296 | } |
| 298 | 297 | ||
| 299 | const class = header.opcode.class(); | 298 | const class = opcode.class(); |
| 300 | const target: Word = switch (header.opcode) { | 299 | const target_id: Word = switch (opcode) { |
| 301 | .OpName, .OpMemberName => inst[1], | 300 | .OpName, .OpMemberName => words[1], |
| 302 | .OpDecorationGroup, .OpGroupDecorate, .OpGroupMemberDecorate => { | 301 | .OpDecorationGroup, .OpGroupDecorate, .OpGroupMemberDecorate => { |
| 303 | return diags.failParse(path.?, "decoration groups are not supported", .{}); | 302 | return diags.failParse(path.?, "decoration groups are not supported", .{}); |
| 304 | }, | 303 | }, |
| 305 | else => if (class == .annotation) inst[1] else continue, | 304 | else => if (class == .annotation) words[1] else continue, |
| 306 | }; | 305 | }; |
| 307 | try annotations.append(gpa, .{ | 306 | try annotations.append(gpa, .{ |
| 308 | .target = target, | 307 | .target_id = target_id, |
| 309 | .class = class, | 308 | .class = class, |
| 310 | .start = start, | 309 | .start = inst.start, |
| 311 | .end = offset, | 310 | .end = inst.end, |
| 312 | }); | 311 | }); |
| 313 | } | 312 | } |
| 314 | 313 | ||
| 314 | var result_ids: std.ArrayList(Word) = .empty; | ||
| 315 | defer result_ids.deinit(gpa); | ||
| 316 | |||
| 315 | const starts = try gpa.alloc(u32, mir.id_bound + 1); | 317 | const starts = try gpa.alloc(u32, mir.id_bound + 1); |
| 316 | defer gpa.free(starts); | 318 | defer gpa.free(starts); |
| 317 | @memset(starts, 0); | 319 | @memset(starts, 0); |
| 318 | 320 | ||
| 319 | for (annotations.items) |annotation| starts[annotation.target + 1] += 1; | 321 | for (annotations.items) |annotation| starts[annotation.target_id + 1] += 1; |
| 320 | for (1..starts.len) |i| starts[i] += starts[i - 1]; | 322 | for (1..starts.len) |i| starts[i] += starts[i - 1]; |
| 321 | 323 | ||
| 322 | const cursors = try gpa.dupe(u32, starts); | 324 | const grouped_indices = try gpa.alloc(u32, annotations.items.len); |
| 323 | defer gpa.free(cursors); | 325 | defer gpa.free(grouped_indices); |
| 324 | const by_target = try gpa.alloc(u32, annotations.items.len); | 326 | { |
| 325 | defer gpa.free(by_target); | 327 | const next_slot = try gpa.dupe(u32, starts); |
| 326 | for (annotations.items, 0..) |annotation, i| { | 328 | defer gpa.free(next_slot); |
| 327 | by_target[cursors[annotation.target]] = @intCast(i); | 329 | for (annotations.items, 0..) |annotation, i| { |
| 328 | cursors[annotation.target] += 1; | 330 | grouped_indices[next_slot[annotation.target_id]] = @intCast(i); |
| 331 | next_slot[annotation.target_id] += 1; | ||
| 332 | } | ||
| 329 | } | 333 | } |
| 330 | 334 | ||
| 331 | var results: std.ArrayList(Word) = .empty; | 335 | it = mir.module.iterate(); |
| 332 | defer results.deinit(gpa); | 336 | while (it.next()) |inst| { |
| 333 | 337 | const start = inst.start; | |
| 334 | offset = 0; | 338 | var end = inst.end; |
| 335 | while (offset < words.len) { | 339 | const opcode = inst.opcode; |
| 336 | const start = offset; | 340 | const words = inst.words; |
| 337 | const header: spec.InstructionHeader = @bitCast(words[start]); | ||
| 338 | const inst = words[start..][0..header.word_count]; | ||
| 339 | offset += inst.len; | ||
| 340 | input.mark += 1; | 341 | input.mark += 1; |
| 341 | flush.deps.clearRetainingCapacity(); | 342 | flush.deps.clearRetainingCapacity(); |
| 342 | 343 | ||
| 343 | const result_index = header.opcode.resultIndex() orelse { | 344 | const result_index = opcode.resultIndex() orelse switch (opcode) { |
| 344 | switch (header.opcode) { | 345 | .OpCapability => { |
| 345 | .OpEntryPoint => { | 346 | const capability = std.enums.fromInt(spec.Capability, words[1]) orelse { |
| 346 | try input.copy(flush, &flush.object_entry_points, start, offset, null); | 347 | return diags.failParse(path.?, "unknown capability '{d}'", .{words[1]}); |
| 347 | }, | 348 | }; |
| 348 | .OpExecutionMode, .OpExecutionModeId => { | 349 | |
| 349 | try input.copy(flush, &flush.object_execution_modes, start, offset, null); | 350 | // TODO: this isn't a full validation. we probably have to automate this |
| 350 | }, | 351 | // based on some generated info from SPIRV-Headers/SPIRV-Registry |
| 351 | .OpTypeForwardPointer => { | 352 | const allowed = switch (capability) { |
| 352 | forward_pointers.set(inst[1]); | 353 | .linkage => true, |
| 353 | try input.copy(flush, &flush.globals, start, offset, null); | 354 | .shader => target.os.tag == .vulkan or target.os.tag == .opengl, |
| 354 | }, | 355 | .kernel, .addresses => target.os.tag == .opencl, |
| 355 | else => {}, | 356 | .physical_storage_buffer_addresses => target.os.tag == .vulkan and target.cpu.arch == .spirv64, |
| 356 | } | 357 | else => if (stringToEnum(std.Target.spirv.Feature, @tagName(capability))) |f| target.cpu.has(.spirv, f) else false, |
| 357 | continue; | 358 | }; |
| 359 | if (!allowed) return diags.failParse( | ||
| 360 | path.?, | ||
| 361 | "SPIR-V capability '{t}' is not enabled by the target feature set", | ||
| 362 | .{capability}, | ||
| 363 | ); | ||
| 364 | continue; | ||
| 365 | }, | ||
| 366 | .OpExtension => { | ||
| 367 | const name = std.mem.sliceTo(std.mem.sliceAsBytes(words[1..]), 0); | ||
| 368 | if (std.mem.eql(u8, name, "SPV_KHR_non_semantic_info")) { | ||
| 369 | flush.nonsemantic_info = true; | ||
| 370 | continue; | ||
| 371 | } | ||
| 372 | |||
| 373 | const allowed = allowed: { | ||
| 374 | if (stringToEnum(std.Target.spirv.Feature, name)) |f| { | ||
| 375 | break :allowed target.cpu.has(.spirv, f); | ||
| 376 | } | ||
| 377 | break :allowed true; | ||
| 378 | }; | ||
| 379 | if (!allowed) return diags.failParse( | ||
| 380 | path.?, | ||
| 381 | "SPIR-V extension '{s}' is not enabled by the target feature set", | ||
| 382 | .{name}, | ||
| 383 | ); | ||
| 384 | continue; | ||
| 385 | }, | ||
| 386 | .OpEntryPoint => { | ||
| 387 | try input.copy(flush, &flush.object_entry_points, start, end, null); | ||
| 388 | continue; | ||
| 389 | }, | ||
| 390 | .OpExecutionMode, .OpExecutionModeId => { | ||
| 391 | try input.copy(flush, &flush.object_execution_modes, start, end, null); | ||
| 392 | continue; | ||
| 393 | }, | ||
| 394 | .OpTypeForwardPointer => { | ||
| 395 | forward_pointers.set(words[1]); | ||
| 396 | try input.copy(flush, &flush.globals, start, end, null); | ||
| 397 | continue; | ||
| 398 | }, | ||
| 399 | else => continue, | ||
| 358 | }; | 400 | }; |
| 359 | const result = inst[result_index]; | 401 | |
| 360 | results.clearRetainingCapacity(); | 402 | const result_id = words[result_index]; |
| 361 | try results.append(gpa, result); | 403 | result_ids.clearRetainingCapacity(); |
| 404 | try result_ids.append(gpa, result_id); | ||
| 362 | 405 | ||
| 363 | var has_body = false; | 406 | var has_body = false; |
| 364 | if (header.opcode == .OpFunction) { | 407 | if (opcode == .OpFunction) { |
| 365 | while (true) { | 408 | while (it.next()) |body| { |
| 366 | const body: spec.InstructionHeader = @bitCast(words[offset]); | 409 | end = body.end; |
| 367 | if (body.opcode == .OpLabel) has_body = true; | 410 | if (body.opcode == .OpLabel) has_body = true; |
| 368 | if (body.opcode.resultIndex()) |index| { | 411 | if (body.result_id != .none) try result_ids.append(gpa, @backingInt(body.result_id)); |
| 369 | try results.append(gpa, words[offset + index]); | ||
| 370 | } | ||
| 371 | offset += body.word_count; | ||
| 372 | if (body.opcode == .OpFunctionEnd) break; | 412 | if (body.opcode == .OpFunctionEnd) break; |
| 373 | } | 413 | } |
| 374 | } | 414 | } |
| 375 | 415 | ||
| 376 | for (results.items) |own| input.marks[own] = input.mark; | 416 | for (result_ids.items) |own| input.marks[own] = input.mark; |
| 377 | 417 | ||
| 378 | if (imports.get(result)) |symbol_index| { | 418 | if (imports.get(result_id)) |symbol_index| { |
| 379 | flush.scratch.reset(); | 419 | flush.scratch.reset(); |
| 380 | try input.copy(flush, &flush.scratch, start, offset, null); | 420 | try input.copy(flush, &flush.scratch, start, end, null); |
| 381 | const declaration = try arena.dupe(Word, flush.scratch.instructions.items); | 421 | const declaration = try arena.dupe(Word, flush.scratch.instructions.items); |
| 382 | flush.symbols.values()[symbol_index].declaration = declaration; | 422 | flush.symbols.values()[symbol_index].declaration = declaration; |
| 383 | continue; | 423 | continue; |
| 384 | } | 424 | } |
| 385 | 425 | ||
| 386 | switch (header.opcode) { | 426 | switch (opcode) { |
| 387 | .OpFunction => if (!has_body) return diags.failParse(path.?, "function declaration without linkage", .{}), | 427 | .OpFunction => if (!has_body) return diags.failParse(path.?, "function declaration without linkage", .{}), |
| 388 | .OpVariable => try flush.variables.put(arena, ids[result], @fromBackingInt(inst[3])), | 428 | .OpVariable => try flush.variables.put(arena, ids[result_id], @fromBackingInt(words[3])), |
| 389 | else => if (!forward_pointers.isSet(result)) { | 429 | else => if (!forward_pointers.isSet(result_id)) { |
| 390 | flush.scratch.reset(); | 430 | flush.scratch.reset(); |
| 391 | try input.copy(flush, &flush.scratch, start, offset, start + result_index); | 431 | try input.copy(flush, &flush.scratch, start, end, start + result_index); |
| 392 | for (by_target[starts[result]..starts[result + 1]]) |index| { | 432 | for (grouped_indices[starts[result_id]..starts[result_id + 1]]) |index| { |
| 393 | const annotation = annotations.items[index]; | 433 | const annotation = annotations.items[index]; |
| 394 | if (annotation.class != .annotation) continue; | 434 | if (annotation.class != .annotation) continue; |
| 395 | const target = annotation.start + 1; | 435 | const target_id = annotation.start + 1; |
| 396 | try input.copy(flush, &flush.scratch, annotation.start, annotation.end, target); | 436 | try input.copy(flush, &flush.scratch, annotation.start, annotation.end, target_id); |
| 397 | } | 437 | } |
| 398 | 438 | ||
| 399 | const key = std.mem.sliceAsBytes(flush.scratch.instructions.items); | 439 | const key = std.mem.sliceAsBytes(flush.scratch.instructions.items); |
| 400 | const gop = try flush.interned.getOrPut(arena, key); | 440 | const gop = try flush.interned.getOrPut(arena, key); |
| 401 | if (gop.found_existing) { | 441 | if (gop.found_existing) { |
| 402 | ids[result] = gop.value_ptr.*; | 442 | ids[result_id] = gop.value_ptr.*; |
| 403 | continue; | 443 | continue; |
| 404 | } | 444 | } |
| 405 | gop.key_ptr.* = try arena.dupe(u8, key); | 445 | gop.key_ptr.* = try arena.dupe(u8, key); |
| 406 | gop.value_ptr.* = ids[result]; | 446 | gop.value_ptr.* = ids[result_id]; |
| 407 | }, | 447 | }, |
| 408 | } | 448 | } |
| 409 | 449 | ||
| 410 | for (results.items) |target| { | 450 | for (result_ids.items) |target_id| { |
| 411 | for (by_target[starts[target]..starts[target + 1]]) |index| { | 451 | for (grouped_indices[starts[target_id]..starts[target_id + 1]]) |index| { |
| 412 | const annotation = annotations.items[index]; | 452 | const annotation = annotations.items[index]; |
| 413 | const section = switch (annotation.class) { | 453 | const section = switch (annotation.class) { |
| 414 | .debug => &flush.names, | 454 | .debug => &flush.names, |
| ... | @@ -419,16 +459,16 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { | ... | @@ -419,16 +459,16 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { |
| 419 | } | 459 | } |
| 420 | } | 460 | } |
| 421 | 461 | ||
| 422 | const section = switch (header.opcode) { | 462 | const section = switch (opcode) { |
| 423 | .OpFunction => &flush.functions, | 463 | .OpFunction => &flush.functions, |
| 424 | .OpExtInstImport => &flush.extended_instruction_sets, | 464 | .OpExtInstImport => &flush.extended_instruction_sets, |
| 425 | .OpString => &flush.debug_strings, | 465 | .OpString => &flush.debug_strings, |
| 426 | else => &flush.globals, | 466 | else => &flush.globals, |
| 427 | }; | 467 | }; |
| 428 | try input.copy(flush, section, start, offset, null); | 468 | try input.copy(flush, section, start, end, null); |
| 429 | if (header.opcode == .OpFunction) { | 469 | if (opcode == .OpFunction) { |
| 430 | const references = try arena.dupe(Id, flush.deps.items); | 470 | const references = try arena.dupe(Id, flush.deps.items); |
| 431 | try flush.function_references.put(arena, ids[result], references); | 471 | try flush.fn_refs.put(arena, ids[result_id], references); |
| 432 | } | 472 | } |
| 433 | } | 473 | } |
| 434 | 474 | ||
| ... | @@ -468,25 +508,26 @@ fn emitCapabilities(flush: *Flush, out: *Section) link.Error!void { | ... | @@ -468,25 +508,26 @@ fn emitCapabilities(flush: *Flush, out: *Section) link.Error!void { |
| 468 | try out.emit(gpa, .OpCapability, .{ .capability = .linkage }); | 508 | try out.emit(gpa, .OpCapability, .{ .capability = .linkage }); |
| 469 | } | 509 | } |
| 470 | 510 | ||
| 471 | inline for (@typeInfo(spec.Capability).@"enum".field_names) |name| { | 511 | for (std.enums.values(spec.Capability)) |capability| { |
| 472 | if (@hasField(std.Target.spirv.Feature, name)) { | 512 | const feature = stringToEnum(std.Target.spirv.Feature, @tagName(capability)) orelse continue; |
| 473 | const feature = @field(std.Target.spirv.Feature, name); | 513 | if (!target.cpu.has(.spirv, feature)) continue; |
| 474 | if (target.cpu.has(.spirv, feature)) { | 514 | try out.emit(gpa, .OpCapability, .{ .capability = capability }); |
| 475 | try out.emit(gpa, .OpCapability, .{ .capability = @field(spec.Capability, name) }); | ||
| 476 | } | ||
| 477 | } | ||
| 478 | } | 515 | } |
| 479 | 516 | ||
| 480 | if (target.cpu.arch == .spirv64 and target.os.tag == .vulkan) { | 517 | if (target.cpu.arch == .spirv64 and target.os.tag == .vulkan) { |
| 481 | try out.emit(gpa, .OpExtension, .{ .name = "SPV_KHR_physical_storage_buffer" }); | 518 | try out.emit(gpa, .OpExtension, .{ .name = "SPV_KHR_physical_storage_buffer" }); |
| 482 | } | 519 | } |
| 483 | 520 | ||
| 484 | inline for (@typeInfo(spec.Extension).@"enum".field_names) |name| { | 521 | for (std.enums.values(spec.Extension)) |extension| { |
| 485 | if (comptime std.mem.startsWith(u8, name, "v1_")) continue; | 522 | const name = @tagName(extension); |
| 486 | if (@hasField(std.Target.spirv.Feature, name)) { | 523 | if (std.mem.startsWith(u8, name, "v1_")) continue; |
| 487 | const feature = @field(std.Target.spirv.Feature, name); | 524 | const feature = stringToEnum(std.Target.spirv.Feature, name) orelse continue; |
| 488 | if (target.cpu.has(.spirv, feature)) try out.emit(gpa, .OpExtension, .{ .name = name }); | 525 | if (!target.cpu.has(.spirv, feature)) continue; |
| 489 | } | 526 | try out.emit(gpa, .OpExtension, .{ .name = name }); |
| 527 | } | ||
| 528 | |||
| 529 | if (flush.nonsemantic_info) { | ||
| 530 | try out.emit(gpa, .OpExtension, .{ .name = "SPV_KHR_non_semantic_info" }); | ||
| 490 | } | 531 | } |
| 491 | } | 532 | } |
| 492 | 533 | ||
| ... | @@ -547,7 +588,7 @@ fn emitEntryPoints(flush: *Flush, out: *Section) link.Error!void { | ... | @@ -547,7 +588,7 @@ fn emitEntryPoints(flush: *Flush, out: *Section) link.Error!void { |
| 547 | if (storage_class == .function) continue; | 588 | if (storage_class == .function) continue; |
| 548 | if (!v1_4 and storage_class != .input and storage_class != .output) continue; | 589 | if (!v1_4 and storage_class != .input and storage_class != .output) continue; |
| 549 | try interface.append(arena, id); | 590 | try interface.append(arena, id); |
| 550 | } else if (flush.function_references.get(id)) |references| { | 591 | } else if (flush.fn_refs.get(id)) |references| { |
| 551 | try pending.appendSlice(arena, references); | 592 | try pending.appendSlice(arena, references); |
| 552 | } | 593 | } |
| 553 | } | 594 | } |
src/main.zig+29| ... | @@ -3582,6 +3582,35 @@ fn buildOutputType( | ... | @@ -3582,6 +3582,35 @@ fn buildOutputType( |
| 3582 | @import("codegen/llvm/bindings.zig").ParseCommandLineOptions(argv.len, &argv); | 3582 | @import("codegen/llvm/bindings.zig").ParseCommandLineOptions(argv.len, &argv); |
| 3583 | } | 3583 | } |
| 3584 | 3584 | ||
| 3585 | if (build_options.have_llvm and create_module.resolved_options.use_llvm and target.cpu.arch.isSpirv()) { | ||
| 3586 | // LLVM has no way to set this non-globally other | ||
| 3587 | // than SPIRVTranslate() but it cannot emits assembly. | ||
| 3588 | var extensions: std.ArrayList(u8) = .empty; | ||
| 3589 | defer extensions.deinit(gpa); | ||
| 3590 | try extensions.appendSlice(gpa, "--spirv-ext="); | ||
| 3591 | |||
| 3592 | var has_extension = false; | ||
| 3593 | if (!root_mod.strip) { | ||
| 3594 | try extensions.appendSlice(gpa, "+SPV_KHR_non_semantic_info"); | ||
| 3595 | has_extension = true; | ||
| 3596 | } | ||
| 3597 | |||
| 3598 | for (std.enums.values(std.Target.spirv.Feature)) |feature| { | ||
| 3599 | const name = @tagName(feature); | ||
| 3600 | if (!mem.startsWith(u8, name, "SPV_")) continue; | ||
| 3601 | if (!target.cpu.has(.spirv, feature)) continue; | ||
| 3602 | if (mem.eql(u8, name, "SPV_KHR_variable_pointers") and target.cpu.has(.spirv, .v1_3)) continue; | ||
| 3603 | |||
| 3604 | if (has_extension) try extensions.append(gpa, ','); | ||
| 3605 | try extensions.append(gpa, '+'); | ||
| 3606 | try extensions.appendSlice(gpa, name); | ||
| 3607 | has_extension = true; | ||
| 3608 | } | ||
| 3609 | |||
| 3610 | const argv = [_][*:0]const u8{ "zig (LLVM option parsing)", try extensions.toOwnedSliceSentinel(gpa, 0) }; | ||
| 3611 | @import("codegen/llvm/bindings.zig").ParseCommandLineOptions(argv.len, &argv); | ||
| 3612 | } | ||
| 3613 | |||
| 3585 | const clang_passthrough_mode = switch (arg_mode) { | 3614 | const clang_passthrough_mode = switch (arg_mode) { |
| 3586 | .cc, .cpp, .translate_c => true, | 3615 | .cc, .cpp, .translate_c => true, |
| 3587 | else => false, | 3616 | else => false, |
src/target.zig+23-33| ... | @@ -310,7 +310,7 @@ pub fn hasNewLinker(ofmt: std.Target.ObjectFormat) bool { | ... | @@ -310,7 +310,7 @@ pub fn hasNewLinker(ofmt: std.Target.ObjectFormat) bool { |
| 310 | /// than or equal to the number of behavior tests as the respective LLVM backend. | 310 | /// than or equal to the number of behavior tests as the respective LLVM backend. |
| 311 | pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool { | 311 | pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool { |
| 312 | if (comptime builtin.cpu.arch.endian() == .big) return false; // https://github.com/ziglang/zig/issues/25961 | 312 | if (comptime builtin.cpu.arch.endian() == .big) return false; // https://github.com/ziglang/zig/issues/25961 |
| 313 | if (target.cpu.arch.isSpirV()) return true; | 313 | if (target.cpu.arch.isSpirv()) return true; |
| 314 | if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) { | 314 | if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) { |
| 315 | if (target.os.tag == .illumos) { | 315 | if (target.os.tag == .illumos) { |
| 316 | // https://github.com/ziglang/zig/issues/25699 | 316 | // https://github.com/ziglang/zig/issues/25699 |
| ... | @@ -635,38 +635,28 @@ pub fn addrSpaceCastIsValid( | ... | @@ -635,38 +635,28 @@ pub fn addrSpaceCastIsValid( |
| 635 | } | 635 | } |
| 636 | } | 636 | } |
| 637 | 637 | ||
| 638 | /// Returns whether pointer operations (arithmetic, indexing, etc.) should be blocked | 638 | /// Returns true if the given address space memory model is logical (i.e. arithmetic pointer |
| 639 | /// for the given address space on the target architecture. | 639 | /// operations are illegal). |
| 640 | /// | 640 | pub fn addrSpaceIsLogical(target: *const std.Target, as: AddressSpace) bool { |
| 641 | /// Under SPIR-V with Vulkan | 641 | const features = &target.cpu.features; |
| 642 | /// (a) all physical pointers (.physical_storage_buffer, .global) always support pointer operations, | 642 | return switch (target.os.tag) { |
| 643 | /// (b) by default logical pointers (.constant, .input, .output, etc.) never support operations | 643 | .vulkan, .opengl => switch (as) { |
| 644 | /// (c) some logical pointers (.storage_buffer, .shared) do support operations when | 644 | .generic, |
| 645 | /// the VariablePointers capability is enabled (which enables OpPtrAccessChain). | 645 | .constant, |
| 646 | pub fn shouldBlockPointerOps(target: *const std.Target, as: AddressSpace) bool { | 646 | .local, |
| 647 | if (target.os.tag != .vulkan and target.os.tag != .opengl) return false; | 647 | .private, |
| 648 | 648 | .input, | |
| 649 | return switch (as) { | 649 | .output, |
| 650 | // TODO: Vulkan doesn't support pointers in the generic address space, we | 650 | .uniform, |
| 651 | // should remove this case but this requires a change in defaultAddressSpace(). | 651 | .push_constant, |
| 652 | .generic => true, | 652 | => true, |
| 653 | // For now, all global pointers are represented using StorageBuffer or CrossWorkgroup, | 653 | .shared => !features.isEnabled(@backingInt(std.Target.spirv.Feature.variable_pointers)), |
| 654 | // so these are real pointers. | 654 | .storage_buffer => !features.isEnabled(@backingInt(std.Target.spirv.Feature.variable_pointers)) and |
| 655 | // Physical pointers always support operations | 655 | !features.isEnabled(@backingInt(std.Target.spirv.Feature.variable_pointers_storage_buffer)), |
| 656 | .global, .physical_storage_buffer => false, | 656 | .physical_storage_buffer => false, |
| 657 | // Logical pointers that support operations with VariablePointers capability | 657 | else => unreachable, |
| 658 | .shared => !target.cpu.features.isEnabled(@backingInt(std.Target.spirv.Feature.variable_pointers)), | 658 | }, |
| 659 | .storage_buffer => !target.cpu.features.isEnabled(@backingInt(std.Target.spirv.Feature.variable_pointers)), | 659 | else => false, |
| 660 | // Logical pointers that never support operations | ||
| 661 | .constant, | ||
| 662 | .local, | ||
| 663 | .private, | ||
| 664 | .input, | ||
| 665 | .output, | ||
| 666 | .uniform, | ||
| 667 | .push_constant, | ||
| 668 | => true, | ||
| 669 | else => unreachable, | ||
| 670 | }; | 660 | }; |
| 671 | } | 661 | } |
| 672 | 662 |
test/behavior.zig+5-5| ... | @@ -115,21 +115,21 @@ test { | ... | @@ -115,21 +115,21 @@ test { |
| 115 | _ = @import("behavior/wasm.zig"); | 115 | _ = @import("behavior/wasm.zig"); |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | if (builtin.zig_backend == .stage2_spirv) { | 118 | if (builtin.cpu.arch.isSpirv()) { |
| 119 | _ = @import("behavior/spirv.zig"); | 119 | _ = @import("behavior/spirv.zig"); |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | if (builtin.zig_backend != .stage2_spirv and builtin.os.tag != .wasi) { | 122 | if (!builtin.cpu.arch.isSpirv() and builtin.os.tag != .wasi) { |
| 123 | _ = @import("behavior/asm.zig"); | 123 | _ = @import("behavior/asm.zig"); |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | if (builtin.zig_backend != .stage2_arm and | 126 | if (builtin.zig_backend != .stage2_arm and |
| 127 | builtin.zig_backend != .stage2_spirv) | 127 | !builtin.cpu.arch.isSpirv()) |
| 128 | { | 128 | { |
| 129 | _ = @import("behavior/export_keyword.zig"); | 129 | _ = @import("behavior/export_keyword.zig"); |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | if (builtin.zig_backend != .stage2_spirv and !builtin.cpu.arch.isWasm()) { | 132 | if (!builtin.cpu.arch.isSpirv() and !builtin.cpu.arch.isWasm()) { |
| 133 | // Due to lack of import/export of global support | 133 | // Due to lack of import/export of global support |
| 134 | // (https://github.com/ziglang/zig/issues/4866), these tests correctly | 134 | // (https://github.com/ziglang/zig/issues/4866), these tests correctly |
| 135 | // cause linker errors, since a data symbol cannot be exported when | 135 | // cause linker errors, since a data symbol cannot be exported when |
| ... | @@ -143,7 +143,7 @@ test { | ... | @@ -143,7 +143,7 @@ test { |
| 143 | // This bug only repros in the root file | 143 | // This bug only repros in the root file |
| 144 | test "dereference @embedFile() of a file full of zero bytes" { | 144 | test "dereference @embedFile() of a file full of zero bytes" { |
| 145 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 145 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 146 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 146 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 147 | 147 | ||
| 148 | const contents = @embedFile("behavior/zero.bin").*; | 148 | const contents = @embedFile("behavior/zero.bin").*; |
| 149 | try @import("std").testing.expect(contents.len == 456); | 149 | try @import("std").testing.expect(contents.len == 456); |
test/behavior/abs.zig+13-7| ... | @@ -4,6 +4,7 @@ const assert = std.debug.assert; | ... | @@ -4,6 +4,7 @@ const assert = std.debug.assert; |
| 4 | const expect = std.testing.expect; | 4 | const expect = std.testing.expect; |
| 5 | 5 | ||
| 6 | test "@abs integers" { | 6 | test "@abs integers" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 7 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 9 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 10 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -49,6 +50,7 @@ fn testAbsIntegers() !void { | ... | @@ -49,6 +50,7 @@ fn testAbsIntegers() !void { |
| 49 | } | 50 | } |
| 50 | 51 | ||
| 51 | test "@abs signed C ABI integers" { | 52 | test "@abs signed C ABI integers" { |
| 53 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 52 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 54 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 53 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 55 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 54 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 56 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -60,7 +62,7 @@ test "@abs signed C ABI integers" { | ... | @@ -60,7 +62,7 @@ test "@abs signed C ABI integers" { |
| 60 | try testOne(c_short, c_ushort); | 62 | try testOne(c_short, c_ushort); |
| 61 | try testOne(c_int, c_uint); | 63 | try testOne(c_int, c_uint); |
| 62 | try testOne(c_long, c_ulong); | 64 | try testOne(c_long, c_ulong); |
| 63 | if (!builtin.cpu.arch.isSpirV()) try testOne(c_longlong, c_ulonglong); | 65 | if (!builtin.cpu.arch.isSpirv()) try testOne(c_longlong, c_ulonglong); |
| 64 | } | 66 | } |
| 65 | fn testOne(comptime Signed: type, comptime Unsigned: type) !void { | 67 | fn testOne(comptime Signed: type, comptime Unsigned: type) !void { |
| 66 | var negative_one: Signed = undefined; | 68 | var negative_one: Signed = undefined; |
| ... | @@ -76,6 +78,7 @@ test "@abs signed C ABI integers" { | ... | @@ -76,6 +78,7 @@ test "@abs signed C ABI integers" { |
| 76 | } | 78 | } |
| 77 | 79 | ||
| 78 | test "@abs unsigned integers" { | 80 | test "@abs unsigned integers" { |
| 81 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 79 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 82 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 80 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 83 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 81 | 84 | ||
| ... | @@ -115,6 +118,7 @@ fn testAbsUnsignedIntegers() !void { | ... | @@ -115,6 +118,7 @@ fn testAbsUnsignedIntegers() !void { |
| 115 | } | 118 | } |
| 116 | 119 | ||
| 117 | test "@abs unsigned C ABI integers" { | 120 | test "@abs unsigned C ABI integers" { |
| 121 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 118 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 122 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 119 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 123 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 120 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 124 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -125,7 +129,7 @@ test "@abs unsigned C ABI integers" { | ... | @@ -125,7 +129,7 @@ test "@abs unsigned C ABI integers" { |
| 125 | try testOne(c_ushort); | 129 | try testOne(c_ushort); |
| 126 | try testOne(c_uint); | 130 | try testOne(c_uint); |
| 127 | try testOne(c_ulong); | 131 | try testOne(c_ulong); |
| 128 | if (!builtin.cpu.arch.isSpirV()) try testOne(c_ulonglong); | 132 | if (!builtin.cpu.arch.isSpirv()) try testOne(c_ulonglong); |
| 129 | } | 133 | } |
| 130 | fn testOne(comptime Unsigned: type) !void { | 134 | fn testOne(comptime Unsigned: type) !void { |
| 131 | var one: Unsigned = undefined; | 135 | var one: Unsigned = undefined; |
| ... | @@ -141,6 +145,7 @@ test "@abs unsigned C ABI integers" { | ... | @@ -141,6 +145,7 @@ test "@abs unsigned C ABI integers" { |
| 141 | } | 145 | } |
| 142 | 146 | ||
| 143 | test "@abs big int <= 128 bits" { | 147 | test "@abs big int <= 128 bits" { |
| 148 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 149 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 145 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 150 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 146 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 151 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| ... | @@ -203,6 +208,7 @@ fn testAbsUnsignedBigInt() !void { | ... | @@ -203,6 +208,7 @@ fn testAbsUnsignedBigInt() !void { |
| 203 | test "@abs floats" { | 208 | test "@abs floats" { |
| 204 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 209 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 205 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 210 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 211 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Fails on lavapipe | ||
| 206 | 212 | ||
| 207 | try comptime testAbsFloats(f16); | 213 | try comptime testAbsFloats(f16); |
| 208 | if (builtin.zig_backend != .stage2_riscv64) try testAbsFloats(f16); | 214 | if (builtin.zig_backend != .stage2_riscv64) try testAbsFloats(f16); |
| ... | @@ -211,9 +217,9 @@ test "@abs floats" { | ... | @@ -211,9 +217,9 @@ test "@abs floats" { |
| 211 | try comptime testAbsFloats(f64); | 217 | try comptime testAbsFloats(f64); |
| 212 | try testAbsFloats(f64); | 218 | try testAbsFloats(f64); |
| 213 | try comptime testAbsFloats(f80); | 219 | try comptime testAbsFloats(f80); |
| 214 | if (builtin.zig_backend != .stage2_spirv and builtin.zig_backend != .stage2_riscv64) try testAbsFloats(f80); | 220 | if (!builtin.cpu.arch.isSpirv() and builtin.zig_backend != .stage2_riscv64) try testAbsFloats(f80); |
| 215 | try comptime testAbsFloats(f128); | 221 | try comptime testAbsFloats(f128); |
| 216 | if (builtin.zig_backend != .stage2_spirv and builtin.zig_backend != .stage2_riscv64) try testAbsFloats(f128); | 222 | if (!builtin.cpu.arch.isSpirv() and builtin.zig_backend != .stage2_riscv64) try testAbsFloats(f128); |
| 217 | } | 223 | } |
| 218 | 224 | ||
| 219 | fn testAbsFloats(comptime T: type) !void { | 225 | fn testAbsFloats(comptime T: type) !void { |
| ... | @@ -258,7 +264,7 @@ test "@abs int vectors" { | ... | @@ -258,7 +264,7 @@ test "@abs int vectors" { |
| 258 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 264 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 259 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 265 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 260 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 266 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 261 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 267 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 262 | 268 | ||
| 263 | try comptime testAbsIntVectors(1); | 269 | try comptime testAbsIntVectors(1); |
| 264 | try testAbsIntVectors(1); | 270 | try testAbsIntVectors(1); |
| ... | @@ -324,7 +330,7 @@ test "@abs unsigned int vectors" { | ... | @@ -324,7 +330,7 @@ test "@abs unsigned int vectors" { |
| 324 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 330 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 325 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 331 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 326 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 332 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 327 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 333 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 328 | 334 | ||
| 329 | try comptime testAbsUnsignedIntVectors(1); | 335 | try comptime testAbsUnsignedIntVectors(1); |
| 330 | try testAbsUnsignedIntVectors(1); | 336 | try testAbsUnsignedIntVectors(1); |
| ... | @@ -381,7 +387,7 @@ test "@abs float vectors" { | ... | @@ -381,7 +387,7 @@ test "@abs float vectors" { |
| 381 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 387 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 382 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 388 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 383 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 389 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 384 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 390 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 385 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 391 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 386 | 392 | ||
| 387 | @setEvalBranchQuota(2000); | 393 | @setEvalBranchQuota(2000); |
test/behavior/addrspace_and_linksection.zig+3-3| ... | @@ -12,7 +12,7 @@ const var_linksection = linksections.?[1]; | ... | @@ -12,7 +12,7 @@ const var_linksection = linksections.?[1]; |
| 12 | const fn_linksection = linksections.?[2]; | 12 | const fn_linksection = linksections.?[2]; |
| 13 | 13 | ||
| 14 | test "addrspace on container-level const" { | 14 | test "addrspace on container-level const" { |
| 15 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 15 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 16 | 16 | ||
| 17 | const S = struct { | 17 | const S = struct { |
| 18 | const a: u32 addrspace(.generic) = 123; | 18 | const a: u32 addrspace(.generic) = 123; |
| ... | @@ -49,7 +49,7 @@ test "addrspace and linksection on container-level const" { | ... | @@ -49,7 +49,7 @@ test "addrspace and linksection on container-level const" { |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | test "addrspace on container-level var" { | 51 | test "addrspace on container-level var" { |
| 52 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 52 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 53 | 53 | ||
| 54 | const S = struct { | 54 | const S = struct { |
| 55 | var a: u32 addrspace(.generic) = 123; | 55 | var a: u32 addrspace(.generic) = 123; |
| ... | @@ -83,7 +83,7 @@ test "addrspace and linksection on container-level var" { | ... | @@ -83,7 +83,7 @@ test "addrspace and linksection on container-level var" { |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | test "addrspace on fn" { | 85 | test "addrspace on fn" { |
| 86 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 86 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 87 | 87 | ||
| 88 | const S = struct { | 88 | const S = struct { |
| 89 | fn f() addrspace(.generic) u32 { | 89 | fn f() addrspace(.generic) u32 { |
test/behavior/align.zig+27-23| ... | @@ -7,7 +7,7 @@ const assert = std.debug.assert; | ... | @@ -7,7 +7,7 @@ const assert = std.debug.assert; |
| 7 | var foo: u8 align(4) = 100; | 7 | var foo: u8 align(4) = 100; |
| 8 | 8 | ||
| 9 | test "global variable alignment" { | 9 | test "global variable alignment" { |
| 10 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 10 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 11 | 11 | ||
| 12 | comptime assert(@typeInfo(@TypeOf(&foo)).pointer.attrs.@"align" == 4); | 12 | comptime assert(@typeInfo(@TypeOf(&foo)).pointer.attrs.@"align" == 4); |
| 13 | comptime assert(@TypeOf(&foo) == *align(4) u8); | 13 | comptime assert(@TypeOf(&foo) == *align(4) u8); |
| ... | @@ -18,7 +18,7 @@ test "global variable alignment" { | ... | @@ -18,7 +18,7 @@ test "global variable alignment" { |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | test "large abi alignment of global" { | 20 | test "large abi alignment of global" { |
| 21 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 21 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 22 | 22 | ||
| 23 | const S = struct { | 23 | const S = struct { |
| 24 | var global: @This() = undefined; | 24 | var global: @This() = undefined; |
| ... | @@ -30,7 +30,7 @@ test "large abi alignment of global" { | ... | @@ -30,7 +30,7 @@ test "large abi alignment of global" { |
| 30 | 30 | ||
| 31 | test "large alignment of local constant" { | 31 | test "large alignment of local constant" { |
| 32 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 32 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 33 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // flaky | 33 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // flaky |
| 34 | if (builtin.zig_backend == .stage2_c and builtin.target.abi == .msvc) return error.SkipZigTest; | 34 | if (builtin.zig_backend == .stage2_c and builtin.target.abi == .msvc) return error.SkipZigTest; |
| 35 | 35 | ||
| 36 | if (builtin.zig_backend == .stage2_x86_64 and builtin.os.tag == .windows) { | 36 | if (builtin.zig_backend == .stage2_x86_64 and builtin.os.tag == .windows) { |
| ... | @@ -44,7 +44,7 @@ test "large alignment of local constant" { | ... | @@ -44,7 +44,7 @@ test "large alignment of local constant" { |
| 44 | 44 | ||
| 45 | test "slicing array of length 1 can not assume runtime index is always zero" { | 45 | test "slicing array of length 1 can not assume runtime index is always zero" { |
| 46 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 46 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 47 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // flaky | 47 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // flaky |
| 48 | 48 | ||
| 49 | var runtime_index: usize = 1; | 49 | var runtime_index: usize = 1; |
| 50 | _ = &runtime_index; | 50 | _ = &runtime_index; |
| ... | @@ -55,7 +55,7 @@ test "slicing array of length 1 can not assume runtime index is always zero" { | ... | @@ -55,7 +55,7 @@ test "slicing array of length 1 can not assume runtime index is always zero" { |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | test "implicitly-aligned pointer is coercible to equivalent explicitly-aligned pointer" { | 57 | test "implicitly-aligned pointer is coercible to equivalent explicitly-aligned pointer" { |
| 58 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 58 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 59 | 59 | ||
| 60 | const A = *u32; | 60 | const A = *u32; |
| 61 | const B = *align(@alignOf(u32)) u32; | 61 | const B = *align(@alignOf(u32)) u32; |
| ... | @@ -89,6 +89,8 @@ test "implicitly-aligned pointer is coercible to equivalent explicitly-aligned p | ... | @@ -89,6 +89,8 @@ test "implicitly-aligned pointer is coercible to equivalent explicitly-aligned p |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | test "implicitly decreasing pointer alignment" { | 91 | test "implicitly decreasing pointer alignment" { |
| 92 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 93 | |||
| 92 | const a: u32 align(4) = 3; | 94 | const a: u32 align(4) = 3; |
| 93 | const b: u32 align(8) = 4; | 95 | const b: u32 align(8) = 4; |
| 94 | try expect(addUnaligned(&a, &b) == 7); | 96 | try expect(addUnaligned(&a, &b) == 7); |
| ... | @@ -240,7 +242,7 @@ test "alignment and size of structs with 128-bit fields" { | ... | @@ -240,7 +242,7 @@ test "alignment and size of structs with 128-bit fields" { |
| 240 | 242 | ||
| 241 | test "implicitly decreasing slice alignment" { | 243 | test "implicitly decreasing slice alignment" { |
| 242 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 244 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 243 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 245 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 244 | const a: u32 align(4) = 3; | 246 | const a: u32 align(4) = 3; |
| 245 | const b: u32 align(8) = 4; | 247 | const b: u32 align(8) = 4; |
| 246 | try expect(addUnalignedSlice(@as(*const [1]u32, &a)[0..], @as(*const [1]u32, &b)[0..]) == 7); | 248 | try expect(addUnalignedSlice(@as(*const [1]u32, &a)[0..], @as(*const [1]u32, &b)[0..]) == 7); |
| ... | @@ -251,7 +253,7 @@ fn addUnalignedSlice(a: []align(1) const u32, b: []align(1) const u32) u32 { | ... | @@ -251,7 +253,7 @@ fn addUnalignedSlice(a: []align(1) const u32, b: []align(1) const u32) u32 { |
| 251 | 253 | ||
| 252 | test "specifying alignment allows pointer cast" { | 254 | test "specifying alignment allows pointer cast" { |
| 253 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 255 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 254 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 256 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 255 | 257 | ||
| 256 | try testBytesAlign(0x33); | 258 | try testBytesAlign(0x33); |
| 257 | } | 259 | } |
| ... | @@ -264,7 +266,7 @@ fn testBytesAlign(b: u8) !void { | ... | @@ -264,7 +266,7 @@ fn testBytesAlign(b: u8) !void { |
| 264 | test "@alignCast slices" { | 266 | test "@alignCast slices" { |
| 265 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 267 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 266 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 268 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 267 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 269 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 268 | 270 | ||
| 269 | var array align(4) = [_]u32{ 1, 1 }; | 271 | var array align(4) = [_]u32{ 1, 1 }; |
| 270 | const slice = array[0..]; | 272 | const slice = array[0..]; |
| ... | @@ -279,6 +281,7 @@ fn sliceExpects4(slice: []align(4) u32) void { | ... | @@ -279,6 +281,7 @@ fn sliceExpects4(slice: []align(4) u32) void { |
| 279 | } | 281 | } |
| 280 | 282 | ||
| 281 | test "return error union with 128-bit integer" { | 283 | test "return error union with 128-bit integer" { |
| 284 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 282 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 285 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 283 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 286 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 284 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 287 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -292,7 +295,7 @@ test "page aligned array on stack" { | ... | @@ -292,7 +295,7 @@ test "page aligned array on stack" { |
| 292 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 295 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 293 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 296 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 294 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 297 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 295 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 298 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 296 | // Large alignment value to make it hard to accidentally pass. | 299 | // Large alignment value to make it hard to accidentally pass. |
| 297 | var array align(0x1000) = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 }; | 300 | var array align(0x1000) = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 }; |
| 298 | var number1: u8 align(16) = 42; | 301 | var number1: u8 align(16) = 42; |
| ... | @@ -310,7 +313,7 @@ test "page aligned array on stack" { | ... | @@ -310,7 +313,7 @@ test "page aligned array on stack" { |
| 310 | test "function alignment" { | 313 | test "function alignment" { |
| 311 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 314 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 312 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 315 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 313 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 316 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 314 | 317 | ||
| 315 | // function alignment greater than 1 is a compile error on wasm | 318 | // function alignment greater than 1 is a compile error on wasm |
| 316 | if (native_arch.isWasm()) return error.SkipZigTest; | 319 | if (native_arch.isWasm()) return error.SkipZigTest; |
| ... | @@ -339,7 +342,7 @@ test "function alignment" { | ... | @@ -339,7 +342,7 @@ test "function alignment" { |
| 339 | test "implicitly decreasing fn alignment" { | 342 | test "implicitly decreasing fn alignment" { |
| 340 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 343 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 341 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 344 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 342 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 345 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 343 | 346 | ||
| 344 | // function alignment greater than 1 is a compile error on wasm | 347 | // function alignment greater than 1 is a compile error on wasm |
| 345 | if (native_arch.isWasm()) return error.SkipZigTest; | 348 | if (native_arch.isWasm()) return error.SkipZigTest; |
| ... | @@ -362,7 +365,7 @@ fn alignedBig() align(16) i32 { | ... | @@ -362,7 +365,7 @@ fn alignedBig() align(16) i32 { |
| 362 | test "@alignCast functions" { | 365 | test "@alignCast functions" { |
| 363 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 366 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 364 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 367 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 365 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 368 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 366 | 369 | ||
| 367 | // function alignment greater than 1 is a compile error on wasm | 370 | // function alignment greater than 1 is a compile error on wasm |
| 368 | if (native_arch.isWasm()) return error.SkipZigTest; | 371 | if (native_arch.isWasm()) return error.SkipZigTest; |
| ... | @@ -381,7 +384,7 @@ fn simple4() align(4) i32 { | ... | @@ -381,7 +384,7 @@ fn simple4() align(4) i32 { |
| 381 | 384 | ||
| 382 | test "runtime-known array index has best alignment possible" { | 385 | test "runtime-known array index has best alignment possible" { |
| 383 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 386 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 384 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 387 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 385 | 388 | ||
| 386 | // take full advantage of over-alignment | 389 | // take full advantage of over-alignment |
| 387 | var array align(4) = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 }; | 390 | var array align(4) = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 }; |
| ... | @@ -430,7 +433,7 @@ fn testIndex2(ptr: [*]align(4) u8, index: usize, comptime T: type) !void { | ... | @@ -430,7 +433,7 @@ fn testIndex2(ptr: [*]align(4) u8, index: usize, comptime T: type) !void { |
| 430 | } | 433 | } |
| 431 | 434 | ||
| 432 | test "alignment of function with c calling convention" { | 435 | test "alignment of function with c calling convention" { |
| 433 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 436 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 434 | 437 | ||
| 435 | const a = @alignOf(@TypeOf(nothing)); | 438 | const a = @alignOf(@TypeOf(nothing)); |
| 436 | 439 | ||
| ... | @@ -449,6 +452,7 @@ const DefaultAligned = struct { | ... | @@ -449,6 +452,7 @@ const DefaultAligned = struct { |
| 449 | }; | 452 | }; |
| 450 | 453 | ||
| 451 | test "read 128-bit field from default aligned struct in stack memory" { | 454 | test "read 128-bit field from default aligned struct in stack memory" { |
| 455 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 452 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 456 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 453 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 457 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 454 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 458 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -467,7 +471,7 @@ var default_aligned_global = DefaultAligned{ | ... | @@ -467,7 +471,7 @@ var default_aligned_global = DefaultAligned{ |
| 467 | }; | 471 | }; |
| 468 | 472 | ||
| 469 | test "read 128-bit field from default aligned struct in global memory" { | 473 | test "read 128-bit field from default aligned struct in global memory" { |
| 470 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 474 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 471 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 475 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 472 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 476 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 473 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 477 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -478,7 +482,7 @@ test "read 128-bit field from default aligned struct in global memory" { | ... | @@ -478,7 +482,7 @@ test "read 128-bit field from default aligned struct in global memory" { |
| 478 | test "struct field explicit alignment" { | 482 | test "struct field explicit alignment" { |
| 479 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 483 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 480 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 484 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 481 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // flaky | 485 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // flaky |
| 482 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 486 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 483 | 487 | ||
| 484 | const S = struct { | 488 | const S = struct { |
| ... | @@ -498,7 +502,7 @@ test "struct field explicit alignment" { | ... | @@ -498,7 +502,7 @@ test "struct field explicit alignment" { |
| 498 | test "align(N) on functions" { | 502 | test "align(N) on functions" { |
| 499 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 503 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 500 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 504 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 501 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 505 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 502 | 506 | ||
| 503 | if (builtin.zig_backend == .stage2_c) { | 507 | if (builtin.zig_backend == .stage2_c) { |
| 504 | // https://github.com/ziglang/zig/issues/16845 | 508 | // https://github.com/ziglang/zig/issues/16845 |
| ... | @@ -536,7 +540,7 @@ test "comptime alloc alignment" { | ... | @@ -536,7 +540,7 @@ test "comptime alloc alignment" { |
| 536 | 540 | ||
| 537 | test "@alignCast null" { | 541 | test "@alignCast null" { |
| 538 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 542 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 539 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 543 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 540 | 544 | ||
| 541 | var ptr: ?*anyopaque = null; | 545 | var ptr: ?*anyopaque = null; |
| 542 | _ = &ptr; | 546 | _ = &ptr; |
| ... | @@ -552,7 +556,7 @@ test "alignment of slice element" { | ... | @@ -552,7 +556,7 @@ test "alignment of slice element" { |
| 552 | test "sub-aligned pointer field access" { | 556 | test "sub-aligned pointer field access" { |
| 553 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 557 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 554 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 558 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 555 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 559 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 556 | 560 | ||
| 557 | // Originally reported at https://github.com/ziglang/zig/issues/14904 | 561 | // Originally reported at https://github.com/ziglang/zig/issues/14904 |
| 558 | 562 | ||
| ... | @@ -570,7 +574,7 @@ test "sub-aligned pointer field access" { | ... | @@ -570,7 +574,7 @@ test "sub-aligned pointer field access" { |
| 570 | } | 574 | } |
| 571 | 575 | ||
| 572 | test "alignment of zero-bit types is respected" { | 576 | test "alignment of zero-bit types is respected" { |
| 573 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 577 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 574 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 578 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 575 | 579 | ||
| 576 | const S = struct { arr: [0]usize = .{} }; | 580 | const S = struct { arr: [0]usize = .{} }; |
| ... | @@ -602,7 +606,7 @@ test "zero-bit fields in extern struct pad fields appropriately" { | ... | @@ -602,7 +606,7 @@ test "zero-bit fields in extern struct pad fields appropriately" { |
| 602 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 606 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 603 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 607 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 604 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 608 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 605 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 609 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 606 | 610 | ||
| 607 | const S = extern struct { | 611 | const S = extern struct { |
| 608 | x: u8, | 612 | x: u8, |
| ... | @@ -626,7 +630,7 @@ test "zero-bit fields in extern struct pad fields appropriately" { | ... | @@ -626,7 +630,7 @@ test "zero-bit fields in extern struct pad fields appropriately" { |
| 626 | } | 630 | } |
| 627 | 631 | ||
| 628 | test "function pointer @intFromPtr/@ptrFromInt roundtrip" { | 632 | test "function pointer @intFromPtr/@ptrFromInt roundtrip" { |
| 629 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 633 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 630 | 634 | ||
| 631 | // This only succeeds on Thumb if we handle the Thumb bit correctly; if not, the `@ptrFromInt` | 635 | // This only succeeds on Thumb if we handle the Thumb bit correctly; if not, the `@ptrFromInt` |
| 632 | // will incorrectly trip an alignment safety check. | 636 | // will incorrectly trip an alignment safety check. |
| ... | @@ -646,7 +650,7 @@ test "function pointer align mask" { | ... | @@ -646,7 +650,7 @@ test "function pointer align mask" { |
| 646 | } | 650 | } |
| 647 | 651 | ||
| 648 | test "align expression is implicitly comptime" { | 652 | test "align expression is implicitly comptime" { |
| 649 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 653 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 650 | 654 | ||
| 651 | const S = struct { | 655 | const S = struct { |
| 652 | fn alignment() usize { | 656 | fn alignment() usize { |
test/behavior/alignof.zig+2-1| ... | @@ -19,6 +19,7 @@ test "@alignOf(T) before referencing T" { | ... | @@ -19,6 +19,7 @@ test "@alignOf(T) before referencing T" { |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | test "comparison of @alignOf(T) against zero" { | 21 | test "comparison of @alignOf(T) against zero" { |
| 22 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 22 | const T = struct { x: u32 }; | 23 | const T = struct { x: u32 }; |
| 23 | try expect(!(@alignOf(T) == 0)); | 24 | try expect(!(@alignOf(T) == 0)); |
| 24 | try expect(@alignOf(T) != 0); | 25 | try expect(@alignOf(T) != 0); |
| ... | @@ -29,7 +30,7 @@ test "comparison of @alignOf(T) against zero" { | ... | @@ -29,7 +30,7 @@ test "comparison of @alignOf(T) against zero" { |
| 29 | } | 30 | } |
| 30 | 31 | ||
| 31 | test "correct alignment for elements and slices of aligned array" { | 32 | test "correct alignment for elements and slices of aligned array" { |
| 32 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 33 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 33 | 34 | ||
| 34 | var buf: [1024]u8 align(64) = undefined; | 35 | var buf: [1024]u8 align(64) = undefined; |
| 35 | var start: usize = 1; | 36 | var start: usize = 1; |
test/behavior/array.zig+52-36| ... | @@ -7,7 +7,7 @@ const expect = testing.expect; | ... | @@ -7,7 +7,7 @@ const expect = testing.expect; |
| 7 | const expectEqual = testing.expectEqual; | 7 | const expectEqual = testing.expectEqual; |
| 8 | 8 | ||
| 9 | test "array to slice" { | 9 | test "array to slice" { |
| 10 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 10 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 11 | 11 | ||
| 12 | const a: u32 align(4) = 3; | 12 | const a: u32 align(4) = 3; |
| 13 | const b: u32 align(8) = 4; | 13 | const b: u32 align(8) = 4; |
| ... | @@ -21,7 +21,7 @@ test "array to slice" { | ... | @@ -21,7 +21,7 @@ test "array to slice" { |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | test "arrays" { | 23 | test "arrays" { |
| 24 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 24 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 25 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 25 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 26 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 26 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 27 | 27 | ||
| ... | @@ -51,7 +51,7 @@ fn getArrayLen(a: []const u32) usize { | ... | @@ -51,7 +51,7 @@ fn getArrayLen(a: []const u32) usize { |
| 51 | test "runtime array concat with comptime slice" { | 51 | test "runtime array concat with comptime slice" { |
| 52 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 52 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 53 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 53 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 54 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 54 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 55 | var a: [1]u8 = .{1}; | 55 | var a: [1]u8 = .{1}; |
| 56 | const b = (comptime @as([]const u8, &.{0})) ++ &a; | 56 | const b = (comptime @as([]const u8, &.{0})) ++ &a; |
| 57 | const c = &a ++ (comptime @as([]const u8, &.{0})); | 57 | const c = &a ++ (comptime @as([]const u8, &.{0})); |
| ... | @@ -61,7 +61,7 @@ test "runtime array concat with comptime slice" { | ... | @@ -61,7 +61,7 @@ test "runtime array concat with comptime slice" { |
| 61 | 61 | ||
| 62 | test "array concat with undefined" { | 62 | test "array concat with undefined" { |
| 63 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 63 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 64 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 64 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 65 | 65 | ||
| 66 | const S = struct { | 66 | const S = struct { |
| 67 | fn doTheTest() !void { | 67 | fn doTheTest() !void { |
| ... | @@ -83,7 +83,7 @@ test "array concat with undefined" { | ... | @@ -83,7 +83,7 @@ test "array concat with undefined" { |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | test "array concat with tuple" { | 85 | test "array concat with tuple" { |
| 86 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 86 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 87 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 87 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 88 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 88 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 89 | 89 | ||
| ... | @@ -99,7 +99,7 @@ test "array concat with tuple" { | ... | @@ -99,7 +99,7 @@ test "array concat with tuple" { |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | test "array concat with undefined tuple" { | 101 | test "array concat with undefined tuple" { |
| 102 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 102 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 103 | 103 | ||
| 104 | { | 104 | { |
| 105 | const array: [2]u64 = .{ 1, 2 }; | 105 | const array: [2]u64 = .{ 1, 2 }; |
| ... | @@ -117,7 +117,7 @@ test "array concat with undefined tuple" { | ... | @@ -117,7 +117,7 @@ test "array concat with undefined tuple" { |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | test "array init with concat" { | 119 | test "array init with concat" { |
| 120 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 120 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 121 | 121 | ||
| 122 | const a = 'a'; | 122 | const a = 'a'; |
| 123 | var i: [4]u8 = [2]u8{ a, 'b' } ++ [2]u8{ 'c', 'd' }; | 123 | var i: [4]u8 = [2]u8{ a, 'b' } ++ [2]u8{ 'c', 'd' }; |
| ... | @@ -152,6 +152,7 @@ const ArrayDotLenConstExpr = struct { | ... | @@ -152,6 +152,7 @@ const ArrayDotLenConstExpr = struct { |
| 152 | const some_array = [_]u8{ 0, 1, 2, 3 }; | 152 | const some_array = [_]u8{ 0, 1, 2, 3 }; |
| 153 | 153 | ||
| 154 | test "array literal with specified size" { | 154 | test "array literal with specified size" { |
| 155 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 155 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 156 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 156 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 157 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 157 | 158 | ||
| ... | @@ -162,6 +163,7 @@ test "array literal with specified size" { | ... | @@ -162,6 +163,7 @@ test "array literal with specified size" { |
| 162 | } | 163 | } |
| 163 | 164 | ||
| 164 | test "array len field" { | 165 | test "array len field" { |
| 166 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 165 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 167 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 166 | 168 | ||
| 167 | var arr = [4]u8{ 0, 0, 0, 0 }; | 169 | var arr = [4]u8{ 0, 0, 0, 0 }; |
| ... | @@ -174,7 +176,7 @@ test "array len field" { | ... | @@ -174,7 +176,7 @@ test "array len field" { |
| 174 | } | 176 | } |
| 175 | 177 | ||
| 176 | test "array with sentinels" { | 178 | test "array with sentinels" { |
| 177 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 179 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 178 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 180 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 179 | 181 | ||
| 180 | const S = struct { | 182 | const S = struct { |
| ... | @@ -211,7 +213,7 @@ test "void arrays" { | ... | @@ -211,7 +213,7 @@ test "void arrays" { |
| 211 | } | 213 | } |
| 212 | 214 | ||
| 213 | test "nested arrays of strings" { | 215 | test "nested arrays of strings" { |
| 214 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 216 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 215 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 217 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 216 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 218 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 217 | 219 | ||
| ... | @@ -226,6 +228,7 @@ test "nested arrays of strings" { | ... | @@ -226,6 +228,7 @@ test "nested arrays of strings" { |
| 226 | } | 228 | } |
| 227 | 229 | ||
| 228 | test "nested arrays of integers" { | 230 | test "nested arrays of integers" { |
| 231 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 229 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 232 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 230 | 233 | ||
| 231 | const array_of_numbers = [_][2]u8{ | 234 | const array_of_numbers = [_][2]u8{ |
| ... | @@ -240,6 +243,7 @@ test "nested arrays of integers" { | ... | @@ -240,6 +243,7 @@ test "nested arrays of integers" { |
| 240 | } | 243 | } |
| 241 | 244 | ||
| 242 | test "implicit comptime in array type size" { | 245 | test "implicit comptime in array type size" { |
| 246 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 243 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 247 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 244 | 248 | ||
| 245 | var arr: [plusOne(10)]bool = undefined; | 249 | var arr: [plusOne(10)]bool = undefined; |
| ... | @@ -253,7 +257,7 @@ fn plusOne(x: u32) u32 { | ... | @@ -253,7 +257,7 @@ fn plusOne(x: u32) u32 { |
| 253 | 257 | ||
| 254 | test "single-item pointer to array indexing and slicing" { | 258 | test "single-item pointer to array indexing and slicing" { |
| 255 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 259 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 256 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 260 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 257 | 261 | ||
| 258 | try testSingleItemPtrArrayIndexSlice(); | 262 | try testSingleItemPtrArrayIndexSlice(); |
| 259 | try comptime testSingleItemPtrArrayIndexSlice(); | 263 | try comptime testSingleItemPtrArrayIndexSlice(); |
| ... | @@ -279,7 +283,7 @@ fn doSomeMangling(array: *[4]u8) void { | ... | @@ -279,7 +283,7 @@ fn doSomeMangling(array: *[4]u8) void { |
| 279 | 283 | ||
| 280 | test "implicit cast zero sized array ptr to slice" { | 284 | test "implicit cast zero sized array ptr to slice" { |
| 281 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 285 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 282 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 286 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 283 | 287 | ||
| 284 | { | 288 | { |
| 285 | var b = "".*; | 289 | var b = "".*; |
| ... | @@ -294,6 +298,7 @@ test "implicit cast zero sized array ptr to slice" { | ... | @@ -294,6 +298,7 @@ test "implicit cast zero sized array ptr to slice" { |
| 294 | } | 298 | } |
| 295 | 299 | ||
| 296 | test "anonymous list literal syntax" { | 300 | test "anonymous list literal syntax" { |
| 301 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 297 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 302 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 298 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 303 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 299 | 304 | ||
| ... | @@ -315,7 +320,7 @@ var s_array: [8]Sub = undefined; | ... | @@ -315,7 +320,7 @@ var s_array: [8]Sub = undefined; |
| 315 | const Sub = struct { b: u8 }; | 320 | const Sub = struct { b: u8 }; |
| 316 | const Str = struct { a: []Sub }; | 321 | const Str = struct { a: []Sub }; |
| 317 | test "set global var array via slice embedded in struct" { | 322 | test "set global var array via slice embedded in struct" { |
| 318 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 323 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 319 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 324 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 320 | 325 | ||
| 321 | var s = Str{ .a = s_array[0..] }; | 326 | var s = Str{ .a = s_array[0..] }; |
| ... | @@ -330,7 +335,7 @@ test "set global var array via slice embedded in struct" { | ... | @@ -330,7 +335,7 @@ test "set global var array via slice embedded in struct" { |
| 330 | } | 335 | } |
| 331 | 336 | ||
| 332 | test "implicit cast single-item pointer" { | 337 | test "implicit cast single-item pointer" { |
| 333 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 338 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 334 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 339 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 335 | 340 | ||
| 336 | try testImplicitCastSingleItemPtr(); | 341 | try testImplicitCastSingleItemPtr(); |
| ... | @@ -359,7 +364,7 @@ test "comptime evaluating function that takes array by value" { | ... | @@ -359,7 +364,7 @@ test "comptime evaluating function that takes array by value" { |
| 359 | } | 364 | } |
| 360 | 365 | ||
| 361 | test "runtime initialize array elem and then implicit cast to slice" { | 366 | test "runtime initialize array elem and then implicit cast to slice" { |
| 362 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 367 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 363 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 368 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 364 | 369 | ||
| 365 | var two: i32 = 2; | 370 | var two: i32 = 2; |
| ... | @@ -369,7 +374,7 @@ test "runtime initialize array elem and then implicit cast to slice" { | ... | @@ -369,7 +374,7 @@ test "runtime initialize array elem and then implicit cast to slice" { |
| 369 | } | 374 | } |
| 370 | 375 | ||
| 371 | test "array literal as argument to function" { | 376 | test "array literal as argument to function" { |
| 372 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 377 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 373 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 378 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 374 | 379 | ||
| 375 | const S = struct { | 380 | const S = struct { |
| ... | @@ -396,7 +401,7 @@ test "array literal as argument to function" { | ... | @@ -396,7 +401,7 @@ test "array literal as argument to function" { |
| 396 | } | 401 | } |
| 397 | 402 | ||
| 398 | test "double nested array to const slice cast in array literal" { | 403 | test "double nested array to const slice cast in array literal" { |
| 399 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 404 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 400 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 405 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 401 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 406 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 402 | 407 | ||
| ... | @@ -457,6 +462,7 @@ test "double nested array to const slice cast in array literal" { | ... | @@ -457,6 +462,7 @@ test "double nested array to const slice cast in array literal" { |
| 457 | } | 462 | } |
| 458 | 463 | ||
| 459 | test "anonymous literal in array" { | 464 | test "anonymous literal in array" { |
| 465 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 460 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 466 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 461 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 467 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 462 | 468 | ||
| ... | @@ -482,6 +488,7 @@ test "anonymous literal in array" { | ... | @@ -482,6 +488,7 @@ test "anonymous literal in array" { |
| 482 | } | 488 | } |
| 483 | 489 | ||
| 484 | test "access the null element of a null terminated array" { | 490 | test "access the null element of a null terminated array" { |
| 491 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 485 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 492 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 486 | 493 | ||
| 487 | const S = struct { | 494 | const S = struct { |
| ... | @@ -499,6 +506,7 @@ test "access the null element of a null terminated array" { | ... | @@ -499,6 +506,7 @@ test "access the null element of a null terminated array" { |
| 499 | } | 506 | } |
| 500 | 507 | ||
| 501 | test "type deduction for array subscript expression" { | 508 | test "type deduction for array subscript expression" { |
| 509 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 502 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 510 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 503 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 511 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 504 | 512 | ||
| ... | @@ -517,7 +525,7 @@ test "type deduction for array subscript expression" { | ... | @@ -517,7 +525,7 @@ test "type deduction for array subscript expression" { |
| 517 | } | 525 | } |
| 518 | 526 | ||
| 519 | test "sentinel element count towards the ABI size calculation" { | 527 | test "sentinel element count towards the ABI size calculation" { |
| 520 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 528 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 521 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 529 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 522 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 530 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 523 | 531 | ||
| ... | @@ -542,7 +550,7 @@ test "sentinel element count towards the ABI size calculation" { | ... | @@ -542,7 +550,7 @@ test "sentinel element count towards the ABI size calculation" { |
| 542 | 550 | ||
| 543 | test "type coercion of anon struct literal to array" { | 551 | test "type coercion of anon struct literal to array" { |
| 544 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 552 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 545 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 553 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 546 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 554 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 547 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 555 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 548 | 556 | ||
| ... | @@ -582,7 +590,7 @@ test "array with comptime-only element type" { | ... | @@ -582,7 +590,7 @@ test "array with comptime-only element type" { |
| 582 | } | 590 | } |
| 583 | 591 | ||
| 584 | test "tuple to array handles sentinel" { | 592 | test "tuple to array handles sentinel" { |
| 585 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 593 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 586 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 594 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 587 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 595 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 588 | 596 | ||
| ... | @@ -612,7 +620,7 @@ test "array-like to array handles sentinel" { | ... | @@ -612,7 +620,7 @@ test "array-like to array handles sentinel" { |
| 612 | } | 620 | } |
| 613 | 621 | ||
| 614 | test "array init of container level array variable" { | 622 | test "array init of container level array variable" { |
| 615 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 623 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 616 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 624 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 617 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 625 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 618 | 626 | ||
| ... | @@ -635,7 +643,7 @@ test "array init of container level array variable" { | ... | @@ -635,7 +643,7 @@ test "array init of container level array variable" { |
| 635 | } | 643 | } |
| 636 | 644 | ||
| 637 | test "runtime initialized sentinel-terminated array literal" { | 645 | test "runtime initialized sentinel-terminated array literal" { |
| 638 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 646 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 639 | 647 | ||
| 640 | var c: u16 = 300; | 648 | var c: u16 = 300; |
| 641 | _ = &c; | 649 | _ = &c; |
| ... | @@ -646,6 +654,7 @@ test "runtime initialized sentinel-terminated array literal" { | ... | @@ -646,6 +654,7 @@ test "runtime initialized sentinel-terminated array literal" { |
| 646 | } | 654 | } |
| 647 | 655 | ||
| 648 | test "array of array agregate init" { | 656 | test "array of array agregate init" { |
| 657 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 649 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 658 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 650 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 659 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 651 | 660 | ||
| ... | @@ -656,7 +665,7 @@ test "array of array agregate init" { | ... | @@ -656,7 +665,7 @@ test "array of array agregate init" { |
| 656 | } | 665 | } |
| 657 | 666 | ||
| 658 | test "pointer to array has ptr field" { | 667 | test "pointer to array has ptr field" { |
| 659 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 668 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 660 | 669 | ||
| 661 | const S = struct { | 670 | const S = struct { |
| 662 | fn doTheTest(p: *const [5]u32) !void { | 671 | fn doTheTest(p: *const [5]u32) !void { |
| ... | @@ -692,6 +701,7 @@ test "discarded array init preserves result location" { | ... | @@ -692,6 +701,7 @@ test "discarded array init preserves result location" { |
| 692 | } | 701 | } |
| 693 | 702 | ||
| 694 | test "array init with no result location has result type" { | 703 | test "array init with no result location has result type" { |
| 704 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 695 | const x = .{ .foo = [2]u16{ | 705 | const x = .{ .foo = [2]u16{ |
| 696 | @intCast(10), | 706 | @intCast(10), |
| 697 | @intCast(20), | 707 | @intCast(20), |
| ... | @@ -705,7 +715,7 @@ test "array init with no result location has result type" { | ... | @@ -705,7 +715,7 @@ test "array init with no result location has result type" { |
| 705 | test "slicing array of zero-sized values" { | 715 | test "slicing array of zero-sized values" { |
| 706 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 716 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 707 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 717 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 708 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 718 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 709 | 719 | ||
| 710 | var arr: [32]u0 = undefined; | 720 | var arr: [32]u0 = undefined; |
| 711 | for (arr[0..]) |*zero| | 721 | for (arr[0..]) |*zero| |
| ... | @@ -715,6 +725,7 @@ test "slicing array of zero-sized values" { | ... | @@ -715,6 +725,7 @@ test "slicing array of zero-sized values" { |
| 715 | } | 725 | } |
| 716 | 726 | ||
| 717 | test "array init with no result pointer sets field result types" { | 727 | test "array init with no result pointer sets field result types" { |
| 728 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 718 | const S = struct { | 729 | const S = struct { |
| 719 | // A function parameter has a result type, but no result pointer. | 730 | // A function parameter has a result type, but no result pointer. |
| 720 | fn f(arr: [1]u32) u32 { | 731 | fn f(arr: [1]u32) u32 { |
| ... | @@ -729,7 +740,7 @@ test "array init with no result pointer sets field result types" { | ... | @@ -729,7 +740,7 @@ test "array init with no result pointer sets field result types" { |
| 729 | } | 740 | } |
| 730 | 741 | ||
| 731 | test "runtime side-effects in comptime-known array init" { | 742 | test "runtime side-effects in comptime-known array init" { |
| 732 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 743 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 733 | 744 | ||
| 734 | var side_effects: u4 = 0; | 745 | var side_effects: u4 = 0; |
| 735 | const init = [4]u4{ | 746 | const init = [4]u4{ |
| ... | @@ -755,7 +766,7 @@ test "runtime side-effects in comptime-known array init" { | ... | @@ -755,7 +766,7 @@ test "runtime side-effects in comptime-known array init" { |
| 755 | } | 766 | } |
| 756 | 767 | ||
| 757 | test "slice initialized through reference to anonymous array init provides result types" { | 768 | test "slice initialized through reference to anonymous array init provides result types" { |
| 758 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 769 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 759 | 770 | ||
| 760 | var my_u32: u32 = 123; | 771 | var my_u32: u32 = 123; |
| 761 | var my_u64: u64 = 456; | 772 | var my_u64: u64 = 456; |
| ... | @@ -770,7 +781,7 @@ test "slice initialized through reference to anonymous array init provides resul | ... | @@ -770,7 +781,7 @@ test "slice initialized through reference to anonymous array init provides resul |
| 770 | } | 781 | } |
| 771 | 782 | ||
| 772 | test "sentinel-terminated slice initialized through reference to anonymous array init provides result types" { | 783 | test "sentinel-terminated slice initialized through reference to anonymous array init provides result types" { |
| 773 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 784 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 774 | 785 | ||
| 775 | var my_u32: u32 = 123; | 786 | var my_u32: u32 = 123; |
| 776 | var my_u64: u64 = 456; | 787 | var my_u64: u64 = 456; |
| ... | @@ -785,7 +796,7 @@ test "sentinel-terminated slice initialized through reference to anonymous array | ... | @@ -785,7 +796,7 @@ test "sentinel-terminated slice initialized through reference to anonymous array |
| 785 | } | 796 | } |
| 786 | 797 | ||
| 787 | test "many-item pointer initialized through reference to anonymous array init provides result types" { | 798 | test "many-item pointer initialized through reference to anonymous array init provides result types" { |
| 788 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 799 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 789 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 800 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 790 | 801 | ||
| 791 | var my_u32: u32 = 123; | 802 | var my_u32: u32 = 123; |
| ... | @@ -804,7 +815,7 @@ test "many-item pointer initialized through reference to anonymous array init pr | ... | @@ -804,7 +815,7 @@ test "many-item pointer initialized through reference to anonymous array init pr |
| 804 | } | 815 | } |
| 805 | 816 | ||
| 806 | test "many-item sentinel-terminated pointer initialized through reference to anonymous array init provides result types" { | 817 | test "many-item sentinel-terminated pointer initialized through reference to anonymous array init provides result types" { |
| 807 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 818 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 808 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 819 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 809 | 820 | ||
| 810 | var my_u32: u32 = 123; | 821 | var my_u32: u32 = 123; |
| ... | @@ -824,7 +835,7 @@ test "many-item sentinel-terminated pointer initialized through reference to ano | ... | @@ -824,7 +835,7 @@ test "many-item sentinel-terminated pointer initialized through reference to ano |
| 824 | } | 835 | } |
| 825 | 836 | ||
| 826 | test "pointer to array initialized through reference to anonymous array init provides result types" { | 837 | test "pointer to array initialized through reference to anonymous array init provides result types" { |
| 827 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 838 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 828 | 839 | ||
| 829 | var my_u32: u32 = 123; | 840 | var my_u32: u32 = 123; |
| 830 | var my_u64: u64 = 456; | 841 | var my_u64: u64 = 456; |
| ... | @@ -839,7 +850,7 @@ test "pointer to array initialized through reference to anonymous array init pro | ... | @@ -839,7 +850,7 @@ test "pointer to array initialized through reference to anonymous array init pro |
| 839 | } | 850 | } |
| 840 | 851 | ||
| 841 | test "pointer to sentinel-terminated array initialized through reference to anonymous array init provides result types" { | 852 | test "pointer to sentinel-terminated array initialized through reference to anonymous array init provides result types" { |
| 842 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 853 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 843 | 854 | ||
| 844 | var my_u32: u32 = 123; | 855 | var my_u32: u32 = 123; |
| 845 | var my_u64: u64 = 456; | 856 | var my_u64: u64 = 456; |
| ... | @@ -854,6 +865,7 @@ test "pointer to sentinel-terminated array initialized through reference to anon | ... | @@ -854,6 +865,7 @@ test "pointer to sentinel-terminated array initialized through reference to anon |
| 854 | } | 865 | } |
| 855 | 866 | ||
| 856 | test "tuple initialized through reference to anonymous array init provides result types" { | 867 | test "tuple initialized through reference to anonymous array init provides result types" { |
| 868 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 857 | const Tuple = struct { u64, *const u32 }; | 869 | const Tuple = struct { u64, *const u32 }; |
| 858 | const foo: *const Tuple = &.{ | 870 | const foo: *const Tuple = &.{ |
| 859 | @intCast(12345), | 871 | @intCast(12345), |
| ... | @@ -864,6 +876,7 @@ test "tuple initialized through reference to anonymous array init provides resul | ... | @@ -864,6 +876,7 @@ test "tuple initialized through reference to anonymous array init provides resul |
| 864 | } | 876 | } |
| 865 | 877 | ||
| 866 | test "copied array element doesn't alias source" { | 878 | test "copied array element doesn't alias source" { |
| 879 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 867 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 880 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 868 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 881 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 869 | 882 | ||
| ... | @@ -878,7 +891,7 @@ test "copied array element doesn't alias source" { | ... | @@ -878,7 +891,7 @@ test "copied array element doesn't alias source" { |
| 878 | 891 | ||
| 879 | test "array initialized with string literal" { | 892 | test "array initialized with string literal" { |
| 880 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 893 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 881 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 894 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 882 | 895 | ||
| 883 | const S = struct { | 896 | const S = struct { |
| 884 | a: u32, | 897 | a: u32, |
| ... | @@ -898,7 +911,7 @@ test "array initialized with string literal" { | ... | @@ -898,7 +911,7 @@ test "array initialized with string literal" { |
| 898 | } | 911 | } |
| 899 | 912 | ||
| 900 | test "array initialized with array with sentinel" { | 913 | test "array initialized with array with sentinel" { |
| 901 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 914 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 902 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 915 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 903 | 916 | ||
| 904 | const S = struct { | 917 | const S = struct { |
| ... | @@ -919,6 +932,7 @@ test "array initialized with array with sentinel" { | ... | @@ -919,6 +932,7 @@ test "array initialized with array with sentinel" { |
| 919 | } | 932 | } |
| 920 | 933 | ||
| 921 | test "store array of array of structs at comptime" { | 934 | test "store array of array of structs at comptime" { |
| 935 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 922 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 936 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 923 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 937 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 924 | 938 | ||
| ... | @@ -944,7 +958,7 @@ test "store array of array of structs at comptime" { | ... | @@ -944,7 +958,7 @@ test "store array of array of structs at comptime" { |
| 944 | 958 | ||
| 945 | test "accessing multidimensional global array at comptime" { | 959 | test "accessing multidimensional global array at comptime" { |
| 946 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 960 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 947 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 961 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 948 | 962 | ||
| 949 | const S = struct { | 963 | const S = struct { |
| 950 | const array = [_][]const []const u8{ | 964 | const array = [_][]const []const u8{ |
| ... | @@ -958,6 +972,7 @@ test "accessing multidimensional global array at comptime" { | ... | @@ -958,6 +972,7 @@ test "accessing multidimensional global array at comptime" { |
| 958 | } | 972 | } |
| 959 | 973 | ||
| 960 | test "union that needs padding bytes inside an array" { | 974 | test "union that needs padding bytes inside an array" { |
| 975 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 961 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 976 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 962 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 977 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 963 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 978 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -981,7 +996,7 @@ test "union that needs padding bytes inside an array" { | ... | @@ -981,7 +996,7 @@ test "union that needs padding bytes inside an array" { |
| 981 | } | 996 | } |
| 982 | 997 | ||
| 983 | test "runtime index of array of zero-bit values" { | 998 | test "runtime index of array of zero-bit values" { |
| 984 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 999 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 985 | 1000 | ||
| 986 | var runtime: struct { array: [1]void, index: usize } = undefined; | 1001 | var runtime: struct { array: [1]void, index: usize } = undefined; |
| 987 | runtime = .{ .array = .{{}}, .index = 0 }; | 1002 | runtime = .{ .array = .{{}}, .index = 0 }; |
| ... | @@ -1035,7 +1050,7 @@ test "initialize pointer to anyopaque with reference to empty array initializer" | ... | @@ -1035,7 +1050,7 @@ test "initialize pointer to anyopaque with reference to empty array initializer" |
| 1035 | } | 1050 | } |
| 1036 | 1051 | ||
| 1037 | test "sentinel of runtime-known array initialization is populated" { | 1052 | test "sentinel of runtime-known array initialization is populated" { |
| 1038 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1053 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1039 | 1054 | ||
| 1040 | var rt: u32 = undefined; | 1055 | var rt: u32 = undefined; |
| 1041 | rt = 42; | 1056 | rt = 42; |
| ... | @@ -1048,6 +1063,7 @@ test "sentinel of runtime-known array initialization is populated" { | ... | @@ -1048,6 +1063,7 @@ test "sentinel of runtime-known array initialization is populated" { |
| 1048 | } | 1063 | } |
| 1049 | 1064 | ||
| 1050 | test "resist alias of explicit copy of array passed as arg" { | 1065 | test "resist alias of explicit copy of array passed as arg" { |
| 1066 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1051 | const S = struct { | 1067 | const S = struct { |
| 1052 | const Thing = [1]u32; | 1068 | const Thing = [1]u32; |
| 1053 | 1069 | ||
| ... | @@ -1069,7 +1085,7 @@ test "resist alias of explicit copy of array passed as arg" { | ... | @@ -1069,7 +1085,7 @@ test "resist alias of explicit copy of array passed as arg" { |
| 1069 | } | 1085 | } |
| 1070 | 1086 | ||
| 1071 | test "access element through reference" { | 1087 | test "access element through reference" { |
| 1072 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1088 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1073 | 1089 | ||
| 1074 | const S = struct { | 1090 | const S = struct { |
| 1075 | fn doTheTest(x: u8) !void { | 1091 | fn doTheTest(x: u8) !void { |
test/behavior/asm.zig+3-3| ... | @@ -18,7 +18,7 @@ comptime { | ... | @@ -18,7 +18,7 @@ comptime { |
| 18 | \\.type this_is_my_alias, @function; | 18 | \\.type this_is_my_alias, @function; |
| 19 | \\.set this_is_my_alias, derp; | 19 | \\.set this_is_my_alias, derp; |
| 20 | ); | 20 | ); |
| 21 | } else if (builtin.zig_backend == .stage2_spirv) { | 21 | } else if (builtin.cpu.arch.isSpirv()) { |
| 22 | asm ( | 22 | asm ( |
| 23 | \\%a = OpString "hello there" | 23 | \\%a = OpString "hello there" |
| 24 | ); | 24 | ); |
| ... | @@ -43,7 +43,7 @@ test "output constraint modifiers" { | ... | @@ -43,7 +43,7 @@ test "output constraint modifiers" { |
| 43 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | 43 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 44 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 44 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 45 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 45 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 46 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 46 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 47 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 47 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 48 | 48 | ||
| 49 | if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // MSVC doesn't support inline assembly | 49 | if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // MSVC doesn't support inline assembly |
| ... | @@ -65,7 +65,7 @@ test "alternative constraints" { | ... | @@ -65,7 +65,7 @@ test "alternative constraints" { |
| 65 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | 65 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 66 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 66 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 67 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 67 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 68 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 68 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 69 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 69 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 70 | 70 | ||
| 71 | if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // MSVC doesn't support inline assembly | 71 | if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // MSVC doesn't support inline assembly |
test/behavior/atomics.zig+11-11| ... | @@ -14,7 +14,7 @@ test "cmpxchg" { | ... | @@ -14,7 +14,7 @@ test "cmpxchg" { |
| 14 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 14 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 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_arm) return error.SkipZigTest; // TODO | 16 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 17 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 17 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 18 | 18 | ||
| 19 | try testCmpxchg(); | 19 | try testCmpxchg(); |
| 20 | try comptime testCmpxchg(); | 20 | try comptime testCmpxchg(); |
| ... | @@ -41,7 +41,7 @@ test "atomicrmw and atomicload" { | ... | @@ -41,7 +41,7 @@ test "atomicrmw and atomicload" { |
| 41 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 41 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 42 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 42 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 43 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 43 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 44 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 44 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 45 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 45 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 46 | 46 | ||
| 47 | var data: u8 = 200; | 47 | var data: u8 = 200; |
| ... | @@ -70,7 +70,7 @@ test "cmpxchg with ptr" { | ... | @@ -70,7 +70,7 @@ test "cmpxchg with ptr" { |
| 70 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 70 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 71 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 71 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 72 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 72 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 73 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 73 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 74 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 74 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 75 | 75 | ||
| 76 | var data1: i32 = 1234; | 76 | var data1: i32 = 1234; |
| ... | @@ -96,7 +96,7 @@ test "cmpxchg with ignored result" { | ... | @@ -96,7 +96,7 @@ test "cmpxchg with ignored result" { |
| 96 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 96 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 97 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 97 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 98 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 98 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 99 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 99 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 100 | 100 | ||
| 101 | var x: i32 = 1234; | 101 | var x: i32 = 1234; |
| 102 | 102 | ||
| ... | @@ -141,7 +141,7 @@ test "cmpxchg on a global variable" { | ... | @@ -141,7 +141,7 @@ test "cmpxchg on a global variable" { |
| 141 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 141 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 142 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 142 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 143 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 143 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 144 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 144 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 145 | 145 | ||
| 146 | _ = @cmpxchgStrong(u32, &a_global_variable, 1234, 42, .acquire, .monotonic); | 146 | _ = @cmpxchgStrong(u32, &a_global_variable, 1234, 42, .acquire, .monotonic); |
| 147 | try expect(a_global_variable == 42); | 147 | try expect(a_global_variable == 42); |
| ... | @@ -151,7 +151,7 @@ test "atomic load and rmw with enum" { | ... | @@ -151,7 +151,7 @@ test "atomic load and rmw with enum" { |
| 151 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 151 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 152 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 152 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 153 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 153 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 154 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 154 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 155 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 155 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 156 | 156 | ||
| 157 | const Value = enum(u8) { a, b, c }; | 157 | const Value = enum(u8) { a, b, c }; |
| ... | @@ -169,7 +169,7 @@ test "atomic store" { | ... | @@ -169,7 +169,7 @@ test "atomic store" { |
| 169 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 169 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 170 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 170 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 171 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 171 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 172 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 172 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 173 | 173 | ||
| 174 | try comptime testAtomicStore(); | 174 | try comptime testAtomicStore(); |
| 175 | try testAtomicStore(); | 175 | try testAtomicStore(); |
| ... | @@ -188,7 +188,7 @@ test "atomicrmw with floats" { | ... | @@ -188,7 +188,7 @@ test "atomicrmw with floats" { |
| 188 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 188 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 189 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 189 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 190 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 190 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 191 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 191 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 192 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 192 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 193 | 193 | ||
| 194 | try testAtomicRmwFloat(); | 194 | try testAtomicRmwFloat(); |
| ... | @@ -214,7 +214,7 @@ test "atomicrmw with ints" { | ... | @@ -214,7 +214,7 @@ test "atomicrmw with ints" { |
| 214 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 214 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 215 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 215 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 216 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 216 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 217 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 217 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 218 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 218 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 219 | 219 | ||
| 220 | try testAtomicRmwInts(); | 220 | try testAtomicRmwInts(); |
| ... | @@ -357,7 +357,7 @@ test "atomics with different types" { | ... | @@ -357,7 +357,7 @@ test "atomics with different types" { |
| 357 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 357 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 358 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 358 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 359 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 359 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 360 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 360 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 361 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 361 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 362 | 362 | ||
| 363 | try testAtomicsWithType(bool, true, false); | 363 | try testAtomicsWithType(bool, true, false); |
| ... | @@ -411,7 +411,7 @@ fn testAtomicsWithPackedStruct(comptime T: type, a: T, b: T) !void { | ... | @@ -411,7 +411,7 @@ fn testAtomicsWithPackedStruct(comptime T: type, a: T, b: T) !void { |
| 411 | test "return @atomicStore, using it as a void value" { | 411 | test "return @atomicStore, using it as a void value" { |
| 412 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 412 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 413 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 413 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 414 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 414 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 415 | 415 | ||
| 416 | const S = struct { | 416 | const S = struct { |
| 417 | const A = struct { | 417 | const A = struct { |
test/behavior/backing_int.zig+11-3| ... | @@ -46,6 +46,8 @@ const E5 = enum(u0) { | ... | @@ -46,6 +46,8 @@ const E5 = enum(u0) { |
| 46 | }; | 46 | }; |
| 47 | 47 | ||
| 48 | test "@backingInt with enums" { | 48 | test "@backingInt with enums" { |
| 49 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 50 | |||
| 49 | const static = struct { | 51 | const static = struct { |
| 50 | fn doTheTest(v1: E1, v2: E2, v3: E3, v4: E4, v5: E5) !void { | 52 | fn doTheTest(v1: E1, v2: E2, v3: E3, v4: E4, v5: E5) !void { |
| 51 | const b1 = @backingInt(v1); | 53 | const b1 = @backingInt(v1); |
| ... | @@ -74,6 +76,8 @@ test "@backingInt with enums" { | ... | @@ -74,6 +76,8 @@ test "@backingInt with enums" { |
| 74 | } | 76 | } |
| 75 | 77 | ||
| 76 | test "@fromBackingInt with enums" { | 78 | test "@fromBackingInt with enums" { |
| 79 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 80 | |||
| 77 | const static = struct { | 81 | const static = struct { |
| 78 | fn doTheTest( | 82 | fn doTheTest( |
| 79 | b1: @typeInfo(E1).@"enum".tag_type, | 83 | b1: @typeInfo(E1).@"enum".tag_type, |
| ... | @@ -137,7 +141,7 @@ const T5 = union(E5) { | ... | @@ -137,7 +141,7 @@ const T5 = union(E5) { |
| 137 | }; | 141 | }; |
| 138 | 142 | ||
| 139 | test "@backingInt with tagged unions" { | 143 | test "@backingInt with tagged unions" { |
| 140 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 144 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 141 | 145 | ||
| 142 | const static = struct { | 146 | const static = struct { |
| 143 | fn doTheTest(v1: T1, v2: T2, v4: T4, v5: T5) !void { | 147 | fn doTheTest(v1: T1, v2: T2, v4: T4, v5: T5) !void { |
| ... | @@ -208,6 +212,8 @@ const S5 = packed struct(u0) { | ... | @@ -208,6 +212,8 @@ const S5 = packed struct(u0) { |
| 208 | }; | 212 | }; |
| 209 | 213 | ||
| 210 | test "@backingInt with packed structs" { | 214 | test "@backingInt with packed structs" { |
| 215 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 216 | |||
| 211 | const static = struct { | 217 | const static = struct { |
| 212 | fn doTheTest(v1: S1, v2: S2, v3: S3, v4: S4, v5: S5) !void { | 218 | fn doTheTest(v1: S1, v2: S2, v3: S3, v4: S4, v5: S5) !void { |
| 213 | const b1 = @backingInt(v1); | 219 | const b1 = @backingInt(v1); |
| ... | @@ -236,6 +242,8 @@ test "@backingInt with packed structs" { | ... | @@ -236,6 +242,8 @@ test "@backingInt with packed structs" { |
| 236 | } | 242 | } |
| 237 | 243 | ||
| 238 | test "@fromBackingInt with packed structs" { | 244 | test "@fromBackingInt with packed structs" { |
| 245 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 246 | |||
| 239 | const static = struct { | 247 | const static = struct { |
| 240 | fn doTheTest( | 248 | fn doTheTest( |
| 241 | b1: @typeInfo(S1).@"struct".backing_integer.?, | 249 | b1: @typeInfo(S1).@"struct".backing_integer.?, |
| ... | @@ -313,7 +321,7 @@ const U5 = packed union(u0) { | ... | @@ -313,7 +321,7 @@ const U5 = packed union(u0) { |
| 313 | }; | 321 | }; |
| 314 | 322 | ||
| 315 | test "@backingInt with packed unions" { | 323 | test "@backingInt with packed unions" { |
| 316 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 324 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 317 | 325 | ||
| 318 | const static = struct { | 326 | const static = struct { |
| 319 | fn doTheTest(v1: U1, v2: U2, v3: U3, v4: U4, v5: U5) !void { | 327 | fn doTheTest(v1: U1, v2: U2, v3: U3, v4: U4, v5: U5) !void { |
| ... | @@ -343,7 +351,7 @@ test "@backingInt with packed unions" { | ... | @@ -343,7 +351,7 @@ test "@backingInt with packed unions" { |
| 343 | } | 351 | } |
| 344 | 352 | ||
| 345 | test "@fromBackingInt with packed unions" { | 353 | test "@fromBackingInt with packed unions" { |
| 346 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 354 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 347 | 355 | ||
| 348 | const static = struct { | 356 | const static = struct { |
| 349 | fn doTheTest( | 357 | fn doTheTest( |
test/behavior/basic.zig+70-32| ... | @@ -24,6 +24,7 @@ fn testTruncate(x: u32) u8 { | ... | @@ -24,6 +24,7 @@ fn testTruncate(x: u32) u8 { |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | test "truncate to non-power-of-two integers" { | 26 | test "truncate to non-power-of-two integers" { |
| 27 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 27 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 28 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 28 | 29 | ||
| 29 | try testTrunc(u32, u1, 0b10101, 0b1); | 30 | try testTrunc(u32, u1, 0b10101, 0b1); |
| ... | @@ -38,6 +39,7 @@ test "truncate to non-power-of-two integers" { | ... | @@ -38,6 +39,7 @@ test "truncate to non-power-of-two integers" { |
| 38 | } | 39 | } |
| 39 | 40 | ||
| 40 | test "truncate to non-power-of-two integers from 128-bit" { | 41 | test "truncate to non-power-of-two integers from 128-bit" { |
| 42 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 41 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 43 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 42 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 44 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 43 | 45 | ||
| ... | @@ -60,7 +62,7 @@ const g1: i32 = 1233 + 1; | ... | @@ -60,7 +62,7 @@ const g1: i32 = 1233 + 1; |
| 60 | var g2: i32 = 0; | 62 | var g2: i32 = 0; |
| 61 | 63 | ||
| 62 | test "global variables" { | 64 | test "global variables" { |
| 63 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 65 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 64 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 66 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 65 | 67 | ||
| 66 | try expect(g2 == 0); | 68 | try expect(g2 == 0); |
| ... | @@ -80,6 +82,8 @@ test "type equality" { | ... | @@ -80,6 +82,8 @@ test "type equality" { |
| 80 | } | 82 | } |
| 81 | 83 | ||
| 82 | test "pointer dereferencing" { | 84 | test "pointer dereferencing" { |
| 85 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 86 | |||
| 83 | var x = @as(i32, 3); | 87 | var x = @as(i32, 3); |
| 84 | const y = &x; | 88 | const y = &x; |
| 85 | 89 | ||
| ... | @@ -137,6 +141,8 @@ test "function branch hints" { | ... | @@ -137,6 +141,8 @@ test "function branch hints" { |
| 137 | } | 141 | } |
| 138 | 142 | ||
| 139 | test "if branch hints" { | 143 | test "if branch hints" { |
| 144 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 145 | |||
| 140 | var t: bool = undefined; | 146 | var t: bool = undefined; |
| 141 | t = true; | 147 | t = true; |
| 142 | if (t) { | 148 | if (t) { |
| ... | @@ -147,6 +153,8 @@ test "if branch hints" { | ... | @@ -147,6 +153,8 @@ test "if branch hints" { |
| 147 | } | 153 | } |
| 148 | 154 | ||
| 149 | test "switch branch hints" { | 155 | test "switch branch hints" { |
| 156 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 157 | |||
| 150 | var t: bool = undefined; | 158 | var t: bool = undefined; |
| 151 | t = true; | 159 | t = true; |
| 152 | switch (t) { | 160 | switch (t) { |
| ... | @@ -160,6 +168,8 @@ test "switch branch hints" { | ... | @@ -160,6 +168,8 @@ test "switch branch hints" { |
| 160 | } | 168 | } |
| 161 | 169 | ||
| 162 | test "orelse branch hints" { | 170 | test "orelse branch hints" { |
| 171 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 172 | |||
| 163 | var x: ?u32 = undefined; | 173 | var x: ?u32 = undefined; |
| 164 | x = 123; | 174 | x = 123; |
| 165 | const val = x orelse val: { | 175 | const val = x orelse val: { |
| ... | @@ -170,6 +180,8 @@ test "orelse branch hints" { | ... | @@ -170,6 +180,8 @@ test "orelse branch hints" { |
| 170 | } | 180 | } |
| 171 | 181 | ||
| 172 | test "catch branch hints" { | 182 | test "catch branch hints" { |
| 183 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 184 | |||
| 173 | var x: error{Bad}!u32 = undefined; | 185 | var x: error{Bad}!u32 = undefined; |
| 174 | x = 123; | 186 | x = 123; |
| 175 | const val = x catch val: { | 187 | const val = x catch val: { |
| ... | @@ -180,6 +192,8 @@ test "catch branch hints" { | ... | @@ -180,6 +192,8 @@ test "catch branch hints" { |
| 180 | } | 192 | } |
| 181 | 193 | ||
| 182 | test "and/or branch hints" { | 194 | test "and/or branch hints" { |
| 195 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 196 | |||
| 183 | var t: bool = undefined; | 197 | var t: bool = undefined; |
| 184 | t = true; | 198 | t = true; |
| 185 | try expect(t or b: { | 199 | try expect(t or b: { |
| ... | @@ -207,14 +221,14 @@ fn first4KeysOfHomeRow() []const u8 { | ... | @@ -207,14 +221,14 @@ fn first4KeysOfHomeRow() []const u8 { |
| 207 | } | 221 | } |
| 208 | 222 | ||
| 209 | test "return string from function" { | 223 | test "return string from function" { |
| 210 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 224 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 211 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 225 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 212 | 226 | ||
| 213 | try expect(mem.eql(u8, first4KeysOfHomeRow(), "aoeu")); | 227 | try expect(mem.eql(u8, first4KeysOfHomeRow(), "aoeu")); |
| 214 | } | 228 | } |
| 215 | 229 | ||
| 216 | test "hex escape" { | 230 | test "hex escape" { |
| 217 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 231 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 218 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 232 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 219 | 233 | ||
| 220 | try expect(mem.eql(u8, "\x68\x65\x6c\x6c\x6f", "hello")); | 234 | try expect(mem.eql(u8, "\x68\x65\x6c\x6c\x6f", "hello")); |
| ... | @@ -222,7 +236,7 @@ test "hex escape" { | ... | @@ -222,7 +236,7 @@ test "hex escape" { |
| 222 | 236 | ||
| 223 | test "multiline string" { | 237 | test "multiline string" { |
| 224 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 238 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 225 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 239 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 226 | 240 | ||
| 227 | const s1 = | 241 | const s1 = |
| 228 | \\one | 242 | \\one |
| ... | @@ -235,7 +249,7 @@ test "multiline string" { | ... | @@ -235,7 +249,7 @@ test "multiline string" { |
| 235 | 249 | ||
| 236 | test "multiline string comments at start" { | 250 | test "multiline string comments at start" { |
| 237 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 251 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 238 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 252 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 239 | 253 | ||
| 240 | const s1 = | 254 | const s1 = |
| 241 | //\\one | 255 | //\\one |
| ... | @@ -248,7 +262,7 @@ test "multiline string comments at start" { | ... | @@ -248,7 +262,7 @@ test "multiline string comments at start" { |
| 248 | 262 | ||
| 249 | test "multiline string comments at end" { | 263 | test "multiline string comments at end" { |
| 250 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 264 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 251 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 265 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 252 | 266 | ||
| 253 | const s1 = | 267 | const s1 = |
| 254 | \\one | 268 | \\one |
| ... | @@ -261,7 +275,7 @@ test "multiline string comments at end" { | ... | @@ -261,7 +275,7 @@ test "multiline string comments at end" { |
| 261 | 275 | ||
| 262 | test "multiline string comments in middle" { | 276 | test "multiline string comments in middle" { |
| 263 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 277 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 264 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 278 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 265 | 279 | ||
| 266 | const s1 = | 280 | const s1 = |
| 267 | \\one | 281 | \\one |
| ... | @@ -274,7 +288,7 @@ test "multiline string comments in middle" { | ... | @@ -274,7 +288,7 @@ test "multiline string comments in middle" { |
| 274 | 288 | ||
| 275 | test "multiline string comments at multiple places" { | 289 | test "multiline string comments at multiple places" { |
| 276 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 290 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 277 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 291 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 278 | 292 | ||
| 279 | const s1 = | 293 | const s1 = |
| 280 | \\one | 294 | \\one |
| ... | @@ -288,7 +302,7 @@ test "multiline string comments at multiple places" { | ... | @@ -288,7 +302,7 @@ test "multiline string comments at multiple places" { |
| 288 | } | 302 | } |
| 289 | 303 | ||
| 290 | test "string concatenation simple" { | 304 | test "string concatenation simple" { |
| 291 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 305 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 292 | 306 | ||
| 293 | try expect(mem.eql(u8, "OK" ++ " IT " ++ "WORKED", "OK IT WORKED")); | 307 | try expect(mem.eql(u8, "OK" ++ " IT " ++ "WORKED", "OK IT WORKED")); |
| 294 | } | 308 | } |
| ... | @@ -302,6 +316,7 @@ test "compile time global reinterpret" { | ... | @@ -302,6 +316,7 @@ test "compile time global reinterpret" { |
| 302 | } | 316 | } |
| 303 | 317 | ||
| 304 | test "cast undefined" { | 318 | test "cast undefined" { |
| 319 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 305 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 320 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 306 | 321 | ||
| 307 | const array: [100]u8 = undefined; | 322 | const array: [100]u8 = undefined; |
| ... | @@ -372,7 +387,8 @@ fn fB() []const u8 { | ... | @@ -372,7 +387,8 @@ fn fB() []const u8 { |
| 372 | 387 | ||
| 373 | test "call function pointer in struct" { | 388 | test "call function pointer in struct" { |
| 374 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 389 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 375 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 390 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 391 | |||
| 376 | try expect(mem.eql(u8, f3(true), "a")); | 392 | try expect(mem.eql(u8, f3(true), "a")); |
| 377 | try expect(mem.eql(u8, f3(false), "b")); | 393 | try expect(mem.eql(u8, f3(false), "b")); |
| 378 | } | 394 | } |
| ... | @@ -394,6 +410,7 @@ const FnPtrWrapper = struct { | ... | @@ -394,6 +410,7 @@ const FnPtrWrapper = struct { |
| 394 | }; | 410 | }; |
| 395 | 411 | ||
| 396 | test "const ptr from var variable" { | 412 | test "const ptr from var variable" { |
| 413 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 397 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 414 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 398 | 415 | ||
| 399 | var x: u64 = undefined; | 416 | var x: u64 = undefined; |
| ... | @@ -412,7 +429,7 @@ fn copy(src: *const u64, dst: *u64) void { | ... | @@ -412,7 +429,7 @@ fn copy(src: *const u64, dst: *u64) void { |
| 412 | test "call result of if else expression" { | 429 | test "call result of if else expression" { |
| 413 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 430 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 414 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 431 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 415 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 432 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 416 | 433 | ||
| 417 | try expect(mem.eql(u8, f2(true), "a")); | 434 | try expect(mem.eql(u8, f2(true), "a")); |
| 418 | try expect(mem.eql(u8, f2(false), "b")); | 435 | try expect(mem.eql(u8, f2(false), "b")); |
| ... | @@ -423,7 +440,7 @@ fn f2(x: bool) []const u8 { | ... | @@ -423,7 +440,7 @@ fn f2(x: bool) []const u8 { |
| 423 | 440 | ||
| 424 | const OpaqueA = opaque {}; | 441 | const OpaqueA = opaque {}; |
| 425 | test "variable is allowed to be a pointer to an opaque type" { | 442 | test "variable is allowed to be a pointer to an opaque type" { |
| 426 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 443 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 427 | 444 | ||
| 428 | var x: i32 = 1234; | 445 | var x: i32 = 1234; |
| 429 | _ = hereIsAnOpaqueType(@as(*OpaqueA, @ptrCast(&x))); | 446 | _ = hereIsAnOpaqueType(@as(*OpaqueA, @ptrCast(&x))); |
| ... | @@ -446,7 +463,7 @@ fn testTakeAddressOfParameter(f: f32) !void { | ... | @@ -446,7 +463,7 @@ fn testTakeAddressOfParameter(f: f32) !void { |
| 446 | } | 463 | } |
| 447 | 464 | ||
| 448 | test "pointer to void return type" { | 465 | test "pointer to void return type" { |
| 449 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 466 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 450 | 467 | ||
| 451 | try testPointerToVoidReturnType(); | 468 | try testPointerToVoidReturnType(); |
| 452 | } | 469 | } |
| ... | @@ -462,7 +479,7 @@ fn testPointerToVoidReturnType2() *const void { | ... | @@ -462,7 +479,7 @@ fn testPointerToVoidReturnType2() *const void { |
| 462 | test "array 2D const double ptr" { | 479 | test "array 2D const double ptr" { |
| 463 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 480 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 464 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 481 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 465 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 482 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 466 | 483 | ||
| 467 | const rect_2d_vertexes = [_][1]f32{ | 484 | const rect_2d_vertexes = [_][1]f32{ |
| 468 | [_]f32{1.0}, | 485 | [_]f32{1.0}, |
| ... | @@ -474,7 +491,7 @@ test "array 2D const double ptr" { | ... | @@ -474,7 +491,7 @@ test "array 2D const double ptr" { |
| 474 | test "array 2D const double ptr with offset" { | 491 | test "array 2D const double ptr with offset" { |
| 475 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 492 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 476 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 493 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 477 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 494 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 478 | 495 | ||
| 479 | const rect_2d_vertexes = [_][2]f32{ | 496 | const rect_2d_vertexes = [_][2]f32{ |
| 480 | [_]f32{ 3.0, 4.239 }, | 497 | [_]f32{ 3.0, 4.239 }, |
| ... | @@ -486,7 +503,7 @@ test "array 2D const double ptr with offset" { | ... | @@ -486,7 +503,7 @@ test "array 2D const double ptr with offset" { |
| 486 | test "array 3D const double ptr with offset" { | 503 | test "array 3D const double ptr with offset" { |
| 487 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 504 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 488 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 505 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 489 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 506 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 490 | 507 | ||
| 491 | const rect_3d_vertexes = [_][2][2]f32{ | 508 | const rect_3d_vertexes = [_][2][2]f32{ |
| 492 | [_][2]f32{ | 509 | [_][2]f32{ |
| ... | @@ -519,6 +536,7 @@ fn nine() u8 { | ... | @@ -519,6 +536,7 @@ fn nine() u8 { |
| 519 | } | 536 | } |
| 520 | 537 | ||
| 521 | test "struct inside function" { | 538 | test "struct inside function" { |
| 539 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 522 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 540 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 523 | 541 | ||
| 524 | try testStructInFn(); | 542 | try testStructInFn(); |
| ... | @@ -541,7 +559,7 @@ fn testStructInFn() !void { | ... | @@ -541,7 +559,7 @@ fn testStructInFn() !void { |
| 541 | 559 | ||
| 542 | test "fn call returning scalar optional in equality expression" { | 560 | test "fn call returning scalar optional in equality expression" { |
| 543 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 561 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 544 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 562 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 545 | 563 | ||
| 546 | try expect(getNull() == null); | 564 | try expect(getNull() == null); |
| 547 | } | 565 | } |
| ... | @@ -553,7 +571,7 @@ fn getNull() ?*i32 { | ... | @@ -553,7 +571,7 @@ fn getNull() ?*i32 { |
| 553 | test "global variable assignment with optional unwrapping with var initialized to undefined" { | 571 | test "global variable assignment with optional unwrapping with var initialized to undefined" { |
| 554 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 572 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 555 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 573 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 556 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 574 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 557 | 575 | ||
| 558 | const S = struct { | 576 | const S = struct { |
| 559 | var data: i32 = 1234; | 577 | var data: i32 = 1234; |
| ... | @@ -570,6 +588,7 @@ test "global variable assignment with optional unwrapping with var initialized t | ... | @@ -570,6 +588,7 @@ test "global variable assignment with optional unwrapping with var initialized t |
| 570 | var global_foo: *i32 = undefined; | 588 | var global_foo: *i32 = undefined; |
| 571 | 589 | ||
| 572 | test "peer result location with typed parent, runtime condition, comptime prongs" { | 590 | test "peer result location with typed parent, runtime condition, comptime prongs" { |
| 591 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 573 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 592 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 574 | 593 | ||
| 575 | const S = struct { | 594 | const S = struct { |
| ... | @@ -610,6 +629,8 @@ fn ZA() type { | ... | @@ -610,6 +629,8 @@ fn ZA() type { |
| 610 | } | 629 | } |
| 611 | 630 | ||
| 612 | test "use of declaration with same name as primitive" { | 631 | test "use of declaration with same name as primitive" { |
| 632 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 633 | |||
| 613 | const S = struct { | 634 | const S = struct { |
| 614 | const @"u8" = u16; | 635 | const @"u8" = u16; |
| 615 | const alias = @"u8"; | 636 | const alias = @"u8"; |
| ... | @@ -636,12 +657,14 @@ fn emptyFn() void {} | ... | @@ -636,12 +657,14 @@ fn emptyFn() void {} |
| 636 | 657 | ||
| 637 | const addr1 = @as(*const u8, @ptrCast(&emptyFn)); | 658 | const addr1 = @as(*const u8, @ptrCast(&emptyFn)); |
| 638 | test "comptime cast fn to ptr" { | 659 | test "comptime cast fn to ptr" { |
| 660 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 661 | |||
| 639 | const addr2 = @as(*const u8, @ptrCast(&emptyFn)); | 662 | const addr2 = @as(*const u8, @ptrCast(&emptyFn)); |
| 640 | comptime assert(addr1 == addr2); | 663 | comptime assert(addr1 == addr2); |
| 641 | } | 664 | } |
| 642 | 665 | ||
| 643 | test "equality compare fn ptrs" { | 666 | test "equality compare fn ptrs" { |
| 644 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // Uses function pointers | 667 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Uses function pointers |
| 645 | 668 | ||
| 646 | var a = &emptyFn; | 669 | var a = &emptyFn; |
| 647 | _ = &a; | 670 | _ = &a; |
| ... | @@ -649,7 +672,7 @@ test "equality compare fn ptrs" { | ... | @@ -649,7 +672,7 @@ test "equality compare fn ptrs" { |
| 649 | } | 672 | } |
| 650 | 673 | ||
| 651 | test "self reference through fn ptr field" { | 674 | test "self reference through fn ptr field" { |
| 652 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 675 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 653 | 676 | ||
| 654 | const S = struct { | 677 | const S = struct { |
| 655 | const A = struct { | 678 | const A = struct { |
| ... | @@ -668,7 +691,7 @@ test "self reference through fn ptr field" { | ... | @@ -668,7 +691,7 @@ test "self reference through fn ptr field" { |
| 668 | 691 | ||
| 669 | test "global variable initialized to global variable array element" { | 692 | test "global variable initialized to global variable array element" { |
| 670 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 693 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 671 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 694 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 672 | 695 | ||
| 673 | try expect(global_ptr == &gdt[0]); | 696 | try expect(global_ptr == &gdt[0]); |
| 674 | } | 697 | } |
| ... | @@ -682,7 +705,7 @@ var gdt = [_]GDTEntry{ | ... | @@ -682,7 +705,7 @@ var gdt = [_]GDTEntry{ |
| 682 | var global_ptr = &gdt[0]; | 705 | var global_ptr = &gdt[0]; |
| 683 | 706 | ||
| 684 | test "global constant is loaded with a runtime-known index" { | 707 | test "global constant is loaded with a runtime-known index" { |
| 685 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 708 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 686 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 709 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 687 | 710 | ||
| 688 | const S = struct { | 711 | const S = struct { |
| ... | @@ -701,7 +724,7 @@ test "global constant is loaded with a runtime-known index" { | ... | @@ -701,7 +724,7 @@ test "global constant is loaded with a runtime-known index" { |
| 701 | } | 724 | } |
| 702 | 725 | ||
| 703 | test "multiline string literal is null terminated" { | 726 | test "multiline string literal is null terminated" { |
| 704 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 727 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 705 | 728 | ||
| 706 | const s1 = | 729 | const s1 = |
| 707 | \\one | 730 | \\one |
| ... | @@ -715,7 +738,7 @@ test "multiline string literal is null terminated" { | ... | @@ -715,7 +738,7 @@ test "multiline string literal is null terminated" { |
| 715 | test "string escapes" { | 738 | test "string escapes" { |
| 716 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 739 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 717 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 740 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 718 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 741 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 719 | 742 | ||
| 720 | try expectEqualStrings("\"", "\x22"); | 743 | try expectEqualStrings("\"", "\x22"); |
| 721 | try expectEqualStrings("\'", "\x27"); | 744 | try expectEqualStrings("\'", "\x27"); |
| ... | @@ -733,7 +756,7 @@ test "explicit cast optional pointers" { | ... | @@ -733,7 +756,7 @@ test "explicit cast optional pointers" { |
| 733 | } | 756 | } |
| 734 | 757 | ||
| 735 | test "pointer comparison" { | 758 | test "pointer comparison" { |
| 736 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 759 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 737 | 760 | ||
| 738 | const a = @as([]const u8, "a"); | 761 | const a = @as([]const u8, "a"); |
| 739 | const b = &a; | 762 | const b = &a; |
| ... | @@ -744,6 +767,7 @@ fn ptrEql(a: *const []const u8, b: *const []const u8) bool { | ... | @@ -744,6 +767,7 @@ fn ptrEql(a: *const []const u8, b: *const []const u8) bool { |
| 744 | } | 767 | } |
| 745 | 768 | ||
| 746 | test "string concatenation" { | 769 | test "string concatenation" { |
| 770 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 747 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 771 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 748 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 772 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 749 | 773 | ||
| ... | @@ -766,6 +790,7 @@ test "string concatenation" { | ... | @@ -766,6 +790,7 @@ test "string concatenation" { |
| 766 | } | 790 | } |
| 767 | 791 | ||
| 768 | test "result location is optional inside error union" { | 792 | test "result location is optional inside error union" { |
| 793 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 769 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 794 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 770 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 795 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 771 | 796 | ||
| ... | @@ -782,7 +807,7 @@ fn maybe(x: bool) anyerror!?u32 { | ... | @@ -782,7 +807,7 @@ fn maybe(x: bool) anyerror!?u32 { |
| 782 | 807 | ||
| 783 | test "auto created variables have correct alignment" { | 808 | test "auto created variables have correct alignment" { |
| 784 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 809 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 785 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 810 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 786 | 811 | ||
| 787 | const S = struct { | 812 | const S = struct { |
| 788 | fn foo(str: [*]const u8) u32 { | 813 | fn foo(str: [*]const u8) u32 { |
| ... | @@ -799,7 +824,7 @@ test "auto created variables have correct alignment" { | ... | @@ -799,7 +824,7 @@ test "auto created variables have correct alignment" { |
| 799 | test "extern variable with non-pointer opaque type" { | 824 | test "extern variable with non-pointer opaque type" { |
| 800 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 825 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 801 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 826 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 802 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 827 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 803 | 828 | ||
| 804 | @export(&var_to_export, .{ .name = "opaque_extern_var" }); | 829 | @export(&var_to_export, .{ .name = "opaque_extern_var" }); |
| 805 | try expect(@as(*align(1) u32, @ptrCast(&opaque_extern_var)).* == 42); | 830 | try expect(@as(*align(1) u32, @ptrCast(&opaque_extern_var)).* == 42); |
| ... | @@ -840,6 +865,7 @@ test "if expression type coercion" { | ... | @@ -840,6 +865,7 @@ test "if expression type coercion" { |
| 840 | } | 865 | } |
| 841 | 866 | ||
| 842 | test "discarding the result of various expressions" { | 867 | test "discarding the result of various expressions" { |
| 868 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 843 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 869 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 844 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 870 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 845 | 871 | ||
| ... | @@ -912,6 +938,7 @@ test "labeled block with runtime branch forwards its result location type to bre | ... | @@ -912,6 +938,7 @@ test "labeled block with runtime branch forwards its result location type to bre |
| 912 | } | 938 | } |
| 913 | 939 | ||
| 914 | test "try in labeled block doesn't cast to wrong type" { | 940 | test "try in labeled block doesn't cast to wrong type" { |
| 941 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 915 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 942 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 916 | 943 | ||
| 917 | const S = struct { | 944 | const S = struct { |
| ... | @@ -936,6 +963,7 @@ test "vector initialized with array init syntax has proper type" { | ... | @@ -936,6 +963,7 @@ test "vector initialized with array init syntax has proper type" { |
| 936 | } | 963 | } |
| 937 | 964 | ||
| 938 | test "weird array and tuple initializations" { | 965 | test "weird array and tuple initializations" { |
| 966 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 939 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 967 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 940 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 968 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 941 | 969 | ||
| ... | @@ -1054,6 +1082,7 @@ comptime { | ... | @@ -1054,6 +1082,7 @@ comptime { |
| 1054 | } | 1082 | } |
| 1055 | 1083 | ||
| 1056 | test "switch inside @as gets correct type" { | 1084 | test "switch inside @as gets correct type" { |
| 1085 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1057 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1086 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1058 | 1087 | ||
| 1059 | var a: u32 = 0; | 1088 | var a: u32 = 0; |
| ... | @@ -1078,7 +1107,7 @@ test "inline call of function with a switch inside the return statement" { | ... | @@ -1078,7 +1107,7 @@ test "inline call of function with a switch inside the return statement" { |
| 1078 | } | 1107 | } |
| 1079 | 1108 | ||
| 1080 | test "pointer to zero sized global is mutable" { | 1109 | test "pointer to zero sized global is mutable" { |
| 1081 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1110 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1082 | 1111 | ||
| 1083 | const S = struct { | 1112 | const S = struct { |
| 1084 | const Thing = struct {}; | 1113 | const Thing = struct {}; |
| ... | @@ -1100,6 +1129,7 @@ test "returning an opaque type from a function" { | ... | @@ -1100,6 +1129,7 @@ test "returning an opaque type from a function" { |
| 1100 | } | 1129 | } |
| 1101 | 1130 | ||
| 1102 | test "orelse coercion as function argument" { | 1131 | test "orelse coercion as function argument" { |
| 1132 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1103 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1133 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1104 | 1134 | ||
| 1105 | const Loc = struct { start: i32 = -1 }; | 1135 | const Loc = struct { start: i32 = -1 }; |
| ... | @@ -1118,7 +1148,7 @@ test "orelse coercion as function argument" { | ... | @@ -1118,7 +1148,7 @@ test "orelse coercion as function argument" { |
| 1118 | } | 1148 | } |
| 1119 | 1149 | ||
| 1120 | test "runtime-known globals initialized with undefined" { | 1150 | test "runtime-known globals initialized with undefined" { |
| 1121 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1151 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1122 | 1152 | ||
| 1123 | const S = struct { | 1153 | const S = struct { |
| 1124 | var array: [10]u32 = [_]u32{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; | 1154 | var array: [10]u32 = [_]u32{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; |
| ... | @@ -1137,7 +1167,7 @@ test "arrays and vectors with big integers" { | ... | @@ -1137,7 +1167,7 @@ test "arrays and vectors with big integers" { |
| 1137 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1167 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1138 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 1168 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 1139 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1169 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1140 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1170 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1141 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1171 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1142 | if (builtin.zig_backend == .stage2_llvm and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32 or builtin.abi == .abin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23805 | 1172 | if (builtin.zig_backend == .stage2_llvm and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32 or builtin.abi == .abin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23805 |
| 1143 | 1173 | ||
| ... | @@ -1211,6 +1241,8 @@ fn testUnsignedCmp(comptime T: type) !void { | ... | @@ -1211,6 +1241,8 @@ fn testUnsignedCmp(comptime T: type) !void { |
| 1211 | } | 1241 | } |
| 1212 | 1242 | ||
| 1213 | test "integer compare <= 64 bits" { | 1243 | test "integer compare <= 64 bits" { |
| 1244 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1245 | |||
| 1214 | inline for (.{ u8, u16, u32, u64, usize, u10, u20, u30, u60 }) |T| { | 1246 | inline for (.{ u8, u16, u32, u64, usize, u10, u20, u30, u60 }) |T| { |
| 1215 | try testUnsignedCmp(T); | 1247 | try testUnsignedCmp(T); |
| 1216 | try comptime testUnsignedCmp(T); | 1248 | try comptime testUnsignedCmp(T); |
| ... | @@ -1222,6 +1254,7 @@ test "integer compare <= 64 bits" { | ... | @@ -1222,6 +1254,7 @@ test "integer compare <= 64 bits" { |
| 1222 | } | 1254 | } |
| 1223 | 1255 | ||
| 1224 | test "integer compare <= 128 bits" { | 1256 | test "integer compare <= 128 bits" { |
| 1257 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1225 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1258 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1226 | 1259 | ||
| 1227 | inline for (.{ u65, u96, u127, u128 }) |T| { | 1260 | inline for (.{ u65, u96, u127, u128 }) |T| { |
| ... | @@ -1235,6 +1268,7 @@ test "integer compare <= 128 bits" { | ... | @@ -1235,6 +1268,7 @@ test "integer compare <= 128 bits" { |
| 1235 | } | 1268 | } |
| 1236 | 1269 | ||
| 1237 | test "integer compare > 128 bits" { | 1270 | test "integer compare > 128 bits" { |
| 1271 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1238 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1272 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1239 | 1273 | ||
| 1240 | inline for (.{ u129, u255, u512, u800 }) |T| { | 1274 | inline for (.{ u129, u255, u512, u800 }) |T| { |
| ... | @@ -1248,6 +1282,7 @@ test "integer compare > 128 bits" { | ... | @@ -1248,6 +1282,7 @@ test "integer compare > 128 bits" { |
| 1248 | } | 1282 | } |
| 1249 | 1283 | ||
| 1250 | test "reference to inferred local variable works as expected" { | 1284 | test "reference to inferred local variable works as expected" { |
| 1285 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1251 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1286 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1252 | 1287 | ||
| 1253 | const Crasher = struct { | 1288 | const Crasher = struct { |
| ... | @@ -1332,7 +1367,7 @@ test "const inferred array of slices" { | ... | @@ -1332,7 +1367,7 @@ test "const inferred array of slices" { |
| 1332 | 1367 | ||
| 1333 | test "var inferred array of slices" { | 1368 | test "var inferred array of slices" { |
| 1334 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1369 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1335 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1370 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1336 | 1371 | ||
| 1337 | const T = struct { v: bool }; | 1372 | const T = struct { v: bool }; |
| 1338 | 1373 | ||
| ... | @@ -1355,6 +1390,7 @@ test "copy array of self-referential struct" { | ... | @@ -1355,6 +1390,7 @@ test "copy array of self-referential struct" { |
| 1355 | } | 1390 | } |
| 1356 | 1391 | ||
| 1357 | test "break out of block based on comptime known values" { | 1392 | test "break out of block based on comptime known values" { |
| 1393 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1358 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1394 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1359 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1395 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1360 | 1396 | ||
| ... | @@ -1392,7 +1428,7 @@ test "allocation and looping over 3-byte integer" { | ... | @@ -1392,7 +1428,7 @@ test "allocation and looping over 3-byte integer" { |
| 1392 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1428 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1393 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1429 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1394 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1430 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1395 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1431 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1396 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1432 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1397 | 1433 | ||
| 1398 | try expect(@sizeOf(u24) == 4); | 1434 | try expect(@sizeOf(u24) == 4); |
| ... | @@ -1419,6 +1455,8 @@ test "allocation and looping over 3-byte integer" { | ... | @@ -1419,6 +1455,8 @@ test "allocation and looping over 3-byte integer" { |
| 1419 | } | 1455 | } |
| 1420 | 1456 | ||
| 1421 | test "loading array from struct is not optimized away" { | 1457 | test "loading array from struct is not optimized away" { |
| 1458 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1459 | |||
| 1422 | const S = struct { | 1460 | const S = struct { |
| 1423 | arr: [1]u32 = .{0}, | 1461 | arr: [1]u32 = .{0}, |
| 1424 | fn doTheTest(self: *@This()) !void { | 1462 | fn doTheTest(self: *@This()) !void { |
test/behavior/bit_shifting.zig+3-3| ... | @@ -65,7 +65,7 @@ test "sharded table" { | ... | @@ -65,7 +65,7 @@ test "sharded table" { |
| 65 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 65 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 66 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 66 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 67 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 67 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 68 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 68 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 69 | 69 | ||
| 70 | // realistic 16-way sharding | 70 | // realistic 16-way sharding |
| 71 | try testShardedTable(u32, 4, 8); | 71 | try testShardedTable(u32, 4, 8); |
| ... | @@ -115,7 +115,7 @@ test "Saturating Shift Left where lhs is of a computed type" { | ... | @@ -115,7 +115,7 @@ test "Saturating Shift Left where lhs is of a computed type" { |
| 115 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 115 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 116 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 116 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 117 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 117 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 118 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 118 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 119 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 119 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 120 | 120 | ||
| 121 | const S = struct { | 121 | const S = struct { |
| ... | @@ -148,7 +148,7 @@ test "Saturating Shift Left where lhs is of a computed type" { | ... | @@ -148,7 +148,7 @@ test "Saturating Shift Left where lhs is of a computed type" { |
| 148 | test "Saturating Shift Left" { | 148 | test "Saturating Shift Left" { |
| 149 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 149 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 150 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 150 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 151 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 151 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 152 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 152 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 153 | 153 | ||
| 154 | const S = struct { | 154 | const S = struct { |
test/behavior/bitcast.zig+19-12| ... | @@ -9,6 +9,7 @@ const minInt = std.math.minInt; | ... | @@ -9,6 +9,7 @@ const minInt = std.math.minInt; |
| 9 | const native_endian = builtin.target.cpu.arch.endian(); | 9 | const native_endian = builtin.target.cpu.arch.endian(); |
| 10 | 10 | ||
| 11 | test "@bitCast iX -> uX (32, 64)" { | 11 | test "@bitCast iX -> uX (32, 64)" { |
| 12 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 12 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 13 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 13 | 14 | ||
| 14 | const bit_values = [_]usize{ 32, 64 }; | 15 | const bit_values = [_]usize{ 32, 64 }; |
| ... | @@ -20,6 +21,7 @@ test "@bitCast iX -> uX (32, 64)" { | ... | @@ -20,6 +21,7 @@ test "@bitCast iX -> uX (32, 64)" { |
| 20 | } | 21 | } |
| 21 | 22 | ||
| 22 | test "@bitCast iX -> uX (8, 16, 128)" { | 23 | test "@bitCast iX -> uX (8, 16, 128)" { |
| 24 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 23 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 25 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 24 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 26 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 25 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 27 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -32,6 +34,7 @@ test "@bitCast iX -> uX (8, 16, 128)" { | ... | @@ -32,6 +34,7 @@ test "@bitCast iX -> uX (8, 16, 128)" { |
| 32 | } | 34 | } |
| 33 | 35 | ||
| 34 | test "@bitCast iX -> uX exotic integers" { | 36 | test "@bitCast iX -> uX exotic integers" { |
| 37 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 35 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 38 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 36 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 39 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 37 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 40 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -98,7 +101,7 @@ test "bitcast literal [4]u8 param to u32" { | ... | @@ -98,7 +101,7 @@ test "bitcast literal [4]u8 param to u32" { |
| 98 | } | 101 | } |
| 99 | 102 | ||
| 100 | test "bitcast generates a temporary value" { | 103 | test "bitcast generates a temporary value" { |
| 101 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 104 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 102 | 105 | ||
| 103 | var y: u16 = 0x55AA; | 106 | var y: u16 = 0x55AA; |
| 104 | _ = &y; | 107 | _ = &y; |
| ... | @@ -107,6 +110,7 @@ test "bitcast generates a temporary value" { | ... | @@ -107,6 +110,7 @@ test "bitcast generates a temporary value" { |
| 107 | } | 110 | } |
| 108 | 111 | ||
| 109 | test "@bitCast packed structs at runtime and comptime" { | 112 | test "@bitCast packed structs at runtime and comptime" { |
| 113 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 110 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 114 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 111 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 115 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 112 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 116 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -134,6 +138,7 @@ test "@bitCast packed structs at runtime and comptime" { | ... | @@ -134,6 +138,7 @@ test "@bitCast packed structs at runtime and comptime" { |
| 134 | } | 138 | } |
| 135 | 139 | ||
| 136 | test "bitcast packed struct to integer and back" { | 140 | test "bitcast packed struct to integer and back" { |
| 141 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 137 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 142 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 138 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 143 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 139 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 144 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -157,6 +162,7 @@ test "bitcast packed struct to integer and back" { | ... | @@ -157,6 +162,7 @@ test "bitcast packed struct to integer and back" { |
| 157 | } | 162 | } |
| 158 | 163 | ||
| 159 | test "implicit cast to error union by returning" { | 164 | test "implicit cast to error union by returning" { |
| 165 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 160 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 166 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 161 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 167 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 162 | 168 | ||
| ... | @@ -211,7 +217,7 @@ test "@bitCast packed struct of floats" { | ... | @@ -211,7 +217,7 @@ test "@bitCast packed struct of floats" { |
| 211 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 217 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 212 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 218 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 213 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 219 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 214 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 220 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 215 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 221 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 216 | 222 | ||
| 217 | const Foo = packed struct { | 223 | const Foo = packed struct { |
| ... | @@ -247,7 +253,7 @@ test "comptime @bitCast packed struct to int and back" { | ... | @@ -247,7 +253,7 @@ test "comptime @bitCast packed struct to int and back" { |
| 247 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 253 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 248 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 254 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 249 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 255 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 250 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 256 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 251 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 257 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 252 | 258 | ||
| 253 | const S = packed struct { | 259 | const S = packed struct { |
| ... | @@ -280,7 +286,7 @@ test "comptime @bitCast packed struct to int and back" { | ... | @@ -280,7 +286,7 @@ test "comptime @bitCast packed struct to int and back" { |
| 280 | test "bitcast vector to integer and back" { | 286 | test "bitcast vector to integer and back" { |
| 281 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 287 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 282 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 288 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 283 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 289 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 284 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 290 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 285 | 291 | ||
| 286 | var vec: @Vector(16, bool) = @splat(true); | 292 | var vec: @Vector(16, bool) = @splat(true); |
| ... | @@ -312,6 +318,7 @@ test "bitcast vector to integer and back" { | ... | @@ -312,6 +318,7 @@ test "bitcast vector to integer and back" { |
| 312 | } | 318 | } |
| 313 | 319 | ||
| 314 | test "bitcast vector elementwise" { | 320 | test "bitcast vector elementwise" { |
| 321 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 315 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 322 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 316 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 323 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 317 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 324 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -355,7 +362,7 @@ fn bitCastWrapper128(x: f128) u128 { | ... | @@ -355,7 +362,7 @@ fn bitCastWrapper128(x: f128) u128 { |
| 355 | } | 362 | } |
| 356 | test "bitcast nan float does not modify signaling bit" { | 363 | test "bitcast nan float does not modify signaling bit" { |
| 357 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 364 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 358 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 365 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 359 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 366 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 360 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isPowerPC()) return error.SkipZigTest; | 367 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isPowerPC()) return error.SkipZigTest; |
| 361 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | 368 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| ... | @@ -409,7 +416,7 @@ test "bitcast nan float does not modify signaling bit" { | ... | @@ -409,7 +416,7 @@ test "bitcast nan float does not modify signaling bit" { |
| 409 | test "@bitCast of packed struct of bools all true" { | 416 | test "@bitCast of packed struct of bools all true" { |
| 410 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 417 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 411 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 418 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 412 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 419 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 413 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 420 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 414 | 421 | ||
| 415 | const P = packed struct { | 422 | const P = packed struct { |
| ... | @@ -429,7 +436,7 @@ test "@bitCast of packed struct of bools all true" { | ... | @@ -429,7 +436,7 @@ test "@bitCast of packed struct of bools all true" { |
| 429 | test "@bitCast of packed struct of bools all false" { | 436 | test "@bitCast of packed struct of bools all false" { |
| 430 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 437 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 431 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 438 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 432 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 439 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 433 | 440 | ||
| 434 | const P = packed struct { | 441 | const P = packed struct { |
| 435 | b0: bool, | 442 | b0: bool, |
| ... | @@ -478,7 +485,7 @@ test "@bitCast of packed struct with void field and multiple integers" { | ... | @@ -478,7 +485,7 @@ test "@bitCast of packed struct with void field and multiple integers" { |
| 478 | } | 485 | } |
| 479 | 486 | ||
| 480 | test "@bitCast vector to array with different element size" { | 487 | test "@bitCast vector to array with different element size" { |
| 481 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 488 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 482 | 489 | ||
| 483 | const static = struct { | 490 | const static = struct { |
| 484 | fn doTheTest(v: @Vector(4, u5)) !void { | 491 | fn doTheTest(v: @Vector(4, u5)) !void { |
| ... | @@ -503,7 +510,7 @@ test "@bitCast vector to array with different element size" { | ... | @@ -503,7 +510,7 @@ test "@bitCast vector to array with different element size" { |
| 503 | } | 510 | } |
| 504 | 511 | ||
| 505 | test "@bitCast packed struct to array of bits" { | 512 | test "@bitCast packed struct to array of bits" { |
| 506 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 513 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 507 | 514 | ||
| 508 | const S = packed struct(u16) { | 515 | const S = packed struct(u16) { |
| 509 | foo: u5, | 516 | foo: u5, |
| ... | @@ -551,7 +558,7 @@ test "@bitCast packed struct to array of bits" { | ... | @@ -551,7 +558,7 @@ test "@bitCast packed struct to array of bits" { |
| 551 | } | 558 | } |
| 552 | 559 | ||
| 553 | test "@bitCast nested arrays of vectors" { | 560 | test "@bitCast nested arrays of vectors" { |
| 554 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 561 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 555 | 562 | ||
| 556 | const Src = [2][2]@Vector(4, u5); | 563 | const Src = [2][2]@Vector(4, u5); |
| 557 | const Dest = [5]@Vector(2, u8); | 564 | const Dest = [5]@Vector(2, u8); |
| ... | @@ -588,7 +595,7 @@ test "@bitCast nested arrays of vectors" { | ... | @@ -588,7 +595,7 @@ test "@bitCast nested arrays of vectors" { |
| 588 | } | 595 | } |
| 589 | 596 | ||
| 590 | test "@bitCast nested arrays of bool to scalar" { | 597 | test "@bitCast nested arrays of bool to scalar" { |
| 591 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 598 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 592 | 599 | ||
| 593 | const static = struct { | 600 | const static = struct { |
| 594 | fn doTheTest(src: [4][4]bool) !void { | 601 | fn doTheTest(src: [4][4]bool) !void { |
| ... | @@ -607,7 +614,7 @@ test "@bitCast nested arrays of bool to scalar" { | ... | @@ -607,7 +614,7 @@ test "@bitCast nested arrays of bool to scalar" { |
| 607 | } | 614 | } |
| 608 | 615 | ||
| 609 | test "@bitCast deeply nested arrays to scalar" { | 616 | test "@bitCast deeply nested arrays to scalar" { |
| 610 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 617 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 611 | 618 | ||
| 612 | const static = struct { | 619 | const static = struct { |
| 613 | fn doTheTest(src: [2][1][3][5]u4) !void { | 620 | fn doTheTest(src: [2][1][3][5]u4) !void { |
test/behavior/bitreverse.zig+4-4| ... | @@ -11,7 +11,7 @@ test "@bitReverse" { | ... | @@ -11,7 +11,7 @@ test "@bitReverse" { |
| 11 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 11 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 12 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 12 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 13 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 13 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 14 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 14 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 15 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 15 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 16 | 16 | ||
| 17 | try comptime testBitReverse(); | 17 | try comptime testBitReverse(); |
| ... | @@ -124,7 +124,7 @@ test "bitReverse vectors u8" { | ... | @@ -124,7 +124,7 @@ test "bitReverse vectors u8" { |
| 124 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 124 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 125 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 125 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 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_spirv) return error.SkipZigTest; | 127 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 128 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 128 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 129 | 129 | ||
| 130 | try comptime vector8(); | 130 | try comptime vector8(); |
| ... | @@ -143,7 +143,7 @@ test "bitReverse vectors u16" { | ... | @@ -143,7 +143,7 @@ test "bitReverse vectors u16" { |
| 143 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 143 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 145 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 145 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 146 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 146 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 147 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 147 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 148 | 148 | ||
| 149 | try comptime vector16(); | 149 | try comptime vector16(); |
| ... | @@ -162,7 +162,7 @@ test "bitReverse vectors u24" { | ... | @@ -162,7 +162,7 @@ test "bitReverse vectors u24" { |
| 162 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 162 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 163 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 163 | if (builtin.zig_backend == .stage2_arm) 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_spirv) return error.SkipZigTest; | 165 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 166 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 166 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 167 | 167 | ||
| 168 | try comptime vector24(); | 168 | try comptime vector24(); |
test/behavior/bool.zig+5| ... | @@ -9,6 +9,7 @@ test "bool literals" { | ... | @@ -9,6 +9,7 @@ test "bool literals" { |
| 9 | } | 9 | } |
| 10 | 10 | ||
| 11 | test "cast bool to int" { | 11 | test "cast bool to int" { |
| 12 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 12 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 13 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 13 | 14 | ||
| 14 | const t = true; | 15 | const t = true; |
| ... | @@ -48,6 +49,8 @@ test "compile time bool not" { | ... | @@ -48,6 +49,8 @@ test "compile time bool not" { |
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | test "short circuit" { | 51 | test "short circuit" { |
| 52 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 53 | |||
| 51 | try testShortCircuit(false, true); | 54 | try testShortCircuit(false, true); |
| 52 | try comptime testShortCircuit(false, true); | 55 | try comptime testShortCircuit(false, true); |
| 53 | } | 56 | } |
| ... | @@ -92,6 +95,8 @@ fn testShortCircuit(f: bool, t: bool) !void { | ... | @@ -92,6 +95,8 @@ fn testShortCircuit(f: bool, t: bool) !void { |
| 92 | } | 95 | } |
| 93 | 96 | ||
| 94 | test "or with noreturn operand" { | 97 | test "or with noreturn operand" { |
| 98 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 99 | |||
| 95 | const S = struct { | 100 | const S = struct { |
| 96 | fn foo(a: u32, b: u32) bool { | 101 | fn foo(a: u32, b: u32) bool { |
| 97 | return a == 5 or b == 2 or @panic("oh no"); | 102 | return a == 5 or b == 2 or @panic("oh no"); |
test/behavior/builtin_functions_returning_void_or_noreturn.zig+1-1| ... | @@ -8,7 +8,7 @@ var x: u8 = 1; | ... | @@ -8,7 +8,7 @@ var x: u8 = 1; |
| 8 | test { | 8 | test { |
| 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 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_spirv) return error.SkipZigTest; | 11 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 12 | 12 | ||
| 13 | var val: u8 = undefined; | 13 | var val: u8 = undefined; |
| 14 | try testing.expectEqual({}, @atomicStore(u8, &val, 0, .unordered)); | 14 | try testing.expectEqual({}, @atomicStore(u8, &val, 0, .unordered)); |
test/behavior/byteswap.zig+5-5| ... | @@ -6,7 +6,7 @@ test "@byteSwap integers" { | ... | @@ -6,7 +6,7 @@ test "@byteSwap integers" { |
| 6 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 6 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 7 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 7 | if (builtin.zig_backend == .stage2_riscv64) 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_spirv) return error.SkipZigTest; | 9 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 10 | 10 | ||
| 11 | const ByteSwapIntTest = struct { | 11 | const ByteSwapIntTest = struct { |
| 12 | fn run() !void { | 12 | fn run() !void { |
| ... | @@ -41,7 +41,7 @@ test "@byteSwap exotic integers" { | ... | @@ -41,7 +41,7 @@ test "@byteSwap exotic integers" { |
| 41 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 41 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 42 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 42 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 43 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 43 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 44 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 44 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 45 | 45 | ||
| 46 | const ByteSwapIntTest = struct { | 46 | const ByteSwapIntTest = struct { |
| 47 | fn run() !void { | 47 | fn run() !void { |
| ... | @@ -84,7 +84,7 @@ test "@byteSwap vectors u8" { | ... | @@ -84,7 +84,7 @@ test "@byteSwap vectors u8" { |
| 84 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 84 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 85 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 85 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 86 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 86 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 87 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 87 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 88 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 88 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 89 | 89 | ||
| 90 | try comptime vector8(); | 90 | try comptime vector8(); |
| ... | @@ -103,7 +103,7 @@ test "@byteSwap vectors u16" { | ... | @@ -103,7 +103,7 @@ test "@byteSwap vectors u16" { |
| 103 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 103 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 104 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 104 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 105 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 105 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 106 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 106 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 107 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 107 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 108 | 108 | ||
| 109 | try comptime vector16(); | 109 | try comptime vector16(); |
| ... | @@ -122,7 +122,7 @@ test "@byteSwap vectors u24" { | ... | @@ -122,7 +122,7 @@ test "@byteSwap vectors u24" { |
| 122 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 122 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 123 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 123 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 124 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 124 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 125 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 125 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 126 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 126 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 127 | 127 | ||
| 128 | try comptime vector24(); | 128 | try comptime vector24(); |
test/behavior/byval_arg_var.zig+1-1| ... | @@ -5,7 +5,7 @@ var result: []const u8 = "wrong"; | ... | @@ -5,7 +5,7 @@ var result: []const u8 = "wrong"; |
| 5 | 5 | ||
| 6 | test "pass string literal byvalue to a generic var param" { | 6 | test "pass string literal byvalue to a generic var param" { |
| 7 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 7 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 8 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 8 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 9 | 9 | ||
| 10 | start(); | 10 | start(); |
| 11 | blowUpStack(10); | 11 | blowUpStack(10); |
test/behavior/call.zig+21-13| ... | @@ -23,7 +23,7 @@ test "basic invocations" { | ... | @@ -23,7 +23,7 @@ test "basic invocations" { |
| 23 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 23 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 24 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 24 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 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_spirv) return error.SkipZigTest; | 26 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 27 | 27 | ||
| 28 | if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // MSVC doesn't support tail call modifiers | 28 | if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // MSVC doesn't support tail call modifiers |
| 29 | 29 | ||
| ... | @@ -61,7 +61,7 @@ test "basic invocations" { | ... | @@ -61,7 +61,7 @@ test "basic invocations" { |
| 61 | test "tuple parameters" { | 61 | test "tuple parameters" { |
| 62 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 62 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 63 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 63 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 64 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 64 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 65 | 65 | ||
| 66 | const add = struct { | 66 | const add = struct { |
| 67 | fn add(a: i32, b: i32) i32 { | 67 | fn add(a: i32, b: i32) i32 { |
| ... | @@ -92,6 +92,7 @@ test "tuple parameters" { | ... | @@ -92,6 +92,7 @@ test "tuple parameters" { |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | test "result location of function call argument through runtime condition and struct init" { | 94 | test "result location of function call argument through runtime condition and struct init" { |
| 95 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 95 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 96 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 96 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 97 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 97 | 98 | ||
| ... | @@ -112,6 +113,7 @@ test "result location of function call argument through runtime condition and st | ... | @@ -112,6 +113,7 @@ test "result location of function call argument through runtime condition and st |
| 112 | } | 113 | } |
| 113 | 114 | ||
| 114 | test "function call with 40 arguments" { | 115 | test "function call with 40 arguments" { |
| 116 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 115 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 117 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 116 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 118 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 117 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 119 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -273,7 +275,7 @@ test "forced tail call" { | ... | @@ -273,7 +275,7 @@ test "forced tail call" { |
| 273 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | 275 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 274 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO | 276 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 275 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 277 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 276 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 278 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 277 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 279 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 278 | 280 | ||
| 279 | if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) { | 281 | if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) { |
| ... | @@ -308,7 +310,7 @@ test "inline call preserves tail call" { | ... | @@ -308,7 +310,7 @@ test "inline call preserves tail call" { |
| 308 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | 310 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 309 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO | 311 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 310 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 312 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 311 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 313 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 312 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 314 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 313 | 315 | ||
| 314 | if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) { | 316 | if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) { |
| ... | @@ -341,7 +343,7 @@ test "inline call preserves tail call" { | ... | @@ -341,7 +343,7 @@ test "inline call preserves tail call" { |
| 341 | 343 | ||
| 342 | test "inline call doesn't re-evaluate non generic struct" { | 344 | test "inline call doesn't re-evaluate non generic struct" { |
| 343 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 345 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 344 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 346 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 345 | 347 | ||
| 346 | const S = struct { | 348 | const S = struct { |
| 347 | fn foo(f: struct { a: u8, b: u8 }) !void { | 349 | fn foo(f: struct { a: u8, b: u8 }) !void { |
| ... | @@ -355,6 +357,8 @@ test "inline call doesn't re-evaluate non generic struct" { | ... | @@ -355,6 +357,8 @@ test "inline call doesn't re-evaluate non generic struct" { |
| 355 | } | 357 | } |
| 356 | 358 | ||
| 357 | test "Enum constructed by @Enum passed as generic argument" { | 359 | test "Enum constructed by @Enum passed as generic argument" { |
| 360 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 361 | |||
| 358 | const S = struct { | 362 | const S = struct { |
| 359 | const E = std.meta.FieldEnum(struct { | 363 | const E = std.meta.FieldEnum(struct { |
| 360 | prev_pos: bool, | 364 | prev_pos: bool, |
| ... | @@ -407,7 +411,7 @@ test "recursive inline call with comptime known argument" { | ... | @@ -407,7 +411,7 @@ test "recursive inline call with comptime known argument" { |
| 407 | 411 | ||
| 408 | test "inline while with @call" { | 412 | test "inline while with @call" { |
| 409 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 413 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 410 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 414 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 411 | 415 | ||
| 412 | const S = struct { | 416 | const S = struct { |
| 413 | fn inc(a: *u32) void { | 417 | fn inc(a: *u32) void { |
| ... | @@ -423,6 +427,8 @@ test "inline while with @call" { | ... | @@ -423,6 +427,8 @@ test "inline while with @call" { |
| 423 | } | 427 | } |
| 424 | 428 | ||
| 425 | test "method call as parameter type" { | 429 | test "method call as parameter type" { |
| 430 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 431 | |||
| 426 | const S = struct { | 432 | const S = struct { |
| 427 | fn foo(x: anytype, y: @TypeOf(x).Inner()) @TypeOf(y) { | 433 | fn foo(x: anytype, y: @TypeOf(x).Inner()) @TypeOf(y) { |
| 428 | return y; | 434 | return y; |
| ... | @@ -436,6 +442,7 @@ test "method call as parameter type" { | ... | @@ -436,6 +442,7 @@ test "method call as parameter type" { |
| 436 | } | 442 | } |
| 437 | 443 | ||
| 438 | test "non-anytype generic parameters provide result type" { | 444 | test "non-anytype generic parameters provide result type" { |
| 445 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 439 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 446 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 440 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 447 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 441 | 448 | ||
| ... | @@ -464,6 +471,7 @@ test "non-anytype generic parameters provide result type" { | ... | @@ -464,6 +471,7 @@ test "non-anytype generic parameters provide result type" { |
| 464 | } | 471 | } |
| 465 | 472 | ||
| 466 | test "argument to generic function has correct result type" { | 473 | test "argument to generic function has correct result type" { |
| 474 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 467 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 475 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 468 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 476 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 469 | 477 | ||
| ... | @@ -491,7 +499,7 @@ test "argument to generic function has correct result type" { | ... | @@ -491,7 +499,7 @@ test "argument to generic function has correct result type" { |
| 491 | } | 499 | } |
| 492 | 500 | ||
| 493 | test "call inline fn through pointer" { | 501 | test "call inline fn through pointer" { |
| 494 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 502 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 495 | 503 | ||
| 496 | const S = struct { | 504 | const S = struct { |
| 497 | inline fn foo(x: u8) !void { | 505 | inline fn foo(x: u8) !void { |
| ... | @@ -517,7 +525,7 @@ test "call function in comptime field" { | ... | @@ -517,7 +525,7 @@ test "call function in comptime field" { |
| 517 | test "call function pointer in comptime field" { | 525 | test "call function pointer in comptime field" { |
| 518 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 526 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 519 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 527 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 520 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 528 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 521 | 529 | ||
| 522 | const Auto = struct { | 530 | const Auto = struct { |
| 523 | auto: [max_len]u8 = undefined, | 531 | auto: [max_len]u8 = undefined, |
| ... | @@ -538,7 +546,7 @@ test "call function pointer in comptime field" { | ... | @@ -538,7 +546,7 @@ test "call function pointer in comptime field" { |
| 538 | } | 546 | } |
| 539 | 547 | ||
| 540 | test "generic function pointer can be called" { | 548 | test "generic function pointer can be called" { |
| 541 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 549 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 542 | 550 | ||
| 543 | const S = struct { | 551 | const S = struct { |
| 544 | var ok = false; | 552 | var ok = false; |
| ... | @@ -615,7 +623,7 @@ test "call with union with zero sized field is not memorized incorrectly" { | ... | @@ -615,7 +623,7 @@ test "call with union with zero sized field is not memorized incorrectly" { |
| 615 | test "function call with cast to anyopaque pointer" { | 623 | test "function call with cast to anyopaque pointer" { |
| 616 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 624 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 617 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 625 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 618 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 626 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 619 | 627 | ||
| 620 | const Foo = struct { | 628 | const Foo = struct { |
| 621 | y: u8, | 629 | y: u8, |
| ... | @@ -633,7 +641,7 @@ test "arguments pointed to on stack into tailcall" { | ... | @@ -633,7 +641,7 @@ test "arguments pointed to on stack into tailcall" { |
| 633 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 641 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 634 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 642 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 635 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | 643 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 636 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 644 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 637 | if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // MSVC doesn't support always tail calls | 645 | if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // MSVC doesn't support always tail calls |
| 638 | 646 | ||
| 639 | switch (builtin.cpu.arch) { | 647 | switch (builtin.cpu.arch) { |
| ... | @@ -707,7 +715,7 @@ test "tail call function pointer" { | ... | @@ -707,7 +715,7 @@ test "tail call function pointer" { |
| 707 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | 715 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 708 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO | 716 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 709 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 717 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 710 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 718 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 711 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 719 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 712 | 720 | ||
| 713 | if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) { | 721 | if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) { |
| ... | @@ -737,7 +745,7 @@ test "tail call function pointer" { | ... | @@ -737,7 +745,7 @@ test "tail call function pointer" { |
| 737 | test "tail call with potentially extended types" { | 745 | test "tail call with potentially extended types" { |
| 738 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | 746 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 739 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO | 747 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 740 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 748 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 741 | 749 | ||
| 742 | if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) { | 750 | if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) { |
| 743 | if (builtin.cpu.arch.isMIPS() or builtin.cpu.arch.isPowerPC() or builtin.cpu.arch.isWasm()) { | 751 | if (builtin.cpu.arch.isMIPS() or builtin.cpu.arch.isPowerPC() or builtin.cpu.arch.isWasm()) { |
test/behavior/cast.zig+129-97| ... | @@ -21,6 +21,7 @@ test "integer literal to pointer cast" { | ... | @@ -21,6 +21,7 @@ test "integer literal to pointer cast" { |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | test "peer type resolution: ?T and T" { | 23 | test "peer type resolution: ?T and T" { |
| 24 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 24 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 25 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 25 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 26 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 26 | 27 | ||
| ... | @@ -67,6 +68,7 @@ test "implicit cast comptime_int to comptime_float" { | ... | @@ -67,6 +68,7 @@ test "implicit cast comptime_int to comptime_float" { |
| 67 | } | 68 | } |
| 68 | 69 | ||
| 69 | test "comptime_int @floatFromInt" { | 70 | test "comptime_int @floatFromInt" { |
| 71 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 70 | { | 72 | { |
| 71 | const result = @as(f16, @floatFromInt(1234)); | 73 | const result = @as(f16, @floatFromInt(1234)); |
| 72 | try expect(@TypeOf(result) == f16); | 74 | try expect(@TypeOf(result) == f16); |
| ... | @@ -97,6 +99,7 @@ test "comptime_int @floatFromInt" { | ... | @@ -97,6 +99,7 @@ test "comptime_int @floatFromInt" { |
| 97 | } | 99 | } |
| 98 | 100 | ||
| 99 | test "@floatFromInt" { | 101 | test "@floatFromInt" { |
| 102 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 100 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 103 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 101 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 104 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 102 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 105 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -126,7 +129,7 @@ fn testIntFromFloat(comptime F: type, f: F, comptime I: type, i: I) !void { | ... | @@ -126,7 +129,7 @@ fn testIntFromFloat(comptime F: type, f: F, comptime I: type, i: I) !void { |
| 126 | } | 129 | } |
| 127 | 130 | ||
| 128 | test "@intFromFloat > 128 bits" { | 131 | test "@intFromFloat > 128 bits" { |
| 129 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 132 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 130 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 133 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 131 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | 134 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 132 | 135 | ||
| ... | @@ -151,7 +154,7 @@ fn testFloatFromInt(comptime I: type, i: I, comptime F: type, expected: F) !void | ... | @@ -151,7 +154,7 @@ fn testFloatFromInt(comptime I: type, i: I, comptime F: type, expected: F) !void |
| 151 | } | 154 | } |
| 152 | 155 | ||
| 153 | test "@floatFromInt > 128 bits" { | 156 | test "@floatFromInt > 128 bits" { |
| 154 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 157 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 155 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 158 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 156 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | 159 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 157 | 160 | ||
| ... | @@ -174,7 +177,7 @@ test "@floatFromInt > 128 bits" { | ... | @@ -174,7 +177,7 @@ test "@floatFromInt > 128 bits" { |
| 174 | test "@floatFromInt(f80)" { | 177 | test "@floatFromInt(f80)" { |
| 175 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 178 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 176 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 179 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 177 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 180 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 178 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 181 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 179 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | 182 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 180 | 183 | ||
| ... | @@ -212,7 +215,7 @@ test "@floatFromInt(f80)" { | ... | @@ -212,7 +215,7 @@ test "@floatFromInt(f80)" { |
| 212 | } | 215 | } |
| 213 | 216 | ||
| 214 | test "type coercion from int to float" { | 217 | test "type coercion from int to float" { |
| 215 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 218 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 216 | 219 | ||
| 217 | const check = struct { | 220 | const check = struct { |
| 218 | // Check that an integer value can be coerced to a float type and | 221 | // Check that an integer value can be coerced to a float type and |
| ... | @@ -273,6 +276,7 @@ test "type coercion from int to float" { | ... | @@ -273,6 +276,7 @@ test "type coercion from int to float" { |
| 273 | } | 276 | } |
| 274 | 277 | ||
| 275 | test "@intFromFloat" { | 278 | test "@intFromFloat" { |
| 279 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 276 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 280 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 277 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 281 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 278 | 282 | ||
| ... | @@ -299,10 +303,11 @@ fn testIntFromFloats() !void { | ... | @@ -299,10 +303,11 @@ fn testIntFromFloats() !void { |
| 299 | 303 | ||
| 300 | try expectRoundCast(f32, -128.2, i8, -128); | 304 | try expectRoundCast(f32, -128.2, i8, -128); |
| 301 | try expectCeilCast(f32, -128.2, i8, -128); | 305 | try expectCeilCast(f32, -128.2, i8, -128); |
| 302 | try expectTruncCast(f32, -128.2, i8, -128); | ||
| 303 | } | 306 | } |
| 304 | 307 | ||
| 305 | test "rounding builtins with anytype and context propagation" { | 308 | test "rounding builtins with anytype and context propagation" { |
| 309 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 310 | |||
| 306 | const S = struct { | 311 | const S = struct { |
| 307 | const x: i32 = 10; | 312 | const x: i32 = 10; |
| 308 | fn check(expected: anytype, actual: anytype) !void { | 313 | fn check(expected: anytype, actual: anytype) !void { |
| ... | @@ -338,7 +343,8 @@ fn expectTruncCast(comptime F: type, f: F, comptime I: type, i: I) !void { | ... | @@ -338,7 +343,8 @@ fn expectTruncCast(comptime F: type, f: F, comptime I: type, i: I) !void { |
| 338 | 343 | ||
| 339 | test "implicitly cast indirect pointer to maybe-indirect pointer" { | 344 | test "implicitly cast indirect pointer to maybe-indirect pointer" { |
| 340 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 345 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 341 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 346 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 347 | |||
| 342 | const S = struct { | 348 | const S = struct { |
| 343 | const Self = @This(); | 349 | const Self = @This(); |
| 344 | x: u8, | 350 | x: u8, |
| ... | @@ -372,6 +378,8 @@ test "@intCast comptime_int" { | ... | @@ -372,6 +378,8 @@ test "@intCast comptime_int" { |
| 372 | } | 378 | } |
| 373 | 379 | ||
| 374 | test "@floatCast comptime_int and comptime_float" { | 380 | test "@floatCast comptime_int and comptime_float" { |
| 381 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 382 | |||
| 375 | { | 383 | { |
| 376 | const result = @as(f16, @floatCast(1234)); | 384 | const result = @as(f16, @floatCast(1234)); |
| 377 | try expect(@TypeOf(result) == f16); | 385 | try expect(@TypeOf(result) == f16); |
| ... | @@ -416,7 +424,7 @@ fn MakeType(comptime T: type) type { | ... | @@ -416,7 +424,7 @@ fn MakeType(comptime T: type) type { |
| 416 | 424 | ||
| 417 | test "implicit cast from *[N]T to [*c]T" { | 425 | test "implicit cast from *[N]T to [*c]T" { |
| 418 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 426 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 419 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 427 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 420 | 428 | ||
| 421 | var x: [4]u16 = [4]u16{ 0, 1, 2, 3 }; | 429 | var x: [4]u16 = [4]u16{ 0, 1, 2, 3 }; |
| 422 | var y: [*c]u16 = &x; | 430 | var y: [*c]u16 = &x; |
| ... | @@ -451,6 +459,7 @@ test "@intCast to u0 and use the result" { | ... | @@ -451,6 +459,7 @@ test "@intCast to u0 and use the result" { |
| 451 | } | 459 | } |
| 452 | 460 | ||
| 453 | test "peer result null and comptime_int" { | 461 | test "peer result null and comptime_int" { |
| 462 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 454 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 463 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 455 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 464 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 456 | 465 | ||
| ... | @@ -477,7 +486,7 @@ test "peer result null and comptime_int" { | ... | @@ -477,7 +486,7 @@ test "peer result null and comptime_int" { |
| 477 | test "*const ?[*]const T to [*c]const [*c]const T" { | 486 | test "*const ?[*]const T to [*c]const [*c]const T" { |
| 478 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 487 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 479 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 488 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 480 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 489 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 481 | 490 | ||
| 482 | var array = [_]u8{ 'o', 'k' }; | 491 | var array = [_]u8{ 'o', 'k' }; |
| 483 | const opt_array_ptr: ?[*]const u8 = &array; | 492 | const opt_array_ptr: ?[*]const u8 = &array; |
| ... | @@ -489,7 +498,7 @@ test "*const ?[*]const T to [*c]const [*c]const T" { | ... | @@ -489,7 +498,7 @@ test "*const ?[*]const T to [*c]const [*c]const T" { |
| 489 | 498 | ||
| 490 | test "array coercion to undefined at runtime" { | 499 | test "array coercion to undefined at runtime" { |
| 491 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 500 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 492 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 501 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 493 | 502 | ||
| 494 | @setRuntimeSafety(true); | 503 | @setRuntimeSafety(true); |
| 495 | 504 | ||
| ... | @@ -516,6 +525,7 @@ fn implicitIntLitToOptional() void { | ... | @@ -516,6 +525,7 @@ fn implicitIntLitToOptional() void { |
| 516 | } | 525 | } |
| 517 | 526 | ||
| 518 | test "return u8 coercing into ?u32 return type" { | 527 | test "return u8 coercing into ?u32 return type" { |
| 528 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 519 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 529 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 520 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 530 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 521 | 531 | ||
| ... | @@ -537,6 +547,7 @@ test "cast from ?[*]T to ??[*]T" { | ... | @@ -537,6 +547,7 @@ test "cast from ?[*]T to ??[*]T" { |
| 537 | } | 547 | } |
| 538 | 548 | ||
| 539 | test "peer type unsigned int to signed" { | 549 | test "peer type unsigned int to signed" { |
| 550 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 540 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 551 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 541 | 552 | ||
| 542 | var w: u31 = 5; | 553 | var w: u31 = 5; |
| ... | @@ -550,7 +561,7 @@ test "peer type unsigned int to signed" { | ... | @@ -550,7 +561,7 @@ test "peer type unsigned int to signed" { |
| 550 | 561 | ||
| 551 | test "expected [*c]const u8, found [*:0]const u8" { | 562 | test "expected [*c]const u8, found [*:0]const u8" { |
| 552 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 563 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 553 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 564 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 554 | 565 | ||
| 555 | var a: [*:0]const u8 = "hello"; | 566 | var a: [*:0]const u8 = "hello"; |
| 556 | _ = &a; | 567 | _ = &a; |
| ... | @@ -562,7 +573,7 @@ test "expected [*c]const u8, found [*:0]const u8" { | ... | @@ -562,7 +573,7 @@ test "expected [*c]const u8, found [*:0]const u8" { |
| 562 | test "explicit cast from integer to error type" { | 573 | test "explicit cast from integer to error type" { |
| 563 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 574 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 564 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 575 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 565 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 576 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 566 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 577 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 567 | 578 | ||
| 568 | try testCastIntToErr(error.ItBroke); | 579 | try testCastIntToErr(error.ItBroke); |
| ... | @@ -577,7 +588,7 @@ fn testCastIntToErr(err: anyerror) !void { | ... | @@ -577,7 +588,7 @@ fn testCastIntToErr(err: anyerror) !void { |
| 577 | test "peer resolve array and const slice" { | 588 | test "peer resolve array and const slice" { |
| 578 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 589 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 579 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 590 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 580 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 591 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 581 | 592 | ||
| 582 | try testPeerResolveArrayConstSlice(true); | 593 | try testPeerResolveArrayConstSlice(true); |
| 583 | try comptime testPeerResolveArrayConstSlice(true); | 594 | try comptime testPeerResolveArrayConstSlice(true); |
| ... | @@ -590,7 +601,7 @@ fn testPeerResolveArrayConstSlice(b: bool) !void { | ... | @@ -590,7 +601,7 @@ fn testPeerResolveArrayConstSlice(b: bool) !void { |
| 590 | } | 601 | } |
| 591 | 602 | ||
| 592 | test "implicitly cast from T to anyerror!?T" { | 603 | test "implicitly cast from T to anyerror!?T" { |
| 593 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 604 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 594 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 605 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 595 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 606 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 596 | 607 | ||
| ... | @@ -616,7 +627,7 @@ fn castToOptionalTypeError(z: i32) !void { | ... | @@ -616,7 +627,7 @@ fn castToOptionalTypeError(z: i32) !void { |
| 616 | } | 627 | } |
| 617 | 628 | ||
| 618 | test "implicitly cast from [0]T to anyerror![]T" { | 629 | test "implicitly cast from [0]T to anyerror![]T" { |
| 619 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 630 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 620 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 631 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 621 | 632 | ||
| 622 | try testCastZeroArrayToErrSliceMut(); | 633 | try testCastZeroArrayToErrSliceMut(); |
| ... | @@ -634,7 +645,7 @@ fn gimmeErrOrSlice() anyerror![]u8 { | ... | @@ -634,7 +645,7 @@ fn gimmeErrOrSlice() anyerror![]u8 { |
| 634 | test "peer type resolution: [0]u8, []const u8, and anyerror![]u8" { | 645 | test "peer type resolution: [0]u8, []const u8, and anyerror![]u8" { |
| 635 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 646 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 636 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 647 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 637 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 648 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 638 | 649 | ||
| 639 | const S = struct { | 650 | const S = struct { |
| 640 | fn doTheTest() anyerror!void { | 651 | fn doTheTest() anyerror!void { |
| ... | @@ -665,7 +676,7 @@ fn peerTypeEmptyArrayAndSliceAndError(a: bool, slice: []u8) anyerror![]u8 { | ... | @@ -665,7 +676,7 @@ fn peerTypeEmptyArrayAndSliceAndError(a: bool, slice: []u8) anyerror![]u8 { |
| 665 | 676 | ||
| 666 | test "implicit cast from *const [N]T to []const T" { | 677 | test "implicit cast from *const [N]T to []const T" { |
| 667 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 678 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 668 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 679 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 669 | 680 | ||
| 670 | try testCastConstArrayRefToConstSlice(); | 681 | try testCastConstArrayRefToConstSlice(); |
| 671 | try comptime testCastConstArrayRefToConstSlice(); | 682 | try comptime testCastConstArrayRefToConstSlice(); |
| ... | @@ -690,7 +701,7 @@ fn testCastConstArrayRefToConstSlice() !void { | ... | @@ -690,7 +701,7 @@ fn testCastConstArrayRefToConstSlice() !void { |
| 690 | 701 | ||
| 691 | test "peer type resolution: error and [N]T" { | 702 | test "peer type resolution: error and [N]T" { |
| 692 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 703 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 693 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 704 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 694 | 705 | ||
| 695 | try expect(mem.eql(u8, try testPeerErrorAndArray(0), "OK")); | 706 | try expect(mem.eql(u8, try testPeerErrorAndArray(0), "OK")); |
| 696 | comptime assert(mem.eql(u8, try testPeerErrorAndArray(0), "OK")); | 707 | comptime assert(mem.eql(u8, try testPeerErrorAndArray(0), "OK")); |
| ... | @@ -714,7 +725,7 @@ fn testPeerErrorAndArray2(x: u8) anyerror![]const u8 { | ... | @@ -714,7 +725,7 @@ fn testPeerErrorAndArray2(x: u8) anyerror![]const u8 { |
| 714 | 725 | ||
| 715 | test "single-item pointer of array to slice to unknown length pointer" { | 726 | test "single-item pointer of array to slice to unknown length pointer" { |
| 716 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 727 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 717 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 728 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 718 | 729 | ||
| 719 | try testCastPtrOfArrayToSliceAndPtr(); | 730 | try testCastPtrOfArrayToSliceAndPtr(); |
| 720 | try comptime testCastPtrOfArrayToSliceAndPtr(); | 731 | try comptime testCastPtrOfArrayToSliceAndPtr(); |
| ... | @@ -743,7 +754,7 @@ fn testCastPtrOfArrayToSliceAndPtr() !void { | ... | @@ -743,7 +754,7 @@ fn testCastPtrOfArrayToSliceAndPtr() !void { |
| 743 | 754 | ||
| 744 | test "cast *[1][*]const u8 to [*]const ?[*]const u8" { | 755 | test "cast *[1][*]const u8 to [*]const ?[*]const u8" { |
| 745 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 756 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 746 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 757 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 747 | 758 | ||
| 748 | const window_name = [1][*]const u8{"window name"}; | 759 | const window_name = [1][*]const u8{"window name"}; |
| 749 | const x: [*]const ?[*]const u8 = &window_name; | 760 | const x: [*]const ?[*]const u8 = &window_name; |
| ... | @@ -755,7 +766,7 @@ test "@intCast on vector" { | ... | @@ -755,7 +766,7 @@ test "@intCast on vector" { |
| 755 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 766 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 756 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 767 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 757 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 768 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 758 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 769 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 759 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; | 770 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| 760 | 771 | ||
| 761 | const S = struct { | 772 | const S = struct { |
| ... | @@ -1027,7 +1038,7 @@ test "peer cast: error set any anyerror" { | ... | @@ -1027,7 +1038,7 @@ test "peer cast: error set any anyerror" { |
| 1027 | test "peer type resolution: error set supersets" { | 1038 | test "peer type resolution: error set supersets" { |
| 1028 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1039 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1029 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1040 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1030 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1041 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1031 | 1042 | ||
| 1032 | const a: error{ One, Two } = undefined; | 1043 | const a: error{ One, Two } = undefined; |
| 1033 | const b: error{One} = undefined; | 1044 | const b: error{One} = undefined; |
| ... | @@ -1056,7 +1067,7 @@ test "peer type resolution: error set supersets" { | ... | @@ -1056,7 +1067,7 @@ test "peer type resolution: error set supersets" { |
| 1056 | test "peer type resolution: disjoint error sets" { | 1067 | test "peer type resolution: disjoint error sets" { |
| 1057 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1068 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1058 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1069 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1059 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1070 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1060 | 1071 | ||
| 1061 | const a: error{ One, Two } = undefined; | 1072 | const a: error{ One, Two } = undefined; |
| 1062 | const b: error{Three} = undefined; | 1073 | const b: error{Three} = undefined; |
| ... | @@ -1085,7 +1096,7 @@ test "peer type resolution: disjoint error sets" { | ... | @@ -1085,7 +1096,7 @@ test "peer type resolution: disjoint error sets" { |
| 1085 | test "peer type resolution: error union and error set" { | 1096 | test "peer type resolution: error union and error set" { |
| 1086 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1097 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1087 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1098 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1088 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1099 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1089 | 1100 | ||
| 1090 | const a: error{Three} = undefined; | 1101 | const a: error{Three} = undefined; |
| 1091 | const b: error{ One, Two }!u32 = undefined; | 1102 | const b: error{ One, Two }!u32 = undefined; |
| ... | @@ -1118,7 +1129,7 @@ test "peer type resolution: error union and error set" { | ... | @@ -1118,7 +1129,7 @@ test "peer type resolution: error union and error set" { |
| 1118 | test "peer type resolution: error union after non-error" { | 1129 | test "peer type resolution: error union after non-error" { |
| 1119 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1130 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1120 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1131 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1121 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1132 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1122 | 1133 | ||
| 1123 | const a: u32 = undefined; | 1134 | const a: u32 = undefined; |
| 1124 | const b: error{ One, Two }!u32 = undefined; | 1135 | const b: error{ One, Two }!u32 = undefined; |
| ... | @@ -1151,7 +1162,7 @@ test "peer type resolution: error union after non-error" { | ... | @@ -1151,7 +1162,7 @@ test "peer type resolution: error union after non-error" { |
| 1151 | test "peer cast *[0]T to E![]const T" { | 1162 | test "peer cast *[0]T to E![]const T" { |
| 1152 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1163 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1153 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1164 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1154 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1165 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1155 | 1166 | ||
| 1156 | var buffer: [5]u8 = "abcde".*; | 1167 | var buffer: [5]u8 = "abcde".*; |
| 1157 | const buf: anyerror![]const u8 = buffer[0..]; | 1168 | const buf: anyerror![]const u8 = buffer[0..]; |
| ... | @@ -1166,7 +1177,7 @@ test "peer cast *[0]T to E![]const T" { | ... | @@ -1166,7 +1177,7 @@ test "peer cast *[0]T to E![]const T" { |
| 1166 | test "peer cast *[0]T to []const T" { | 1177 | test "peer cast *[0]T to []const T" { |
| 1167 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1178 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1168 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1179 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1169 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1180 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1170 | 1181 | ||
| 1171 | var buffer: [5]u8 = "abcde".*; | 1182 | var buffer: [5]u8 = "abcde".*; |
| 1172 | const buf: []const u8 = buffer[0..]; | 1183 | const buf: []const u8 = buffer[0..]; |
| ... | @@ -1177,6 +1188,7 @@ test "peer cast *[0]T to []const T" { | ... | @@ -1177,6 +1188,7 @@ test "peer cast *[0]T to []const T" { |
| 1177 | } | 1188 | } |
| 1178 | 1189 | ||
| 1179 | test "peer cast *[N]T to [*]T" { | 1190 | test "peer cast *[N]T to [*]T" { |
| 1191 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1180 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1192 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1181 | 1193 | ||
| 1182 | var array = [4:99]i32{ 1, 2, 3, 4 }; | 1194 | var array = [4:99]i32{ 1, 2, 3, 4 }; |
| ... | @@ -1189,7 +1201,7 @@ test "peer cast *[N]T to [*]T" { | ... | @@ -1189,7 +1201,7 @@ test "peer cast *[N]T to [*]T" { |
| 1189 | test "peer resolution of string literals" { | 1201 | test "peer resolution of string literals" { |
| 1190 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1202 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1191 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1203 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1192 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1204 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1193 | 1205 | ||
| 1194 | const S = struct { | 1206 | const S = struct { |
| 1195 | const E = enum { a, b, c, d }; | 1207 | const E = enum { a, b, c, d }; |
| ... | @@ -1210,7 +1222,7 @@ test "peer resolution of string literals" { | ... | @@ -1210,7 +1222,7 @@ test "peer resolution of string literals" { |
| 1210 | 1222 | ||
| 1211 | test "peer cast [:x]T to []T" { | 1223 | test "peer cast [:x]T to []T" { |
| 1212 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1224 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1213 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1225 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1214 | 1226 | ||
| 1215 | const S = struct { | 1227 | const S = struct { |
| 1216 | fn doTheTest() !void { | 1228 | fn doTheTest() !void { |
| ... | @@ -1226,7 +1238,7 @@ test "peer cast [:x]T to []T" { | ... | @@ -1226,7 +1238,7 @@ test "peer cast [:x]T to []T" { |
| 1226 | 1238 | ||
| 1227 | test "peer cast [N:x]T to [N]T" { | 1239 | test "peer cast [N:x]T to [N]T" { |
| 1228 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1240 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1229 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1241 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1230 | 1242 | ||
| 1231 | const S = struct { | 1243 | const S = struct { |
| 1232 | fn doTheTest() !void { | 1244 | fn doTheTest() !void { |
| ... | @@ -1242,7 +1254,7 @@ test "peer cast [N:x]T to [N]T" { | ... | @@ -1242,7 +1254,7 @@ test "peer cast [N:x]T to [N]T" { |
| 1242 | 1254 | ||
| 1243 | test "peer cast *[N:x]T to *[N]T" { | 1255 | test "peer cast *[N:x]T to *[N]T" { |
| 1244 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1256 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1245 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1257 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1246 | 1258 | ||
| 1247 | const S = struct { | 1259 | const S = struct { |
| 1248 | fn doTheTest() !void { | 1260 | fn doTheTest() !void { |
| ... | @@ -1258,7 +1270,7 @@ test "peer cast *[N:x]T to *[N]T" { | ... | @@ -1258,7 +1270,7 @@ test "peer cast *[N:x]T to *[N]T" { |
| 1258 | test "peer cast [*:x]T to [*]T" { | 1270 | test "peer cast [*:x]T to [*]T" { |
| 1259 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1271 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1260 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1272 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1261 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1273 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1262 | 1274 | ||
| 1263 | const S = struct { | 1275 | const S = struct { |
| 1264 | fn doTheTest() !void { | 1276 | fn doTheTest() !void { |
| ... | @@ -1278,7 +1290,7 @@ test "peer cast [*:x]T to [*]T" { | ... | @@ -1278,7 +1290,7 @@ test "peer cast [*:x]T to [*]T" { |
| 1278 | test "peer cast [:x]T to [*:x]T" { | 1290 | test "peer cast [:x]T to [*:x]T" { |
| 1279 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1291 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1280 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1292 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1281 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1293 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1282 | 1294 | ||
| 1283 | const S = struct { | 1295 | const S = struct { |
| 1284 | fn doTheTest() !void { | 1296 | fn doTheTest() !void { |
| ... | @@ -1298,7 +1310,7 @@ test "peer cast [:x]T to [*:x]T" { | ... | @@ -1298,7 +1310,7 @@ test "peer cast [:x]T to [*:x]T" { |
| 1298 | 1310 | ||
| 1299 | test "peer type resolution implicit cast to return type" { | 1311 | test "peer type resolution implicit cast to return type" { |
| 1300 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1312 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1301 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1313 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1302 | 1314 | ||
| 1303 | const S = struct { | 1315 | const S = struct { |
| 1304 | fn doTheTest() !void { | 1316 | fn doTheTest() !void { |
| ... | @@ -1318,7 +1330,7 @@ test "peer type resolution implicit cast to return type" { | ... | @@ -1318,7 +1330,7 @@ test "peer type resolution implicit cast to return type" { |
| 1318 | 1330 | ||
| 1319 | test "peer type resolution implicit cast to variable type" { | 1331 | test "peer type resolution implicit cast to variable type" { |
| 1320 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1332 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1321 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1333 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1322 | 1334 | ||
| 1323 | const S = struct { | 1335 | const S = struct { |
| 1324 | fn doTheTest() !void { | 1336 | fn doTheTest() !void { |
| ... | @@ -1343,7 +1355,7 @@ test "variable initialization uses result locations properly with regards to the | ... | @@ -1343,7 +1355,7 @@ test "variable initialization uses result locations properly with regards to the |
| 1343 | 1355 | ||
| 1344 | test "cast between C pointer with different but compatible types" { | 1356 | test "cast between C pointer with different but compatible types" { |
| 1345 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1357 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1346 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1358 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1347 | 1359 | ||
| 1348 | const S = struct { | 1360 | const S = struct { |
| 1349 | fn foo(arg: [*]c_ushort) u16 { | 1361 | fn foo(arg: [*]c_ushort) u16 { |
| ... | @@ -1360,7 +1372,7 @@ test "cast between C pointer with different but compatible types" { | ... | @@ -1360,7 +1372,7 @@ test "cast between C pointer with different but compatible types" { |
| 1360 | 1372 | ||
| 1361 | test "peer type resolve string lit with sentinel-terminated mutable slice" { | 1373 | test "peer type resolve string lit with sentinel-terminated mutable slice" { |
| 1362 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1374 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1363 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1375 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1364 | 1376 | ||
| 1365 | var array: [4:0]u8 = undefined; | 1377 | var array: [4:0]u8 = undefined; |
| 1366 | array[4] = 0; // TODO remove this when #4372 is solved | 1378 | array[4] = 0; // TODO remove this when #4372 is solved |
| ... | @@ -1370,6 +1382,8 @@ test "peer type resolve string lit with sentinel-terminated mutable slice" { | ... | @@ -1370,6 +1382,8 @@ test "peer type resolve string lit with sentinel-terminated mutable slice" { |
| 1370 | } | 1382 | } |
| 1371 | 1383 | ||
| 1372 | test "peer type resolve array pointers, one of them const" { | 1384 | test "peer type resolve array pointers, one of them const" { |
| 1385 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1386 | |||
| 1373 | var array1: [4]u8 = undefined; | 1387 | var array1: [4]u8 = undefined; |
| 1374 | const array2: [5]u8 = undefined; | 1388 | const array2: [5]u8 = undefined; |
| 1375 | comptime assert(@TypeOf(&array1, &array2) == []const u8); | 1389 | comptime assert(@TypeOf(&array1, &array2) == []const u8); |
| ... | @@ -1377,6 +1391,8 @@ test "peer type resolve array pointers, one of them const" { | ... | @@ -1377,6 +1391,8 @@ test "peer type resolve array pointers, one of them const" { |
| 1377 | } | 1391 | } |
| 1378 | 1392 | ||
| 1379 | test "peer type resolve array pointer and unknown pointer" { | 1393 | test "peer type resolve array pointer and unknown pointer" { |
| 1394 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1395 | |||
| 1380 | const const_array: [4]u8 = undefined; | 1396 | const const_array: [4]u8 = undefined; |
| 1381 | var array: [4]u8 = undefined; | 1397 | var array: [4]u8 = undefined; |
| 1382 | var const_ptr: [*]const u8 = undefined; | 1398 | var const_ptr: [*]const u8 = undefined; |
| ... | @@ -1397,6 +1413,8 @@ test "peer type resolve array pointer and unknown pointer" { | ... | @@ -1397,6 +1413,8 @@ test "peer type resolve array pointer and unknown pointer" { |
| 1397 | } | 1413 | } |
| 1398 | 1414 | ||
| 1399 | test "comptime float casts" { | 1415 | test "comptime float casts" { |
| 1416 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1417 | |||
| 1400 | const a = @as(comptime_float, @floatFromInt(1)); | 1418 | const a = @as(comptime_float, @floatFromInt(1)); |
| 1401 | try expect(a == 1); | 1419 | try expect(a == 1); |
| 1402 | try expect(@TypeOf(a) == comptime_float); | 1420 | try expect(@TypeOf(a) == comptime_float); |
| ... | @@ -1431,7 +1449,7 @@ test "pointer reinterpret const float to int" { | ... | @@ -1431,7 +1449,7 @@ test "pointer reinterpret const float to int" { |
| 1431 | test "implicit cast from [*]T to ?*anyopaque" { | 1449 | test "implicit cast from [*]T to ?*anyopaque" { |
| 1432 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1450 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1433 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1451 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1434 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1452 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1435 | 1453 | ||
| 1436 | var a = [_]u8{ 3, 2, 1 }; | 1454 | var a = [_]u8{ 3, 2, 1 }; |
| 1437 | var runtime_zero: usize = 0; | 1455 | var runtime_zero: usize = 0; |
| ... | @@ -1448,7 +1466,7 @@ fn incrementVoidPtrArray(array: ?*anyopaque, len: usize) void { | ... | @@ -1448,7 +1466,7 @@ fn incrementVoidPtrArray(array: ?*anyopaque, len: usize) void { |
| 1448 | } | 1466 | } |
| 1449 | 1467 | ||
| 1450 | test "compile time int to ptr of function" { | 1468 | test "compile time int to ptr of function" { |
| 1451 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1469 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1452 | 1470 | ||
| 1453 | try foobar(FUNCTION_CONSTANT); | 1471 | try foobar(FUNCTION_CONSTANT); |
| 1454 | } | 1472 | } |
| ... | @@ -1463,7 +1481,7 @@ fn foobar(func: PFN_void) !void { | ... | @@ -1463,7 +1481,7 @@ fn foobar(func: PFN_void) !void { |
| 1463 | } | 1481 | } |
| 1464 | 1482 | ||
| 1465 | test "cast function with an opaque parameter" { | 1483 | test "cast function with an opaque parameter" { |
| 1466 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1484 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1467 | 1485 | ||
| 1468 | const Container = struct { | 1486 | const Container = struct { |
| 1469 | const Ctx = opaque {}; | 1487 | const Ctx = opaque {}; |
| ... | @@ -1490,7 +1508,7 @@ test "cast function with an opaque parameter" { | ... | @@ -1490,7 +1508,7 @@ test "cast function with an opaque parameter" { |
| 1490 | test "implicit ptr to *anyopaque" { | 1508 | test "implicit ptr to *anyopaque" { |
| 1491 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1509 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1492 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1510 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1493 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1511 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1494 | 1512 | ||
| 1495 | var a: u32 = 1; | 1513 | var a: u32 = 1; |
| 1496 | const ptr: *align(@alignOf(u32)) anyopaque = &a; | 1514 | const ptr: *align(@alignOf(u32)) anyopaque = &a; |
| ... | @@ -1503,7 +1521,7 @@ test "implicit ptr to *anyopaque" { | ... | @@ -1503,7 +1521,7 @@ test "implicit ptr to *anyopaque" { |
| 1503 | 1521 | ||
| 1504 | test "return null from fn () anyerror!?&T" { | 1522 | test "return null from fn () anyerror!?&T" { |
| 1505 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1523 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1506 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1524 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1507 | 1525 | ||
| 1508 | const a = returnNullFromOptionalTypeErrorRef(); | 1526 | const a = returnNullFromOptionalTypeErrorRef(); |
| 1509 | const b = returnNullLitFromOptionalTypeErrorRef(); | 1527 | const b = returnNullLitFromOptionalTypeErrorRef(); |
| ... | @@ -1520,7 +1538,7 @@ fn returnNullLitFromOptionalTypeErrorRef() anyerror!?*A { | ... | @@ -1520,7 +1538,7 @@ fn returnNullLitFromOptionalTypeErrorRef() anyerror!?*A { |
| 1520 | test "peer type resolution: [0]u8 and []const u8" { | 1538 | test "peer type resolution: [0]u8 and []const u8" { |
| 1521 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1539 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1522 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1540 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1523 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1541 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1524 | 1542 | ||
| 1525 | try expect(peerTypeEmptyArrayAndSlice(true, "hi").len == 0); | 1543 | try expect(peerTypeEmptyArrayAndSlice(true, "hi").len == 0); |
| 1526 | try expect(peerTypeEmptyArrayAndSlice(false, "hi").len == 1); | 1544 | try expect(peerTypeEmptyArrayAndSlice(false, "hi").len == 1); |
| ... | @@ -1540,7 +1558,7 @@ fn peerTypeEmptyArrayAndSlice(a: bool, slice: []const u8) []const u8 { | ... | @@ -1540,7 +1558,7 @@ fn peerTypeEmptyArrayAndSlice(a: bool, slice: []const u8) []const u8 { |
| 1540 | test "implicitly cast from [N]T to ?[]const T" { | 1558 | test "implicitly cast from [N]T to ?[]const T" { |
| 1541 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1559 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1542 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1560 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1543 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1561 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1544 | 1562 | ||
| 1545 | try expect(mem.eql(u8, castToOptionalSlice().?, "hi")); | 1563 | try expect(mem.eql(u8, castToOptionalSlice().?, "hi")); |
| 1546 | comptime assert(mem.eql(u8, castToOptionalSlice().?, "hi")); | 1564 | comptime assert(mem.eql(u8, castToOptionalSlice().?, "hi")); |
| ... | @@ -1553,7 +1571,7 @@ fn castToOptionalSlice() ?[]const u8 { | ... | @@ -1553,7 +1571,7 @@ fn castToOptionalSlice() ?[]const u8 { |
| 1553 | test "cast u128 to f128 and back" { | 1571 | test "cast u128 to f128 and back" { |
| 1554 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1572 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1555 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1573 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1556 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1574 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1557 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1575 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1558 | 1576 | ||
| 1559 | try comptime testCast128(); | 1577 | try comptime testCast128(); |
| ... | @@ -1576,7 +1594,7 @@ test "implicit cast from *[N]T to ?[*]T" { | ... | @@ -1576,7 +1594,7 @@ test "implicit cast from *[N]T to ?[*]T" { |
| 1576 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1594 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1577 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1595 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1578 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1596 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1579 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1597 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1580 | 1598 | ||
| 1581 | var x: ?[*]u16 = null; | 1599 | var x: ?[*]u16 = null; |
| 1582 | var y: [4]u16 = [4]u16{ 0, 1, 2, 3 }; | 1600 | var y: [4]u16 = [4]u16{ 0, 1, 2, 3 }; |
| ... | @@ -1591,7 +1609,7 @@ test "implicit cast from *[N]T to ?[*]T" { | ... | @@ -1591,7 +1609,7 @@ test "implicit cast from *[N]T to ?[*]T" { |
| 1591 | test "implicit cast from *T to ?*anyopaque" { | 1609 | test "implicit cast from *T to ?*anyopaque" { |
| 1592 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1610 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1593 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1611 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1594 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1612 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1595 | 1613 | ||
| 1596 | var a: u8 = 1; | 1614 | var a: u8 = 1; |
| 1597 | incrementVoidPtrValue(&a); | 1615 | incrementVoidPtrValue(&a); |
| ... | @@ -1603,7 +1621,7 @@ fn incrementVoidPtrValue(value: ?*anyopaque) void { | ... | @@ -1603,7 +1621,7 @@ fn incrementVoidPtrValue(value: ?*anyopaque) void { |
| 1603 | } | 1621 | } |
| 1604 | 1622 | ||
| 1605 | test "implicit cast *[0]T to E![]const u8" { | 1623 | test "implicit cast *[0]T to E![]const u8" { |
| 1606 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1624 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1607 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1625 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1608 | 1626 | ||
| 1609 | var x = @as(anyerror![]const u8, &[0]u8{}); | 1627 | var x = @as(anyerror![]const u8, &[0]u8{}); |
| ... | @@ -1613,13 +1631,13 @@ test "implicit cast *[0]T to E![]const u8" { | ... | @@ -1613,13 +1631,13 @@ test "implicit cast *[0]T to E![]const u8" { |
| 1613 | 1631 | ||
| 1614 | var global_array: [4]u8 = undefined; | 1632 | var global_array: [4]u8 = undefined; |
| 1615 | test "cast from array reference to fn: comptime fn ptr" { | 1633 | test "cast from array reference to fn: comptime fn ptr" { |
| 1616 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1634 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1617 | 1635 | ||
| 1618 | const f = @as(*align(1) const fn () callconv(.c) void, @ptrCast(&global_array)); | 1636 | const f = @as(*align(1) const fn () callconv(.c) void, @ptrCast(&global_array)); |
| 1619 | try expect(@intFromPtr(f) == @intFromPtr(&global_array)); | 1637 | try expect(@intFromPtr(f) == @intFromPtr(&global_array)); |
| 1620 | } | 1638 | } |
| 1621 | test "cast from array reference to fn: runtime fn ptr" { | 1639 | test "cast from array reference to fn: runtime fn ptr" { |
| 1622 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1640 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1623 | 1641 | ||
| 1624 | var f = @as(*align(1) const fn () callconv(.c) void, @ptrCast(&global_array)); | 1642 | var f = @as(*align(1) const fn () callconv(.c) void, @ptrCast(&global_array)); |
| 1625 | _ = &f; | 1643 | _ = &f; |
| ... | @@ -1629,7 +1647,7 @@ test "cast from array reference to fn: runtime fn ptr" { | ... | @@ -1629,7 +1647,7 @@ test "cast from array reference to fn: runtime fn ptr" { |
| 1629 | test "*const [N]null u8 to ?[]const u8" { | 1647 | test "*const [N]null u8 to ?[]const u8" { |
| 1630 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1648 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1631 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1649 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1632 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1650 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1633 | 1651 | ||
| 1634 | const S = struct { | 1652 | const S = struct { |
| 1635 | fn doTheTest() !void { | 1653 | fn doTheTest() !void { |
| ... | @@ -1646,7 +1664,7 @@ test "*const [N]null u8 to ?[]const u8" { | ... | @@ -1646,7 +1664,7 @@ test "*const [N]null u8 to ?[]const u8" { |
| 1646 | test "comptime @ptrCast to optional slice" { | 1664 | test "comptime @ptrCast to optional slice" { |
| 1647 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1665 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1648 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1666 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1649 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1667 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1650 | 1668 | ||
| 1651 | const result: ?[]const u8 = comptime blk: { | 1669 | const result: ?[]const u8 = comptime blk: { |
| 1652 | const slice: []const u8 = "123"; | 1670 | const slice: []const u8 = "123"; |
| ... | @@ -1679,7 +1697,7 @@ var global_struct: struct { f0: usize } = undefined; | ... | @@ -1679,7 +1697,7 @@ var global_struct: struct { f0: usize } = undefined; |
| 1679 | test "assignment to optional pointer result loc" { | 1697 | test "assignment to optional pointer result loc" { |
| 1680 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1698 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1681 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1699 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1682 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1700 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1683 | 1701 | ||
| 1684 | var foo: struct { ptr: ?*anyopaque } = .{ .ptr = &global_struct }; | 1702 | var foo: struct { ptr: ?*anyopaque } = .{ .ptr = &global_struct }; |
| 1685 | _ = &foo; | 1703 | _ = &foo; |
| ... | @@ -1687,7 +1705,7 @@ test "assignment to optional pointer result loc" { | ... | @@ -1687,7 +1705,7 @@ test "assignment to optional pointer result loc" { |
| 1687 | } | 1705 | } |
| 1688 | 1706 | ||
| 1689 | test "cast between *[N]void and []void" { | 1707 | test "cast between *[N]void and []void" { |
| 1690 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1708 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1691 | 1709 | ||
| 1692 | var a: [4]void = undefined; | 1710 | var a: [4]void = undefined; |
| 1693 | const b: []void = &a; | 1711 | const b: []void = &a; |
| ... | @@ -1696,7 +1714,7 @@ test "cast between *[N]void and []void" { | ... | @@ -1696,7 +1714,7 @@ test "cast between *[N]void and []void" { |
| 1696 | 1714 | ||
| 1697 | test "peer resolve arrays of different size to const slice" { | 1715 | test "peer resolve arrays of different size to const slice" { |
| 1698 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1716 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1699 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1717 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1700 | 1718 | ||
| 1701 | try expect(mem.eql(u8, boolToStr(true), "true")); | 1719 | try expect(mem.eql(u8, boolToStr(true), "true")); |
| 1702 | try expect(mem.eql(u8, boolToStr(false), "false")); | 1720 | try expect(mem.eql(u8, boolToStr(false), "false")); |
| ... | @@ -1710,7 +1728,7 @@ fn boolToStr(b: bool) []const u8 { | ... | @@ -1710,7 +1728,7 @@ fn boolToStr(b: bool) []const u8 { |
| 1710 | test "cast f16 to wider types" { | 1728 | test "cast f16 to wider types" { |
| 1711 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1729 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1712 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1730 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1713 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1731 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1714 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1732 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1715 | 1733 | ||
| 1716 | const S = struct { | 1734 | const S = struct { |
| ... | @@ -1729,7 +1747,7 @@ test "cast f16 to wider types" { | ... | @@ -1729,7 +1747,7 @@ test "cast f16 to wider types" { |
| 1729 | test "cast f128 to narrower types" { | 1747 | test "cast f128 to narrower types" { |
| 1730 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1748 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1731 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1749 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1732 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1750 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1733 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1751 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1734 | 1752 | ||
| 1735 | const S = struct { | 1753 | const S = struct { |
| ... | @@ -1748,7 +1766,7 @@ test "cast f128 to narrower types" { | ... | @@ -1748,7 +1766,7 @@ test "cast f128 to narrower types" { |
| 1748 | test "peer type resolution: unreachable, null, slice" { | 1766 | test "peer type resolution: unreachable, null, slice" { |
| 1749 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1767 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1750 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1768 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1751 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1769 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1752 | 1770 | ||
| 1753 | const S = struct { | 1771 | const S = struct { |
| 1754 | fn doTheTest(num: usize, word: []const u8) !void { | 1772 | fn doTheTest(num: usize, word: []const u8) !void { |
| ... | @@ -1787,7 +1805,7 @@ test "cast i8 fn call peers to i32 result" { | ... | @@ -1787,7 +1805,7 @@ test "cast i8 fn call peers to i32 result" { |
| 1787 | test "cast compatible optional types" { | 1805 | test "cast compatible optional types" { |
| 1788 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1806 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1789 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1807 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1790 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1808 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1791 | 1809 | ||
| 1792 | var a: ?[:0]const u8 = null; | 1810 | var a: ?[:0]const u8 = null; |
| 1793 | _ = &a; | 1811 | _ = &a; |
| ... | @@ -1797,7 +1815,7 @@ test "cast compatible optional types" { | ... | @@ -1797,7 +1815,7 @@ test "cast compatible optional types" { |
| 1797 | 1815 | ||
| 1798 | test "coerce undefined single-item pointer of array to error union of slice" { | 1816 | test "coerce undefined single-item pointer of array to error union of slice" { |
| 1799 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1817 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1800 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1818 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1801 | 1819 | ||
| 1802 | const a = @as([*]u8, undefined)[0..0]; | 1820 | const a = @as([*]u8, undefined)[0..0]; |
| 1803 | var b: error{a}![]const u8 = a; | 1821 | var b: error{a}![]const u8 = a; |
| ... | @@ -1807,7 +1825,7 @@ test "coerce undefined single-item pointer of array to error union of slice" { | ... | @@ -1807,7 +1825,7 @@ test "coerce undefined single-item pointer of array to error union of slice" { |
| 1807 | } | 1825 | } |
| 1808 | 1826 | ||
| 1809 | test "pointer to empty struct literal to mutable slice" { | 1827 | test "pointer to empty struct literal to mutable slice" { |
| 1810 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1828 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1811 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1829 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1812 | 1830 | ||
| 1813 | var x: []i32 = &.{}; | 1831 | var x: []i32 = &.{}; |
| ... | @@ -1818,7 +1836,7 @@ test "pointer to empty struct literal to mutable slice" { | ... | @@ -1818,7 +1836,7 @@ test "pointer to empty struct literal to mutable slice" { |
| 1818 | test "coerce between pointers of compatible differently-named floats" { | 1836 | test "coerce between pointers of compatible differently-named floats" { |
| 1819 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1837 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1820 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1838 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1821 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1839 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1822 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1840 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1823 | 1841 | ||
| 1824 | const F = switch (@typeInfo(c_longdouble).float.bits) { | 1842 | const F = switch (@typeInfo(c_longdouble).float.bits) { |
| ... | @@ -1878,6 +1896,8 @@ test "cast typed undefined to int" { | ... | @@ -1878,6 +1896,8 @@ test "cast typed undefined to int" { |
| 1878 | // } | 1896 | // } |
| 1879 | 1897 | ||
| 1880 | test "bitcast packed struct with u0" { | 1898 | test "bitcast packed struct with u0" { |
| 1899 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1900 | |||
| 1881 | const S = packed struct(u2) { a: u0, b: u2 }; | 1901 | const S = packed struct(u2) { a: u0, b: u2 }; |
| 1882 | const s = @as(S, @bitCast(@as(u2, 2))); | 1902 | const s = @as(S, @bitCast(@as(u2, 2))); |
| 1883 | try expect(s.a == 0); | 1903 | try expect(s.a == 0); |
| ... | @@ -1888,7 +1908,7 @@ test "bitcast packed struct with u0" { | ... | @@ -1888,7 +1908,7 @@ test "bitcast packed struct with u0" { |
| 1888 | 1908 | ||
| 1889 | test "optional pointer coerced to optional allowzero pointer" { | 1909 | test "optional pointer coerced to optional allowzero pointer" { |
| 1890 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1910 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1891 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1911 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1892 | 1912 | ||
| 1893 | var p: ?*u32 = undefined; | 1913 | var p: ?*u32 = undefined; |
| 1894 | var q: ?*allowzero u32 = undefined; | 1914 | var q: ?*allowzero u32 = undefined; |
| ... | @@ -1905,7 +1925,7 @@ test "optional slice coerced to allowzero many pointer" { | ... | @@ -1905,7 +1925,7 @@ test "optional slice coerced to allowzero many pointer" { |
| 1905 | } | 1925 | } |
| 1906 | 1926 | ||
| 1907 | test "optional slice passed as parameter coerced to allowzero many pointer" { | 1927 | test "optional slice passed as parameter coerced to allowzero many pointer" { |
| 1908 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1928 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1909 | 1929 | ||
| 1910 | const ns = struct { | 1930 | const ns = struct { |
| 1911 | const Color = struct { | 1931 | const Color = struct { |
| ... | @@ -1926,7 +1946,7 @@ test "optional slice passed as parameter coerced to allowzero many pointer" { | ... | @@ -1926,7 +1946,7 @@ test "optional slice passed as parameter coerced to allowzero many pointer" { |
| 1926 | } | 1946 | } |
| 1927 | 1947 | ||
| 1928 | test "single item pointer to pointer to array to slice" { | 1948 | test "single item pointer to pointer to array to slice" { |
| 1929 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1949 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1930 | 1950 | ||
| 1931 | var x: i32 = 1234; | 1951 | var x: i32 = 1234; |
| 1932 | try expect(@as([]const i32, @as(*[1]i32, &x))[0] == 1234); | 1952 | try expect(@as([]const i32, @as(*[1]i32, &x))[0] == 1234); |
| ... | @@ -1936,7 +1956,7 @@ test "single item pointer to pointer to array to slice" { | ... | @@ -1936,7 +1956,7 @@ test "single item pointer to pointer to array to slice" { |
| 1936 | 1956 | ||
| 1937 | test "peer type resolution forms error union" { | 1957 | test "peer type resolution forms error union" { |
| 1938 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1958 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1939 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1959 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1940 | 1960 | ||
| 1941 | var foo: i32 = 123; | 1961 | var foo: i32 = 123; |
| 1942 | _ = &foo; | 1962 | _ = &foo; |
| ... | @@ -1971,7 +1991,7 @@ test "@volatileCast without a result location" { | ... | @@ -1971,7 +1991,7 @@ test "@volatileCast without a result location" { |
| 1971 | } | 1991 | } |
| 1972 | 1992 | ||
| 1973 | test "coercion from single-item pointer to @as to slice" { | 1993 | test "coercion from single-item pointer to @as to slice" { |
| 1974 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1994 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1975 | 1995 | ||
| 1976 | var x: u32 = 1; | 1996 | var x: u32 = 1; |
| 1977 | 1997 | ||
| ... | @@ -1984,7 +2004,7 @@ test "coercion from single-item pointer to @as to slice" { | ... | @@ -1984,7 +2004,7 @@ test "coercion from single-item pointer to @as to slice" { |
| 1984 | test "peer type resolution: const sentinel slice and mutable non-sentinel slice" { | 2004 | test "peer type resolution: const sentinel slice and mutable non-sentinel slice" { |
| 1985 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2005 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1986 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2006 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1987 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2007 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1988 | 2008 | ||
| 1989 | const S = struct { | 2009 | const S = struct { |
| 1990 | fn doTheTest(comptime T: type, comptime s: T) !void { | 2010 | fn doTheTest(comptime T: type, comptime s: T) !void { |
| ... | @@ -2011,6 +2031,7 @@ test "peer type resolution: const sentinel slice and mutable non-sentinel slice" | ... | @@ -2011,6 +2031,7 @@ test "peer type resolution: const sentinel slice and mutable non-sentinel slice" |
| 2011 | } | 2031 | } |
| 2012 | 2032 | ||
| 2013 | test "peer type resolution: float and comptime-known fixed-width integer" { | 2033 | test "peer type resolution: float and comptime-known fixed-width integer" { |
| 2034 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2014 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2035 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2015 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2036 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2016 | 2037 | ||
| ... | @@ -2032,7 +2053,7 @@ test "peer type resolution: float and comptime-known fixed-width integer" { | ... | @@ -2032,7 +2053,7 @@ test "peer type resolution: float and comptime-known fixed-width integer" { |
| 2032 | } | 2053 | } |
| 2033 | 2054 | ||
| 2034 | test "peer type resolution: float and runtime-known fixed-width integer" { | 2055 | test "peer type resolution: float and runtime-known fixed-width integer" { |
| 2035 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2056 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2036 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2057 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2037 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2058 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2038 | 2059 | ||
| ... | @@ -2077,7 +2098,7 @@ test "peer type resolution: same array type with sentinel" { | ... | @@ -2077,7 +2098,7 @@ test "peer type resolution: same array type with sentinel" { |
| 2077 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2098 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2078 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2099 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2079 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2100 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2080 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2101 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2081 | 2102 | ||
| 2082 | var a: [2:0]u32 = .{ 0, 1 }; | 2103 | var a: [2:0]u32 = .{ 0, 1 }; |
| 2083 | var b: [2:0]u32 = .{ 2, 3 }; | 2104 | var b: [2:0]u32 = .{ 2, 3 }; |
| ... | @@ -2099,7 +2120,7 @@ test "peer type resolution: same array type with sentinel" { | ... | @@ -2099,7 +2120,7 @@ test "peer type resolution: same array type with sentinel" { |
| 2099 | test "peer type resolution: array with sentinel and array without sentinel" { | 2120 | test "peer type resolution: array with sentinel and array without sentinel" { |
| 2100 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2121 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2101 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2122 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2102 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2123 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2103 | 2124 | ||
| 2104 | var a: [2:0]u32 = .{ 0, 1 }; | 2125 | var a: [2:0]u32 = .{ 0, 1 }; |
| 2105 | var b: [2]u32 = .{ 2, 3 }; | 2126 | var b: [2]u32 = .{ 2, 3 }; |
| ... | @@ -2122,7 +2143,7 @@ test "peer type resolution: array and vector with same child type" { | ... | @@ -2122,7 +2143,7 @@ test "peer type resolution: array and vector with same child type" { |
| 2122 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2143 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2123 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2124 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2145 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2125 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2146 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2126 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 2147 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 2127 | 2148 | ||
| 2128 | var arr: [2]u32 = .{ 0, 1 }; | 2149 | var arr: [2]u32 = .{ 0, 1 }; |
| ... | @@ -2143,7 +2164,7 @@ test "peer type resolution: array and vector with same child type" { | ... | @@ -2143,7 +2164,7 @@ test "peer type resolution: array and vector with same child type" { |
| 2143 | } | 2164 | } |
| 2144 | 2165 | ||
| 2145 | test "peer type resolution: array with smaller child type and vector with larger child type" { | 2166 | test "peer type resolution: array with smaller child type and vector with larger child type" { |
| 2146 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2167 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2147 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2168 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2148 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2169 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2149 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2170 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -2170,7 +2191,7 @@ test "peer type resolution: error union and optional of same type" { | ... | @@ -2170,7 +2191,7 @@ test "peer type resolution: error union and optional of same type" { |
| 2170 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2191 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2171 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2192 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2172 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2193 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2173 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2194 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2174 | 2195 | ||
| 2175 | const E = error{Foo}; | 2196 | const E = error{Foo}; |
| 2176 | var a: E!*u8 = error.Foo; | 2197 | var a: E!*u8 = error.Foo; |
| ... | @@ -2193,7 +2214,7 @@ test "peer type resolution: error union and optional of same type" { | ... | @@ -2193,7 +2214,7 @@ test "peer type resolution: error union and optional of same type" { |
| 2193 | test "peer type resolution: C pointer and @TypeOf(null)" { | 2214 | test "peer type resolution: C pointer and @TypeOf(null)" { |
| 2194 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2215 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2195 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2216 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2196 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2217 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2197 | 2218 | ||
| 2198 | var a: [*c]c_int = 0x1000; | 2219 | var a: [*c]c_int = 0x1000; |
| 2199 | _ = &a; | 2220 | _ = &a; |
| ... | @@ -2215,7 +2236,7 @@ test "peer type resolution: C pointer and @TypeOf(null)" { | ... | @@ -2215,7 +2236,7 @@ test "peer type resolution: C pointer and @TypeOf(null)" { |
| 2215 | test "peer type resolution: three-way resolution combines error set and optional" { | 2236 | test "peer type resolution: three-way resolution combines error set and optional" { |
| 2216 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2237 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2217 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2238 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2218 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2239 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2219 | 2240 | ||
| 2220 | const E = error{Foo}; | 2241 | const E = error{Foo}; |
| 2221 | var a: E = error.Foo; | 2242 | var a: E = error.Foo; |
| ... | @@ -2258,7 +2279,7 @@ test "peer type resolution: vector and optional vector" { | ... | @@ -2258,7 +2279,7 @@ test "peer type resolution: vector and optional vector" { |
| 2258 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2279 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2259 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2280 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2260 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2281 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2261 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 2282 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 2262 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 2283 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 2263 | 2284 | ||
| 2264 | var a: ?@Vector(3, u32) = .{ 0, 1, 2 }; | 2285 | var a: ?@Vector(3, u32) = .{ 0, 1, 2 }; |
| ... | @@ -2279,6 +2300,7 @@ test "peer type resolution: vector and optional vector" { | ... | @@ -2279,6 +2300,7 @@ test "peer type resolution: vector and optional vector" { |
| 2279 | } | 2300 | } |
| 2280 | 2301 | ||
| 2281 | test "peer type resolution: optional fixed-width int and comptime_int" { | 2302 | test "peer type resolution: optional fixed-width int and comptime_int" { |
| 2303 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2282 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2304 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2283 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2305 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2284 | 2306 | ||
| ... | @@ -2303,7 +2325,7 @@ test "peer type resolution: array and tuple" { | ... | @@ -2303,7 +2325,7 @@ test "peer type resolution: array and tuple" { |
| 2303 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2325 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2304 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2326 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2305 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2327 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2306 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2328 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2307 | 2329 | ||
| 2308 | var arr: [3]i32 = .{ 1, 2, 3 }; | 2330 | var arr: [3]i32 = .{ 1, 2, 3 }; |
| 2309 | _ = &arr; | 2331 | _ = &arr; |
| ... | @@ -2324,7 +2346,7 @@ test "peer type resolution: array and tuple" { | ... | @@ -2324,7 +2346,7 @@ test "peer type resolution: array and tuple" { |
| 2324 | } | 2346 | } |
| 2325 | 2347 | ||
| 2326 | test "peer type resolution: vector and tuple" { | 2348 | test "peer type resolution: vector and tuple" { |
| 2327 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2349 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2328 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2350 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2329 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2351 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2330 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2352 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -2351,7 +2373,7 @@ test "peer type resolution: vector and array and tuple" { | ... | @@ -2351,7 +2373,7 @@ test "peer type resolution: vector and array and tuple" { |
| 2351 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2373 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2352 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2374 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2353 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2375 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2354 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2376 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2355 | 2377 | ||
| 2356 | var vec: @Vector(2, i8) = .{ 10, 20 }; | 2378 | var vec: @Vector(2, i8) = .{ 10, 20 }; |
| 2357 | var arr: [2]i8 = .{ 30, 40 }; | 2379 | var arr: [2]i8 = .{ 30, 40 }; |
| ... | @@ -2393,7 +2415,7 @@ test "peer type resolution: vector and array and tuple" { | ... | @@ -2393,7 +2415,7 @@ test "peer type resolution: vector and array and tuple" { |
| 2393 | test "peer type resolution: empty tuple pointer and slice" { | 2415 | test "peer type resolution: empty tuple pointer and slice" { |
| 2394 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2416 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2395 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2417 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2396 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2418 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2397 | 2419 | ||
| 2398 | var a: [:0]const u8 = "Hello"; | 2420 | var a: [:0]const u8 = "Hello"; |
| 2399 | var b = &.{}; | 2421 | var b = &.{}; |
| ... | @@ -2414,7 +2436,7 @@ test "peer type resolution: empty tuple pointer and slice" { | ... | @@ -2414,7 +2436,7 @@ test "peer type resolution: empty tuple pointer and slice" { |
| 2414 | test "peer type resolution: tuple pointer and slice" { | 2436 | test "peer type resolution: tuple pointer and slice" { |
| 2415 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2437 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2416 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2438 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2417 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2439 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2418 | 2440 | ||
| 2419 | var a: [:0]const u8 = "Hello"; | 2441 | var a: [:0]const u8 = "Hello"; |
| 2420 | var b = &.{ @as(u8, 'x'), @as(u8, 'y'), @as(u8, 'z') }; | 2442 | var b = &.{ @as(u8, 'x'), @as(u8, 'y'), @as(u8, 'z') }; |
| ... | @@ -2436,7 +2458,7 @@ test "peer type resolution: tuple pointer and optional slice" { | ... | @@ -2436,7 +2458,7 @@ test "peer type resolution: tuple pointer and optional slice" { |
| 2436 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2458 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2437 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2459 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2438 | // Miscompilation on Intel's OpenCL CPU runtime. | 2460 | // Miscompilation on Intel's OpenCL CPU runtime. |
| 2439 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // flaky | 2461 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // flaky |
| 2440 | 2462 | ||
| 2441 | var a: ?[:0]const u8 = null; | 2463 | var a: ?[:0]const u8 = null; |
| 2442 | var b = &.{ @as(u8, 'x'), @as(u8, 'y'), @as(u8, 'z') }; | 2464 | var b = &.{ @as(u8, 'x'), @as(u8, 'y'), @as(u8, 'z') }; |
| ... | @@ -2457,7 +2479,7 @@ test "peer type resolution: tuple pointer and optional slice" { | ... | @@ -2457,7 +2479,7 @@ test "peer type resolution: tuple pointer and optional slice" { |
| 2457 | test "peer type resolution: many compatible pointers" { | 2479 | test "peer type resolution: many compatible pointers" { |
| 2458 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2480 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2459 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2481 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2460 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2482 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2461 | 2483 | ||
| 2462 | var buf = "foo-3".*; | 2484 | var buf = "foo-3".*; |
| 2463 | 2485 | ||
| ... | @@ -2521,6 +2543,7 @@ test "peer type resolution: many compatible pointers" { | ... | @@ -2521,6 +2543,7 @@ test "peer type resolution: many compatible pointers" { |
| 2521 | } | 2543 | } |
| 2522 | 2544 | ||
| 2523 | test "peer type resolution: tuples with comptime fields" { | 2545 | test "peer type resolution: tuples with comptime fields" { |
| 2546 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2524 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2547 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2525 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2548 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2526 | 2549 | ||
| ... | @@ -2553,7 +2576,7 @@ test "peer type resolution: tuples with comptime fields" { | ... | @@ -2553,7 +2576,7 @@ test "peer type resolution: tuples with comptime fields" { |
| 2553 | test "peer type resolution: C pointer and many pointer" { | 2576 | test "peer type resolution: C pointer and many pointer" { |
| 2554 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2577 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2555 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2578 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2556 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2579 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2557 | 2580 | ||
| 2558 | var buf = "hello".*; | 2581 | var buf = "hello".*; |
| 2559 | 2582 | ||
| ... | @@ -2576,7 +2599,7 @@ test "peer type resolution: C pointer and many pointer" { | ... | @@ -2576,7 +2599,7 @@ test "peer type resolution: C pointer and many pointer" { |
| 2576 | test "peer type resolution: pointer attributes are combined correctly" { | 2599 | test "peer type resolution: pointer attributes are combined correctly" { |
| 2577 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2600 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2578 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2601 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2579 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2602 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2580 | 2603 | ||
| 2581 | var buf_a align(4) = "foo".*; | 2604 | var buf_a align(4) = "foo".*; |
| 2582 | var buf_b align(4) = "bar".*; | 2605 | var buf_b align(4) = "bar".*; |
| ... | @@ -2663,7 +2686,7 @@ test "peer type resolution: arrays of compatible types" { | ... | @@ -2663,7 +2686,7 @@ test "peer type resolution: arrays of compatible types" { |
| 2663 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2686 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2664 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2687 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2665 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2688 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2666 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2689 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2667 | 2690 | ||
| 2668 | var e0: u8 = 3; | 2691 | var e0: u8 = 3; |
| 2669 | var e1: u8 = 2; | 2692 | var e1: u8 = 2; |
| ... | @@ -2680,7 +2703,7 @@ test "peer type resolution: arrays of compatible types" { | ... | @@ -2680,7 +2703,7 @@ test "peer type resolution: arrays of compatible types" { |
| 2680 | test "cast builtins can wrap result in optional" { | 2703 | test "cast builtins can wrap result in optional" { |
| 2681 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2704 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2682 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2705 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2683 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2706 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2684 | 2707 | ||
| 2685 | const S = struct { | 2708 | const S = struct { |
| 2686 | const MyEnum = enum(u32) { _ }; | 2709 | const MyEnum = enum(u32) { _ }; |
| ... | @@ -2715,7 +2738,7 @@ test "cast builtins can wrap result in optional" { | ... | @@ -2715,7 +2738,7 @@ test "cast builtins can wrap result in optional" { |
| 2715 | } | 2738 | } |
| 2716 | 2739 | ||
| 2717 | test "cast builtins can wrap result in error union" { | 2740 | test "cast builtins can wrap result in error union" { |
| 2718 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2741 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2719 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2742 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2720 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2743 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2721 | 2744 | ||
| ... | @@ -2755,7 +2778,7 @@ test "cast builtins can wrap result in error union" { | ... | @@ -2755,7 +2778,7 @@ test "cast builtins can wrap result in error union" { |
| 2755 | test "cast builtins can wrap result in error union and optional" { | 2778 | test "cast builtins can wrap result in error union and optional" { |
| 2756 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2779 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2757 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2780 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2758 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2781 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2759 | 2782 | ||
| 2760 | const S = struct { | 2783 | const S = struct { |
| 2761 | const MyEnum = enum(u32) { _ }; | 2784 | const MyEnum = enum(u32) { _ }; |
| ... | @@ -2791,7 +2814,7 @@ test "cast builtins can wrap result in error union and optional" { | ... | @@ -2791,7 +2814,7 @@ test "cast builtins can wrap result in error union and optional" { |
| 2791 | } | 2814 | } |
| 2792 | 2815 | ||
| 2793 | test "@floatCast on vector" { | 2816 | test "@floatCast on vector" { |
| 2794 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2817 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2795 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2818 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2796 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2819 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2797 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2820 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -2836,7 +2859,7 @@ test "@ptrFromInt on vector" { | ... | @@ -2836,7 +2859,7 @@ test "@ptrFromInt on vector" { |
| 2836 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2859 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2837 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2860 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2838 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2861 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2839 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2862 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2840 | 2863 | ||
| 2841 | const S = struct { | 2864 | const S = struct { |
| 2842 | fn doTheTest() !void { | 2865 | fn doTheTest() !void { |
| ... | @@ -2860,7 +2883,7 @@ test "@intFromPtr on vector" { | ... | @@ -2860,7 +2883,7 @@ test "@intFromPtr on vector" { |
| 2860 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2883 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2861 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2884 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2862 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2885 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2863 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2886 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2864 | 2887 | ||
| 2865 | const S = struct { | 2888 | const S = struct { |
| 2866 | fn doTheTest() !void { | 2889 | fn doTheTest() !void { |
| ... | @@ -2880,7 +2903,7 @@ test "@intFromPtr on vector" { | ... | @@ -2880,7 +2903,7 @@ test "@intFromPtr on vector" { |
| 2880 | } | 2903 | } |
| 2881 | 2904 | ||
| 2882 | test "@floatFromInt on vector" { | 2905 | test "@floatFromInt on vector" { |
| 2883 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2906 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2884 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2907 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2885 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2908 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2886 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2909 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -2900,7 +2923,7 @@ test "@floatFromInt on vector" { | ... | @@ -2900,7 +2923,7 @@ test "@floatFromInt on vector" { |
| 2900 | } | 2923 | } |
| 2901 | 2924 | ||
| 2902 | test "@intFromFloat on vector" { | 2925 | test "@intFromFloat on vector" { |
| 2903 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2926 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2904 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2927 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2905 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2928 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2906 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2929 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -2920,6 +2943,7 @@ test "@intFromFloat on vector" { | ... | @@ -2920,6 +2943,7 @@ test "@intFromFloat on vector" { |
| 2920 | } | 2943 | } |
| 2921 | 2944 | ||
| 2922 | test "@floatFromInt and @intFromFloat on vectors of any length" { | 2945 | test "@floatFromInt and @intFromFloat on vectors of any length" { |
| 2946 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2923 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2947 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2924 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2948 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2925 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2949 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -2950,7 +2974,7 @@ test "@floatFromInt and @intFromFloat on vectors of any length" { | ... | @@ -2950,7 +2974,7 @@ test "@floatFromInt and @intFromFloat on vectors of any length" { |
| 2950 | } | 2974 | } |
| 2951 | 2975 | ||
| 2952 | test "@intFromBool on vector" { | 2976 | test "@intFromBool on vector" { |
| 2953 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2977 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2954 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2978 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2955 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2979 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2956 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2980 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -2970,6 +2994,8 @@ test "@intFromBool on vector" { | ... | @@ -2970,6 +2994,8 @@ test "@intFromBool on vector" { |
| 2970 | } | 2994 | } |
| 2971 | 2995 | ||
| 2972 | test "numeric coercions with undefined" { | 2996 | test "numeric coercions with undefined" { |
| 2997 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2998 | |||
| 2973 | const from: i32 = undefined; | 2999 | const from: i32 = undefined; |
| 2974 | var to: f32 = from; | 3000 | var to: f32 = from; |
| 2975 | to = @floatFromInt(from); | 3001 | to = @floatFromInt(from); |
| ... | @@ -2987,6 +3013,7 @@ test "15-bit int to float" { | ... | @@ -2987,6 +3013,7 @@ test "15-bit int to float" { |
| 2987 | } | 3013 | } |
| 2988 | 3014 | ||
| 2989 | test "@as does not corrupt values with incompatible representations" { | 3015 | test "@as does not corrupt values with incompatible representations" { |
| 3016 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2990 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 3017 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2991 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 3018 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2992 | 3019 | ||
| ... | @@ -3003,7 +3030,7 @@ test "@as does not corrupt values with incompatible representations" { | ... | @@ -3003,7 +3030,7 @@ test "@as does not corrupt values with incompatible representations" { |
| 3003 | test "result information is preserved through many nested structures" { | 3030 | test "result information is preserved through many nested structures" { |
| 3004 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 3031 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 3005 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 3032 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 3006 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 3033 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 3007 | 3034 | ||
| 3008 | const S = struct { | 3035 | const S = struct { |
| 3009 | fn doTheTest() !void { | 3036 | fn doTheTest() !void { |
| ... | @@ -3025,6 +3052,7 @@ test "result information is preserved through many nested structures" { | ... | @@ -3025,6 +3052,7 @@ test "result information is preserved through many nested structures" { |
| 3025 | } | 3052 | } |
| 3026 | 3053 | ||
| 3027 | test "@intCast vector of signed integer" { | 3054 | test "@intCast vector of signed integer" { |
| 3055 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 3028 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 3056 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 3029 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 3057 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 3030 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 3058 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -3047,6 +3075,7 @@ test "result type is preserved into comptime block" { | ... | @@ -3047,6 +3075,7 @@ test "result type is preserved into comptime block" { |
| 3047 | } | 3075 | } |
| 3048 | 3076 | ||
| 3049 | test "bitcast vector" { | 3077 | test "bitcast vector" { |
| 3078 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 3050 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 3079 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 3051 | 3080 | ||
| 3052 | const u8x32 = @Vector(32, u8); | 3081 | const u8x32 = @Vector(32, u8); |
| ... | @@ -3058,7 +3087,7 @@ test "bitcast vector" { | ... | @@ -3058,7 +3087,7 @@ test "bitcast vector" { |
| 3058 | } | 3087 | } |
| 3059 | 3088 | ||
| 3060 | test "peer type resolution: slice of sentinel-terminated array" { | 3089 | test "peer type resolution: slice of sentinel-terminated array" { |
| 3061 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 3090 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 3062 | 3091 | ||
| 3063 | var f: bool = undefined; | 3092 | var f: bool = undefined; |
| 3064 | f = false; | 3093 | f = false; |
| ... | @@ -3077,6 +3106,7 @@ test "peer type resolution: slice of sentinel-terminated array" { | ... | @@ -3077,6 +3106,7 @@ test "peer type resolution: slice of sentinel-terminated array" { |
| 3077 | 3106 | ||
| 3078 | test "@intFromFloat boundary cases" { | 3107 | test "@intFromFloat boundary cases" { |
| 3079 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 3108 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 3109 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 3080 | 3110 | ||
| 3081 | const S = struct { | 3111 | const S = struct { |
| 3082 | fn case(comptime I: type, x: f32, bump: enum { up, down }, expected: I) !void { | 3112 | fn case(comptime I: type, x: f32, bump: enum { up, down }, expected: I) !void { |
| ... | @@ -3107,6 +3137,7 @@ test "@intFromFloat boundary cases" { | ... | @@ -3107,6 +3137,7 @@ test "@intFromFloat boundary cases" { |
| 3107 | } | 3137 | } |
| 3108 | 3138 | ||
| 3109 | test "@intFromFloat vector boundary cases" { | 3139 | test "@intFromFloat vector boundary cases" { |
| 3140 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 3110 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 3141 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 3111 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 3142 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 3112 | 3143 | ||
| ... | @@ -3135,6 +3166,7 @@ test "@intFromFloat vector boundary cases" { | ... | @@ -3135,6 +3166,7 @@ test "@intFromFloat vector boundary cases" { |
| 3135 | } | 3166 | } |
| 3136 | 3167 | ||
| 3137 | test "coerce enum to union with zero-bit fields through local variables" { | 3168 | test "coerce enum to union with zero-bit fields through local variables" { |
| 3169 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 3138 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 3170 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 3139 | 3171 | ||
| 3140 | const E = enum(u1) { foo, bar }; | 3172 | const E = enum(u1) { foo, bar }; |
test/behavior/cast_int.zig+5-2| ... | @@ -6,6 +6,7 @@ const maxInt = std.math.maxInt; | ... | @@ -6,6 +6,7 @@ const maxInt = std.math.maxInt; |
| 6 | const minInt = std.math.minInt; | 6 | const minInt = std.math.minInt; |
| 7 | 7 | ||
| 8 | test "@intCast i32 to u7" { | 8 | test "@intCast i32 to u7" { |
| 9 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 10 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 11 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 11 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 12 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -33,6 +34,7 @@ test "coerce i8 to i32 and @intCast back" { | ... | @@ -33,6 +34,7 @@ test "coerce i8 to i32 and @intCast back" { |
| 33 | } | 34 | } |
| 34 | 35 | ||
| 35 | test "coerce non byte-sized integers accross 32bits boundary" { | 36 | test "coerce non byte-sized integers accross 32bits boundary" { |
| 37 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 36 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 38 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 37 | 39 | ||
| 38 | { | 40 | { |
| ... | @@ -143,7 +145,8 @@ fn testIntCast(comptime S: type, a: S, comptime D: type, expected: D) !void { | ... | @@ -143,7 +145,8 @@ fn testIntCast(comptime S: type, a: S, comptime D: type, expected: D) !void { |
| 143 | 145 | ||
| 144 | test "@intCast <= 64 bits" { | 146 | test "@intCast <= 64 bits" { |
| 145 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 147 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 146 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 148 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 149 | |||
| 147 | try testIntCast(i32, minInt(i32), i64, minInt(i32)); | 150 | try testIntCast(i32, minInt(i32), i64, minInt(i32)); |
| 148 | try testIntCast(i32, maxInt(i32), i64, maxInt(i32)); | 151 | try testIntCast(i32, maxInt(i32), i64, maxInt(i32)); |
| 149 | try testIntCast(u32, maxInt(u32), u64, maxInt(u32)); | 152 | try testIntCast(u32, maxInt(u32), u64, maxInt(u32)); |
| ... | @@ -168,7 +171,7 @@ test "@intCast <= 64 bits" { | ... | @@ -168,7 +171,7 @@ test "@intCast <= 64 bits" { |
| 168 | 171 | ||
| 169 | test "@intCast > 128 bits" { | 172 | test "@intCast > 128 bits" { |
| 170 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 173 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 171 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 174 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 172 | 175 | ||
| 173 | try testIntCast(u8, 123, u140, 123); | 176 | try testIntCast(u8, 123, u140, 123); |
| 174 | try testIntCast(u64, 1 << 63, u140, 1 << 63); | 177 | try testIntCast(u64, 1 << 63, u140, 1 << 63); |
test/behavior/comptime_memory.zig+7-2| ... | @@ -415,6 +415,8 @@ test "dereference undefined pointer to zero-bit type" { | ... | @@ -415,6 +415,8 @@ test "dereference undefined pointer to zero-bit type" { |
| 415 | } | 415 | } |
| 416 | 416 | ||
| 417 | test "type pun extern struct" { | 417 | test "type pun extern struct" { |
| 418 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 419 | |||
| 418 | const S = extern struct { f: u8 }; | 420 | const S = extern struct { f: u8 }; |
| 419 | comptime var s = S{ .f = 123 }; | 421 | comptime var s = S{ .f = 123 }; |
| 420 | @as(*u8, @ptrCast(&s)).* = 72; | 422 | @as(*u8, @ptrCast(&s)).* = 72; |
| ... | @@ -434,7 +436,7 @@ test "type pun null pointer-like optional" { | ... | @@ -434,7 +436,7 @@ test "type pun null pointer-like optional" { |
| 434 | } | 436 | } |
| 435 | 437 | ||
| 436 | test "write empty array to end" { | 438 | test "write empty array to end" { |
| 437 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 439 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 438 | 440 | ||
| 439 | comptime var array: [5]u8 = "hello".*; | 441 | comptime var array: [5]u8 = "hello".*; |
| 440 | array[5..5].* = .{}; | 442 | array[5..5].* = .{}; |
| ... | @@ -514,7 +516,8 @@ fn fieldPtrTest() u32 { | ... | @@ -514,7 +516,8 @@ fn fieldPtrTest() u32 { |
| 514 | return a.value; | 516 | return a.value; |
| 515 | } | 517 | } |
| 516 | test "pointer in aggregate field can mutate comptime state" { | 518 | test "pointer in aggregate field can mutate comptime state" { |
| 517 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 519 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 520 | |||
| 518 | try comptime std.testing.expect(fieldPtrTest() == 2); | 521 | try comptime std.testing.expect(fieldPtrTest() == 2); |
| 519 | } | 522 | } |
| 520 | 523 | ||
| ... | @@ -598,6 +601,8 @@ test "reinterpret sentinel-terminated array as packed struct" { | ... | @@ -598,6 +601,8 @@ test "reinterpret sentinel-terminated array as packed struct" { |
| 598 | } | 601 | } |
| 599 | 602 | ||
| 600 | test "reinterpret pointer as optional pointer via double-pointer coercion" { | 603 | test "reinterpret pointer as optional pointer via double-pointer coercion" { |
| 604 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 605 | |||
| 601 | const p0: *const *anyopaque = &@ptrFromInt(0x1000); | 606 | const p0: *const *anyopaque = &@ptrFromInt(0x1000); |
| 602 | const p1: *const ?*anyopaque = p0; | 607 | const p1: *const ?*anyopaque = p0; |
| 603 | 608 |
test/behavior/const_slice_child.zig+1-1| ... | @@ -10,7 +10,7 @@ test "const slice child" { | ... | @@ -10,7 +10,7 @@ test "const slice child" { |
| 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_sparc64) return error.SkipZigTest; // TODO | 11 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 12 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 12 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 13 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 13 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 14 | 14 | ||
| 15 | const strs = [_][*]const u8{ "one", "two", "three" }; | 15 | const strs = [_][*]const u8{ "one", "two", "three" }; |
| 16 | argv = &strs; | 16 | argv = &strs; |
test/behavior/decl_literals.zig+4-2| ... | @@ -33,6 +33,7 @@ test "decl literal with pointer" { | ... | @@ -33,6 +33,7 @@ test "decl literal with pointer" { |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | test "call decl literal with optional" { | 35 | test "call decl literal with optional" { |
| 36 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 36 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 37 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 37 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 38 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 38 | 39 | ||
| ... | @@ -48,7 +49,7 @@ test "call decl literal with optional" { | ... | @@ -48,7 +49,7 @@ test "call decl literal with optional" { |
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | test "call decl literal with pointer" { | 51 | test "call decl literal with pointer" { |
| 51 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 52 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 52 | 53 | ||
| 53 | const S = struct { | 54 | const S = struct { |
| 54 | x: u32, | 55 | x: u32, |
| ... | @@ -62,6 +63,7 @@ test "call decl literal with pointer" { | ... | @@ -62,6 +63,7 @@ test "call decl literal with pointer" { |
| 62 | } | 63 | } |
| 63 | 64 | ||
| 64 | test "call decl literal" { | 65 | test "call decl literal" { |
| 66 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 65 | const S = struct { | 67 | const S = struct { |
| 66 | x: u32, | 68 | x: u32, |
| 67 | fn init() @This() { | 69 | fn init() @This() { |
| ... | @@ -74,7 +76,7 @@ test "call decl literal" { | ... | @@ -74,7 +76,7 @@ test "call decl literal" { |
| 74 | } | 76 | } |
| 75 | 77 | ||
| 76 | test "call decl literal with error union" { | 78 | test "call decl literal with error union" { |
| 77 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 79 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 78 | 80 | ||
| 79 | const S = struct { | 81 | const S = struct { |
| 80 | x: u32, | 82 | x: u32, |
test/behavior/defer.zig+7-2| ... | @@ -5,6 +5,8 @@ const expectEqual = std.testing.expectEqual; | ... | @@ -5,6 +5,8 @@ const expectEqual = std.testing.expectEqual; |
| 5 | const expectError = std.testing.expectError; | 5 | const expectError = std.testing.expectError; |
| 6 | 6 | ||
| 7 | test "break and continue inside loop inside defer expression" { | 7 | test "break and continue inside loop inside defer expression" { |
| 8 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 9 | |||
| 8 | testBreakContInDefer(10); | 10 | testBreakContInDefer(10); |
| 9 | comptime testBreakContInDefer(10); | 11 | comptime testBreakContInDefer(10); |
| 10 | } | 12 | } |
| ... | @@ -32,6 +34,7 @@ test "defer and labeled break" { | ... | @@ -32,6 +34,7 @@ test "defer and labeled break" { |
| 32 | } | 34 | } |
| 33 | 35 | ||
| 34 | test "errdefer does not apply to fn inside fn" { | 36 | test "errdefer does not apply to fn inside fn" { |
| 37 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 35 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 38 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 36 | 39 | ||
| 37 | if (testNestedFnErrDefer()) |_| @panic("expected error") else |e| try expect(e == error.Bad); | 40 | if (testNestedFnErrDefer()) |_| @panic("expected error") else |e| try expect(e == error.Bad); |
| ... | @@ -49,6 +52,7 @@ fn testNestedFnErrDefer() anyerror!void { | ... | @@ -49,6 +52,7 @@ fn testNestedFnErrDefer() anyerror!void { |
| 49 | } | 52 | } |
| 50 | 53 | ||
| 51 | test "return variable while defer expression in scope to modify it" { | 54 | test "return variable while defer expression in scope to modify it" { |
| 55 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 52 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 56 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 53 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 57 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 54 | 58 | ||
| ... | @@ -89,7 +93,7 @@ fn runSomeErrorDefers(x: bool) !bool { | ... | @@ -89,7 +93,7 @@ fn runSomeErrorDefers(x: bool) !bool { |
| 89 | } | 93 | } |
| 90 | 94 | ||
| 91 | test "mixing normal and error defers" { | 95 | test "mixing normal and error defers" { |
| 92 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 96 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 93 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 97 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 94 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 98 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 95 | 99 | ||
| ... | @@ -109,7 +113,8 @@ test "mixing normal and error defers" { | ... | @@ -109,7 +113,8 @@ test "mixing normal and error defers" { |
| 109 | 113 | ||
| 110 | test "simple else prong doesn't emit an error for unreachable else prong" { | 114 | test "simple else prong doesn't emit an error for unreachable else prong" { |
| 111 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 115 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 112 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 116 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 117 | |||
| 113 | const S = struct { | 118 | const S = struct { |
| 114 | fn foo() error{Foo}!void { | 119 | fn foo() error{Foo}!void { |
| 115 | return error.Foo; | 120 | return error.Foo; |
test/behavior/destructure.zig+14| ... | @@ -4,6 +4,8 @@ const assert = std.debug.assert; | ... | @@ -4,6 +4,8 @@ const assert = std.debug.assert; |
| 4 | const expect = std.testing.expect; | 4 | const expect = std.testing.expect; |
| 5 | 5 | ||
| 6 | test "simple destructure" { | 6 | test "simple destructure" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 8 | |||
| 7 | const S = struct { | 9 | const S = struct { |
| 8 | fn doTheTest() !void { | 10 | fn doTheTest() !void { |
| 9 | var x: u32 = undefined; | 11 | var x: u32 = undefined; |
| ... | @@ -23,6 +25,8 @@ test "simple destructure" { | ... | @@ -23,6 +25,8 @@ test "simple destructure" { |
| 23 | } | 25 | } |
| 24 | 26 | ||
| 25 | test "destructure with comptime syntax" { | 27 | test "destructure with comptime syntax" { |
| 28 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 29 | |||
| 26 | const S = struct { | 30 | const S = struct { |
| 27 | fn doTheTest() !void { | 31 | fn doTheTest() !void { |
| 28 | { | 32 | { |
| ... | @@ -78,6 +82,8 @@ test "destructure with comptime syntax" { | ... | @@ -78,6 +82,8 @@ test "destructure with comptime syntax" { |
| 78 | } | 82 | } |
| 79 | 83 | ||
| 80 | test "destructure from labeled block" { | 84 | test "destructure from labeled block" { |
| 85 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 86 | |||
| 81 | const S = struct { | 87 | const S = struct { |
| 82 | fn doTheTest(rt_true: bool) !void { | 88 | fn doTheTest(rt_true: bool) !void { |
| 83 | const x: u32, const y: u8, const z: i64 = blk: { | 89 | const x: u32, const y: u8, const z: i64 = blk: { |
| ... | @@ -96,6 +102,8 @@ test "destructure from labeled block" { | ... | @@ -96,6 +102,8 @@ test "destructure from labeled block" { |
| 96 | } | 102 | } |
| 97 | 103 | ||
| 98 | test "destructure tuple value" { | 104 | test "destructure tuple value" { |
| 105 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 106 | |||
| 99 | const tup: struct { f32, u32, i64 } = .{ 10.0, 20, 30 }; | 107 | const tup: struct { f32, u32, i64 } = .{ 10.0, 20, 30 }; |
| 100 | const x, const y, const z = tup; | 108 | const x, const y, const z = tup; |
| 101 | 109 | ||
| ... | @@ -109,6 +117,8 @@ test "destructure tuple value" { | ... | @@ -109,6 +117,8 @@ test "destructure tuple value" { |
| 109 | } | 117 | } |
| 110 | 118 | ||
| 111 | test "destructure array value" { | 119 | test "destructure array value" { |
| 120 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 121 | |||
| 112 | const arr: [3]u32 = .{ 10, 20, 30 }; | 122 | const arr: [3]u32 = .{ 10, 20, 30 }; |
| 113 | const x, const y, const z = arr; | 123 | const x, const y, const z = arr; |
| 114 | 124 | ||
| ... | @@ -122,6 +132,8 @@ test "destructure array value" { | ... | @@ -122,6 +132,8 @@ test "destructure array value" { |
| 122 | } | 132 | } |
| 123 | 133 | ||
| 124 | test "destructure from struct init with named tuple fields" { | 134 | test "destructure from struct init with named tuple fields" { |
| 135 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 136 | |||
| 125 | const Tuple = struct { u8, u16, u32 }; | 137 | const Tuple = struct { u8, u16, u32 }; |
| 126 | const x, const y, const z = Tuple{ | 138 | const x, const y, const z = Tuple{ |
| 127 | .@"0" = 100, | 139 | .@"0" = 100, |
| ... | @@ -149,6 +161,8 @@ test "destructure of comptime-known tuple is comptime-known" { | ... | @@ -149,6 +161,8 @@ test "destructure of comptime-known tuple is comptime-known" { |
| 149 | } | 161 | } |
| 150 | 162 | ||
| 151 | test "destructure of comptime-known tuple where some destinations are runtime-known is comptime-known" { | 163 | test "destructure of comptime-known tuple where some destinations are runtime-known is comptime-known" { |
| 164 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 165 | |||
| 152 | var z: u32 = undefined; | 166 | var z: u32 = undefined; |
| 153 | var x: u8, const y, z = .{ 1, 2, 3 }; | 167 | var x: u8, const y, z = .{ 1, 2, 3 }; |
| 154 | _ = &x; | 168 | _ = &x; |
test/behavior/enum.zig+32-13| ... | @@ -12,6 +12,8 @@ fn shouldEqual(n: Number, expected: u3) !void { | ... | @@ -12,6 +12,8 @@ fn shouldEqual(n: Number, expected: u3) !void { |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | test "enum to int" { | 14 | test "enum to int" { |
| 15 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 16 | |||
| 15 | try shouldEqual(Number.Zero, 0); | 17 | try shouldEqual(Number.Zero, 0); |
| 16 | try shouldEqual(Number.One, 1); | 18 | try shouldEqual(Number.One, 1); |
| 17 | try shouldEqual(Number.Two, 2); | 19 | try shouldEqual(Number.Two, 2); |
| ... | @@ -614,6 +616,7 @@ test "enum with specified tag values" { | ... | @@ -614,6 +616,7 @@ test "enum with specified tag values" { |
| 614 | } | 616 | } |
| 615 | 617 | ||
| 616 | test "non-exhaustive enum" { | 618 | test "non-exhaustive enum" { |
| 619 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 617 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 620 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 618 | 621 | ||
| 619 | const S = struct { | 622 | const S = struct { |
| ... | @@ -657,6 +660,8 @@ test "non-exhaustive enum" { | ... | @@ -657,6 +660,8 @@ test "non-exhaustive enum" { |
| 657 | } | 660 | } |
| 658 | 661 | ||
| 659 | test "empty non-exhaustive enum" { | 662 | test "empty non-exhaustive enum" { |
| 663 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 664 | |||
| 660 | const S = struct { | 665 | const S = struct { |
| 661 | const E = enum(u8) { _ }; | 666 | const E = enum(u8) { _ }; |
| 662 | 667 | ||
| ... | @@ -678,6 +683,7 @@ test "empty non-exhaustive enum" { | ... | @@ -678,6 +683,7 @@ test "empty non-exhaustive enum" { |
| 678 | } | 683 | } |
| 679 | 684 | ||
| 680 | test "single field non-exhaustive enum" { | 685 | test "single field non-exhaustive enum" { |
| 686 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 681 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 687 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 682 | 688 | ||
| 683 | const S = struct { | 689 | const S = struct { |
| ... | @@ -796,6 +802,8 @@ test "enum with 1 field but explicit tag type should still have the tag type" { | ... | @@ -796,6 +802,8 @@ test "enum with 1 field but explicit tag type should still have the tag type" { |
| 796 | } | 802 | } |
| 797 | 803 | ||
| 798 | test "signed integer as enum tag" { | 804 | test "signed integer as enum tag" { |
| 805 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 806 | |||
| 799 | const SignedEnum = enum(i2) { | 807 | const SignedEnum = enum(i2) { |
| 800 | A0 = -1, | 808 | A0 = -1, |
| 801 | A1 = 0, | 809 | A1 = 0, |
| ... | @@ -880,6 +888,8 @@ test "method call on an enum" { | ... | @@ -880,6 +888,8 @@ test "method call on an enum" { |
| 880 | } | 888 | } |
| 881 | 889 | ||
| 882 | test "enum value allocation" { | 890 | test "enum value allocation" { |
| 891 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 892 | |||
| 883 | const LargeEnum = enum(u32) { | 893 | const LargeEnum = enum(u32) { |
| 884 | A0 = 0x80000000, | 894 | A0 = 0x80000000, |
| 885 | A1, | 895 | A1, |
| ... | @@ -892,6 +902,7 @@ test "enum value allocation" { | ... | @@ -892,6 +902,7 @@ test "enum value allocation" { |
| 892 | } | 902 | } |
| 893 | 903 | ||
| 894 | test "enum literal casting to tagged union" { | 904 | test "enum literal casting to tagged union" { |
| 905 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 895 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 906 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 896 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 907 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 897 | 908 | ||
| ... | @@ -918,6 +929,7 @@ test "enum literal casting to tagged union" { | ... | @@ -918,6 +929,7 @@ test "enum literal casting to tagged union" { |
| 918 | const Bar = enum { A, B, C, D }; | 929 | const Bar = enum { A, B, C, D }; |
| 919 | 930 | ||
| 920 | test "enum literal casting to error union with payload enum" { | 931 | test "enum literal casting to error union with payload enum" { |
| 932 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 921 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 933 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 922 | 934 | ||
| 923 | var bar: error{B}!Bar = undefined; | 935 | var bar: error{B}!Bar = undefined; |
| ... | @@ -927,6 +939,7 @@ test "enum literal casting to error union with payload enum" { | ... | @@ -927,6 +939,7 @@ test "enum literal casting to error union with payload enum" { |
| 927 | } | 939 | } |
| 928 | 940 | ||
| 929 | test "constant enum initialization with differing sizes" { | 941 | test "constant enum initialization with differing sizes" { |
| 942 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 930 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 943 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 931 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 944 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 932 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 945 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -972,7 +985,7 @@ test "@tagName" { | ... | @@ -972,7 +985,7 @@ test "@tagName" { |
| 972 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 985 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 973 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 986 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 974 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 987 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 975 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 988 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 976 | 989 | ||
| 977 | try expect(mem.eql(u8, testEnumTagNameBare(BareNumber.Three), "Three")); | 990 | try expect(mem.eql(u8, testEnumTagNameBare(BareNumber.Three), "Three")); |
| 978 | comptime assert(mem.eql(u8, testEnumTagNameBare(BareNumber.Three), "Three")); | 991 | comptime assert(mem.eql(u8, testEnumTagNameBare(BareNumber.Three), "Three")); |
| ... | @@ -988,7 +1001,7 @@ test "@tagName non-exhaustive enum" { | ... | @@ -988,7 +1001,7 @@ test "@tagName non-exhaustive enum" { |
| 988 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1001 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 989 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1002 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 990 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1003 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 991 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1004 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 992 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1005 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 993 | 1006 | ||
| 994 | try expect(mem.eql(u8, testEnumTagNameBare(NonExhaustive.B), "B")); | 1007 | try expect(mem.eql(u8, testEnumTagNameBare(NonExhaustive.B), "B")); |
| ... | @@ -1000,7 +1013,7 @@ test "@tagName is null-terminated" { | ... | @@ -1000,7 +1013,7 @@ test "@tagName is null-terminated" { |
| 1000 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1013 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1001 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1014 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1002 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1015 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1003 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1016 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1004 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1017 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1005 | 1018 | ||
| 1006 | const S = struct { | 1019 | const S = struct { |
| ... | @@ -1016,7 +1029,7 @@ test "tag name with assigned enum values" { | ... | @@ -1016,7 +1029,7 @@ test "tag name with assigned enum values" { |
| 1016 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1029 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1017 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1030 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1018 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1031 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1019 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1032 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1020 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1033 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1021 | 1034 | ||
| 1022 | const LocalFoo = enum(u8) { | 1035 | const LocalFoo = enum(u8) { |
| ... | @@ -1030,7 +1043,7 @@ test "tag name with assigned enum values" { | ... | @@ -1030,7 +1043,7 @@ test "tag name with assigned enum values" { |
| 1030 | 1043 | ||
| 1031 | test "@tagName on enum literals" { | 1044 | test "@tagName on enum literals" { |
| 1032 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1045 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1033 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1046 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1034 | 1047 | ||
| 1035 | try expect(mem.eql(u8, @tagName(.FooBar), "FooBar")); | 1048 | try expect(mem.eql(u8, @tagName(.FooBar), "FooBar")); |
| 1036 | comptime assert(mem.eql(u8, @tagName(.FooBar), "FooBar")); | 1049 | comptime assert(mem.eql(u8, @tagName(.FooBar), "FooBar")); |
| ... | @@ -1040,7 +1053,7 @@ test "tag name with signed enum values" { | ... | @@ -1040,7 +1053,7 @@ test "tag name with signed enum values" { |
| 1040 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1053 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1041 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1054 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1042 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1055 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1043 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1056 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1044 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1057 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1045 | 1058 | ||
| 1046 | const LocalFoo = enum(isize) { | 1059 | const LocalFoo = enum(isize) { |
| ... | @@ -1057,7 +1070,7 @@ test "tag name with signed enum values" { | ... | @@ -1057,7 +1070,7 @@ test "tag name with signed enum values" { |
| 1057 | test "tag name with large enum values" { | 1070 | test "tag name with large enum values" { |
| 1058 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1071 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1059 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | 1072 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1060 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1073 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1061 | 1074 | ||
| 1062 | const Kdf = enum(u128) { | 1075 | const Kdf = enum(u128) { |
| 1063 | aes_kdf = 0xea4f8ac1080d74bf60448a629af3d9c9, | 1076 | aes_kdf = 0xea4f8ac1080d74bf60448a629af3d9c9, |
| ... | @@ -1077,7 +1090,7 @@ test "tag name with large enum values" { | ... | @@ -1077,7 +1090,7 @@ test "tag name with large enum values" { |
| 1077 | test "@tagName with exotic integer enum types" { | 1090 | test "@tagName with exotic integer enum types" { |
| 1078 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1091 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1079 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | 1092 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1080 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1093 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1081 | 1094 | ||
| 1082 | const S = struct { | 1095 | const S = struct { |
| 1083 | fn testEnumSigned(comptime T: type) !void { | 1096 | fn testEnumSigned(comptime T: type) !void { |
| ... | @@ -1177,7 +1190,7 @@ test "@tagName in callconv(.c) function" { | ... | @@ -1177,7 +1190,7 @@ test "@tagName in callconv(.c) function" { |
| 1177 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1190 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1178 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1191 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1179 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 1192 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 1180 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1193 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1181 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1194 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1182 | 1195 | ||
| 1183 | try expect(mem.orderZ(u8, testEnumTagNameCallconvC(), "Two") == .eq); | 1196 | try expect(mem.orderZ(u8, testEnumTagNameCallconvC(), "Two") == .eq); |
| ... | @@ -1191,6 +1204,7 @@ fn testEnumTagNameCallconvC() callconv(.c) [*:0]const u8 { | ... | @@ -1191,6 +1204,7 @@ fn testEnumTagNameCallconvC() callconv(.c) [*:0]const u8 { |
| 1191 | } | 1204 | } |
| 1192 | 1205 | ||
| 1193 | test "enum literal casting to optional" { | 1206 | test "enum literal casting to optional" { |
| 1207 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1194 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1208 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1195 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1209 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1196 | 1210 | ||
| ... | @@ -1217,6 +1231,7 @@ const bit_field_1 = BitFieldOfEnums{ | ... | @@ -1217,6 +1231,7 @@ const bit_field_1 = BitFieldOfEnums{ |
| 1217 | }; | 1231 | }; |
| 1218 | 1232 | ||
| 1219 | test "bit field access with enum fields" { | 1233 | test "bit field access with enum fields" { |
| 1234 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 1220 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1235 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1221 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1236 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1222 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1237 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -1260,7 +1275,7 @@ test "tag name functions are unique" { | ... | @@ -1260,7 +1275,7 @@ test "tag name functions are unique" { |
| 1260 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1275 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1261 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1276 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1262 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1277 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1263 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1278 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1264 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1279 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1265 | 1280 | ||
| 1266 | { | 1281 | { |
| ... | @@ -1279,7 +1294,7 @@ test "tag name functions are unique" { | ... | @@ -1279,7 +1294,7 @@ test "tag name functions are unique" { |
| 1279 | 1294 | ||
| 1280 | test "size of enum with only one tag which has explicit integer tag type" { | 1295 | test "size of enum with only one tag which has explicit integer tag type" { |
| 1281 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1296 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1282 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1297 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1283 | 1298 | ||
| 1284 | const E = enum(u8) { nope = 10 }; | 1299 | const E = enum(u8) { nope = 10 }; |
| 1285 | const S0 = struct { e: E }; | 1300 | const S0 = struct { e: E }; |
| ... | @@ -1314,7 +1329,7 @@ test "switch on an extern enum with negative value" { | ... | @@ -1314,7 +1329,7 @@ test "switch on an extern enum with negative value" { |
| 1314 | } | 1329 | } |
| 1315 | 1330 | ||
| 1316 | test "switch on an enum with small signed tag type" { | 1331 | test "switch on an enum with small signed tag type" { |
| 1317 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1332 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1318 | 1333 | ||
| 1319 | const E = enum(i3) { | 1334 | const E = enum(i3) { |
| 1320 | y = -2, | 1335 | y = -2, |
| ... | @@ -1358,7 +1373,7 @@ test "enum tag from a local variable" { | ... | @@ -1358,7 +1373,7 @@ test "enum tag from a local variable" { |
| 1358 | } | 1373 | } |
| 1359 | 1374 | ||
| 1360 | test "auto-numbered enum with signed tag type" { | 1375 | test "auto-numbered enum with signed tag type" { |
| 1361 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1376 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1362 | 1377 | ||
| 1363 | const E = enum(i32) { a, b }; | 1378 | const E = enum(i32) { a, b }; |
| 1364 | 1379 | ||
| ... | @@ -1375,6 +1390,7 @@ test "auto-numbered enum with signed tag type" { | ... | @@ -1375,6 +1390,7 @@ test "auto-numbered enum with signed tag type" { |
| 1375 | } | 1390 | } |
| 1376 | 1391 | ||
| 1377 | test "lazy initialized field" { | 1392 | test "lazy initialized field" { |
| 1393 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1378 | try std.testing.expectEqual(@as(u8, @alignOf(struct {})), getLazyInitialized(.a)); | 1394 | try std.testing.expectEqual(@as(u8, @alignOf(struct {})), getLazyInitialized(.a)); |
| 1379 | } | 1395 | } |
| 1380 | 1396 | ||
| ... | @@ -1403,6 +1419,7 @@ test "matching captures causes enum equivalence" { | ... | @@ -1403,6 +1419,7 @@ test "matching captures causes enum equivalence" { |
| 1403 | } | 1419 | } |
| 1404 | 1420 | ||
| 1405 | test "large enum field values" { | 1421 | test "large enum field values" { |
| 1422 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1406 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1423 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1407 | 1424 | ||
| 1408 | { | 1425 | { |
| ... | @@ -1451,6 +1468,8 @@ test "comptime @enumFromInt with signed arithmetic" { | ... | @@ -1451,6 +1468,8 @@ test "comptime @enumFromInt with signed arithmetic" { |
| 1451 | } | 1468 | } |
| 1452 | 1469 | ||
| 1453 | test "enum int tag type uses declaration inside the enum" { | 1470 | test "enum int tag type uses declaration inside the enum" { |
| 1471 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1472 | |||
| 1454 | const static = struct { | 1473 | const static = struct { |
| 1455 | const E = enum(E.IntTag) { | 1474 | const E = enum(E.IntTag) { |
| 1456 | const IntTag = u8; | 1475 | const IntTag = u8; |
test/behavior/error.zig+54-15| ... | @@ -30,6 +30,7 @@ fn shouldBeNotEqual(a: anyerror, b: anyerror) void { | ... | @@ -30,6 +30,7 @@ fn shouldBeNotEqual(a: anyerror, b: anyerror) void { |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | test "error binary operator" { | 32 | test "error binary operator" { |
| 33 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 33 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 34 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 34 | 35 | ||
| 35 | const a = errBinaryOperatorG(true) catch 3; | 36 | const a = errBinaryOperatorG(true) catch 3; |
| ... | @@ -61,12 +62,14 @@ pub fn baz() anyerror!i32 { | ... | @@ -61,12 +62,14 @@ pub fn baz() anyerror!i32 { |
| 61 | } | 62 | } |
| 62 | 63 | ||
| 63 | test "error wrapping" { | 64 | test "error wrapping" { |
| 65 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 64 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 66 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 65 | 67 | ||
| 66 | try expect((baz() catch unreachable) == 15); | 68 | try expect((baz() catch unreachable) == 15); |
| 67 | } | 69 | } |
| 68 | 70 | ||
| 69 | test "unwrap simple value from error" { | 71 | test "unwrap simple value from error" { |
| 72 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 70 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 73 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 71 | 74 | ||
| 72 | const i = unwrapSimpleValueFromErrorDo() catch unreachable; | 75 | const i = unwrapSimpleValueFromErrorDo() catch unreachable; |
| ... | @@ -77,6 +80,7 @@ fn unwrapSimpleValueFromErrorDo() anyerror!isize { | ... | @@ -77,6 +80,7 @@ fn unwrapSimpleValueFromErrorDo() anyerror!isize { |
| 77 | } | 80 | } |
| 78 | 81 | ||
| 79 | test "error return in assignment" { | 82 | test "error return in assignment" { |
| 83 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 80 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 84 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 81 | 85 | ||
| 82 | doErrReturnInAssignment() catch unreachable; | 86 | doErrReturnInAssignment() catch unreachable; |
| ... | @@ -98,6 +102,7 @@ test "syntax: optional operator in front of error union operator" { | ... | @@ -98,6 +102,7 @@ test "syntax: optional operator in front of error union operator" { |
| 98 | } | 102 | } |
| 99 | 103 | ||
| 100 | test "widen cast integer payload of error union function call" { | 104 | test "widen cast integer payload of error union function call" { |
| 105 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 101 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 106 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 102 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 107 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 103 | 108 | ||
| ... | @@ -124,7 +129,7 @@ test "debug info for optional error set" { | ... | @@ -124,7 +129,7 @@ test "debug info for optional error set" { |
| 124 | 129 | ||
| 125 | test "implicit cast to optional to error union to return result loc" { | 130 | test "implicit cast to optional to error union to return result loc" { |
| 126 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 131 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 127 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 132 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 128 | 133 | ||
| 129 | const S = struct { | 134 | const S = struct { |
| 130 | fn entry() !void { | 135 | fn entry() !void { |
| ... | @@ -145,12 +150,14 @@ test "implicit cast to optional to error union to return result loc" { | ... | @@ -145,12 +150,14 @@ test "implicit cast to optional to error union to return result loc" { |
| 145 | } | 150 | } |
| 146 | 151 | ||
| 147 | test "fn returning empty error set can be passed as fn returning any error" { | 152 | test "fn returning empty error set can be passed as fn returning any error" { |
| 153 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 154 | |||
| 148 | entry(); | 155 | entry(); |
| 149 | comptime entry(); | 156 | comptime entry(); |
| 150 | } | 157 | } |
| 151 | 158 | ||
| 152 | test "fn returning empty error set can be passed as fn returning any error - pointer" { | 159 | test "fn returning empty error set can be passed as fn returning any error - pointer" { |
| 153 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 160 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 154 | 161 | ||
| 155 | entryPtr(); | 162 | entryPtr(); |
| 156 | comptime entryPtr(); | 163 | comptime entryPtr(); |
| ... | @@ -182,6 +189,8 @@ fn fooPtr(f: *const fn () anyerror!void) void { | ... | @@ -182,6 +189,8 @@ fn fooPtr(f: *const fn () anyerror!void) void { |
| 182 | fn bar2() (error{}!void) {} | 189 | fn bar2() (error{}!void) {} |
| 183 | 190 | ||
| 184 | test "error union type " { | 191 | test "error union type " { |
| 192 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 193 | |||
| 185 | try testErrorUnionType(); | 194 | try testErrorUnionType(); |
| 186 | try comptime testErrorUnionType(); | 195 | try comptime testErrorUnionType(); |
| 187 | } | 196 | } |
| ... | @@ -195,6 +204,8 @@ fn testErrorUnionType() !void { | ... | @@ -195,6 +204,8 @@ fn testErrorUnionType() !void { |
| 195 | } | 204 | } |
| 196 | 205 | ||
| 197 | test "error set type" { | 206 | test "error set type" { |
| 207 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 208 | |||
| 198 | try testErrorSetType(); | 209 | try testErrorSetType(); |
| 199 | try comptime testErrorSetType(); | 210 | try comptime testErrorSetType(); |
| 200 | } | 211 | } |
| ... | @@ -218,6 +229,7 @@ fn testErrorSetType() !void { | ... | @@ -218,6 +229,7 @@ fn testErrorSetType() !void { |
| 218 | } | 229 | } |
| 219 | 230 | ||
| 220 | test "explicit error set cast" { | 231 | test "explicit error set cast" { |
| 232 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 221 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 233 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 222 | 234 | ||
| 223 | try testExplicitErrorSetCast(Set1.A); | 235 | try testExplicitErrorSetCast(Set1.A); |
| ... | @@ -236,6 +248,7 @@ fn testExplicitErrorSetCast(set1: Set1) !void { | ... | @@ -236,6 +248,7 @@ fn testExplicitErrorSetCast(set1: Set1) !void { |
| 236 | } | 248 | } |
| 237 | 249 | ||
| 238 | test "@errorCast on error unions" { | 250 | test "@errorCast on error unions" { |
| 251 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 239 | const S = struct { | 252 | const S = struct { |
| 240 | fn doTheTest() !void { | 253 | fn doTheTest() !void { |
| 241 | { | 254 | { |
| ... | @@ -262,6 +275,7 @@ test "@errorCast on error unions" { | ... | @@ -262,6 +275,7 @@ test "@errorCast on error unions" { |
| 262 | } | 275 | } |
| 263 | 276 | ||
| 264 | test "comptime test error for empty error set" { | 277 | test "comptime test error for empty error set" { |
| 278 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 265 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 279 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 266 | 280 | ||
| 267 | try testComptimeTestErrorEmptySet(1234); | 281 | try testComptimeTestErrorEmptySet(1234); |
| ... | @@ -298,6 +312,8 @@ test "inferred empty error set comptime catch" { | ... | @@ -298,6 +312,8 @@ test "inferred empty error set comptime catch" { |
| 298 | } | 312 | } |
| 299 | 313 | ||
| 300 | test "error inference with an empty set" { | 314 | test "error inference with an empty set" { |
| 315 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 316 | |||
| 301 | const S = struct { | 317 | const S = struct { |
| 302 | const Struct = struct { | 318 | const Struct = struct { |
| 303 | pub fn func() (error{})!usize { | 319 | pub fn func() (error{})!usize { |
| ... | @@ -319,6 +335,7 @@ test "error inference with an empty set" { | ... | @@ -319,6 +335,7 @@ test "error inference with an empty set" { |
| 319 | } | 335 | } |
| 320 | 336 | ||
| 321 | test "error union peer type resolution" { | 337 | test "error union peer type resolution" { |
| 338 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 322 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 339 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 323 | 340 | ||
| 324 | try testErrorUnionPeerTypeResolution(1); | 341 | try testErrorUnionPeerTypeResolution(1); |
| ... | @@ -350,6 +367,7 @@ fn quux_1() !i32 { | ... | @@ -350,6 +367,7 @@ fn quux_1() !i32 { |
| 350 | } | 367 | } |
| 351 | 368 | ||
| 352 | test "error: Zero sized error set returned with value payload crash" { | 369 | test "error: Zero sized error set returned with value payload crash" { |
| 370 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 353 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 371 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 354 | 372 | ||
| 355 | _ = try foo3(0); | 373 | _ = try foo3(0); |
| ... | @@ -363,7 +381,7 @@ fn foo3(b: usize) Error!usize { | ... | @@ -363,7 +381,7 @@ fn foo3(b: usize) Error!usize { |
| 363 | 381 | ||
| 364 | test "error: Infer error set from literals" { | 382 | test "error: Infer error set from literals" { |
| 365 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 383 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 366 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 384 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 367 | 385 | ||
| 368 | _ = nullLiteral("n") catch |err| handleErrors(err); | 386 | _ = nullLiteral("n") catch |err| handleErrors(err); |
| 369 | _ = floatLiteral("n") catch |err| handleErrors(err); | 387 | _ = floatLiteral("n") catch |err| handleErrors(err); |
| ... | @@ -400,6 +418,7 @@ fn intLiteral(str: []const u8) !?i64 { | ... | @@ -400,6 +418,7 @@ fn intLiteral(str: []const u8) !?i64 { |
| 400 | } | 418 | } |
| 401 | 419 | ||
| 402 | test "nested error union function call in optional unwrap" { | 420 | test "nested error union function call in optional unwrap" { |
| 421 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 403 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 422 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 404 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 423 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 405 | 424 | ||
| ... | @@ -446,6 +465,7 @@ test "nested error union function call in optional unwrap" { | ... | @@ -446,6 +465,7 @@ test "nested error union function call in optional unwrap" { |
| 446 | } | 465 | } |
| 447 | 466 | ||
| 448 | test "return function call to error set from error union function" { | 467 | test "return function call to error set from error union function" { |
| 468 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 449 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 469 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 450 | 470 | ||
| 451 | const S = struct { | 471 | const S = struct { |
| ... | @@ -477,6 +497,7 @@ test "optional error set is the same size as error set" { | ... | @@ -477,6 +497,7 @@ test "optional error set is the same size as error set" { |
| 477 | } | 497 | } |
| 478 | 498 | ||
| 479 | test "nested catch" { | 499 | test "nested catch" { |
| 500 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 480 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 501 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 481 | 502 | ||
| 482 | const S = struct { | 503 | const S = struct { |
| ... | @@ -502,7 +523,7 @@ test "nested catch" { | ... | @@ -502,7 +523,7 @@ test "nested catch" { |
| 502 | 523 | ||
| 503 | test "function pointer with return type that is error union with payload which is pointer of parent struct" { | 524 | test "function pointer with return type that is error union with payload which is pointer of parent struct" { |
| 504 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 525 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 505 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 526 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 506 | 527 | ||
| 507 | const S = struct { | 528 | const S = struct { |
| 508 | const Foo = struct { | 529 | const Foo = struct { |
| ... | @@ -524,6 +545,7 @@ test "function pointer with return type that is error union with payload which i | ... | @@ -524,6 +545,7 @@ test "function pointer with return type that is error union with payload which i |
| 524 | } | 545 | } |
| 525 | 546 | ||
| 526 | test "return result loc as peer result loc in inferred error set function" { | 547 | test "return result loc as peer result loc in inferred error set function" { |
| 548 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 527 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 549 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 528 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 550 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 529 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 551 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -555,6 +577,7 @@ test "return result loc as peer result loc in inferred error set function" { | ... | @@ -555,6 +577,7 @@ test "return result loc as peer result loc in inferred error set function" { |
| 555 | } | 577 | } |
| 556 | 578 | ||
| 557 | test "error payload type is correctly resolved" { | 579 | test "error payload type is correctly resolved" { |
| 580 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 558 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 581 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 559 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 582 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 560 | 583 | ||
| ... | @@ -585,7 +608,7 @@ test "error union comptime caching" { | ... | @@ -585,7 +608,7 @@ test "error union comptime caching" { |
| 585 | test "@errorName" { | 608 | test "@errorName" { |
| 586 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 609 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 587 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 610 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 588 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 611 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 589 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 612 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 590 | 613 | ||
| 591 | try expect(mem.eql(u8, @errorName(error.AnError), "AnError")); | 614 | try expect(mem.eql(u8, @errorName(error.AnError), "AnError")); |
| ... | @@ -599,7 +622,7 @@ fn gimmeItBroke() anyerror { | ... | @@ -599,7 +622,7 @@ fn gimmeItBroke() anyerror { |
| 599 | test "@errorName sentinel length matches slice length" { | 622 | test "@errorName sentinel length matches slice length" { |
| 600 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 623 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 601 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 624 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 602 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 625 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 603 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 626 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 604 | 627 | ||
| 605 | const name = testBuiltinErrorName(error.FooBar); | 628 | const name = testBuiltinErrorName(error.FooBar); |
| ... | @@ -613,6 +636,8 @@ pub fn testBuiltinErrorName(err: anyerror) [:0]const u8 { | ... | @@ -613,6 +636,8 @@ pub fn testBuiltinErrorName(err: anyerror) [:0]const u8 { |
| 613 | } | 636 | } |
| 614 | 637 | ||
| 615 | test "error set equality" { | 638 | test "error set equality" { |
| 639 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 640 | |||
| 616 | const a = error{One}; | 641 | const a = error{One}; |
| 617 | const b = error{One}; | 642 | const b = error{One}; |
| 618 | 643 | ||
| ... | @@ -628,6 +653,7 @@ test "error set equality" { | ... | @@ -628,6 +653,7 @@ test "error set equality" { |
| 628 | } | 653 | } |
| 629 | 654 | ||
| 630 | test "inferred error set equality" { | 655 | test "inferred error set equality" { |
| 656 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 631 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 657 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 632 | 658 | ||
| 633 | const S = struct { | 659 | const S = struct { |
| ... | @@ -691,6 +717,7 @@ test "coerce error set to the current inferred error set" { | ... | @@ -691,6 +717,7 @@ test "coerce error set to the current inferred error set" { |
| 691 | } | 717 | } |
| 692 | 718 | ||
| 693 | test "error union payload is properly aligned" { | 719 | test "error union payload is properly aligned" { |
| 720 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 694 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 721 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 695 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 722 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 696 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 723 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -723,6 +750,7 @@ test "ret_ptr doesn't cause own inferred error set to be resolved" { | ... | @@ -723,6 +750,7 @@ test "ret_ptr doesn't cause own inferred error set to be resolved" { |
| 723 | } | 750 | } |
| 724 | 751 | ||
| 725 | test "simple else prong allowed even when all errors handled" { | 752 | test "simple else prong allowed even when all errors handled" { |
| 753 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 726 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 754 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 727 | 755 | ||
| 728 | const S = struct { | 756 | const S = struct { |
| ... | @@ -750,7 +778,7 @@ test "simple else prong allowed even when all errors handled" { | ... | @@ -750,7 +778,7 @@ test "simple else prong allowed even when all errors handled" { |
| 750 | test "pointer to error union payload" { | 778 | test "pointer to error union payload" { |
| 751 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 779 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 752 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 780 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 753 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 781 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 754 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 782 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 755 | 783 | ||
| 756 | var err_union: anyerror!u8 = 15; | 784 | var err_union: anyerror!u8 = 15; |
| ... | @@ -781,7 +809,7 @@ const NoReturn = struct { | ... | @@ -781,7 +809,7 @@ const NoReturn = struct { |
| 781 | }; | 809 | }; |
| 782 | 810 | ||
| 783 | test "error union of noreturn used with if" { | 811 | test "error union of noreturn used with if" { |
| 784 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 812 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 785 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 813 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 786 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 814 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 787 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 815 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -795,7 +823,7 @@ test "error union of noreturn used with if" { | ... | @@ -795,7 +823,7 @@ test "error union of noreturn used with if" { |
| 795 | } | 823 | } |
| 796 | 824 | ||
| 797 | test "error union of noreturn used with try" { | 825 | test "error union of noreturn used with try" { |
| 798 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 826 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 799 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 827 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 800 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 828 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 801 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 829 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -806,7 +834,7 @@ test "error union of noreturn used with try" { | ... | @@ -806,7 +834,7 @@ test "error union of noreturn used with try" { |
| 806 | } | 834 | } |
| 807 | 835 | ||
| 808 | test "error union of noreturn used with catch" { | 836 | test "error union of noreturn used with catch" { |
| 809 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 837 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 810 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 838 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 811 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 839 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 812 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 840 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -819,7 +847,7 @@ test "error union of noreturn used with catch" { | ... | @@ -819,7 +847,7 @@ test "error union of noreturn used with catch" { |
| 819 | test "alignment of wrapping an error union payload" { | 847 | test "alignment of wrapping an error union payload" { |
| 820 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 848 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 821 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 849 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 822 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 850 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 823 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 851 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 824 | 852 | ||
| 825 | const S = struct { | 853 | const S = struct { |
| ... | @@ -835,6 +863,7 @@ test "alignment of wrapping an error union payload" { | ... | @@ -835,6 +863,7 @@ test "alignment of wrapping an error union payload" { |
| 835 | } | 863 | } |
| 836 | 864 | ||
| 837 | test "compare error union and error set" { | 865 | test "compare error union and error set" { |
| 866 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 838 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 867 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 839 | 868 | ||
| 840 | var a: anyerror = error.Foo; | 869 | var a: anyerror = error.Foo; |
| ... | @@ -872,7 +901,7 @@ test "catch within a function that calls no errorable functions" { | ... | @@ -872,7 +901,7 @@ test "catch within a function that calls no errorable functions" { |
| 872 | test "error from comptime string" { | 901 | test "error from comptime string" { |
| 873 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 902 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 874 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 903 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 875 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 904 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 876 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 905 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 877 | 906 | ||
| 878 | const name = "Weird error name!"; | 907 | const name = "Weird error name!"; |
| ... | @@ -887,6 +916,8 @@ test "error from comptime string" { | ... | @@ -887,6 +916,8 @@ test "error from comptime string" { |
| 887 | } | 916 | } |
| 888 | 917 | ||
| 889 | test "field access of anyerror results in smaller error set" { | 918 | test "field access of anyerror results in smaller error set" { |
| 919 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 920 | |||
| 890 | const E1 = @TypeOf(error.Foo); | 921 | const E1 = @TypeOf(error.Foo); |
| 891 | try expect(@TypeOf(E1.Foo) == E1); | 922 | try expect(@TypeOf(E1.Foo) == E1); |
| 892 | const E2 = error{ A, B, C }; | 923 | const E2 = error{ A, B, C }; |
| ... | @@ -895,6 +926,7 @@ test "field access of anyerror results in smaller error set" { | ... | @@ -895,6 +926,7 @@ test "field access of anyerror results in smaller error set" { |
| 895 | } | 926 | } |
| 896 | 927 | ||
| 897 | test "optional error union return type" { | 928 | test "optional error union return type" { |
| 929 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 898 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 930 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 899 | 931 | ||
| 900 | const S = struct { | 932 | const S = struct { |
| ... | @@ -933,7 +965,7 @@ test "optional error set function parameter" { | ... | @@ -933,7 +965,7 @@ test "optional error set function parameter" { |
| 933 | 965 | ||
| 934 | test "returning an error union containing a type with no runtime bits" { | 966 | test "returning an error union containing a type with no runtime bits" { |
| 935 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 967 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 936 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 968 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 937 | 969 | ||
| 938 | const ZeroByteType = struct { | 970 | const ZeroByteType = struct { |
| 939 | foo: void, | 971 | foo: void, |
| ... | @@ -949,7 +981,7 @@ test "returning an error union containing a type with no runtime bits" { | ... | @@ -949,7 +981,7 @@ test "returning an error union containing a type with no runtime bits" { |
| 949 | 981 | ||
| 950 | test "try used in recursive function with inferred error set" { | 982 | test "try used in recursive function with inferred error set" { |
| 951 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 983 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 952 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 984 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 953 | 985 | ||
| 954 | const Value = union(enum) { | 986 | const Value = union(enum) { |
| 955 | values: []const @This(), | 987 | values: []const @This(), |
| ... | @@ -1010,6 +1042,7 @@ test "function called at runtime is properly analyzed for inferred error set" { | ... | @@ -1010,6 +1042,7 @@ test "function called at runtime is properly analyzed for inferred error set" { |
| 1010 | } | 1042 | } |
| 1011 | 1043 | ||
| 1012 | test "errorCast to adhoc inferred error set" { | 1044 | test "errorCast to adhoc inferred error set" { |
| 1045 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1013 | const S = struct { | 1046 | const S = struct { |
| 1014 | inline fn baz() !i32 { | 1047 | inline fn baz() !i32 { |
| 1015 | return @errorCast(err()); | 1048 | return @errorCast(err()); |
| ... | @@ -1022,6 +1055,7 @@ test "errorCast to adhoc inferred error set" { | ... | @@ -1022,6 +1055,7 @@ test "errorCast to adhoc inferred error set" { |
| 1022 | } | 1055 | } |
| 1023 | 1056 | ||
| 1024 | test "@errorCast from error set to error union" { | 1057 | test "@errorCast from error set to error union" { |
| 1058 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1025 | const S = struct { | 1059 | const S = struct { |
| 1026 | fn doTheTest(set: error{ A, B }) error{A}!i32 { | 1060 | fn doTheTest(set: error{ A, B }) error{A}!i32 { |
| 1027 | return @errorCast(set); | 1061 | return @errorCast(set); |
| ... | @@ -1032,6 +1066,7 @@ test "@errorCast from error set to error union" { | ... | @@ -1032,6 +1066,7 @@ test "@errorCast from error set to error union" { |
| 1032 | } | 1066 | } |
| 1033 | 1067 | ||
| 1034 | test "@errorCast from error union to error union" { | 1068 | test "@errorCast from error union to error union" { |
| 1069 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1035 | const S = struct { | 1070 | const S = struct { |
| 1036 | fn doTheTest(set: error{ A, B }!i32) error{A}!i32 { | 1071 | fn doTheTest(set: error{ A, B }!i32) error{A}!i32 { |
| 1037 | return @errorCast(set); | 1072 | return @errorCast(set); |
| ... | @@ -1045,7 +1080,7 @@ test "result location initialization of error union with OPV payload" { | ... | @@ -1045,7 +1080,7 @@ test "result location initialization of error union with OPV payload" { |
| 1045 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1080 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1046 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1081 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1047 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1082 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1048 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1083 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1049 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 1084 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 1050 | 1085 | ||
| 1051 | const S = struct { | 1086 | const S = struct { |
| ... | @@ -1067,6 +1102,7 @@ test "result location initialization of error union with OPV payload" { | ... | @@ -1067,6 +1102,7 @@ test "result location initialization of error union with OPV payload" { |
| 1067 | } | 1102 | } |
| 1068 | 1103 | ||
| 1069 | test "return error union with i65" { | 1104 | test "return error union with i65" { |
| 1105 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1070 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1106 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1071 | 1107 | ||
| 1072 | try expect(try add(1000, 234) == 1234); | 1108 | try expect(try add(1000, 234) == 1234); |
| ... | @@ -1077,6 +1113,7 @@ fn add(x: i65, y: i65) anyerror!i65 { | ... | @@ -1077,6 +1113,7 @@ fn add(x: i65, y: i65) anyerror!i65 { |
| 1077 | } | 1113 | } |
| 1078 | 1114 | ||
| 1079 | test "compare error union to error set" { | 1115 | test "compare error union to error set" { |
| 1116 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1080 | const S = struct { | 1117 | const S = struct { |
| 1081 | fn doTheTest(val: error{Foo}!i32) !void { | 1118 | fn doTheTest(val: error{Foo}!i32) !void { |
| 1082 | if (error.Foo == val) return error.Unexpected; | 1119 | if (error.Foo == val) return error.Unexpected; |
| ... | @@ -1107,6 +1144,7 @@ test "'if' ignores error via local while 'else' ignores error directly" { | ... | @@ -1107,6 +1144,7 @@ test "'if' ignores error via local while 'else' ignores error directly" { |
| 1107 | } | 1144 | } |
| 1108 | 1145 | ||
| 1109 | test "@errorCast into own inferred error set" { | 1146 | test "@errorCast into own inferred error set" { |
| 1147 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1110 | const static = struct { | 1148 | const static = struct { |
| 1111 | fn foo(b: bool) !void { | 1149 | fn foo(b: bool) !void { |
| 1112 | if (b) { | 1150 | if (b) { |
| ... | @@ -1140,6 +1178,7 @@ test "@errorCast into other inferred error set" { | ... | @@ -1140,6 +1178,7 @@ test "@errorCast into other inferred error set" { |
| 1140 | } | 1178 | } |
| 1141 | 1179 | ||
| 1142 | test "error union with vector type" { | 1180 | test "error union with vector type" { |
| 1181 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1143 | var x: anyerror!@Vector(5, f64) = undefined; | 1182 | var x: anyerror!@Vector(5, f64) = undefined; |
| 1144 | x = error.Expected; | 1183 | x = error.Expected; |
| 1145 | try expect(x == error.Expected); | 1184 | try expect(x == error.Expected); |
test/behavior/eval.zig+49-21| ... | @@ -5,7 +5,7 @@ const expect = std.testing.expect; | ... | @@ -5,7 +5,7 @@ const expect = std.testing.expect; |
| 5 | const expectEqual = std.testing.expectEqual; | 5 | const expectEqual = std.testing.expectEqual; |
| 6 | 6 | ||
| 7 | test "compile time recursion" { | 7 | test "compile time recursion" { |
| 8 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 8 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 9 | 9 | ||
| 10 | try expect(some_data.len == 21); | 10 | try expect(some_data.len == 21); |
| 11 | } | 11 | } |
| ... | @@ -72,6 +72,7 @@ fn constExprEvalOnSingleExprBlocksFn(x: i32, b: bool) i32 { | ... | @@ -72,6 +72,7 @@ fn constExprEvalOnSingleExprBlocksFn(x: i32, b: bool) i32 { |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | test "constant expressions" { | 74 | test "constant expressions" { |
| 75 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 75 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 76 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 76 | 77 | ||
| 77 | var array: [array_size]u8 = undefined; | 78 | var array: [array_size]u8 = undefined; |
| ... | @@ -93,6 +94,7 @@ fn letsTryToCompareBools(a: bool, b: bool) bool { | ... | @@ -93,6 +94,7 @@ fn letsTryToCompareBools(a: bool, b: bool) bool { |
| 93 | return max(bool, a, b); | 94 | return max(bool, a, b); |
| 94 | } | 95 | } |
| 95 | test "inlined block and runtime block phi" { | 96 | test "inlined block and runtime block phi" { |
| 97 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 96 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 98 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 97 | 99 | ||
| 98 | try expect(letsTryToCompareBools(true, true)); | 100 | try expect(letsTryToCompareBools(true, true)); |
| ... | @@ -141,7 +143,7 @@ test "pointer to type" { | ... | @@ -141,7 +143,7 @@ test "pointer to type" { |
| 141 | test "a type constructed in a global expression" { | 143 | test "a type constructed in a global expression" { |
| 142 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 144 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 143 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 145 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 144 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 146 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 145 | 147 | ||
| 146 | var l: List = undefined; | 148 | var l: List = undefined; |
| 147 | l.array[0] = 10; | 149 | l.array[0] = 10; |
| ... | @@ -234,6 +236,7 @@ const vertices = [_]Vertex{ | ... | @@ -234,6 +236,7 @@ const vertices = [_]Vertex{ |
| 234 | }; | 236 | }; |
| 235 | 237 | ||
| 236 | test "statically initialized list" { | 238 | test "statically initialized list" { |
| 239 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 237 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 240 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 238 | 241 | ||
| 239 | try expect(static_point_list[0].x == 1); | 242 | try expect(static_point_list[0].x == 1); |
| ... | @@ -303,6 +306,7 @@ fn performFn(comptime prefix_char: u8, start_value: i32) i32 { | ... | @@ -303,6 +306,7 @@ fn performFn(comptime prefix_char: u8, start_value: i32) i32 { |
| 303 | } | 306 | } |
| 304 | 307 | ||
| 305 | test "comptime iterate over fn ptr list" { | 308 | test "comptime iterate over fn ptr list" { |
| 309 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 306 | try expect(performFn('t', 1) == 6); | 310 | try expect(performFn('t', 1) == 6); |
| 307 | try expect(performFn('o', 0) == 1); | 311 | try expect(performFn('o', 0) == 1); |
| 308 | try expect(performFn('w', 99) == 99); | 312 | try expect(performFn('w', 99) == 99); |
| ... | @@ -339,6 +343,7 @@ fn doesAlotT(comptime T: type, value: usize) T { | ... | @@ -339,6 +343,7 @@ fn doesAlotT(comptime T: type, value: usize) T { |
| 339 | } | 343 | } |
| 340 | 344 | ||
| 341 | test "@setEvalBranchQuota at same scope as generic function call" { | 345 | test "@setEvalBranchQuota at same scope as generic function call" { |
| 346 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 342 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 347 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 343 | 348 | ||
| 344 | try expect(doesAlotT(u32, 2) == 2); | 349 | try expect(doesAlotT(u32, 2) == 2); |
| ... | @@ -390,7 +395,7 @@ test "return 0 from function that has u0 return type" { | ... | @@ -390,7 +395,7 @@ test "return 0 from function that has u0 return type" { |
| 390 | } | 395 | } |
| 391 | 396 | ||
| 392 | test "statically initialized struct" { | 397 | test "statically initialized struct" { |
| 393 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 398 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 394 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 399 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 395 | 400 | ||
| 396 | st_init_str_foo.x += 1; | 401 | st_init_str_foo.x += 1; |
| ... | @@ -406,6 +411,7 @@ var st_init_str_foo = StInitStrFoo{ | ... | @@ -406,6 +411,7 @@ var st_init_str_foo = StInitStrFoo{ |
| 406 | }; | 411 | }; |
| 407 | 412 | ||
| 408 | test "inline for with same type but different values" { | 413 | test "inline for with same type but different values" { |
| 414 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 409 | var res: usize = 0; | 415 | var res: usize = 0; |
| 410 | inline for ([_]type{ [2]u8, [1]u8, [2]u8 }) |T| { | 416 | inline for ([_]type{ [2]u8, [1]u8, [2]u8 }) |T| { |
| 411 | var a: T = undefined; | 417 | var a: T = undefined; |
| ... | @@ -441,7 +447,7 @@ fn copyWithPartialInline(s: []u32, b: []u8) void { | ... | @@ -441,7 +447,7 @@ fn copyWithPartialInline(s: []u32, b: []u8) void { |
| 441 | test "binary math operator in partially inlined function" { | 447 | test "binary math operator in partially inlined function" { |
| 442 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 448 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 443 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 449 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 444 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 450 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 445 | 451 | ||
| 446 | var s: [4]u32 = undefined; | 452 | var s: [4]u32 = undefined; |
| 447 | var b: [16]u8 = undefined; | 453 | var b: [16]u8 = undefined; |
| ... | @@ -484,6 +490,7 @@ test "comptime bitwise operators" { | ... | @@ -484,6 +490,7 @@ test "comptime bitwise operators" { |
| 484 | } | 490 | } |
| 485 | 491 | ||
| 486 | test "comptime shlWithOverflow" { | 492 | test "comptime shlWithOverflow" { |
| 493 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 487 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 494 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 488 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 495 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 489 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 496 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -498,7 +505,7 @@ test "comptime shlWithOverflow" { | ... | @@ -498,7 +505,7 @@ test "comptime shlWithOverflow" { |
| 498 | 505 | ||
| 499 | test "const ptr to variable data changes at runtime" { | 506 | test "const ptr to variable data changes at runtime" { |
| 500 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 507 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 501 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 508 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 502 | 509 | ||
| 503 | try expect(foo_ref.name[0] == 'a'); | 510 | try expect(foo_ref.name[0] == 'a'); |
| 504 | foo_ref.name = "b"; | 511 | foo_ref.name = "b"; |
| ... | @@ -515,7 +522,7 @@ const foo_ref = &foo_contents; | ... | @@ -515,7 +522,7 @@ const foo_ref = &foo_contents; |
| 515 | test "runtime 128 bit integer division" { | 522 | test "runtime 128 bit integer division" { |
| 516 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 523 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 517 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 524 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 518 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 525 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 519 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 526 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 520 | 527 | ||
| 521 | var a: u128 = 152313999999999991610955792383; | 528 | var a: u128 = 152313999999999991610955792383; |
| ... | @@ -527,13 +534,14 @@ test "runtime 128 bit integer division" { | ... | @@ -527,13 +534,14 @@ test "runtime 128 bit integer division" { |
| 527 | 534 | ||
| 528 | test "@tagName of @typeInfo" { | 535 | test "@tagName of @typeInfo" { |
| 529 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 536 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 530 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 537 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 531 | 538 | ||
| 532 | const str = @tagName(@typeInfo(u8)); | 539 | const str = @tagName(@typeInfo(u8)); |
| 533 | try expect(std.mem.eql(u8, str, "int")); | 540 | try expect(std.mem.eql(u8, str, "int")); |
| 534 | } | 541 | } |
| 535 | 542 | ||
| 536 | test "static eval list init" { | 543 | test "static eval list init" { |
| 544 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 537 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 545 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 538 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 546 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 539 | 547 | ||
| ... | @@ -551,6 +559,7 @@ pub fn vec3(x: f32, y: f32, z: f32) Vec3 { | ... | @@ -551,6 +559,7 @@ pub fn vec3(x: f32, y: f32, z: f32) Vec3 { |
| 551 | } | 559 | } |
| 552 | 560 | ||
| 553 | test "inlined loop has array literal with elided runtime scope on first iteration but not second iteration" { | 561 | test "inlined loop has array literal with elided runtime scope on first iteration but not second iteration" { |
| 562 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 554 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 563 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 555 | 564 | ||
| 556 | var runtime = [1]i32{3}; | 565 | var runtime = [1]i32{3}; |
| ... | @@ -603,7 +612,7 @@ const hi1 = "hi"; | ... | @@ -603,7 +612,7 @@ const hi1 = "hi"; |
| 603 | const hi2 = hi1; | 612 | const hi2 = hi1; |
| 604 | test "const global shares pointer with other same one" { | 613 | test "const global shares pointer with other same one" { |
| 605 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 614 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 606 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 615 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 607 | 616 | ||
| 608 | try assertEqualPtrs(&hi1[0], &hi2[0]); | 617 | try assertEqualPtrs(&hi1[0], &hi2[0]); |
| 609 | comptime assert(&hi1[0] == &hi2[0]); | 618 | comptime assert(&hi1[0] == &hi2[0]); |
| ... | @@ -722,7 +731,7 @@ fn testVarInsideInlineLoop(args: anytype) !void { | ... | @@ -722,7 +731,7 @@ fn testVarInsideInlineLoop(args: anytype) !void { |
| 722 | test "array concatenation of function calls" { | 731 | test "array concatenation of function calls" { |
| 723 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 732 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 724 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 733 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 725 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 734 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 726 | 735 | ||
| 727 | var a = oneItem(3) ++ oneItem(4); | 736 | var a = oneItem(3) ++ oneItem(4); |
| 728 | try expect(std.mem.eql(i32, &a, &[_]i32{ 3, 4 })); | 737 | try expect(std.mem.eql(i32, &a, &[_]i32{ 3, 4 })); |
| ... | @@ -737,6 +746,7 @@ fn scalar(x: u32) u32 { | ... | @@ -737,6 +746,7 @@ fn scalar(x: u32) u32 { |
| 737 | } | 746 | } |
| 738 | 747 | ||
| 739 | test "array concatenation peer resolves element types - value" { | 748 | test "array concatenation peer resolves element types - value" { |
| 749 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 740 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 750 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 741 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 751 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 742 | 752 | ||
| ... | @@ -755,7 +765,7 @@ test "array concatenation peer resolves element types - value" { | ... | @@ -755,7 +765,7 @@ test "array concatenation peer resolves element types - value" { |
| 755 | test "array concatenation peer resolves element types - pointer" { | 765 | test "array concatenation peer resolves element types - pointer" { |
| 756 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 766 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 757 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 767 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 758 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 768 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 759 | 769 | ||
| 760 | var a = [2]u3{ 1, 7 }; | 770 | var a = [2]u3{ 1, 7 }; |
| 761 | var b = [3]u8{ 200, 225, 255 }; | 771 | var b = [3]u8{ 200, 225, 255 }; |
| ... | @@ -772,7 +782,7 @@ test "array concatenation sets the sentinel - value" { | ... | @@ -772,7 +782,7 @@ test "array concatenation sets the sentinel - value" { |
| 772 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 782 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 773 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 783 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 774 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 784 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 775 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 785 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 776 | 786 | ||
| 777 | var a = [2]u3{ 1, 7 }; | 787 | var a = [2]u3{ 1, 7 }; |
| 778 | var b = [3:69]u8{ 200, 225, 255 }; | 788 | var b = [3:69]u8{ 200, 225, 255 }; |
| ... | @@ -791,7 +801,7 @@ test "array concatenation sets the sentinel - value" { | ... | @@ -791,7 +801,7 @@ test "array concatenation sets the sentinel - value" { |
| 791 | test "array concatenation sets the sentinel - pointer" { | 801 | test "array concatenation sets the sentinel - pointer" { |
| 792 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 802 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 793 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 803 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 794 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 804 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 795 | 805 | ||
| 796 | var a = [2]u3{ 1, 7 }; | 806 | var a = [2]u3{ 1, 7 }; |
| 797 | var b = [3:69]u8{ 200, 225, 255 }; | 807 | var b = [3:69]u8{ 200, 225, 255 }; |
| ... | @@ -926,7 +936,7 @@ test "closure capture type of runtime-known var" { | ... | @@ -926,7 +936,7 @@ test "closure capture type of runtime-known var" { |
| 926 | } | 936 | } |
| 927 | 937 | ||
| 928 | test "comptime break passing through runtime condition converted to runtime break" { | 938 | test "comptime break passing through runtime condition converted to runtime break" { |
| 929 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 939 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 930 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 940 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 931 | 941 | ||
| 932 | const S = struct { | 942 | const S = struct { |
| ... | @@ -959,7 +969,7 @@ test "comptime break passing through runtime condition converted to runtime brea | ... | @@ -959,7 +969,7 @@ test "comptime break passing through runtime condition converted to runtime brea |
| 959 | } | 969 | } |
| 960 | 970 | ||
| 961 | test "comptime break to outer loop passing through runtime condition converted to runtime break" { | 971 | test "comptime break to outer loop passing through runtime condition converted to runtime break" { |
| 962 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 972 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 963 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 973 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 964 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 974 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 965 | 975 | ||
| ... | @@ -996,6 +1006,8 @@ test "comptime break to outer loop passing through runtime condition converted t | ... | @@ -996,6 +1006,8 @@ test "comptime break to outer loop passing through runtime condition converted t |
| 996 | } | 1006 | } |
| 997 | 1007 | ||
| 998 | test "comptime break operand passing through runtime condition converted to runtime break" { | 1008 | test "comptime break operand passing through runtime condition converted to runtime break" { |
| 1009 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1010 | |||
| 999 | const S = struct { | 1011 | const S = struct { |
| 1000 | fn doTheTest(runtime: u8) !void { | 1012 | fn doTheTest(runtime: u8) !void { |
| 1001 | const result = inline for ([3]u8{ 'a', 'b', 'c' }) |byte| { | 1013 | const result = inline for ([3]u8{ 'a', 'b', 'c' }) |byte| { |
| ... | @@ -1012,6 +1024,7 @@ test "comptime break operand passing through runtime condition converted to runt | ... | @@ -1012,6 +1024,7 @@ test "comptime break operand passing through runtime condition converted to runt |
| 1012 | } | 1024 | } |
| 1013 | 1025 | ||
| 1014 | test "comptime break operand passing through runtime switch converted to runtime break" { | 1026 | test "comptime break operand passing through runtime switch converted to runtime break" { |
| 1027 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1015 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1028 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1016 | 1029 | ||
| 1017 | const S = struct { | 1030 | const S = struct { |
| ... | @@ -1038,7 +1051,7 @@ test "equality of pointers to comptime const" { | ... | @@ -1038,7 +1051,7 @@ test "equality of pointers to comptime const" { |
| 1038 | test "storing an array of type in a field" { | 1051 | test "storing an array of type in a field" { |
| 1039 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1052 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1040 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1053 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1041 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1054 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1042 | 1055 | ||
| 1043 | const S = struct { | 1056 | const S = struct { |
| 1044 | fn doTheTest() void { | 1057 | fn doTheTest() void { |
| ... | @@ -1066,7 +1079,7 @@ test "storing an array of type in a field" { | ... | @@ -1066,7 +1079,7 @@ test "storing an array of type in a field" { |
| 1066 | 1079 | ||
| 1067 | test "pass pointer to field of comptime-only type as a runtime parameter" { | 1080 | test "pass pointer to field of comptime-only type as a runtime parameter" { |
| 1068 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1081 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1069 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1082 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1070 | 1083 | ||
| 1071 | const S = struct { | 1084 | const S = struct { |
| 1072 | const Mixed = struct { | 1085 | const Mixed = struct { |
| ... | @@ -1192,7 +1205,8 @@ test "lazy value is resolved as slice operand" { | ... | @@ -1192,7 +1205,8 @@ test "lazy value is resolved as slice operand" { |
| 1192 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1205 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1193 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1206 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1194 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1207 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1195 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1208 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1209 | |||
| 1196 | const A = struct { a: u32 }; | 1210 | const A = struct { a: u32 }; |
| 1197 | var a: [512]u64 = undefined; | 1211 | var a: [512]u64 = undefined; |
| 1198 | 1212 | ||
| ... | @@ -1203,6 +1217,8 @@ test "lazy value is resolved as slice operand" { | ... | @@ -1203,6 +1217,8 @@ test "lazy value is resolved as slice operand" { |
| 1203 | } | 1217 | } |
| 1204 | 1218 | ||
| 1205 | test "break from inline loop depends on runtime condition" { | 1219 | test "break from inline loop depends on runtime condition" { |
| 1220 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1221 | |||
| 1206 | const S = struct { | 1222 | const S = struct { |
| 1207 | fn foo(a: u8) bool { | 1223 | fn foo(a: u8) bool { |
| 1208 | return a == 4; | 1224 | return a == 4; |
| ... | @@ -1249,6 +1265,7 @@ test "inline for inside a runtime condition" { | ... | @@ -1249,6 +1265,7 @@ test "inline for inside a runtime condition" { |
| 1249 | } | 1265 | } |
| 1250 | 1266 | ||
| 1251 | test "continue in inline for inside a comptime switch" { | 1267 | test "continue in inline for inside a comptime switch" { |
| 1268 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1252 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1269 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1253 | 1270 | ||
| 1254 | const arr = .{ 1, 2, 3 }; | 1271 | const arr = .{ 1, 2, 3 }; |
| ... | @@ -1267,7 +1284,7 @@ test "continue in inline for inside a comptime switch" { | ... | @@ -1267,7 +1284,7 @@ test "continue in inline for inside a comptime switch" { |
| 1267 | } | 1284 | } |
| 1268 | 1285 | ||
| 1269 | test "length of global array is determinable at comptime" { | 1286 | test "length of global array is determinable at comptime" { |
| 1270 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1287 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1271 | 1288 | ||
| 1272 | const S = struct { | 1289 | const S = struct { |
| 1273 | var bytes: [1024]u8 = undefined; | 1290 | var bytes: [1024]u8 = undefined; |
| ... | @@ -1316,7 +1333,7 @@ test "continue nested inline for loop in named block expr" { | ... | @@ -1316,7 +1333,7 @@ test "continue nested inline for loop in named block expr" { |
| 1316 | } | 1333 | } |
| 1317 | 1334 | ||
| 1318 | test "x and false is comptime-known false" { | 1335 | test "x and false is comptime-known false" { |
| 1319 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1336 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1320 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1337 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1321 | 1338 | ||
| 1322 | const T = struct { | 1339 | const T = struct { |
| ... | @@ -1344,7 +1361,7 @@ test "x and false is comptime-known false" { | ... | @@ -1344,7 +1361,7 @@ test "x and false is comptime-known false" { |
| 1344 | } | 1361 | } |
| 1345 | 1362 | ||
| 1346 | test "x or true is comptime-known true" { | 1363 | test "x or true is comptime-known true" { |
| 1347 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1364 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1348 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1365 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1349 | 1366 | ||
| 1350 | const T = struct { | 1367 | const T = struct { |
| ... | @@ -1372,6 +1389,7 @@ test "x or true is comptime-known true" { | ... | @@ -1372,6 +1389,7 @@ test "x or true is comptime-known true" { |
| 1372 | } | 1389 | } |
| 1373 | 1390 | ||
| 1374 | test "non-optional and optional array elements concatenated" { | 1391 | test "non-optional and optional array elements concatenated" { |
| 1392 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1375 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1393 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1376 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1394 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1377 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1395 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -1391,6 +1409,8 @@ test "inline call in @TypeOf inherits is_inline property" { | ... | @@ -1391,6 +1409,8 @@ test "inline call in @TypeOf inherits is_inline property" { |
| 1391 | } | 1409 | } |
| 1392 | 1410 | ||
| 1393 | test "comptime function turns function value to function pointer" { | 1411 | test "comptime function turns function value to function pointer" { |
| 1412 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1413 | |||
| 1394 | const S = struct { | 1414 | const S = struct { |
| 1395 | fn fnPtr(function: anytype) *const @TypeOf(function) { | 1415 | fn fnPtr(function: anytype) *const @TypeOf(function) { |
| 1396 | return &function; | 1416 | return &function; |
| ... | @@ -1406,7 +1426,7 @@ test "comptime function turns function value to function pointer" { | ... | @@ -1406,7 +1426,7 @@ test "comptime function turns function value to function pointer" { |
| 1406 | } | 1426 | } |
| 1407 | 1427 | ||
| 1408 | test "container level const and var have unique addresses" { | 1428 | test "container level const and var have unique addresses" { |
| 1409 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1429 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1410 | 1430 | ||
| 1411 | const S = struct { | 1431 | const S = struct { |
| 1412 | x: i32, | 1432 | x: i32, |
| ... | @@ -1451,6 +1471,8 @@ test "struct in comptime false branch is not evaluated" { | ... | @@ -1451,6 +1471,8 @@ test "struct in comptime false branch is not evaluated" { |
| 1451 | } | 1471 | } |
| 1452 | 1472 | ||
| 1453 | test "result of nested switch assigned to variable" { | 1473 | test "result of nested switch assigned to variable" { |
| 1474 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1475 | |||
| 1454 | var zds: u32 = 0; | 1476 | var zds: u32 = 0; |
| 1455 | zds = switch (zds) { | 1477 | zds = switch (zds) { |
| 1456 | 0 => switch (zds) { | 1478 | 0 => switch (zds) { |
| ... | @@ -1465,6 +1487,8 @@ test "result of nested switch assigned to variable" { | ... | @@ -1465,6 +1487,8 @@ test "result of nested switch assigned to variable" { |
| 1465 | } | 1487 | } |
| 1466 | 1488 | ||
| 1467 | test "inline for loop of functions returning error unions" { | 1489 | test "inline for loop of functions returning error unions" { |
| 1490 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1491 | |||
| 1468 | const T1 = struct { | 1492 | const T1 = struct { |
| 1469 | fn v() error{}!usize { | 1493 | fn v() error{}!usize { |
| 1470 | return 1; | 1494 | return 1; |
| ... | @@ -1519,6 +1543,8 @@ test "early exit in container level const" { | ... | @@ -1519,6 +1543,8 @@ test "early exit in container level const" { |
| 1519 | } | 1543 | } |
| 1520 | 1544 | ||
| 1521 | test "@inComptime" { | 1545 | test "@inComptime" { |
| 1546 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1547 | |||
| 1522 | const S = struct { | 1548 | const S = struct { |
| 1523 | fn inComptime() bool { | 1549 | fn inComptime() bool { |
| 1524 | return @inComptime(); | 1550 | return @inComptime(); |
| ... | @@ -1584,6 +1610,8 @@ test "comptime labeled block implicit exit" { | ... | @@ -1584,6 +1610,8 @@ test "comptime labeled block implicit exit" { |
| 1584 | } | 1610 | } |
| 1585 | 1611 | ||
| 1586 | test "comptime block has intermediate runtime-known values" { | 1612 | test "comptime block has intermediate runtime-known values" { |
| 1613 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1614 | |||
| 1587 | const arr: [2]u8 = .{ 1, 2 }; | 1615 | const arr: [2]u8 = .{ 1, 2 }; |
| 1588 | 1616 | ||
| 1589 | var idx: usize = undefined; | 1617 | var idx: usize = undefined; |
test/behavior/export_builtin.zig+3-3| ... | @@ -4,7 +4,7 @@ const expect = std.testing.expect; | ... | @@ -4,7 +4,7 @@ const expect = std.testing.expect; |
| 4 | 4 | ||
| 5 | test "exporting enum value" { | 5 | test "exporting enum value" { |
| 6 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 6 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 7 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 7 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 8 | 8 | ||
| 9 | const S = struct { | 9 | const S = struct { |
| 10 | const E = enum(c_int) { one, two }; | 10 | const E = enum(c_int) { one, two }; |
| ... | @@ -18,7 +18,7 @@ test "exporting enum value" { | ... | @@ -18,7 +18,7 @@ test "exporting enum value" { |
| 18 | 18 | ||
| 19 | test "exporting using namespace access" { | 19 | test "exporting using namespace access" { |
| 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 21 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 21 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 22 | 22 | ||
| 23 | const S = struct { | 23 | const S = struct { |
| 24 | const Inner = struct { | 24 | const Inner = struct { |
| ... | @@ -35,7 +35,7 @@ test "exporting using namespace access" { | ... | @@ -35,7 +35,7 @@ test "exporting using namespace access" { |
| 35 | test "exporting comptime-known value" { | 35 | test "exporting comptime-known value" { |
| 36 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 36 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 37 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | 37 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 38 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 38 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 39 | 39 | ||
| 40 | const x: u32 = 10; | 40 | const x: u32 = 10; |
| 41 | @export(&x, .{ .name = "exporting_comptime_known_value_foo" }); | 41 | @export(&x, .{ .name = "exporting_comptime_known_value_foo" }); |
test/behavior/export_keyword.zig+1-1| ... | @@ -43,7 +43,7 @@ export fn testPackedStuff(a: *const PackedStruct, b: *const PackedUnion) void { | ... | @@ -43,7 +43,7 @@ export fn testPackedStuff(a: *const PackedStruct, b: *const PackedUnion) void { |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | test "export function alias" { | 45 | test "export function alias" { |
| 46 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 46 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 47 | 47 | ||
| 48 | _ = struct { | 48 | _ = struct { |
| 49 | fn foo_internal() callconv(.c) u32 { | 49 | fn foo_internal() callconv(.c) u32 { |
test/behavior/extern.zig+3-3| ... | @@ -4,7 +4,7 @@ const expect = std.testing.expect; | ... | @@ -4,7 +4,7 @@ const expect = std.testing.expect; |
| 4 | 4 | ||
| 5 | test "anyopaque extern symbol" { | 5 | test "anyopaque extern symbol" { |
| 6 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | 6 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| 7 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 7 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 8 | 8 | ||
| 9 | const a = @extern(*anyopaque, .{ .name = "a_mystery_symbol" }); | 9 | const a = @extern(*anyopaque, .{ .name = "a_mystery_symbol" }); |
| 10 | const b: *i32 = @ptrCast(@alignCast(a)); | 10 | const b: *i32 = @ptrCast(@alignCast(a)); |
| ... | @@ -15,7 +15,7 @@ export var a_mystery_symbol: i32 = 1234; | ... | @@ -15,7 +15,7 @@ export var a_mystery_symbol: i32 = 1234; |
| 15 | 15 | ||
| 16 | test "function extern symbol" { | 16 | test "function extern symbol" { |
| 17 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | 17 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| 18 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 18 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 19 | 19 | ||
| 20 | const a = @extern(*const fn () callconv(.c) i32, .{ .name = "a_mystery_function" }); | 20 | const a = @extern(*const fn () callconv(.c) i32, .{ .name = "a_mystery_function" }); |
| 21 | try expect(a() == 4567); | 21 | try expect(a() == 4567); |
| ... | @@ -27,7 +27,7 @@ export fn a_mystery_function() i32 { | ... | @@ -27,7 +27,7 @@ export fn a_mystery_function() i32 { |
| 27 | 27 | ||
| 28 | test "function extern symbol matches extern decl" { | 28 | test "function extern symbol matches extern decl" { |
| 29 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | 29 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| 30 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 30 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 31 | 31 | ||
| 32 | const S = struct { | 32 | const S = struct { |
| 33 | extern fn another_mystery_function() u32; | 33 | extern fn another_mystery_function() u32; |
test/behavior/field_parent_ptr.zig+16-16| ... | @@ -2,7 +2,7 @@ const expect = @import("std").testing.expect; | ... | @@ -2,7 +2,7 @@ const expect = @import("std").testing.expect; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | test "@fieldParentPtr struct" { | 4 | test "@fieldParentPtr struct" { |
| 5 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 5 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 6 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 6 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 7 | 7 | ||
| 8 | const C = struct { | 8 | const C = struct { |
| ... | @@ -139,7 +139,7 @@ test "@fieldParentPtr struct" { | ... | @@ -139,7 +139,7 @@ test "@fieldParentPtr struct" { |
| 139 | 139 | ||
| 140 | test "@fieldParentPtr extern struct" { | 140 | test "@fieldParentPtr extern struct" { |
| 141 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 141 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 142 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 142 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 143 | 143 | ||
| 144 | const C = extern struct { | 144 | const C = extern struct { |
| 145 | a: bool = true, | 145 | a: bool = true, |
| ... | @@ -274,7 +274,7 @@ test "@fieldParentPtr extern struct" { | ... | @@ -274,7 +274,7 @@ test "@fieldParentPtr extern struct" { |
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | test "@fieldParentPtr extern struct first zero-bit field" { | 276 | test "@fieldParentPtr extern struct first zero-bit field" { |
| 277 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 277 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 278 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 278 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 279 | 279 | ||
| 280 | const C = extern struct { | 280 | const C = extern struct { |
| ... | @@ -378,7 +378,7 @@ test "@fieldParentPtr extern struct first zero-bit field" { | ... | @@ -378,7 +378,7 @@ test "@fieldParentPtr extern struct first zero-bit field" { |
| 378 | } | 378 | } |
| 379 | 379 | ||
| 380 | test "@fieldParentPtr extern struct middle zero-bit field" { | 380 | test "@fieldParentPtr extern struct middle zero-bit field" { |
| 381 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 381 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 382 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 382 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 383 | 383 | ||
| 384 | const C = extern struct { | 384 | const C = extern struct { |
| ... | @@ -482,7 +482,7 @@ test "@fieldParentPtr extern struct middle zero-bit field" { | ... | @@ -482,7 +482,7 @@ test "@fieldParentPtr extern struct middle zero-bit field" { |
| 482 | } | 482 | } |
| 483 | 483 | ||
| 484 | test "@fieldParentPtr extern struct last zero-bit field" { | 484 | test "@fieldParentPtr extern struct last zero-bit field" { |
| 485 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 485 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 486 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 486 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 487 | 487 | ||
| 488 | const C = extern struct { | 488 | const C = extern struct { |
| ... | @@ -587,7 +587,7 @@ test "@fieldParentPtr extern struct last zero-bit field" { | ... | @@ -587,7 +587,7 @@ test "@fieldParentPtr extern struct last zero-bit field" { |
| 587 | 587 | ||
| 588 | test "@fieldParentPtr unaligned packed struct" { | 588 | test "@fieldParentPtr unaligned packed struct" { |
| 589 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | 589 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 590 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 590 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 591 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 591 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 592 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 592 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 593 | 593 | ||
| ... | @@ -725,7 +725,7 @@ test "@fieldParentPtr unaligned packed struct" { | ... | @@ -725,7 +725,7 @@ test "@fieldParentPtr unaligned packed struct" { |
| 725 | 725 | ||
| 726 | test "@fieldParentPtr aligned packed struct" { | 726 | test "@fieldParentPtr aligned packed struct" { |
| 727 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | 727 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 728 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 728 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 729 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 729 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 730 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 730 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 731 | 731 | ||
| ... | @@ -863,7 +863,7 @@ test "@fieldParentPtr aligned packed struct" { | ... | @@ -863,7 +863,7 @@ test "@fieldParentPtr aligned packed struct" { |
| 863 | 863 | ||
| 864 | test "@fieldParentPtr nested packed struct" { | 864 | test "@fieldParentPtr nested packed struct" { |
| 865 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | 865 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 866 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 866 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 867 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 867 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 868 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 868 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 869 | 869 | ||
| ... | @@ -1026,7 +1026,7 @@ test "@fieldParentPtr nested packed struct" { | ... | @@ -1026,7 +1026,7 @@ test "@fieldParentPtr nested packed struct" { |
| 1026 | 1026 | ||
| 1027 | test "@fieldParentPtr packed struct first zero-bit field" { | 1027 | test "@fieldParentPtr packed struct first zero-bit field" { |
| 1028 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | 1028 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 1029 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1029 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1030 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1030 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1031 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1031 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1032 | 1032 | ||
| ... | @@ -1132,7 +1132,7 @@ test "@fieldParentPtr packed struct first zero-bit field" { | ... | @@ -1132,7 +1132,7 @@ test "@fieldParentPtr packed struct first zero-bit field" { |
| 1132 | 1132 | ||
| 1133 | test "@fieldParentPtr packed struct middle zero-bit field" { | 1133 | test "@fieldParentPtr packed struct middle zero-bit field" { |
| 1134 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | 1134 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 1135 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1135 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1136 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1136 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1137 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1137 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1138 | 1138 | ||
| ... | @@ -1238,7 +1238,7 @@ test "@fieldParentPtr packed struct middle zero-bit field" { | ... | @@ -1238,7 +1238,7 @@ test "@fieldParentPtr packed struct middle zero-bit field" { |
| 1238 | 1238 | ||
| 1239 | test "@fieldParentPtr packed struct last zero-bit field" { | 1239 | test "@fieldParentPtr packed struct last zero-bit field" { |
| 1240 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | 1240 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 1241 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1241 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1242 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1242 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1243 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1243 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1244 | 1244 | ||
| ... | @@ -1344,7 +1344,7 @@ test "@fieldParentPtr packed struct last zero-bit field" { | ... | @@ -1344,7 +1344,7 @@ test "@fieldParentPtr packed struct last zero-bit field" { |
| 1344 | 1344 | ||
| 1345 | test "@fieldParentPtr tagged union" { | 1345 | test "@fieldParentPtr tagged union" { |
| 1346 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1346 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1347 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1347 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1348 | 1348 | ||
| 1349 | const C = union(enum) { | 1349 | const C = union(enum) { |
| 1350 | a: bool, | 1350 | a: bool, |
| ... | @@ -1479,7 +1479,7 @@ test "@fieldParentPtr tagged union" { | ... | @@ -1479,7 +1479,7 @@ test "@fieldParentPtr tagged union" { |
| 1479 | } | 1479 | } |
| 1480 | 1480 | ||
| 1481 | test "@fieldParentPtr untagged union" { | 1481 | test "@fieldParentPtr untagged union" { |
| 1482 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1482 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1483 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1483 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1484 | 1484 | ||
| 1485 | const C = union { | 1485 | const C = union { |
| ... | @@ -1617,7 +1617,7 @@ test "@fieldParentPtr untagged union" { | ... | @@ -1617,7 +1617,7 @@ test "@fieldParentPtr untagged union" { |
| 1617 | test "@fieldParentPtr extern union" { | 1617 | test "@fieldParentPtr extern union" { |
| 1618 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | 1618 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1619 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1619 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1620 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1620 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1621 | 1621 | ||
| 1622 | const C = extern union { | 1622 | const C = extern union { |
| 1623 | a: bool, | 1623 | a: bool, |
| ... | @@ -1752,7 +1752,7 @@ test "@fieldParentPtr extern union" { | ... | @@ -1752,7 +1752,7 @@ test "@fieldParentPtr extern union" { |
| 1752 | } | 1752 | } |
| 1753 | 1753 | ||
| 1754 | test "@fieldParentPtr packed union" { | 1754 | test "@fieldParentPtr packed union" { |
| 1755 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1755 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1756 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1756 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1757 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1757 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1758 | 1758 | ||
| ... | @@ -1896,7 +1896,7 @@ test "@fieldParentPtr packed union" { | ... | @@ -1896,7 +1896,7 @@ test "@fieldParentPtr packed union" { |
| 1896 | 1896 | ||
| 1897 | test "@fieldParentPtr tagged union all zero-bit fields" { | 1897 | test "@fieldParentPtr tagged union all zero-bit fields" { |
| 1898 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1898 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1899 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1899 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1900 | 1900 | ||
| 1901 | const C = union(enum) { | 1901 | const C = union(enum) { |
| 1902 | a: u0, | 1902 | a: u0, |
test/behavior/floatop.zig+73-47| ... | @@ -28,7 +28,7 @@ test "add f32/f64" { | ... | @@ -28,7 +28,7 @@ test "add f32/f64" { |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | test "add f80/f128/c_longdouble" { | 30 | test "add f80/f128/c_longdouble" { |
| 31 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 31 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 32 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 32 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 33 | 33 | ||
| 34 | try testAdd(f80); | 34 | try testAdd(f80); |
| ... | @@ -62,7 +62,7 @@ test "sub f32/f64" { | ... | @@ -62,7 +62,7 @@ test "sub f32/f64" { |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | test "sub f80/f128/c_longdouble" { | 64 | test "sub f80/f128/c_longdouble" { |
| 65 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 65 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 66 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 66 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 67 | 67 | ||
| 68 | try testSub(f80); | 68 | try testSub(f80); |
| ... | @@ -96,7 +96,7 @@ test "mul f32/f64" { | ... | @@ -96,7 +96,7 @@ test "mul f32/f64" { |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | test "mul f80/f128/c_longdouble" { | 98 | test "mul f80/f128/c_longdouble" { |
| 99 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 99 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 100 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 100 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 101 | 101 | ||
| 102 | try testMul(f80); | 102 | try testMul(f80); |
| ... | @@ -116,6 +116,7 @@ fn testMul(comptime T: type) !void { | ... | @@ -116,6 +116,7 @@ fn testMul(comptime T: type) !void { |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | test "cmp f16" { | 118 | test "cmp f16" { |
| 119 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 119 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 120 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 120 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 121 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 121 | 122 | ||
| ... | @@ -124,7 +125,7 @@ test "cmp f16" { | ... | @@ -124,7 +125,7 @@ test "cmp f16" { |
| 124 | } | 125 | } |
| 125 | 126 | ||
| 126 | test "cmp f32" { | 127 | test "cmp f32" { |
| 127 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 128 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 128 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 129 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 129 | if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765 | 130 | if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765 |
| 130 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765 | 131 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765 |
| ... | @@ -137,6 +138,7 @@ test "cmp f64" { | ... | @@ -137,6 +138,7 @@ test "cmp f64" { |
| 137 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 138 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 138 | if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765 | 139 | if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765 |
| 139 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765 | 140 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765 |
| 141 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Fails on lavapipe | ||
| 140 | 142 | ||
| 141 | try testCmp(f64); | 143 | try testCmp(f64); |
| 142 | try comptime testCmp(f64); | 144 | try comptime testCmp(f64); |
| ... | @@ -145,7 +147,7 @@ test "cmp f64" { | ... | @@ -145,7 +147,7 @@ test "cmp f64" { |
| 145 | test "cmp f128" { | 147 | test "cmp f128" { |
| 146 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 148 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 147 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 149 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 148 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 150 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 149 | 151 | ||
| 150 | try testCmp(f128); | 152 | try testCmp(f128); |
| 151 | try comptime testCmp(f128); | 153 | try comptime testCmp(f128); |
| ... | @@ -153,7 +155,7 @@ test "cmp f128" { | ... | @@ -153,7 +155,7 @@ test "cmp f128" { |
| 153 | 155 | ||
| 154 | test "cmp f80/c_longdouble" { | 156 | test "cmp f80/c_longdouble" { |
| 155 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 157 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 156 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 158 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 157 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 159 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 158 | 160 | ||
| 159 | try testCmp(f80); | 161 | try testCmp(f80); |
| ... | @@ -217,6 +219,7 @@ fn testCmp(comptime T: type) !void { | ... | @@ -217,6 +219,7 @@ fn testCmp(comptime T: type) !void { |
| 217 | } | 219 | } |
| 218 | 220 | ||
| 219 | test "vector cmp f16" { | 221 | test "vector cmp f16" { |
| 222 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 220 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 223 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 221 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 224 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 222 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 225 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -228,7 +231,7 @@ test "vector cmp f16" { | ... | @@ -228,7 +231,7 @@ test "vector cmp f16" { |
| 228 | 231 | ||
| 229 | test "vector cmp f32" { | 232 | test "vector cmp f32" { |
| 230 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 233 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 231 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 234 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 232 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 235 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 233 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 236 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 234 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isArm()) return error.SkipZigTest; | 237 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isArm()) return error.SkipZigTest; |
| ... | @@ -247,6 +250,7 @@ test "vector cmp f64" { | ... | @@ -247,6 +250,7 @@ test "vector cmp f64" { |
| 247 | if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765 | 250 | if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765 |
| 248 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765 | 251 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isAarch64() and builtin.os.tag == .netbsd) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/36765 |
| 249 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; | 252 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| 253 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Fails on lavapipe | ||
| 250 | 254 | ||
| 251 | try testCmpVector(f64); | 255 | try testCmpVector(f64); |
| 252 | try comptime testCmpVector(f64); | 256 | try comptime testCmpVector(f64); |
| ... | @@ -255,7 +259,7 @@ test "vector cmp f64" { | ... | @@ -255,7 +259,7 @@ test "vector cmp f64" { |
| 255 | test "vector cmp f128" { | 259 | test "vector cmp f128" { |
| 256 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 260 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 257 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 261 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 258 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 262 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 259 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 263 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 260 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; | 264 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| 261 | 265 | ||
| ... | @@ -267,7 +271,7 @@ test "vector cmp f80/c_longdouble" { | ... | @@ -267,7 +271,7 @@ test "vector cmp f80/c_longdouble" { |
| 267 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 271 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 268 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; | 272 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| 269 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 273 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 270 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 274 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 271 | 275 | ||
| 272 | try testCmpVector(f80); | 276 | try testCmpVector(f80); |
| 273 | try comptime testCmpVector(f80); | 277 | try comptime testCmpVector(f80); |
| ... | @@ -357,7 +361,7 @@ test "@sqrt f16" { | ... | @@ -357,7 +361,7 @@ test "@sqrt f16" { |
| 357 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 361 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 358 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 362 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 359 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 363 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 360 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 364 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 361 | 365 | ||
| 362 | try testSqrt(f16); | 366 | try testSqrt(f16); |
| 363 | try comptime testSqrt(f16); | 367 | try comptime testSqrt(f16); |
| ... | @@ -366,7 +370,7 @@ test "@sqrt f16" { | ... | @@ -366,7 +370,7 @@ test "@sqrt f16" { |
| 366 | test "@sqrt f32/f64" { | 370 | test "@sqrt f32/f64" { |
| 367 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 371 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 368 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 372 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 369 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 373 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 370 | 374 | ||
| 371 | try testSqrt(f32); | 375 | try testSqrt(f32); |
| 372 | try comptime testSqrt(f32); | 376 | try comptime testSqrt(f32); |
| ... | @@ -378,7 +382,7 @@ test "@sqrt f80/f128/c_longdouble" { | ... | @@ -378,7 +382,7 @@ test "@sqrt f80/f128/c_longdouble" { |
| 378 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 382 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 379 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 383 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 380 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 384 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 381 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 385 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 382 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | 386 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| 383 | 387 | ||
| 384 | try testSqrt(f80); | 388 | try testSqrt(f80); |
| ... | @@ -457,6 +461,7 @@ fn testSqrt(comptime T: type) !void { | ... | @@ -457,6 +461,7 @@ fn testSqrt(comptime T: type) !void { |
| 457 | } | 461 | } |
| 458 | 462 | ||
| 459 | test "@sqrt with vectors" { | 463 | test "@sqrt with vectors" { |
| 464 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 460 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 465 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 461 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 466 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 462 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 467 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -479,7 +484,7 @@ test "@sin f16" { | ... | @@ -479,7 +484,7 @@ test "@sin f16" { |
| 479 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 484 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 480 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 485 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 481 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 486 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 482 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 487 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 483 | 488 | ||
| 484 | try testSin(f16); | 489 | try testSin(f16); |
| 485 | try comptime testSin(f16); | 490 | try comptime testSin(f16); |
| ... | @@ -489,7 +494,7 @@ test "@sin f32/f64" { | ... | @@ -489,7 +494,7 @@ test "@sin f32/f64" { |
| 489 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 494 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 490 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 495 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 491 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 496 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 492 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 497 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 493 | 498 | ||
| 494 | try testSin(f32); | 499 | try testSin(f32); |
| 495 | comptime try testSin(f32); | 500 | comptime try testSin(f32); |
| ... | @@ -501,7 +506,7 @@ test "@sin f80/f128/c_longdouble" { | ... | @@ -501,7 +506,7 @@ test "@sin f80/f128/c_longdouble" { |
| 501 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 506 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 502 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 507 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 503 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 508 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 504 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 509 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 505 | 510 | ||
| 506 | try testSin(f80); | 511 | try testSin(f80); |
| 507 | comptime try testSin(f80); | 512 | comptime try testSin(f80); |
| ... | @@ -524,6 +529,7 @@ fn testSin(comptime T: type) !void { | ... | @@ -524,6 +529,7 @@ fn testSin(comptime T: type) !void { |
| 524 | } | 529 | } |
| 525 | 530 | ||
| 526 | test "@sin with vectors" { | 531 | test "@sin with vectors" { |
| 532 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 527 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 533 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 528 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 534 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 529 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 535 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -546,7 +552,7 @@ test "@cos f16" { | ... | @@ -546,7 +552,7 @@ test "@cos f16" { |
| 546 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 552 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 547 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 553 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 548 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 554 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 549 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 555 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 550 | 556 | ||
| 551 | try testCos(f16); | 557 | try testCos(f16); |
| 552 | try comptime testCos(f16); | 558 | try comptime testCos(f16); |
| ... | @@ -556,7 +562,7 @@ test "@cos f32/f64" { | ... | @@ -556,7 +562,7 @@ test "@cos f32/f64" { |
| 556 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 562 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 557 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 563 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 558 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 564 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 559 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 565 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 560 | 566 | ||
| 561 | try testCos(f32); | 567 | try testCos(f32); |
| 562 | try comptime testCos(f32); | 568 | try comptime testCos(f32); |
| ... | @@ -568,7 +574,7 @@ test "@cos f80/f128/c_longdouble" { | ... | @@ -568,7 +574,7 @@ test "@cos f80/f128/c_longdouble" { |
| 568 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 574 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 569 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 575 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 570 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 576 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 571 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 577 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 572 | 578 | ||
| 573 | try testCos(f80); | 579 | try testCos(f80); |
| 574 | try comptime testCos(f80); | 580 | try comptime testCos(f80); |
| ... | @@ -591,6 +597,7 @@ fn testCos(comptime T: type) !void { | ... | @@ -591,6 +597,7 @@ fn testCos(comptime T: type) !void { |
| 591 | } | 597 | } |
| 592 | 598 | ||
| 593 | test "@cos with vectors" { | 599 | test "@cos with vectors" { |
| 600 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 594 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 601 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 595 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 602 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 596 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 603 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -613,7 +620,7 @@ test "@tan f16" { | ... | @@ -613,7 +620,7 @@ test "@tan f16" { |
| 613 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 620 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 614 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 621 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 615 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 622 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 616 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 623 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 617 | 624 | ||
| 618 | try testTan(f16); | 625 | try testTan(f16); |
| 619 | try comptime testTan(f16); | 626 | try comptime testTan(f16); |
| ... | @@ -623,7 +630,7 @@ test "@tan f32/f64" { | ... | @@ -623,7 +630,7 @@ test "@tan f32/f64" { |
| 623 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 630 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 624 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 631 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 625 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 632 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 626 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 633 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 627 | 634 | ||
| 628 | try testTan(f32); | 635 | try testTan(f32); |
| 629 | try comptime testTan(f32); | 636 | try comptime testTan(f32); |
| ... | @@ -635,7 +642,7 @@ test "@tan f80/f128/c_longdouble" { | ... | @@ -635,7 +642,7 @@ test "@tan f80/f128/c_longdouble" { |
| 635 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 642 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 636 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 643 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 637 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 644 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 638 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 645 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 639 | 646 | ||
| 640 | try testTan(f80); | 647 | try testTan(f80); |
| 641 | try comptime testTan(f80); | 648 | try comptime testTan(f80); |
| ... | @@ -658,6 +665,7 @@ fn testTan(comptime T: type) !void { | ... | @@ -658,6 +665,7 @@ fn testTan(comptime T: type) !void { |
| 658 | } | 665 | } |
| 659 | 666 | ||
| 660 | test "@tan with vectors" { | 667 | test "@tan with vectors" { |
| 668 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 661 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 669 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 662 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 670 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 663 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 671 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -680,7 +688,7 @@ test "@exp f16" { | ... | @@ -680,7 +688,7 @@ test "@exp f16" { |
| 680 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 688 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 681 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 689 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 682 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 690 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 683 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 691 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 684 | 692 | ||
| 685 | try testExp(f16); | 693 | try testExp(f16); |
| 686 | try comptime testExp(f16); | 694 | try comptime testExp(f16); |
| ... | @@ -690,7 +698,7 @@ test "@exp f32/f64" { | ... | @@ -690,7 +698,7 @@ test "@exp f32/f64" { |
| 690 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 698 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 691 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 699 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 692 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 700 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 693 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 701 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 694 | 702 | ||
| 695 | try testExp(f32); | 703 | try testExp(f32); |
| 696 | try comptime testExp(f32); | 704 | try comptime testExp(f32); |
| ... | @@ -702,7 +710,7 @@ test "@exp f80/f128/c_longdouble" { | ... | @@ -702,7 +710,7 @@ test "@exp f80/f128/c_longdouble" { |
| 702 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 710 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 703 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 711 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 704 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 712 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 705 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 713 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 706 | 714 | ||
| 707 | try testExp(f80); | 715 | try testExp(f80); |
| 708 | try comptime testExp(f80); | 716 | try comptime testExp(f80); |
| ... | @@ -729,6 +737,7 @@ fn testExp(comptime T: type) !void { | ... | @@ -729,6 +737,7 @@ fn testExp(comptime T: type) !void { |
| 729 | } | 737 | } |
| 730 | 738 | ||
| 731 | test "@exp with vectors" { | 739 | test "@exp with vectors" { |
| 740 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 732 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 741 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 733 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 742 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 734 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 743 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -751,7 +760,7 @@ test "@exp2 f16" { | ... | @@ -751,7 +760,7 @@ test "@exp2 f16" { |
| 751 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 760 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 752 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 761 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 753 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 762 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 754 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 763 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 755 | 764 | ||
| 756 | try testExp2(f16); | 765 | try testExp2(f16); |
| 757 | try comptime testExp2(f16); | 766 | try comptime testExp2(f16); |
| ... | @@ -761,7 +770,7 @@ test "@exp2 f32/f64" { | ... | @@ -761,7 +770,7 @@ test "@exp2 f32/f64" { |
| 761 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 770 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 762 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 771 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 763 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 772 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 764 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 773 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 765 | 774 | ||
| 766 | try testExp2(f32); | 775 | try testExp2(f32); |
| 767 | try comptime testExp2(f32); | 776 | try comptime testExp2(f32); |
| ... | @@ -773,7 +782,7 @@ test "@exp2 f80/f128/c_longdouble" { | ... | @@ -773,7 +782,7 @@ test "@exp2 f80/f128/c_longdouble" { |
| 773 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 782 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 774 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 783 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 775 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 784 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 776 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 785 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 777 | 786 | ||
| 778 | try testExp2(f80); | 787 | try testExp2(f80); |
| 779 | try comptime testExp2(f80); | 788 | try comptime testExp2(f80); |
| ... | @@ -795,6 +804,7 @@ fn testExp2(comptime T: type) !void { | ... | @@ -795,6 +804,7 @@ fn testExp2(comptime T: type) !void { |
| 795 | } | 804 | } |
| 796 | 805 | ||
| 797 | test "@exp2 with @vectors" { | 806 | test "@exp2 with @vectors" { |
| 807 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 798 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 808 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 799 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 809 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 800 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 810 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -817,7 +827,7 @@ test "@log f16" { | ... | @@ -817,7 +827,7 @@ test "@log f16" { |
| 817 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 827 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 818 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 828 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 819 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 829 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 820 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 830 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 821 | 831 | ||
| 822 | try testLog(f16); | 832 | try testLog(f16); |
| 823 | try comptime testLog(f16); | 833 | try comptime testLog(f16); |
| ... | @@ -827,7 +837,7 @@ test "@log f32/f64" { | ... | @@ -827,7 +837,7 @@ test "@log f32/f64" { |
| 827 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 837 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 828 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 838 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 829 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 839 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 830 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 840 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 831 | 841 | ||
| 832 | try testLog(f32); | 842 | try testLog(f32); |
| 833 | try comptime testLog(f32); | 843 | try comptime testLog(f32); |
| ... | @@ -839,7 +849,7 @@ test "@log f80/f128/c_longdouble" { | ... | @@ -839,7 +849,7 @@ test "@log f80/f128/c_longdouble" { |
| 839 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 849 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 840 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 850 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 841 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 851 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 842 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 852 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 843 | 853 | ||
| 844 | try testLog(f80); | 854 | try testLog(f80); |
| 845 | try comptime testLog(f80); | 855 | try comptime testLog(f80); |
| ... | @@ -865,7 +875,7 @@ test "@log with @vectors" { | ... | @@ -865,7 +875,7 @@ test "@log with @vectors" { |
| 865 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 875 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 866 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 876 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 867 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 877 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 868 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 878 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 869 | 879 | ||
| 870 | { | 880 | { |
| 871 | var v: @Vector(4, f32) = [_]f32{ 1.1, 2.2, 0.3, 0.4 }; | 881 | var v: @Vector(4, f32) = [_]f32{ 1.1, 2.2, 0.3, 0.4 }; |
| ... | @@ -882,7 +892,7 @@ test "@log2 f16" { | ... | @@ -882,7 +892,7 @@ test "@log2 f16" { |
| 882 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 892 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 883 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 893 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 884 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 894 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 885 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 895 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 886 | 896 | ||
| 887 | try testLog2(f16); | 897 | try testLog2(f16); |
| 888 | try comptime testLog2(f16); | 898 | try comptime testLog2(f16); |
| ... | @@ -892,7 +902,7 @@ test "@log2 f32/f64" { | ... | @@ -892,7 +902,7 @@ test "@log2 f32/f64" { |
| 892 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 902 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 893 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 903 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 894 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 904 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 895 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 905 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 896 | 906 | ||
| 897 | try testLog2(f32); | 907 | try testLog2(f32); |
| 898 | try comptime testLog2(f32); | 908 | try comptime testLog2(f32); |
| ... | @@ -904,7 +914,7 @@ test "@log2 f80/f128/c_longdouble" { | ... | @@ -904,7 +914,7 @@ test "@log2 f80/f128/c_longdouble" { |
| 904 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 914 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 905 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 915 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 906 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 916 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 907 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 917 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 908 | 918 | ||
| 909 | try testLog2(f80); | 919 | try testLog2(f80); |
| 910 | try comptime testLog2(f80); | 920 | try comptime testLog2(f80); |
| ... | @@ -926,6 +936,7 @@ fn testLog2(comptime T: type) !void { | ... | @@ -926,6 +936,7 @@ fn testLog2(comptime T: type) !void { |
| 926 | } | 936 | } |
| 927 | 937 | ||
| 928 | test "@log2 with vectors" { | 938 | test "@log2 with vectors" { |
| 939 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 929 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 940 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 930 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 941 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 931 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 942 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -957,7 +968,7 @@ test "@log10 f16" { | ... | @@ -957,7 +968,7 @@ test "@log10 f16" { |
| 957 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 968 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 958 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 969 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 959 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 970 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 960 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 971 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 961 | 972 | ||
| 962 | try testLog10(f16); | 973 | try testLog10(f16); |
| 963 | try comptime testLog10(f16); | 974 | try comptime testLog10(f16); |
| ... | @@ -967,7 +978,7 @@ test "@log10 f32/f64" { | ... | @@ -967,7 +978,7 @@ test "@log10 f32/f64" { |
| 967 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 978 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 968 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 979 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 969 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 980 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 970 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 981 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 971 | 982 | ||
| 972 | try testLog10(f32); | 983 | try testLog10(f32); |
| 973 | try comptime testLog10(f32); | 984 | try comptime testLog10(f32); |
| ... | @@ -979,7 +990,7 @@ test "@log10 f80/f128/c_longdouble" { | ... | @@ -979,7 +990,7 @@ test "@log10 f80/f128/c_longdouble" { |
| 979 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 990 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 980 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 991 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 981 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 992 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 982 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 993 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 983 | 994 | ||
| 984 | try testLog10(f80); | 995 | try testLog10(f80); |
| 985 | try comptime testLog10(f80); | 996 | try comptime testLog10(f80); |
| ... | @@ -1004,7 +1015,7 @@ test "@log10 with vectors" { | ... | @@ -1004,7 +1015,7 @@ test "@log10 with vectors" { |
| 1004 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1015 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1005 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1016 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1006 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1017 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1007 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1018 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1008 | 1019 | ||
| 1009 | try testLog10WithVectors(); | 1020 | try testLog10WithVectors(); |
| 1010 | try comptime testLog10WithVectors(); | 1021 | try comptime testLog10WithVectors(); |
| ... | @@ -1024,6 +1035,7 @@ test "@abs f16" { | ... | @@ -1024,6 +1035,7 @@ test "@abs f16" { |
| 1024 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1035 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1025 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1036 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1026 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1037 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1038 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Fails on lavapipe | ||
| 1027 | 1039 | ||
| 1028 | try testFabs(f16); | 1040 | try testFabs(f16); |
| 1029 | try comptime testFabs(f16); | 1041 | try comptime testFabs(f16); |
| ... | @@ -1032,6 +1044,7 @@ test "@abs f16" { | ... | @@ -1032,6 +1044,7 @@ test "@abs f16" { |
| 1032 | test "@abs f32/f64" { | 1044 | test "@abs f32/f64" { |
| 1033 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1045 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1034 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1046 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1047 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Fails on lavapipe | ||
| 1035 | 1048 | ||
| 1036 | try testFabs(f32); | 1049 | try testFabs(f32); |
| 1037 | try comptime testFabs(f32); | 1050 | try comptime testFabs(f32); |
| ... | @@ -1042,7 +1055,7 @@ test "@abs f32/f64" { | ... | @@ -1042,7 +1055,7 @@ test "@abs f32/f64" { |
| 1042 | test "@abs f80/f128/c_longdouble" { | 1055 | test "@abs f80/f128/c_longdouble" { |
| 1043 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1056 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1044 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1057 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1045 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1058 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1046 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1059 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1047 | 1060 | ||
| 1048 | try testFabs(f80); | 1061 | try testFabs(f80); |
| ... | @@ -1118,6 +1131,7 @@ fn testFabs(comptime T: type) !void { | ... | @@ -1118,6 +1131,7 @@ fn testFabs(comptime T: type) !void { |
| 1118 | } | 1131 | } |
| 1119 | 1132 | ||
| 1120 | test "@abs with vectors" { | 1133 | test "@abs with vectors" { |
| 1134 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1121 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1135 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1122 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1136 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1123 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1137 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1137,6 +1151,7 @@ fn testFabsWithVectors() !void { | ... | @@ -1137,6 +1151,7 @@ fn testFabsWithVectors() !void { |
| 1137 | } | 1151 | } |
| 1138 | 1152 | ||
| 1139 | test "@floor f16" { | 1153 | test "@floor f16" { |
| 1154 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1140 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1155 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1141 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1156 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1142 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1157 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1146,6 +1161,7 @@ test "@floor f16" { | ... | @@ -1146,6 +1161,7 @@ test "@floor f16" { |
| 1146 | } | 1161 | } |
| 1147 | 1162 | ||
| 1148 | test "@floor f32/f64" { | 1163 | test "@floor f32/f64" { |
| 1164 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1149 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1165 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1150 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1166 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1151 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1167 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1159,7 +1175,7 @@ test "@floor f32/f64" { | ... | @@ -1159,7 +1175,7 @@ test "@floor f32/f64" { |
| 1159 | test "@floor f80/f128/c_longdouble" { | 1175 | test "@floor f80/f128/c_longdouble" { |
| 1160 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1176 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1161 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1177 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1162 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1178 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1163 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1179 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1164 | 1180 | ||
| 1165 | try testFloor(f80); | 1181 | try testFloor(f80); |
| ... | @@ -1201,6 +1217,7 @@ fn testFloor(comptime T: type) !void { | ... | @@ -1201,6 +1217,7 @@ fn testFloor(comptime T: type) !void { |
| 1201 | } | 1217 | } |
| 1202 | 1218 | ||
| 1203 | test "@floor with vectors" { | 1219 | test "@floor with vectors" { |
| 1220 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1204 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1221 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1205 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1222 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1206 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1223 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1220,6 +1237,7 @@ fn testFloorWithVectors() !void { | ... | @@ -1220,6 +1237,7 @@ fn testFloorWithVectors() !void { |
| 1220 | } | 1237 | } |
| 1221 | 1238 | ||
| 1222 | test "@ceil f16" { | 1239 | test "@ceil f16" { |
| 1240 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1223 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1241 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1224 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1242 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1225 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1243 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1229,6 +1247,7 @@ test "@ceil f16" { | ... | @@ -1229,6 +1247,7 @@ test "@ceil f16" { |
| 1229 | } | 1247 | } |
| 1230 | 1248 | ||
| 1231 | test "@ceil f32/f64" { | 1249 | test "@ceil f32/f64" { |
| 1250 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1232 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1251 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1233 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1252 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1234 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1253 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1242,7 +1261,7 @@ test "@ceil f32/f64" { | ... | @@ -1242,7 +1261,7 @@ test "@ceil f32/f64" { |
| 1242 | test "@ceil f80/f128/c_longdouble" { | 1261 | test "@ceil f80/f128/c_longdouble" { |
| 1243 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1262 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1244 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1263 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1245 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1264 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1246 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1265 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1247 | 1266 | ||
| 1248 | try testCeil(f80); | 1267 | try testCeil(f80); |
| ... | @@ -1256,7 +1275,7 @@ test "@ceil f80/f128/c_longdouble" { | ... | @@ -1256,7 +1275,7 @@ test "@ceil f80/f128/c_longdouble" { |
| 1256 | test "@ceil f80 maxInt(u64)" { | 1275 | test "@ceil f80 maxInt(u64)" { |
| 1257 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1276 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1258 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1277 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1259 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1278 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1260 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1279 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1261 | 1280 | ||
| 1262 | var x: u64 = std.math.maxInt(u64); | 1281 | var x: u64 = std.math.maxInt(u64); |
| ... | @@ -1296,6 +1315,7 @@ fn testCeil(comptime T: type) !void { | ... | @@ -1296,6 +1315,7 @@ fn testCeil(comptime T: type) !void { |
| 1296 | } | 1315 | } |
| 1297 | 1316 | ||
| 1298 | test "@ceil with vectors" { | 1317 | test "@ceil with vectors" { |
| 1318 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1299 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1319 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1300 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1320 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1301 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1321 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1315,6 +1335,7 @@ fn testCeilWithVectors() !void { | ... | @@ -1315,6 +1335,7 @@ fn testCeilWithVectors() !void { |
| 1315 | } | 1335 | } |
| 1316 | 1336 | ||
| 1317 | test "@trunc f16" { | 1337 | test "@trunc f16" { |
| 1338 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1318 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1339 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1319 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1340 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1320 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1341 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1324,6 +1345,7 @@ test "@trunc f16" { | ... | @@ -1324,6 +1345,7 @@ test "@trunc f16" { |
| 1324 | } | 1345 | } |
| 1325 | 1346 | ||
| 1326 | test "@trunc f32/f64" { | 1347 | test "@trunc f32/f64" { |
| 1348 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1327 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1349 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1328 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1350 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1329 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1351 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1337,7 +1359,7 @@ test "@trunc f32/f64" { | ... | @@ -1337,7 +1359,7 @@ test "@trunc f32/f64" { |
| 1337 | test "@trunc f80/f128/c_longdouble" { | 1359 | test "@trunc f80/f128/c_longdouble" { |
| 1338 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1360 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1339 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1361 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1340 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1362 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1341 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1363 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1342 | 1364 | ||
| 1343 | try testTrunc(f80); | 1365 | try testTrunc(f80); |
| ... | @@ -1379,6 +1401,7 @@ fn testTrunc(comptime T: type) !void { | ... | @@ -1379,6 +1401,7 @@ fn testTrunc(comptime T: type) !void { |
| 1379 | } | 1401 | } |
| 1380 | 1402 | ||
| 1381 | test "@trunc with vectors" { | 1403 | test "@trunc with vectors" { |
| 1404 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1382 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1405 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1383 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1406 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1384 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1407 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1398,6 +1421,7 @@ fn testTruncWithVectors() !void { | ... | @@ -1398,6 +1421,7 @@ fn testTruncWithVectors() !void { |
| 1398 | } | 1421 | } |
| 1399 | 1422 | ||
| 1400 | test "neg f16" { | 1423 | test "neg f16" { |
| 1424 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1401 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1425 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1402 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1426 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1403 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1427 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1407,6 +1431,7 @@ test "neg f16" { | ... | @@ -1407,6 +1431,7 @@ test "neg f16" { |
| 1407 | } | 1431 | } |
| 1408 | 1432 | ||
| 1409 | test "neg f32/f64" { | 1433 | test "neg f32/f64" { |
| 1434 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1410 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1435 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1411 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1436 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1412 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1437 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1420,7 +1445,7 @@ test "neg f32/f64" { | ... | @@ -1420,7 +1445,7 @@ test "neg f32/f64" { |
| 1420 | test "neg f80/f128/c_longdouble" { | 1445 | test "neg f80/f128/c_longdouble" { |
| 1421 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1446 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1422 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1447 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1423 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1448 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1424 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1449 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1425 | 1450 | ||
| 1426 | try testNeg(f80); | 1451 | try testNeg(f80); |
| ... | @@ -1501,7 +1526,7 @@ fn testNeg(comptime T: type) !void { | ... | @@ -1501,7 +1526,7 @@ fn testNeg(comptime T: type) !void { |
| 1501 | } | 1526 | } |
| 1502 | 1527 | ||
| 1503 | test "negate f80" { | 1528 | test "negate f80" { |
| 1504 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1529 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1505 | 1530 | ||
| 1506 | var f: f80 = 0.0; | 1531 | var f: f80 = 0.0; |
| 1507 | const a: u80 = @bitCast(f); | 1532 | const a: u80 = @bitCast(f); |
| ... | @@ -1535,7 +1560,7 @@ test "f128 at compile time is lossy" { | ... | @@ -1535,7 +1560,7 @@ test "f128 at compile time is lossy" { |
| 1535 | test "comptime fixed-width float zero divided by zero produces NaN" { | 1560 | test "comptime fixed-width float zero divided by zero produces NaN" { |
| 1536 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1561 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1537 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1562 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1538 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1563 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1539 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1564 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1540 | 1565 | ||
| 1541 | inline for (.{ f16, f32, f64, f80, f128 }) |F| { | 1566 | inline for (.{ f16, f32, f64, f80, f128 }) |F| { |
| ... | @@ -1544,6 +1569,7 @@ test "comptime fixed-width float zero divided by zero produces NaN" { | ... | @@ -1544,6 +1569,7 @@ test "comptime fixed-width float zero divided by zero produces NaN" { |
| 1544 | } | 1569 | } |
| 1545 | 1570 | ||
| 1546 | test "comptime fixed-width float non-zero divided by zero produces signed Inf" { | 1571 | test "comptime fixed-width float non-zero divided by zero produces signed Inf" { |
| 1572 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1547 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1573 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1548 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1574 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1549 | 1575 | ||
| ... | @@ -1687,7 +1713,7 @@ test "comptime calls are only memoized when float arguments are bit-for-bit equa | ... | @@ -1687,7 +1713,7 @@ test "comptime calls are only memoized when float arguments are bit-for-bit equa |
| 1687 | test "result location forwarded through unary float builtins" { | 1713 | test "result location forwarded through unary float builtins" { |
| 1688 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1714 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1689 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1715 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1690 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1716 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1691 | 1717 | ||
| 1692 | const S = struct { | 1718 | const S = struct { |
| 1693 | var x: u32 = 10; | 1719 | var x: u32 = 10; |
test/behavior/fn.zig+35-13| ... | @@ -21,6 +21,8 @@ fn testLocVars(b: i32) void { | ... | @@ -21,6 +21,8 @@ fn testLocVars(b: i32) void { |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | test "mutable local variables" { | 23 | test "mutable local variables" { |
| 24 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 25 | |||
| 24 | var zero: i32 = 0; | 26 | var zero: i32 = 0; |
| 25 | _ = &zero; | 27 | _ = &zero; |
| 26 | try expect(zero == 0); | 28 | try expect(zero == 0); |
| ... | @@ -70,13 +72,14 @@ fn outer(y: u32) *const fn (u32) u32 { | ... | @@ -70,13 +72,14 @@ fn outer(y: u32) *const fn (u32) u32 { |
| 70 | } | 72 | } |
| 71 | 73 | ||
| 72 | test "return inner function which references comptime variable of outer function" { | 74 | test "return inner function which references comptime variable of outer function" { |
| 73 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 75 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 74 | 76 | ||
| 75 | const func = outer(10); | 77 | const func = outer(10); |
| 76 | try expect(func(3) == 7); | 78 | try expect(func(3) == 7); |
| 77 | } | 79 | } |
| 78 | 80 | ||
| 79 | test "discard the result of a function that returns a struct" { | 81 | test "discard the result of a function that returns a struct" { |
| 82 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 80 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 83 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 81 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 84 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 82 | 85 | ||
| ... | @@ -101,7 +104,7 @@ test "discard the result of a function that returns a struct" { | ... | @@ -101,7 +104,7 @@ test "discard the result of a function that returns a struct" { |
| 101 | test "inline function call that calls optional function pointer, return pointer at callsite interacts correctly with callsite return type" { | 104 | test "inline function call that calls optional function pointer, return pointer at callsite interacts correctly with callsite return type" { |
| 102 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 105 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 103 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 106 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 104 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 107 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 105 | 108 | ||
| 106 | const S = struct { | 109 | const S = struct { |
| 107 | field: u32, | 110 | field: u32, |
| ... | @@ -147,7 +150,7 @@ fn fnWithUnreachable() noreturn { | ... | @@ -147,7 +150,7 @@ fn fnWithUnreachable() noreturn { |
| 147 | 150 | ||
| 148 | test "extern struct with stdcallcc fn pointer" { | 151 | test "extern struct with stdcallcc fn pointer" { |
| 149 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 152 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 150 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 153 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 151 | 154 | ||
| 152 | const S = extern struct { | 155 | const S = extern struct { |
| 153 | ptr: *const fn () callconv(if (builtin.target.cpu.arch == .x86) .{ .x86_stdcall = .{} } else .c) i32, | 156 | ptr: *const fn () callconv(if (builtin.target.cpu.arch == .x86) .{ .x86_stdcall = .{} } else .c) i32, |
| ... | @@ -175,6 +178,7 @@ fn fComplexCallconvRet(x: u32) callconv(blk: { | ... | @@ -175,6 +178,7 @@ fn fComplexCallconvRet(x: u32) callconv(blk: { |
| 175 | } | 178 | } |
| 176 | 179 | ||
| 177 | test "function with complex callconv and return type expressions" { | 180 | test "function with complex callconv and return type expressions" { |
| 181 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 178 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 182 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 179 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 183 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 180 | 184 | ||
| ... | @@ -182,6 +186,7 @@ test "function with complex callconv and return type expressions" { | ... | @@ -182,6 +186,7 @@ test "function with complex callconv and return type expressions" { |
| 182 | } | 186 | } |
| 183 | 187 | ||
| 184 | test "pass by non-copying value" { | 188 | test "pass by non-copying value" { |
| 189 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 185 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 190 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 186 | 191 | ||
| 187 | try expect(addPointCoords(Point{ .x = 1, .y = 2 }) == 3); | 192 | try expect(addPointCoords(Point{ .x = 1, .y = 2 }) == 3); |
| ... | @@ -197,6 +202,7 @@ fn addPointCoords(pt: Point) i32 { | ... | @@ -197,6 +202,7 @@ fn addPointCoords(pt: Point) i32 { |
| 197 | } | 202 | } |
| 198 | 203 | ||
| 199 | test "pass by non-copying value through var arg" { | 204 | test "pass by non-copying value through var arg" { |
| 205 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 200 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 206 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 201 | 207 | ||
| 202 | try expect((try addPointCoordsVar(Point{ .x = 1, .y = 2 })) == 3); | 208 | try expect((try addPointCoordsVar(Point{ .x = 1, .y = 2 })) == 3); |
| ... | @@ -208,6 +214,7 @@ fn addPointCoordsVar(pt: anytype) !i32 { | ... | @@ -208,6 +214,7 @@ fn addPointCoordsVar(pt: anytype) !i32 { |
| 208 | } | 214 | } |
| 209 | 215 | ||
| 210 | test "pass by non-copying value as method" { | 216 | test "pass by non-copying value as method" { |
| 217 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 211 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 218 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 212 | 219 | ||
| 213 | var pt = Point2{ .x = 1, .y = 2 }; | 220 | var pt = Point2{ .x = 1, .y = 2 }; |
| ... | @@ -224,6 +231,7 @@ const Point2 = struct { | ... | @@ -224,6 +231,7 @@ const Point2 = struct { |
| 224 | }; | 231 | }; |
| 225 | 232 | ||
| 226 | test "pass by non-copying value as method, which is generic" { | 233 | test "pass by non-copying value as method, which is generic" { |
| 234 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 227 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 235 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 228 | 236 | ||
| 229 | var pt = Point3{ .x = 1, .y = 2 }; | 237 | var pt = Point3{ .x = 1, .y = 2 }; |
| ... | @@ -252,7 +260,7 @@ test "pass by non-copying value as method, at comptime" { | ... | @@ -252,7 +260,7 @@ test "pass by non-copying value as method, at comptime" { |
| 252 | test "implicit cast fn call result to optional in field result" { | 260 | test "implicit cast fn call result to optional in field result" { |
| 253 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 261 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 254 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 262 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 255 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 263 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 256 | 264 | ||
| 257 | const S = struct { | 265 | const S = struct { |
| 258 | fn entry() !void { | 266 | fn entry() !void { |
| ... | @@ -290,6 +298,7 @@ fn voidFun(a: i32, b: void, c: i32, d: void) !void { | ... | @@ -290,6 +298,7 @@ fn voidFun(a: i32, b: void, c: i32, d: void) !void { |
| 290 | } | 298 | } |
| 291 | 299 | ||
| 292 | test "call function with empty string" { | 300 | test "call function with empty string" { |
| 301 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 293 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 302 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 294 | 303 | ||
| 295 | acceptsString(""); | 304 | acceptsString(""); |
| ... | @@ -302,7 +311,7 @@ fn acceptsString(foo: []u8) void { | ... | @@ -302,7 +311,7 @@ fn acceptsString(foo: []u8) void { |
| 302 | test "function pointers" { | 311 | test "function pointers" { |
| 303 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 312 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 304 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 313 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 305 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 314 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 306 | 315 | ||
| 307 | const fns = [_]*const @TypeOf(fn1){ | 316 | const fns = [_]*const @TypeOf(fn1){ |
| 308 | &fn1, | 317 | &fn1, |
| ... | @@ -337,6 +346,7 @@ fn numberLiteralArg(a: anytype) !void { | ... | @@ -337,6 +346,7 @@ fn numberLiteralArg(a: anytype) !void { |
| 337 | } | 346 | } |
| 338 | 347 | ||
| 339 | test "function call with anon list literal" { | 348 | test "function call with anon list literal" { |
| 349 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 340 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 350 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 341 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 351 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 342 | 352 | ||
| ... | @@ -356,6 +366,7 @@ test "function call with anon list literal" { | ... | @@ -356,6 +366,7 @@ test "function call with anon list literal" { |
| 356 | } | 366 | } |
| 357 | 367 | ||
| 358 | test "function call with anon list literal - 2D" { | 368 | test "function call with anon list literal - 2D" { |
| 369 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 359 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 370 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 360 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 371 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 361 | 372 | ||
| ... | @@ -394,6 +405,8 @@ test "ability to give comptime types and non comptime types to same parameter" { | ... | @@ -394,6 +405,8 @@ test "ability to give comptime types and non comptime types to same parameter" { |
| 394 | } | 405 | } |
| 395 | 406 | ||
| 396 | test "function with inferred error set but returning no error" { | 407 | test "function with inferred error set but returning no error" { |
| 408 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 409 | |||
| 397 | const S = struct { | 410 | const S = struct { |
| 398 | fn foo() !void {} | 411 | fn foo() !void {} |
| 399 | }; | 412 | }; |
| ... | @@ -404,7 +417,7 @@ test "function with inferred error set but returning no error" { | ... | @@ -404,7 +417,7 @@ test "function with inferred error set but returning no error" { |
| 404 | 417 | ||
| 405 | test "import passed byref to function in return type" { | 418 | test "import passed byref to function in return type" { |
| 406 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 419 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 407 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 420 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 408 | 421 | ||
| 409 | const S = struct { | 422 | const S = struct { |
| 410 | fn get() @import("std").ArrayList(i32) { | 423 | fn get() @import("std").ArrayList(i32) { |
| ... | @@ -418,7 +431,7 @@ test "import passed byref to function in return type" { | ... | @@ -418,7 +431,7 @@ test "import passed byref to function in return type" { |
| 418 | 431 | ||
| 419 | test "implicit cast function to function ptr" { | 432 | test "implicit cast function to function ptr" { |
| 420 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 433 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 421 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 434 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 422 | 435 | ||
| 423 | const S1 = struct { | 436 | const S1 = struct { |
| 424 | export fn someFunctionThatReturnsAValue() c_int { | 437 | export fn someFunctionThatReturnsAValue() c_int { |
| ... | @@ -439,7 +452,7 @@ test "implicit cast function to function ptr" { | ... | @@ -439,7 +452,7 @@ test "implicit cast function to function ptr" { |
| 439 | test "method call with optional and error union first param" { | 452 | test "method call with optional and error union first param" { |
| 440 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 453 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 441 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 454 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 442 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 455 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 443 | 456 | ||
| 444 | const S = struct { | 457 | const S = struct { |
| 445 | x: i32 = 1234, | 458 | x: i32 = 1234, |
| ... | @@ -459,7 +472,7 @@ test "method call with optional and error union first param" { | ... | @@ -459,7 +472,7 @@ test "method call with optional and error union first param" { |
| 459 | test "method call with optional pointer first param" { | 472 | test "method call with optional pointer first param" { |
| 460 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 473 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 461 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 474 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 462 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 475 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 463 | 476 | ||
| 464 | const S = struct { | 477 | const S = struct { |
| 465 | x: i32 = 1234, | 478 | x: i32 = 1234, |
| ... | @@ -477,7 +490,7 @@ test "method call with optional pointer first param" { | ... | @@ -477,7 +490,7 @@ test "method call with optional pointer first param" { |
| 477 | test "using @ptrCast on function pointers" { | 490 | test "using @ptrCast on function pointers" { |
| 478 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 491 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 479 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 492 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 480 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 493 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 481 | 494 | ||
| 482 | const S = struct { | 495 | const S = struct { |
| 483 | const A = struct { data: [4]u8 }; | 496 | const A = struct { data: [4]u8 }; |
| ... | @@ -514,6 +527,8 @@ test "function returns function returning type" { | ... | @@ -514,6 +527,8 @@ test "function returns function returning type" { |
| 514 | } | 527 | } |
| 515 | 528 | ||
| 516 | test "peer type resolution of inferred error set with non-void payload" { | 529 | test "peer type resolution of inferred error set with non-void payload" { |
| 530 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 531 | |||
| 517 | const S = struct { | 532 | const S = struct { |
| 518 | fn openDataFile(mode: enum { read, write }) !u32 { | 533 | fn openDataFile(mode: enum { read, write }) !u32 { |
| 519 | return switch (mode) { | 534 | return switch (mode) { |
| ... | @@ -532,6 +547,8 @@ test "peer type resolution of inferred error set with non-void payload" { | ... | @@ -532,6 +547,8 @@ test "peer type resolution of inferred error set with non-void payload" { |
| 532 | } | 547 | } |
| 533 | 548 | ||
| 534 | test "lazy values passed to anytype parameter" { | 549 | test "lazy values passed to anytype parameter" { |
| 550 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 551 | |||
| 535 | const A = struct { | 552 | const A = struct { |
| 536 | a: u32, | 553 | a: u32, |
| 537 | fn foo(comptime a: anytype) !void { | 554 | fn foo(comptime a: anytype) !void { |
| ... | @@ -570,7 +587,7 @@ test "pass and return comptime-only types" { | ... | @@ -570,7 +587,7 @@ test "pass and return comptime-only types" { |
| 570 | 587 | ||
| 571 | test "pointer to alias behaves same as pointer to function" { | 588 | test "pointer to alias behaves same as pointer to function" { |
| 572 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 589 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 573 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 590 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 574 | 591 | ||
| 575 | const S = struct { | 592 | const S = struct { |
| 576 | fn foo() u32 { | 593 | fn foo() u32 { |
| ... | @@ -593,6 +610,7 @@ test "comptime parameters don't have to be marked comptime if only called at com | ... | @@ -593,6 +610,7 @@ test "comptime parameters don't have to be marked comptime if only called at com |
| 593 | } | 610 | } |
| 594 | 611 | ||
| 595 | test "inline function with comptime-known comptime-only return type called at runtime" { | 612 | test "inline function with comptime-known comptime-only return type called at runtime" { |
| 613 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 596 | const S = struct { | 614 | const S = struct { |
| 597 | inline fn foo(x: *i32, y: *const i32) type { | 615 | inline fn foo(x: *i32, y: *const i32) type { |
| 598 | x.* = y.*; | 616 | x.* = y.*; |
| ... | @@ -607,7 +625,7 @@ test "inline function with comptime-known comptime-only return type called at ru | ... | @@ -607,7 +625,7 @@ test "inline function with comptime-known comptime-only return type called at ru |
| 607 | } | 625 | } |
| 608 | 626 | ||
| 609 | test "address of function parameter is consistent" { | 627 | test "address of function parameter is consistent" { |
| 610 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 628 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 611 | 629 | ||
| 612 | const S = struct { | 630 | const S = struct { |
| 613 | fn paramAddrMatch(x: u8) bool { | 631 | fn paramAddrMatch(x: u8) bool { |
| ... | @@ -635,6 +653,8 @@ test "address of function parameter is consistent in function return type" { | ... | @@ -635,6 +653,8 @@ test "address of function parameter is consistent in function return type" { |
| 635 | } | 653 | } |
| 636 | 654 | ||
| 637 | test "function parameter self equality" { | 655 | test "function parameter self equality" { |
| 656 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 657 | |||
| 638 | const S = struct { | 658 | const S = struct { |
| 639 | fn equal(x: u32) bool { | 659 | fn equal(x: u32) bool { |
| 640 | return x == x; | 660 | return x == x; |
| ... | @@ -664,6 +684,8 @@ test "function parameter self equality" { | ... | @@ -664,6 +684,8 @@ test "function parameter self equality" { |
| 664 | } | 684 | } |
| 665 | 685 | ||
| 666 | test "inline call propagates comptime-known argument to generic parameter and return types" { | 686 | test "inline call propagates comptime-known argument to generic parameter and return types" { |
| 687 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 688 | |||
| 667 | const S = struct { | 689 | const S = struct { |
| 668 | inline fn f(x: bool, y: if (x) u8 else u16) if (x) bool else u32 { | 690 | inline fn f(x: bool, y: if (x) u8 else u16) if (x) bool else u32 { |
| 669 | if (x) { | 691 | if (x) { |
| ... | @@ -744,7 +766,7 @@ test "coerce generic function making generic parameter concrete" { | ... | @@ -744,7 +766,7 @@ test "coerce generic function making generic parameter concrete" { |
| 744 | } | 766 | } |
| 745 | 767 | ||
| 746 | test "return undefined pointer from function, directly and by expired local" { | 768 | test "return undefined pointer from function, directly and by expired local" { |
| 747 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 769 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 748 | 770 | ||
| 749 | const S = struct { | 771 | const S = struct { |
| 750 | var global: i32 = 1; | 772 | var global: i32 = 1; |
test/behavior/fn_delegation.zig+1| ... | @@ -32,6 +32,7 @@ fn custom(comptime T: type, comptime num: u64) fn (T) u64 { | ... | @@ -32,6 +32,7 @@ fn custom(comptime T: type, comptime num: u64) fn (T) u64 { |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | test "fn delegation" { | 34 | test "fn delegation" { |
| 35 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 35 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 36 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 36 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 37 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 37 | 38 |
test/behavior/fn_in_struct_in_comptime.zig+1-1| ... | @@ -12,7 +12,7 @@ fn get_foo() fn (*u8) usize { | ... | @@ -12,7 +12,7 @@ fn get_foo() fn (*u8) usize { |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | test "define a function in an anonymous struct in comptime" { | 14 | test "define a function in an anonymous struct in comptime" { |
| 15 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 15 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 16 | 16 | ||
| 17 | const foo = get_foo(); | 17 | const foo = get_foo(); |
| 18 | try expect(foo(@as(*u8, @ptrFromInt(12345))) == 12345); | 18 | try expect(foo(@as(*u8, @ptrFromInt(12345))) == 12345); |
test/behavior/for.zig+20-11| ... | @@ -5,6 +5,7 @@ const expectEqual = std.testing.expectEqual; | ... | @@ -5,6 +5,7 @@ const expectEqual = std.testing.expectEqual; |
| 5 | const mem = std.mem; | 5 | const mem = std.mem; |
| 6 | 6 | ||
| 7 | test "continue in for loop" { | 7 | test "continue in for loop" { |
| 8 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 9 | 10 | ||
| 10 | const array = [_]i32{ 1, 2, 3, 4, 5 }; | 11 | const array = [_]i32{ 1, 2, 3, 4, 5 }; |
| ... | @@ -67,7 +68,7 @@ test "ignore lval with underscore (for loop)" { | ... | @@ -67,7 +68,7 @@ test "ignore lval with underscore (for loop)" { |
| 67 | test "basic for loop" { | 68 | test "basic for loop" { |
| 68 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 69 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 69 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 70 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 70 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 71 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 71 | 72 | ||
| 72 | const expected_result: [24]u8 = .{ | 73 | const expected_result: [24]u8 = .{ |
| 73 | 9, 8, 7, 6, 0, 1, 2, 3, | 74 | 9, 8, 7, 6, 0, 1, 2, 3, |
| ... | @@ -114,7 +115,7 @@ test "basic for loop" { | ... | @@ -114,7 +115,7 @@ test "basic for loop" { |
| 114 | test "for with null and T peer types and inferred result location type" { | 115 | test "for with null and T peer types and inferred result location type" { |
| 115 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 116 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 116 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 117 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 117 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 118 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 118 | 119 | ||
| 119 | const S = struct { | 120 | const S = struct { |
| 120 | fn doTheTest(slice: []const u8) !void { | 121 | fn doTheTest(slice: []const u8) !void { |
| ... | @@ -133,6 +134,7 @@ test "for with null and T peer types and inferred result location type" { | ... | @@ -133,6 +134,7 @@ test "for with null and T peer types and inferred result location type" { |
| 133 | } | 134 | } |
| 134 | 135 | ||
| 135 | test "2 break statements and an else" { | 136 | test "2 break statements and an else" { |
| 137 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 136 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 138 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 137 | 139 | ||
| 138 | const S = struct { | 140 | const S = struct { |
| ... | @@ -154,7 +156,7 @@ test "2 break statements and an else" { | ... | @@ -154,7 +156,7 @@ test "2 break statements and an else" { |
| 154 | test "for loop with pointer elem var" { | 156 | test "for loop with pointer elem var" { |
| 155 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 157 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 156 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 158 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 157 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 159 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 158 | 160 | ||
| 159 | const source = "abcdefg"; | 161 | const source = "abcdefg"; |
| 160 | var target: [source.len]u8 = undefined; | 162 | var target: [source.len]u8 = undefined; |
| ... | @@ -179,6 +181,7 @@ fn mangleString(s: []u8) void { | ... | @@ -179,6 +181,7 @@ fn mangleString(s: []u8) void { |
| 179 | } | 181 | } |
| 180 | 182 | ||
| 181 | test "for copies its payload" { | 183 | test "for copies its payload" { |
| 184 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 182 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 185 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 183 | 186 | ||
| 184 | const S = struct { | 187 | const S = struct { |
| ... | @@ -198,7 +201,7 @@ test "for copies its payload" { | ... | @@ -198,7 +201,7 @@ test "for copies its payload" { |
| 198 | test "for on slice with allowzero ptr" { | 201 | test "for on slice with allowzero ptr" { |
| 199 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 202 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 200 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 203 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 201 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 204 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 202 | 205 | ||
| 203 | const S = struct { | 206 | const S = struct { |
| 204 | fn doTheTest(slice: []const u8) !void { | 207 | fn doTheTest(slice: []const u8) !void { |
| ... | @@ -213,7 +216,7 @@ test "for on slice with allowzero ptr" { | ... | @@ -213,7 +216,7 @@ test "for on slice with allowzero ptr" { |
| 213 | 216 | ||
| 214 | test "else continue outer for" { | 217 | test "else continue outer for" { |
| 215 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 218 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 216 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 219 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 217 | 220 | ||
| 218 | var i: usize = 6; | 221 | var i: usize = 6; |
| 219 | var buf: [5]u8 = undefined; | 222 | var buf: [5]u8 = undefined; |
| ... | @@ -226,6 +229,7 @@ test "else continue outer for" { | ... | @@ -226,6 +229,7 @@ test "else continue outer for" { |
| 226 | } | 229 | } |
| 227 | 230 | ||
| 228 | test "for loop with else branch" { | 231 | test "for loop with else branch" { |
| 232 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 229 | { | 233 | { |
| 230 | var x = [_]u32{ 1, 2 }; | 234 | var x = [_]u32{ 1, 2 }; |
| 231 | _ = &x; | 235 | _ = &x; |
| ... | @@ -272,6 +276,7 @@ test "two counters" { | ... | @@ -272,6 +276,7 @@ test "two counters" { |
| 272 | } | 276 | } |
| 273 | 277 | ||
| 274 | test "1-based counter and ptr to array" { | 278 | test "1-based counter and ptr to array" { |
| 279 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 275 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 280 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 276 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 281 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 277 | 282 | ||
| ... | @@ -306,7 +311,7 @@ test "1-based counter and ptr to array" { | ... | @@ -306,7 +311,7 @@ test "1-based counter and ptr to array" { |
| 306 | test "slice and two counters, one is offset and one is runtime" { | 311 | test "slice and two counters, one is offset and one is runtime" { |
| 307 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 312 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 308 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 313 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 309 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 314 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 310 | 315 | ||
| 311 | const slice: []const u8 = "blah"; | 316 | const slice: []const u8 = "blah"; |
| 312 | var start: usize = 0; | 317 | var start: usize = 0; |
| ... | @@ -335,7 +340,7 @@ test "slice and two counters, one is offset and one is runtime" { | ... | @@ -335,7 +340,7 @@ test "slice and two counters, one is offset and one is runtime" { |
| 335 | test "two slices, one captured by-ref" { | 340 | test "two slices, one captured by-ref" { |
| 336 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 341 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 337 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 342 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 338 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 343 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 339 | 344 | ||
| 340 | var buf: [10]u8 = undefined; | 345 | var buf: [10]u8 = undefined; |
| 341 | const slice1: []const u8 = "blah"; | 346 | const slice1: []const u8 = "blah"; |
| ... | @@ -354,7 +359,7 @@ test "two slices, one captured by-ref" { | ... | @@ -354,7 +359,7 @@ test "two slices, one captured by-ref" { |
| 354 | test "raw pointer and slice" { | 359 | test "raw pointer and slice" { |
| 355 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 360 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 356 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 361 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 357 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 362 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 358 | 363 | ||
| 359 | var buf: [10]u8 = undefined; | 364 | var buf: [10]u8 = undefined; |
| 360 | const slice: []const u8 = "blah"; | 365 | const slice: []const u8 = "blah"; |
| ... | @@ -373,7 +378,7 @@ test "raw pointer and slice" { | ... | @@ -373,7 +378,7 @@ test "raw pointer and slice" { |
| 373 | test "raw pointer and counter" { | 378 | test "raw pointer and counter" { |
| 374 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 379 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 375 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 380 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 376 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 381 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 377 | 382 | ||
| 378 | var buf: [10]u8 = undefined; | 383 | var buf: [10]u8 = undefined; |
| 379 | const ptr: [*]u8 = &buf; | 384 | const ptr: [*]u8 = &buf; |
| ... | @@ -391,7 +396,7 @@ test "raw pointer and counter" { | ... | @@ -391,7 +396,7 @@ test "raw pointer and counter" { |
| 391 | test "inline for with slice as the comptime-known" { | 396 | test "inline for with slice as the comptime-known" { |
| 392 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 397 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 393 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 398 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 394 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 399 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 395 | 400 | ||
| 396 | const comptime_slice = "hello"; | 401 | const comptime_slice = "hello"; |
| 397 | var runtime_i: usize = 3; | 402 | var runtime_i: usize = 3; |
| ... | @@ -422,7 +427,7 @@ test "inline for with slice as the comptime-known" { | ... | @@ -422,7 +427,7 @@ test "inline for with slice as the comptime-known" { |
| 422 | test "inline for with counter as the comptime-known" { | 427 | test "inline for with counter as the comptime-known" { |
| 423 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 428 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 424 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 429 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 425 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 430 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 426 | 431 | ||
| 427 | var runtime_slice = "hello"; | 432 | var runtime_slice = "hello"; |
| 428 | var runtime_i: usize = 3; | 433 | var runtime_i: usize = 3; |
| ... | @@ -451,6 +456,7 @@ test "inline for with counter as the comptime-known" { | ... | @@ -451,6 +456,7 @@ test "inline for with counter as the comptime-known" { |
| 451 | } | 456 | } |
| 452 | 457 | ||
| 453 | test "inline for on tuple pointer" { | 458 | test "inline for on tuple pointer" { |
| 459 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 454 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 460 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 455 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 461 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 456 | 462 | ||
| ... | @@ -465,6 +471,7 @@ test "inline for on tuple pointer" { | ... | @@ -465,6 +471,7 @@ test "inline for on tuple pointer" { |
| 465 | } | 471 | } |
| 466 | 472 | ||
| 467 | test "ref counter that starts at zero" { | 473 | test "ref counter that starts at zero" { |
| 474 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 468 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 475 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 469 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 476 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 470 | 477 | ||
| ... | @@ -479,6 +486,7 @@ test "ref counter that starts at zero" { | ... | @@ -479,6 +486,7 @@ test "ref counter that starts at zero" { |
| 479 | } | 486 | } |
| 480 | 487 | ||
| 481 | test "inferred alloc ptr of for loop" { | 488 | test "inferred alloc ptr of for loop" { |
| 489 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 482 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 490 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 483 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 491 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 484 | 492 | ||
| ... | @@ -501,6 +509,7 @@ test "inferred alloc ptr of for loop" { | ... | @@ -501,6 +509,7 @@ test "inferred alloc ptr of for loop" { |
| 501 | } | 509 | } |
| 502 | 510 | ||
| 503 | test "for loop results in a bool" { | 511 | test "for loop results in a bool" { |
| 512 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 504 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 513 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 505 | 514 | ||
| 506 | try std.testing.expect(for ([1]u8{0}) |x| { | 515 | try std.testing.expect(for ([1]u8{0}) |x| { |
test/behavior/generics.zig+27-12| ... | @@ -5,6 +5,8 @@ const expect = testing.expect; | ... | @@ -5,6 +5,8 @@ const expect = testing.expect; |
| 5 | const expectEqual = testing.expectEqual; | 5 | const expectEqual = testing.expectEqual; |
| 6 | 6 | ||
| 7 | test "one param, explicit comptime" { | 7 | test "one param, explicit comptime" { |
| 8 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 9 | |||
| 8 | var x: usize = 0; | 10 | var x: usize = 0; |
| 9 | x += checkSize(i32); | 11 | x += checkSize(i32); |
| 10 | x += checkSize(bool); | 12 | x += checkSize(bool); |
| ... | @@ -17,6 +19,7 @@ fn checkSize(comptime T: type) usize { | ... | @@ -17,6 +19,7 @@ fn checkSize(comptime T: type) usize { |
| 17 | } | 19 | } |
| 18 | 20 | ||
| 19 | test "simple generic fn" { | 21 | test "simple generic fn" { |
| 22 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 20 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 23 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 21 | 24 | ||
| 22 | try expect(max(i32, 3, -1) == 3); | 25 | try expect(max(i32, 3, -1) == 3); |
| ... | @@ -51,6 +54,7 @@ fn sameButWithFloats(a: f64, b: f64) f64 { | ... | @@ -51,6 +54,7 @@ fn sameButWithFloats(a: f64, b: f64) f64 { |
| 51 | } | 54 | } |
| 52 | 55 | ||
| 53 | test "fn with comptime args" { | 56 | test "fn with comptime args" { |
| 57 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 54 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 58 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 55 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 59 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 56 | 60 | ||
| ... | @@ -86,7 +90,7 @@ fn max_f64(a: f64, b: f64) f64 { | ... | @@ -86,7 +90,7 @@ fn max_f64(a: f64, b: f64) f64 { |
| 86 | test "type constructed by comptime function call" { | 90 | test "type constructed by comptime function call" { |
| 87 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 91 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 88 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 92 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 89 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 93 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 90 | 94 | ||
| 91 | var l: SimpleList(10) = undefined; | 95 | var l: SimpleList(10) = undefined; |
| 92 | l.array[0] = 10; | 96 | l.array[0] = 10; |
| ... | @@ -108,6 +112,7 @@ fn SimpleList(comptime L: usize) type { | ... | @@ -108,6 +112,7 @@ fn SimpleList(comptime L: usize) type { |
| 108 | } | 112 | } |
| 109 | 113 | ||
| 110 | test "function with return type type" { | 114 | test "function with return type type" { |
| 115 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 111 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 116 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 112 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 117 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 113 | 118 | ||
| ... | @@ -150,7 +155,7 @@ fn aGenericFn(comptime T: type, comptime a: T, b: T) T { | ... | @@ -150,7 +155,7 @@ fn aGenericFn(comptime T: type, comptime a: T, b: T) T { |
| 150 | test "generic fn with implicit cast" { | 155 | test "generic fn with implicit cast" { |
| 151 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 156 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 152 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 157 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 153 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 158 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 154 | 159 | ||
| 155 | try expect(getFirstByte(u8, &[_]u8{13}) == 13); | 160 | try expect(getFirstByte(u8, &[_]u8{13}) == 13); |
| 156 | try expect(getFirstByte(u16, &[_]u16{ | 161 | try expect(getFirstByte(u16, &[_]u16{ |
| ... | @@ -169,7 +174,7 @@ test "generic fn keeps non-generic parameter types" { | ... | @@ -169,7 +174,7 @@ test "generic fn keeps non-generic parameter types" { |
| 169 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 174 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 170 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 175 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 171 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 176 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 172 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 177 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 173 | 178 | ||
| 174 | const A = 128; | 179 | const A = 128; |
| 175 | 180 | ||
| ... | @@ -204,7 +209,7 @@ fn foo2(arg: anytype) bool { | ... | @@ -204,7 +209,7 @@ fn foo2(arg: anytype) bool { |
| 204 | 209 | ||
| 205 | test "generic struct" { | 210 | test "generic struct" { |
| 206 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 211 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 207 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 212 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 208 | 213 | ||
| 209 | var a1 = GenNode(i32){ | 214 | var a1 = GenNode(i32){ |
| 210 | .value = 13, | 215 | .value = 13, |
| ... | @@ -245,7 +250,7 @@ test "function parameter is generic" { | ... | @@ -245,7 +250,7 @@ test "function parameter is generic" { |
| 245 | test "generic function instantiation turns into comptime call" { | 250 | test "generic function instantiation turns into comptime call" { |
| 246 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 251 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 247 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 252 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 248 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 253 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 249 | 254 | ||
| 250 | const S = struct { | 255 | const S = struct { |
| 251 | fn doTheTest() !void { | 256 | fn doTheTest() !void { |
| ... | @@ -273,6 +278,7 @@ test "generic function instantiation turns into comptime call" { | ... | @@ -273,6 +278,7 @@ test "generic function instantiation turns into comptime call" { |
| 273 | } | 278 | } |
| 274 | 279 | ||
| 275 | test "generic function with void and comptime parameter" { | 280 | test "generic function with void and comptime parameter" { |
| 281 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 276 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 282 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 277 | 283 | ||
| 278 | const S = struct { x: i32 }; | 284 | const S = struct { x: i32 }; |
| ... | @@ -288,6 +294,7 @@ test "generic function with void and comptime parameter" { | ... | @@ -288,6 +294,7 @@ test "generic function with void and comptime parameter" { |
| 288 | } | 294 | } |
| 289 | 295 | ||
| 290 | test "anonymous struct return type referencing comptime parameter" { | 296 | test "anonymous struct return type referencing comptime parameter" { |
| 297 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 291 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 298 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 292 | 299 | ||
| 293 | const S = struct { | 300 | const S = struct { |
| ... | @@ -306,7 +313,7 @@ test "anonymous struct return type referencing comptime parameter" { | ... | @@ -306,7 +313,7 @@ test "anonymous struct return type referencing comptime parameter" { |
| 306 | test "generic function instantiation non-duplicates" { | 313 | test "generic function instantiation non-duplicates" { |
| 307 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 314 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 308 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 315 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 309 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 316 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 310 | 317 | ||
| 311 | const S = struct { | 318 | const S = struct { |
| 312 | fn copy(comptime T: type, dest: []T, source: []const T) void { | 319 | fn copy(comptime T: type, dest: []T, source: []const T) void { |
| ... | @@ -339,7 +346,7 @@ test "generic instantiation of tagged union with only one field" { | ... | @@ -339,7 +346,7 @@ test "generic instantiation of tagged union with only one field" { |
| 339 | } | 346 | } |
| 340 | 347 | ||
| 341 | test "generic parameter type is function type" { | 348 | test "generic parameter type is function type" { |
| 342 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 349 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 343 | 350 | ||
| 344 | const S = struct { | 351 | const S = struct { |
| 345 | fn foo(comptime T: type, callback: *const fn (user_data: T) anyerror!void, data: T) anyerror!void { | 352 | fn foo(comptime T: type, callback: *const fn (user_data: T) anyerror!void, data: T) anyerror!void { |
| ... | @@ -374,6 +381,7 @@ test "extern function used as generic parameter" { | ... | @@ -374,6 +381,7 @@ test "extern function used as generic parameter" { |
| 374 | } | 381 | } |
| 375 | 382 | ||
| 376 | test "generic struct as parameter type" { | 383 | test "generic struct as parameter type" { |
| 384 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 377 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 385 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 378 | 386 | ||
| 379 | const S = struct { | 387 | const S = struct { |
| ... | @@ -389,7 +397,7 @@ test "generic struct as parameter type" { | ... | @@ -389,7 +397,7 @@ test "generic struct as parameter type" { |
| 389 | } | 397 | } |
| 390 | 398 | ||
| 391 | test "slice as parameter type" { | 399 | test "slice as parameter type" { |
| 392 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 400 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 393 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 401 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 394 | 402 | ||
| 395 | const S = struct { | 403 | const S = struct { |
| ... | @@ -406,7 +414,7 @@ test "slice as parameter type" { | ... | @@ -406,7 +414,7 @@ test "slice as parameter type" { |
| 406 | } | 414 | } |
| 407 | 415 | ||
| 408 | test "null sentinel pointer passed as generic argument" { | 416 | test "null sentinel pointer passed as generic argument" { |
| 409 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 417 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 410 | 418 | ||
| 411 | const S = struct { | 419 | const S = struct { |
| 412 | fn doTheTest(a: anytype) !void { | 420 | fn doTheTest(a: anytype) !void { |
| ... | @@ -417,6 +425,8 @@ test "null sentinel pointer passed as generic argument" { | ... | @@ -417,6 +425,8 @@ test "null sentinel pointer passed as generic argument" { |
| 417 | } | 425 | } |
| 418 | 426 | ||
| 419 | test "generic function passed as comptime argument" { | 427 | test "generic function passed as comptime argument" { |
| 428 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 429 | |||
| 420 | const S = struct { | 430 | const S = struct { |
| 421 | fn doMath(comptime f: fn (comptime type, i32, i32) error{Overflow}!i32, a: i32, b: i32) !void { | 431 | fn doMath(comptime f: fn (comptime type, i32, i32) error{Overflow}!i32, a: i32, b: i32) !void { |
| 422 | const result = try f(i32, a, b); | 432 | const result = try f(i32, a, b); |
| ... | @@ -427,7 +437,7 @@ test "generic function passed as comptime argument" { | ... | @@ -427,7 +437,7 @@ test "generic function passed as comptime argument" { |
| 427 | } | 437 | } |
| 428 | 438 | ||
| 429 | test "return type of generic function is function pointer" { | 439 | test "return type of generic function is function pointer" { |
| 430 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 440 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 431 | 441 | ||
| 432 | const S = struct { | 442 | const S = struct { |
| 433 | fn b(comptime T: type) ?*const fn () error{}!T { | 443 | fn b(comptime T: type) ?*const fn () error{}!T { |
| ... | @@ -439,6 +449,8 @@ test "return type of generic function is function pointer" { | ... | @@ -439,6 +449,8 @@ test "return type of generic function is function pointer" { |
| 439 | } | 449 | } |
| 440 | 450 | ||
| 441 | test "coerced function body has inequal value with its uncoerced body" { | 451 | test "coerced function body has inequal value with its uncoerced body" { |
| 452 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 453 | |||
| 442 | const S = struct { | 454 | const S = struct { |
| 443 | const A = B(i32, c); | 455 | const A = B(i32, c); |
| 444 | fn c() !i32 { | 456 | fn c() !i32 { |
| ... | @@ -485,7 +497,9 @@ test "union in struct captures argument" { | ... | @@ -485,7 +497,9 @@ test "union in struct captures argument" { |
| 485 | } | 497 | } |
| 486 | 498 | ||
| 487 | test "function argument tuple used as struct field" { | 499 | test "function argument tuple used as struct field" { |
| 500 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 488 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 501 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 502 | |||
| 489 | const S = struct { | 503 | const S = struct { |
| 490 | fn DeleagateWithContext(comptime Function: type) type { | 504 | fn DeleagateWithContext(comptime Function: type) type { |
| 491 | const ArgArgs = std.meta.ArgsTuple(Function); | 505 | const ArgArgs = std.meta.ArgsTuple(Function); |
| ... | @@ -516,7 +530,7 @@ test "comptime callconv(.c) function ptr uses comptime type argument" { | ... | @@ -516,7 +530,7 @@ test "comptime callconv(.c) function ptr uses comptime type argument" { |
| 516 | } | 530 | } |
| 517 | 531 | ||
| 518 | test "call generic function with from function called by the generic function" { | 532 | test "call generic function with from function called by the generic function" { |
| 519 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 533 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 520 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 534 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 521 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 535 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 522 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 536 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -559,6 +573,7 @@ fn StructCapture(comptime T: type) type { | ... | @@ -559,6 +573,7 @@ fn StructCapture(comptime T: type) type { |
| 559 | } | 573 | } |
| 560 | 574 | ||
| 561 | test "call generic function that uses capture from function declaration's scope" { | 575 | test "call generic function that uses capture from function declaration's scope" { |
| 576 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 562 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 577 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 563 | 578 | ||
| 564 | const S = StructCapture(f64); | 579 | const S = StructCapture(f64); |
| ... | @@ -573,7 +588,7 @@ comptime { | ... | @@ -573,7 +588,7 @@ comptime { |
| 573 | } | 588 | } |
| 574 | 589 | ||
| 575 | test "generic parameter resolves to comptime-only type but is not marked comptime" { | 590 | test "generic parameter resolves to comptime-only type but is not marked comptime" { |
| 576 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 591 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 577 | 592 | ||
| 578 | const S = struct { | 593 | const S = struct { |
| 579 | fn foo(comptime T: type, rt_false: bool, func: fn (T) void) T { | 594 | fn foo(comptime T: type, rt_false: bool, func: fn (T) void) T { |
test/behavior/globals.zig+12-8| ... | @@ -4,7 +4,7 @@ const expect = std.testing.expect; | ... | @@ -4,7 +4,7 @@ const expect = std.testing.expect; |
| 4 | 4 | ||
| 5 | var pos = [2]f32{ 0.0, 0.0 }; | 5 | var pos = [2]f32{ 0.0, 0.0 }; |
| 6 | test "store to global array" { | 6 | test "store to global array" { |
| 7 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 7 | if (builtin.cpu.arch.isSpirv()) 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_arm) return error.SkipZigTest; | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 10 | 10 | ||
| ... | @@ -15,7 +15,7 @@ test "store to global array" { | ... | @@ -15,7 +15,7 @@ test "store to global array" { |
| 15 | 15 | ||
| 16 | var vpos = @Vector(2, f32){ 0.0, 0.0 }; | 16 | var vpos = @Vector(2, f32){ 0.0, 0.0 }; |
| 17 | test "store to global vector" { | 17 | test "store to global vector" { |
| 18 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 18 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 19 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 19 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 21 | 21 | ||
| ... | @@ -27,7 +27,7 @@ test "store to global vector" { | ... | @@ -27,7 +27,7 @@ test "store to global vector" { |
| 27 | test "slices pointing at the same address as global array." { | 27 | test "slices pointing at the same address as global array." { |
| 28 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 28 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 29 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 29 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 30 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 30 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 31 | 31 | ||
| 32 | const S = struct { | 32 | const S = struct { |
| 33 | const a = [_]u8{ 1, 2, 3 }; | 33 | const a = [_]u8{ 1, 2, 3 }; |
| ... | @@ -44,7 +44,7 @@ test "slices pointing at the same address as global array." { | ... | @@ -44,7 +44,7 @@ test "slices pointing at the same address as global array." { |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | test "global loads can affect liveness" { | 46 | test "global loads can affect liveness" { |
| 47 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 47 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 48 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 48 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 49 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 49 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 50 | 50 | ||
| ... | @@ -68,6 +68,8 @@ test "global loads can affect liveness" { | ... | @@ -68,6 +68,8 @@ test "global loads can affect liveness" { |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | test "global const can be self-referential" { | 70 | test "global const can be self-referential" { |
| 71 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 72 | |||
| 71 | const S = struct { | 73 | const S = struct { |
| 72 | self: *const @This(), | 74 | self: *const @This(), |
| 73 | x: u32, | 75 | x: u32, |
| ... | @@ -83,7 +85,7 @@ test "global const can be self-referential" { | ... | @@ -83,7 +85,7 @@ test "global const can be self-referential" { |
| 83 | } | 85 | } |
| 84 | 86 | ||
| 85 | test "global var can be self-referential" { | 87 | test "global var can be self-referential" { |
| 86 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 88 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 87 | 89 | ||
| 88 | const S = struct { | 90 | const S = struct { |
| 89 | self: *@This(), | 91 | self: *@This(), |
| ... | @@ -112,6 +114,8 @@ test "global var can be self-referential" { | ... | @@ -112,6 +114,8 @@ test "global var can be self-referential" { |
| 112 | } | 114 | } |
| 113 | 115 | ||
| 114 | test "global const can be indirectly self-referential" { | 116 | test "global const can be indirectly self-referential" { |
| 117 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 118 | |||
| 115 | const S = struct { | 119 | const S = struct { |
| 116 | other: *const @This(), | 120 | other: *const @This(), |
| 117 | x: u32, | 121 | x: u32, |
| ... | @@ -136,7 +140,7 @@ test "global const can be indirectly self-referential" { | ... | @@ -136,7 +140,7 @@ test "global const can be indirectly self-referential" { |
| 136 | } | 140 | } |
| 137 | 141 | ||
| 138 | test "global var can be indirectly self-referential" { | 142 | test "global var can be indirectly self-referential" { |
| 139 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 143 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 140 | 144 | ||
| 141 | const S = struct { | 145 | const S = struct { |
| 142 | other: *@This(), | 146 | other: *@This(), |
| ... | @@ -175,7 +179,7 @@ var callbacks: Callbacks = undefined; | ... | @@ -175,7 +179,7 @@ var callbacks: Callbacks = undefined; |
| 175 | var callbacks_loaded: bool = false; | 179 | var callbacks_loaded: bool = false; |
| 176 | 180 | ||
| 177 | test "function pointer field call on global extern struct, conditional on global" { | 181 | test "function pointer field call on global extern struct, conditional on global" { |
| 178 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 182 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 179 | 183 | ||
| 180 | if (callbacks_loaded) { | 184 | if (callbacks_loaded) { |
| 181 | try std.testing.expectEqual(42, callbacks.key_callback(42)); | 185 | try std.testing.expectEqual(42, callbacks.key_callback(42)); |
| ... | @@ -184,7 +188,7 @@ test "function pointer field call on global extern struct, conditional on global | ... | @@ -184,7 +188,7 @@ test "function pointer field call on global extern struct, conditional on global |
| 184 | 188 | ||
| 185 | test "function pointer field call on global extern struct" { | 189 | test "function pointer field call on global extern struct" { |
| 186 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 190 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 187 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 191 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 188 | 192 | ||
| 189 | const S = struct { | 193 | const S = struct { |
| 190 | fn keyCallback(key: i32) callconv(.c) i32 { | 194 | fn keyCallback(key: i32) callconv(.c) i32 { |
test/behavior/hasdecl.zig+2| ... | @@ -12,6 +12,7 @@ pub const Bar = struct { | ... | @@ -12,6 +12,7 @@ pub const Bar = struct { |
| 12 | }; | 12 | }; |
| 13 | 13 | ||
| 14 | test "@hasDecl" { | 14 | test "@hasDecl" { |
| 15 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 15 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 16 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 16 | 17 | ||
| 17 | try expect(@hasDecl(Foo, "public_thing")); | 18 | try expect(@hasDecl(Foo, "public_thing")); |
| ... | @@ -24,6 +25,7 @@ test "@hasDecl" { | ... | @@ -24,6 +25,7 @@ test "@hasDecl" { |
| 24 | } | 25 | } |
| 25 | 26 | ||
| 26 | test "@hasDecl using a sliced string literal" { | 27 | test "@hasDecl using a sliced string literal" { |
| 28 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 27 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 29 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 28 | 30 | ||
| 29 | try expect(@hasDecl(@This(), "Bar") == true); | 31 | try expect(@hasDecl(@This(), "Bar") == true); |
test/behavior/hasfield.zig+2| ... | @@ -2,6 +2,8 @@ const expect = @import("std").testing.expect; | ... | @@ -2,6 +2,8 @@ const expect = @import("std").testing.expect; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | test "@hasField" { | 4 | test "@hasField" { |
| 5 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 6 | |||
| 5 | const struc = struct { | 7 | const struc = struct { |
| 6 | a: i32, | 8 | a: i32, |
| 7 | b: []u8, | 9 | b: []u8, |
test/behavior/if.zig+10-2| ... | @@ -4,6 +4,8 @@ const expect = std.testing.expect; | ... | @@ -4,6 +4,8 @@ const expect = std.testing.expect; |
| 4 | const expectEqual = std.testing.expectEqual; | 4 | const expectEqual = std.testing.expectEqual; |
| 5 | 5 | ||
| 6 | test "if statements" { | 6 | test "if statements" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 8 | |||
| 7 | shouldBeEqual(1, 1); | 9 | shouldBeEqual(1, 1); |
| 8 | firstEqlThird(2, 1, 2); | 10 | firstEqlThird(2, 1, 2); |
| 9 | } | 11 | } |
| ... | @@ -44,7 +46,7 @@ var global_with_val: anyerror!u32 = 0; | ... | @@ -44,7 +46,7 @@ var global_with_val: anyerror!u32 = 0; |
| 44 | var global_with_err: anyerror!u32 = error.SomeError; | 46 | var global_with_err: anyerror!u32 = error.SomeError; |
| 45 | 47 | ||
| 46 | test "unwrap mutable global var" { | 48 | test "unwrap mutable global var" { |
| 47 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 49 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 48 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 50 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 49 | 51 | ||
| 50 | if (global_with_val) |v| { | 52 | if (global_with_val) |v| { |
| ... | @@ -94,6 +96,7 @@ test "const result loc, runtime if cond, else unreachable" { | ... | @@ -94,6 +96,7 @@ test "const result loc, runtime if cond, else unreachable" { |
| 94 | } | 96 | } |
| 95 | 97 | ||
| 96 | test "if copies its payload" { | 98 | test "if copies its payload" { |
| 99 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 97 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 100 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 98 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 101 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 99 | 102 | ||
| ... | @@ -131,7 +134,7 @@ test "if prongs cast to expected type instead of peer type resolution" { | ... | @@ -131,7 +134,7 @@ test "if prongs cast to expected type instead of peer type resolution" { |
| 131 | test "if peer expressions inferred optional type" { | 134 | test "if peer expressions inferred optional type" { |
| 132 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 135 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 133 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 136 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 134 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 137 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 135 | 138 | ||
| 136 | var self: []const u8 = "abcdef"; | 139 | var self: []const u8 = "abcdef"; |
| 137 | var index: usize = 0; | 140 | var index: usize = 0; |
| ... | @@ -147,6 +150,7 @@ test "if peer expressions inferred optional type" { | ... | @@ -147,6 +150,7 @@ test "if peer expressions inferred optional type" { |
| 147 | } | 150 | } |
| 148 | 151 | ||
| 149 | test "if-else expression with runtime condition result location is inferred optional" { | 152 | test "if-else expression with runtime condition result location is inferred optional" { |
| 153 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 150 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 154 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 151 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 155 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 152 | 156 | ||
| ... | @@ -158,6 +162,8 @@ test "if-else expression with runtime condition result location is inferred opti | ... | @@ -158,6 +162,8 @@ test "if-else expression with runtime condition result location is inferred opti |
| 158 | } | 162 | } |
| 159 | 163 | ||
| 160 | test "result location with inferred type ends up being pointer to comptime_int" { | 164 | test "result location with inferred type ends up being pointer to comptime_int" { |
| 165 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 166 | |||
| 161 | var a: ?u32 = 1234; | 167 | var a: ?u32 = 1234; |
| 162 | var b: u32 = 2000; | 168 | var b: u32 = 2000; |
| 163 | _ = .{ &a, &b }; | 169 | _ = .{ &a, &b }; |
| ... | @@ -186,6 +192,7 @@ fn returnTrue() bool { | ... | @@ -186,6 +192,7 @@ fn returnTrue() bool { |
| 186 | } | 192 | } |
| 187 | 193 | ||
| 188 | test "if value shouldn't be load-elided if used later (structs)" { | 194 | test "if value shouldn't be load-elided if used later (structs)" { |
| 195 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 189 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 196 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 190 | 197 | ||
| 191 | const Foo = struct { x: i32 }; | 198 | const Foo = struct { x: i32 }; |
| ... | @@ -205,6 +212,7 @@ test "if value shouldn't be load-elided if used later (structs)" { | ... | @@ -205,6 +212,7 @@ test "if value shouldn't be load-elided if used later (structs)" { |
| 205 | } | 212 | } |
| 206 | 213 | ||
| 207 | test "if value shouldn't be load-elided if used later (optionals)" { | 214 | test "if value shouldn't be load-elided if used later (optionals)" { |
| 215 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 208 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 216 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 209 | 217 | ||
| 210 | var a: ?i32 = 1; | 218 | var a: ?i32 = 1; |
test/behavior/import_c_keywords.zig+1-1| ... | @@ -29,7 +29,7 @@ extern fn an_alias_of_some_non_c_keyword_function() Id; | ... | @@ -29,7 +29,7 @@ extern fn an_alias_of_some_non_c_keyword_function() Id; |
| 29 | test "import c keywords" { | 29 | test "import c keywords" { |
| 30 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 30 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 31 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 31 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 32 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 32 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 33 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | 33 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| 34 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 34 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 35 | 35 |
test/behavior/incomplete_struct_param_tld.zig+1-1| ... | @@ -23,7 +23,7 @@ fn foo(a: A) i32 { | ... | @@ -23,7 +23,7 @@ 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_spirv) return error.SkipZigTest; | 26 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 27 | 27 | ||
| 28 | const a = A{ | 28 | const a = A{ |
| 29 | .b = B{ | 29 | .b = B{ |
test/behavior/inline_switch.zig+6| ... | @@ -3,6 +3,7 @@ const expect = std.testing.expect; | ... | @@ -3,6 +3,7 @@ const expect = std.testing.expect; |
| 3 | const builtin = @import("builtin"); | 3 | const builtin = @import("builtin"); |
| 4 | 4 | ||
| 5 | test "inline scalar prongs" { | 5 | test "inline scalar prongs" { |
| 6 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 6 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 7 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 7 | 8 | ||
| 8 | var x: usize = 0; | 9 | var x: usize = 0; |
| ... | @@ -42,6 +43,7 @@ test "inline switch enums" { | ... | @@ -42,6 +43,7 @@ test "inline switch enums" { |
| 42 | 43 | ||
| 43 | const U = union(E) { a: void, b: u2, c: u3, d: u4 }; | 44 | const U = union(E) { a: void, b: u2, c: u3, d: u4 }; |
| 44 | test "inline switch unions" { | 45 | test "inline switch unions" { |
| 46 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 45 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 47 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 46 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 48 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 47 | var x: U = .a; | 49 | var x: U = .a; |
| ... | @@ -67,6 +69,7 @@ test "inline switch unions" { | ... | @@ -67,6 +69,7 @@ test "inline switch unions" { |
| 67 | } | 69 | } |
| 68 | 70 | ||
| 69 | test "inline else bool" { | 71 | test "inline else bool" { |
| 72 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 70 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 73 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 71 | var a = true; | 74 | var a = true; |
| 72 | _ = &a; | 75 | _ = &a; |
| ... | @@ -89,6 +92,7 @@ test "inline else error" { | ... | @@ -89,6 +92,7 @@ test "inline else error" { |
| 89 | } | 92 | } |
| 90 | 93 | ||
| 91 | test "inline else enum" { | 94 | test "inline else enum" { |
| 95 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 92 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 96 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 93 | 97 | ||
| 94 | const E2 = enum(u8) { a = 2, b = 3, c = 4, d = 5 }; | 98 | const E2 = enum(u8) { a = 2, b = 3, c = 4, d = 5 }; |
| ... | @@ -134,6 +138,8 @@ test "inline else int all values" { | ... | @@ -134,6 +138,8 @@ test "inline else int all values" { |
| 134 | } | 138 | } |
| 135 | 139 | ||
| 136 | test "inline switch capture is set when switch operand is comptime known" { | 140 | test "inline switch capture is set when switch operand is comptime known" { |
| 141 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 142 | |||
| 137 | const U2 = union(enum) { | 143 | const U2 = union(enum) { |
| 138 | a: u32, | 144 | a: u32, |
| 139 | }; | 145 | }; |
test/behavior/int128.zig+5-2| ... | @@ -5,6 +5,7 @@ const minInt = std.math.minInt; | ... | @@ -5,6 +5,7 @@ const minInt = std.math.minInt; |
| 5 | const builtin = @import("builtin"); | 5 | const builtin = @import("builtin"); |
| 6 | 6 | ||
| 7 | test "uint128" { | 7 | test "uint128" { |
| 8 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 10 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 11 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -25,7 +26,7 @@ test "uint128" { | ... | @@ -25,7 +26,7 @@ test "uint128" { |
| 25 | test "undefined 128 bit int" { | 26 | test "undefined 128 bit int" { |
| 26 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 27 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 27 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 28 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 28 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 29 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 29 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 30 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 30 | 31 | ||
| 31 | @setRuntimeSafety(true); | 32 | @setRuntimeSafety(true); |
| ... | @@ -42,6 +43,7 @@ test "undefined 128 bit int" { | ... | @@ -42,6 +43,7 @@ test "undefined 128 bit int" { |
| 42 | } | 43 | } |
| 43 | 44 | ||
| 44 | test "int128" { | 45 | test "int128" { |
| 46 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 45 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 47 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 46 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 48 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 47 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 49 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -66,7 +68,7 @@ test "int128" { | ... | @@ -66,7 +68,7 @@ test "int128" { |
| 66 | test "truncate int128" { | 68 | test "truncate int128" { |
| 67 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 69 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 68 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 70 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 69 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 71 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 70 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 72 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 71 | 73 | ||
| 72 | { | 74 | { |
| ... | @@ -87,6 +89,7 @@ test "truncate int128" { | ... | @@ -87,6 +89,7 @@ test "truncate int128" { |
| 87 | } | 89 | } |
| 88 | 90 | ||
| 89 | test "shift int128" { | 91 | test "shift int128" { |
| 92 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 90 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 93 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 91 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 94 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 92 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 95 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
test/behavior/int_comparison_elision.zig+2-1| ... | @@ -4,6 +4,7 @@ const maxInt = std.math.maxInt; | ... | @@ -4,6 +4,7 @@ const maxInt = std.math.maxInt; |
| 4 | const builtin = @import("builtin"); | 4 | const builtin = @import("builtin"); |
| 5 | 5 | ||
| 6 | test "int comparison elision" { | 6 | test "int comparison elision" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 7 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 8 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 8 | 9 | ||
| 9 | testIntEdges(u0); | 10 | testIntEdges(u0); |
| ... | @@ -14,7 +15,7 @@ test "int comparison elision" { | ... | @@ -14,7 +15,7 @@ test "int comparison elision" { |
| 14 | 15 | ||
| 15 | // TODO: support int types > 128 bits wide in other backends | 16 | // TODO: support int types > 128 bits wide in other backends |
| 16 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 17 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 17 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 18 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 18 | 19 | ||
| 19 | // TODO: panic: integer overflow with int types > 65528 bits wide | 20 | // TODO: panic: integer overflow with int types > 65528 bits wide |
| 20 | // TODO: LLVM generates too many parameters for wasmtime when splitting up int > 64000 bits wide | 21 | // TODO: LLVM generates too many parameters for wasmtime when splitting up int > 64000 bits wide |
test/behavior/ir_block_deps.zig+1| ... | @@ -18,6 +18,7 @@ fn getErrInt() anyerror!i32 { | ... | @@ -18,6 +18,7 @@ fn getErrInt() anyerror!i32 { |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | test "ir block deps" { | 20 | test "ir block deps" { |
| 21 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 21 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 22 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 22 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 23 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 23 | 24 |
test/behavior/lower_strlit_to_vector.zig+1-1| ... | @@ -4,7 +4,7 @@ const builtin = @import("builtin"); | ... | @@ -4,7 +4,7 @@ const builtin = @import("builtin"); |
| 4 | test "strlit to vector" { | 4 | test "strlit to vector" { |
| 5 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 5 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 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_spirv) return error.SkipZigTest; | 7 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 8 | 8 | ||
| 9 | const strlit = "0123456789abcdef0123456789ABCDEF"; | 9 | const strlit = "0123456789abcdef0123456789ABCDEF"; |
| 10 | const vec_from_strlit: @Vector(32, u8) = strlit.*; | 10 | const vec_from_strlit: @Vector(32, u8) = strlit.*; |
test/behavior/math.zig+82-46| ... | @@ -10,6 +10,7 @@ const mem = std.mem; | ... | @@ -10,6 +10,7 @@ const mem = std.mem; |
| 10 | const math = std.math; | 10 | const math = std.math; |
| 11 | 11 | ||
| 12 | test "assignment operators" { | 12 | test "assignment operators" { |
| 13 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 13 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 14 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 14 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 15 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 15 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 16 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -40,6 +41,8 @@ test "assignment operators" { | ... | @@ -40,6 +41,8 @@ test "assignment operators" { |
| 40 | } | 41 | } |
| 41 | 42 | ||
| 42 | test "three expr in a row" { | 43 | test "three expr in a row" { |
| 44 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 45 | |||
| 43 | try testThreeExprInARow(false, true); | 46 | try testThreeExprInARow(false, true); |
| 44 | try comptime testThreeExprInARow(false, true); | 47 | try comptime testThreeExprInARow(false, true); |
| 45 | } | 48 | } |
| ... | @@ -64,7 +67,7 @@ fn assertFalse(b: bool) !void { | ... | @@ -64,7 +67,7 @@ fn assertFalse(b: bool) !void { |
| 64 | test "@clz small" { | 67 | test "@clz small" { |
| 65 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 68 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 66 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 69 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 67 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 70 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 68 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 71 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 69 | 72 | ||
| 70 | try testClzSmall(); | 73 | try testClzSmall(); |
| ... | @@ -82,7 +85,7 @@ fn testClzSmall() !void { | ... | @@ -82,7 +85,7 @@ fn testClzSmall() !void { |
| 82 | test "@clz big ints" { | 85 | test "@clz big ints" { |
| 83 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 86 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 84 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 87 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 85 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 88 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 86 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 89 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 87 | 90 | ||
| 88 | try testClzBigInts(); | 91 | try testClzBigInts(); |
| ... | @@ -102,7 +105,7 @@ test "@clz vectors" { | ... | @@ -102,7 +105,7 @@ test "@clz vectors" { |
| 102 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 105 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 103 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 106 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 104 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 107 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 105 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 108 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 106 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 109 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 107 | 110 | ||
| 108 | try testClzVectors(); | 111 | try testClzVectors(); |
| ... | @@ -143,7 +146,7 @@ test "@ctz small" { | ... | @@ -143,7 +146,7 @@ test "@ctz small" { |
| 143 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 146 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 144 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 147 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 145 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 148 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 146 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 149 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 147 | 150 | ||
| 148 | try testCtzSmall(); | 151 | try testCtzSmall(); |
| 149 | try comptime testCtzSmall(); | 152 | try comptime testCtzSmall(); |
| ... | @@ -165,7 +168,7 @@ fn testOneCtz(comptime T: type, x: T) u32 { | ... | @@ -165,7 +168,7 @@ fn testOneCtz(comptime T: type, x: T) u32 { |
| 165 | test "@ctz 128-bit integers" { | 168 | test "@ctz 128-bit integers" { |
| 166 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 169 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 167 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 170 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 168 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 171 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 169 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 172 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 170 | 173 | ||
| 171 | try testCtz128(); | 174 | try testCtz128(); |
| ... | @@ -184,7 +187,7 @@ test "@ctz vectors" { | ... | @@ -184,7 +187,7 @@ test "@ctz vectors" { |
| 184 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 187 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 185 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 188 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 186 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 189 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 187 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 190 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 188 | 191 | ||
| 189 | try testCtzVectors(); | 192 | try testCtzVectors(); |
| 190 | try comptime testCtzVectors(); | 193 | try comptime testCtzVectors(); |
| ... | @@ -258,6 +261,8 @@ test "quad hex float literal parsing in range" { | ... | @@ -258,6 +261,8 @@ test "quad hex float literal parsing in range" { |
| 258 | } | 261 | } |
| 259 | 262 | ||
| 260 | test "underscore separator parsing" { | 263 | test "underscore separator parsing" { |
| 264 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 265 | |||
| 261 | try expect(1_234_567 == 1234567); | 266 | try expect(1_234_567 == 1234567); |
| 262 | try expect(1_234_567 == 1234567); | 267 | try expect(1_234_567 == 1234567); |
| 263 | try expect(1_2_3_4_5_6_7 == 1234567); | 268 | try expect(1_2_3_4_5_6_7 == 1234567); |
| ... | @@ -334,6 +339,7 @@ test "comptime_int multi-limb partial shift right" { | ... | @@ -334,6 +339,7 @@ test "comptime_int multi-limb partial shift right" { |
| 334 | } | 339 | } |
| 335 | 340 | ||
| 336 | test "xor" { | 341 | test "xor" { |
| 342 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 337 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 343 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 338 | 344 | ||
| 339 | try test_xor(); | 345 | try test_xor(); |
| ... | @@ -382,6 +388,7 @@ fn not(comptime T: type, a: T) T { | ... | @@ -382,6 +388,7 @@ fn not(comptime T: type, a: T) T { |
| 382 | } | 388 | } |
| 383 | 389 | ||
| 384 | test "binary not" { | 390 | test "binary not" { |
| 391 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 385 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 392 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 386 | 393 | ||
| 387 | try expect(not(u0, 0) == 0); | 394 | try expect(not(u0, 0) == 0); |
| ... | @@ -421,6 +428,7 @@ test "binary not" { | ... | @@ -421,6 +428,7 @@ test "binary not" { |
| 421 | } | 428 | } |
| 422 | 429 | ||
| 423 | test "binary not big int <= 128 bits" { | 430 | test "binary not big int <= 128 bits" { |
| 431 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 424 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 432 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 425 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 433 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 426 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 434 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -456,7 +464,8 @@ test "division" { | ... | @@ -456,7 +464,8 @@ test "division" { |
| 456 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 464 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 457 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 465 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 458 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 466 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 459 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 467 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 468 | |||
| 460 | try testIntDivision(); | 469 | try testIntDivision(); |
| 461 | try comptime testIntDivision(); | 470 | try comptime testIntDivision(); |
| 462 | 471 | ||
| ... | @@ -629,7 +638,7 @@ test "large integer division" { | ... | @@ -629,7 +638,7 @@ test "large integer division" { |
| 629 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 638 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 630 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 639 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 631 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 640 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 632 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 641 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 633 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 642 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 634 | 643 | ||
| 635 | { | 644 | { |
| ... | @@ -650,7 +659,7 @@ test "division half-precision floats" { | ... | @@ -650,7 +659,7 @@ test "division half-precision floats" { |
| 650 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 659 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 651 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 660 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 652 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 661 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 653 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 662 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 654 | 663 | ||
| 655 | try testDivisionFP16(); | 664 | try testDivisionFP16(); |
| 656 | try comptime testDivisionFP16(); | 665 | try comptime testDivisionFP16(); |
| ... | @@ -737,6 +746,7 @@ fn testUnsignedNegationWrappingEval(x: u16) !void { | ... | @@ -737,6 +746,7 @@ fn testUnsignedNegationWrappingEval(x: u16) !void { |
| 737 | } | 746 | } |
| 738 | 747 | ||
| 739 | test "negation wrapping" { | 748 | test "negation wrapping" { |
| 749 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 740 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 750 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 741 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 751 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 742 | 752 | ||
| ... | @@ -750,6 +760,7 @@ fn negateWrap(comptime T: type, x: T) T { | ... | @@ -750,6 +760,7 @@ fn negateWrap(comptime T: type, x: T) T { |
| 750 | } | 760 | } |
| 751 | 761 | ||
| 752 | test "unsigned 64-bit division" { | 762 | test "unsigned 64-bit division" { |
| 763 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 753 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 764 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 754 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 765 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 755 | 766 | ||
| ... | @@ -791,7 +802,7 @@ fn testShrTrunc(x: u16) !void { | ... | @@ -791,7 +802,7 @@ fn testShrTrunc(x: u16) !void { |
| 791 | test "f128" { | 802 | test "f128" { |
| 792 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 803 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 793 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 804 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 794 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 805 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 795 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 806 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 796 | 807 | ||
| 797 | try test_f128(); | 808 | try test_f128(); |
| ... | @@ -817,6 +828,7 @@ fn should_not_be_zero(x: f128) !void { | ... | @@ -817,6 +828,7 @@ fn should_not_be_zero(x: f128) !void { |
| 817 | } | 828 | } |
| 818 | 829 | ||
| 819 | test "umax wrapped squaring" { | 830 | test "umax wrapped squaring" { |
| 831 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 820 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 832 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 821 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 833 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 822 | 834 | ||
| ... | @@ -873,6 +885,7 @@ test "umax wrapped squaring" { | ... | @@ -873,6 +885,7 @@ test "umax wrapped squaring" { |
| 873 | } | 885 | } |
| 874 | 886 | ||
| 875 | test "128-bit multiplication" { | 887 | test "128-bit multiplication" { |
| 888 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 876 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 889 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 877 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 890 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 878 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 891 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -905,6 +918,7 @@ fn testAddWithOverflow(comptime T: type, a: T, b: T, add: T, bit: u1) !void { | ... | @@ -905,6 +918,7 @@ fn testAddWithOverflow(comptime T: type, a: T, b: T, add: T, bit: u1) !void { |
| 905 | } | 918 | } |
| 906 | 919 | ||
| 907 | test "@addWithOverflow" { | 920 | test "@addWithOverflow" { |
| 921 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 908 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 922 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 909 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 923 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 910 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 924 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| ... | @@ -923,6 +937,7 @@ test "@addWithOverflow" { | ... | @@ -923,6 +937,7 @@ test "@addWithOverflow" { |
| 923 | } | 937 | } |
| 924 | 938 | ||
| 925 | test "@addWithOverflow <= 128 bits" { | 939 | test "@addWithOverflow <= 128 bits" { |
| 940 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 926 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 941 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 927 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 942 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 928 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 943 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -968,7 +983,7 @@ test "@addWithOverflow > 128 bits" { | ... | @@ -968,7 +983,7 @@ test "@addWithOverflow > 128 bits" { |
| 968 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 983 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 969 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 984 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 970 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 985 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 971 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 986 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 972 | 987 | ||
| 973 | try testAddWithOverflow(u129, 4, 105, 109, 0); | 988 | try testAddWithOverflow(u129, 4, 105, 109, 0); |
| 974 | try testAddWithOverflow(u129, 1000, 100, 1100, 0); | 989 | try testAddWithOverflow(u129, 1000, 100, 1100, 0); |
| ... | @@ -1008,6 +1023,7 @@ test "@addWithOverflow > 128 bits" { | ... | @@ -1008,6 +1023,7 @@ test "@addWithOverflow > 128 bits" { |
| 1008 | } | 1023 | } |
| 1009 | 1024 | ||
| 1010 | test "small int addition" { | 1025 | test "small int addition" { |
| 1026 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1011 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1027 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1012 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1028 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1013 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 1029 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| ... | @@ -1036,6 +1052,7 @@ fn testMulWithOverflow(comptime T: type, a: T, b: T, mul: T, bit: u1) !void { | ... | @@ -1036,6 +1052,7 @@ fn testMulWithOverflow(comptime T: type, a: T, b: T, mul: T, bit: u1) !void { |
| 1036 | } | 1052 | } |
| 1037 | 1053 | ||
| 1038 | test "basic @mulWithOverflow" { | 1054 | test "basic @mulWithOverflow" { |
| 1055 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1039 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1056 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1040 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1057 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1041 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 1058 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| ... | @@ -1048,6 +1065,7 @@ test "basic @mulWithOverflow" { | ... | @@ -1048,6 +1065,7 @@ test "basic @mulWithOverflow" { |
| 1048 | } | 1065 | } |
| 1049 | 1066 | ||
| 1050 | test "extensive @mulWithOverflow" { | 1067 | test "extensive @mulWithOverflow" { |
| 1068 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1051 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1069 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1052 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1070 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1053 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1071 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1087,6 +1105,7 @@ test "extensive @mulWithOverflow" { | ... | @@ -1087,6 +1105,7 @@ test "extensive @mulWithOverflow" { |
| 1087 | } | 1105 | } |
| 1088 | 1106 | ||
| 1089 | test "@mulWithOverflow bitsize > 32" { | 1107 | test "@mulWithOverflow bitsize > 32" { |
| 1108 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1090 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1109 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1091 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1110 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1092 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1111 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1123,6 +1142,7 @@ fn testMutiplyUnwrap(comptime T: type, wrapped_a: anyerror!T, comptime b: T, exp | ... | @@ -1123,6 +1142,7 @@ fn testMutiplyUnwrap(comptime T: type, wrapped_a: anyerror!T, comptime b: T, exp |
| 1123 | } | 1142 | } |
| 1124 | 1143 | ||
| 1125 | test "Multiply unwrap error * immediate" { | 1144 | test "Multiply unwrap error * immediate" { |
| 1145 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1126 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1146 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1127 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1147 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1128 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1148 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1139,7 +1159,7 @@ test "@mulWithOverflow bitsize 128 bits" { | ... | @@ -1139,7 +1159,7 @@ test "@mulWithOverflow bitsize 128 bits" { |
| 1139 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1159 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1140 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1160 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1141 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1161 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1142 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 1162 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 1143 | 1163 | ||
| 1144 | try testMulWithOverflow(u128, 3, 0x5555555555555555_5555555555555555, 0xffffffffffffffff_ffffffffffffffff, 0); | 1164 | try testMulWithOverflow(u128, 3, 0x5555555555555555_5555555555555555, 0xffffffffffffffff_ffffffffffffffff, 0); |
| 1145 | try testMulWithOverflow(u128, 3, 0x5555555555555555_5555555555555556, 2, 1); | 1165 | try testMulWithOverflow(u128, 3, 0x5555555555555555_5555555555555556, 2, 1); |
| ... | @@ -1162,7 +1182,7 @@ test "@mulWithOverflow bitsize 128 bits" { | ... | @@ -1162,7 +1182,7 @@ test "@mulWithOverflow bitsize 128 bits" { |
| 1162 | 1182 | ||
| 1163 | test "@mulWithOverflow > 128 bits" { | 1183 | test "@mulWithOverflow > 128 bits" { |
| 1164 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1184 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1165 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1185 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1166 | 1186 | ||
| 1167 | try testMulWithOverflow(u140, 0, maxInt(u140), 0, 0); | 1187 | try testMulWithOverflow(u140, 0, maxInt(u140), 0, 0); |
| 1168 | try testMulWithOverflow(u140, 1, maxInt(u140), maxInt(u140), 0); | 1188 | try testMulWithOverflow(u140, 1, maxInt(u140), maxInt(u140), 0); |
| ... | @@ -1191,7 +1211,7 @@ test "@mulWithOverflow > 128 bits" { | ... | @@ -1191,7 +1211,7 @@ test "@mulWithOverflow > 128 bits" { |
| 1191 | 1211 | ||
| 1192 | test "@mulWithOverflow bitsize 256 bits" { | 1212 | test "@mulWithOverflow bitsize 256 bits" { |
| 1193 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1213 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1194 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1214 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1195 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1215 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1196 | 1216 | ||
| 1197 | { | 1217 | { |
| ... | @@ -1235,6 +1255,7 @@ fn testSubWithOverflow(comptime T: type, a: T, b: T, sub: T, bit: u1) !void { | ... | @@ -1235,6 +1255,7 @@ fn testSubWithOverflow(comptime T: type, a: T, b: T, sub: T, bit: u1) !void { |
| 1235 | } | 1255 | } |
| 1236 | 1256 | ||
| 1237 | test "@subWithOverflow" { | 1257 | test "@subWithOverflow" { |
| 1258 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1238 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1259 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1239 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1260 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1240 | 1261 | ||
| ... | @@ -1251,6 +1272,7 @@ test "@subWithOverflow" { | ... | @@ -1251,6 +1272,7 @@ test "@subWithOverflow" { |
| 1251 | } | 1272 | } |
| 1252 | 1273 | ||
| 1253 | test "@subWithOverflow <= 128 bits" { | 1274 | test "@subWithOverflow <= 128 bits" { |
| 1275 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1254 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1276 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1255 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1277 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1256 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1278 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1294,7 +1316,7 @@ test "@subWithOverflow > 128 bits" { | ... | @@ -1294,7 +1316,7 @@ test "@subWithOverflow > 128 bits" { |
| 1294 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1316 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1295 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1317 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1296 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1318 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1297 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 1319 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 1298 | 1320 | ||
| 1299 | try testSubWithOverflow(u129, 4, 105, maxInt(u129) - 100, 1); | 1321 | try testSubWithOverflow(u129, 4, 105, maxInt(u129) - 100, 1); |
| 1300 | try testSubWithOverflow(u129, 1000, 100, 900, 0); | 1322 | try testSubWithOverflow(u129, 1000, 100, 900, 0); |
| ... | @@ -1340,7 +1362,7 @@ fn testShlWithOverflow(comptime T: type, a: T, b: math.Log2Int(T), shl: T, bit: | ... | @@ -1340,7 +1362,7 @@ fn testShlWithOverflow(comptime T: type, a: T, b: math.Log2Int(T), shl: T, bit: |
| 1340 | test "@shlWithOverflow" { | 1362 | test "@shlWithOverflow" { |
| 1341 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1363 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1342 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1364 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1343 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1365 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1344 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1366 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1345 | 1367 | ||
| 1346 | try testShlWithOverflow(u4, 2, 1, 4, 0); | 1368 | try testShlWithOverflow(u4, 2, 1, 4, 0); |
| ... | @@ -1359,7 +1381,7 @@ test "@shlWithOverflow" { | ... | @@ -1359,7 +1381,7 @@ test "@shlWithOverflow" { |
| 1359 | test "@shlWithOverflow > 64 bits" { | 1381 | test "@shlWithOverflow > 64 bits" { |
| 1360 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1382 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1361 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1383 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1362 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1384 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1363 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1385 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1364 | 1386 | ||
| 1365 | try testShlWithOverflow(u65, 0x0_0100_0000_0000_0000, 7, 0x0_8000_0000_0000_0000, 0); | 1387 | try testShlWithOverflow(u65, 0x0_0100_0000_0000_0000, 7, 0x0_8000_0000_0000_0000, 0); |
| ... | @@ -1385,7 +1407,7 @@ test "@shlWithOverflow > 64 bits" { | ... | @@ -1385,7 +1407,7 @@ test "@shlWithOverflow > 64 bits" { |
| 1385 | 1407 | ||
| 1386 | test "@shlWithOverflow > 128 bits" { | 1408 | test "@shlWithOverflow > 128 bits" { |
| 1387 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1409 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1388 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1410 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1389 | 1411 | ||
| 1390 | try testShlWithOverflow(u140, 1 << 100, 20, 1 << 120, 0); | 1412 | try testShlWithOverflow(u140, 1 << 100, 20, 1 << 120, 0); |
| 1391 | try testShlWithOverflow(u140, 1 << 100, 40, 0, 1); | 1413 | try testShlWithOverflow(u140, 1 << 100, 40, 0, 1); |
| ... | @@ -1413,6 +1435,7 @@ fn testAnd(comptime T: type, a: T, b: T, expected: T) !void { | ... | @@ -1413,6 +1435,7 @@ fn testAnd(comptime T: type, a: T, b: T, expected: T) !void { |
| 1413 | } | 1435 | } |
| 1414 | 1436 | ||
| 1415 | test "and > 128 bits" { | 1437 | test "and > 128 bits" { |
| 1438 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1416 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1439 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1417 | 1440 | ||
| 1418 | try testAnd(u140, (1 << 139) | (1 << 70) | 0xaa, (1 << 139) | (1 << 69) | 0xcc, (1 << 139) | 0x88); | 1441 | try testAnd(u140, (1 << 139) | (1 << 70) | 0xaa, (1 << 139) | (1 << 69) | 0xcc, (1 << 139) | 0x88); |
| ... | @@ -1441,6 +1464,7 @@ fn testOr(comptime T: type, a: T, b: T, expected: T) !void { | ... | @@ -1441,6 +1464,7 @@ fn testOr(comptime T: type, a: T, b: T, expected: T) !void { |
| 1441 | } | 1464 | } |
| 1442 | 1465 | ||
| 1443 | test "or > 128 bits" { | 1466 | test "or > 128 bits" { |
| 1467 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1444 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1468 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1445 | 1469 | ||
| 1446 | try testOr(u140, 0, 1 << 139, 1 << 139); | 1470 | try testOr(u140, 0, 1 << 139, 1 << 139); |
| ... | @@ -1469,6 +1493,7 @@ fn testXor(comptime T: type, a: T, b: T, expected: T) !void { | ... | @@ -1469,6 +1493,7 @@ fn testXor(comptime T: type, a: T, b: T, expected: T) !void { |
| 1469 | } | 1493 | } |
| 1470 | 1494 | ||
| 1471 | test "xor > 128 bits" { | 1495 | test "xor > 128 bits" { |
| 1496 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1472 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1497 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1473 | 1498 | ||
| 1474 | try testXor(u140, 0, maxInt(u140), maxInt(u140)); | 1499 | try testXor(u140, 0, maxInt(u140), maxInt(u140)); |
| ... | @@ -1497,6 +1522,7 @@ fn testNot(comptime T: type, a: T, expected: T) !void { | ... | @@ -1497,6 +1522,7 @@ fn testNot(comptime T: type, a: T, expected: T) !void { |
| 1497 | } | 1522 | } |
| 1498 | 1523 | ||
| 1499 | test "not > 128 bits" { | 1524 | test "not > 128 bits" { |
| 1525 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1500 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1526 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1501 | 1527 | ||
| 1502 | try testNot(u140, 0, maxInt(u140)); | 1528 | try testNot(u140, 0, maxInt(u140)); |
| ... | @@ -1525,6 +1551,7 @@ fn testShl(comptime T: type, a: T, b: std.math.Log2Int(T), expected: T) !void { | ... | @@ -1525,6 +1551,7 @@ fn testShl(comptime T: type, a: T, b: std.math.Log2Int(T), expected: T) !void { |
| 1525 | } | 1551 | } |
| 1526 | 1552 | ||
| 1527 | test "shl > 128 bits" { | 1553 | test "shl > 128 bits" { |
| 1554 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1528 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1555 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1529 | 1556 | ||
| 1530 | try testShl(u140, 1 << 5, 10, 1 << 15); | 1557 | try testShl(u140, 1 << 5, 10, 1 << 15); |
| ... | @@ -1553,6 +1580,7 @@ fn testShr(comptime T: type, a: T, b: std.math.Log2Int(T), expected: T) !void { | ... | @@ -1553,6 +1580,7 @@ fn testShr(comptime T: type, a: T, b: std.math.Log2Int(T), expected: T) !void { |
| 1553 | } | 1580 | } |
| 1554 | 1581 | ||
| 1555 | test "shr > 128 bits" { | 1582 | test "shr > 128 bits" { |
| 1583 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1556 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1584 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1557 | 1585 | ||
| 1558 | try testShr(u140, 1 << 139, 39, 1 << 100); | 1586 | try testShr(u140, 1 << 139, 39, 1 << 100); |
| ... | @@ -1582,7 +1610,7 @@ fn testClz(comptime T: type, a: T, expected: u16) !void { | ... | @@ -1582,7 +1610,7 @@ fn testClz(comptime T: type, a: T, expected: u16) !void { |
| 1582 | 1610 | ||
| 1583 | test "@clz > 128 bits" { | 1611 | test "@clz > 128 bits" { |
| 1584 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1612 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1585 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1613 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1586 | 1614 | ||
| 1587 | try testClz(u140, 0, 140); | 1615 | try testClz(u140, 0, 140); |
| 1588 | try testClz(u140, 1 << 139, 0); | 1616 | try testClz(u140, 1 << 139, 0); |
| ... | @@ -1611,7 +1639,7 @@ fn testCtz(comptime T: type, a: T, expected: u16) !void { | ... | @@ -1611,7 +1639,7 @@ fn testCtz(comptime T: type, a: T, expected: u16) !void { |
| 1611 | 1639 | ||
| 1612 | test "@ctz > 128 bits" { | 1640 | test "@ctz > 128 bits" { |
| 1613 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1641 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1614 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1642 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1615 | 1643 | ||
| 1616 | try testCtz(u140, 0, 140); | 1644 | try testCtz(u140, 0, 140); |
| 1617 | try testCtz(u140, 1 << 139, 139); | 1645 | try testCtz(u140, 1 << 139, 139); |
| ... | @@ -1640,7 +1668,7 @@ fn testPopCount(comptime T: type, a: T, expected: u16) !void { | ... | @@ -1640,7 +1668,7 @@ fn testPopCount(comptime T: type, a: T, expected: u16) !void { |
| 1640 | 1668 | ||
| 1641 | test "@popCount > 128 bits" { | 1669 | test "@popCount > 128 bits" { |
| 1642 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1670 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1643 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1671 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1644 | 1672 | ||
| 1645 | try testPopCount(u140, 0, 0); | 1673 | try testPopCount(u140, 0, 0); |
| 1646 | try testPopCount(u140, maxInt(u140), 140); | 1674 | try testPopCount(u140, maxInt(u140), 140); |
| ... | @@ -1669,7 +1697,7 @@ fn testBitReverse(comptime T: type, a: T, expected: T) !void { | ... | @@ -1669,7 +1697,7 @@ fn testBitReverse(comptime T: type, a: T, expected: T) !void { |
| 1669 | 1697 | ||
| 1670 | test "@bitReverse > 128 bits" { | 1698 | test "@bitReverse > 128 bits" { |
| 1671 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1699 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1672 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1700 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1673 | 1701 | ||
| 1674 | try testBitReverse(u140, 1 << 139, 1); | 1702 | try testBitReverse(u140, 1 << 139, 1); |
| 1675 | try testBitReverse(u140, 1 << 70, 1 << 69); | 1703 | try testBitReverse(u140, 1 << 70, 1 << 69); |
| ... | @@ -1698,7 +1726,7 @@ fn testByteSwap(comptime T: type, a: T, expected: T) !void { | ... | @@ -1698,7 +1726,7 @@ fn testByteSwap(comptime T: type, a: T, expected: T) !void { |
| 1698 | 1726 | ||
| 1699 | test "@byteSwap > 128 bits" { | 1727 | test "@byteSwap > 128 bits" { |
| 1700 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1728 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1701 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1729 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1702 | 1730 | ||
| 1703 | try testByteSwap(u144, 1 << 136, 1); | 1731 | try testByteSwap(u144, 1 << 136, 1); |
| 1704 | try testByteSwap(u144, 1, 1 << 136); | 1732 | try testByteSwap(u144, 1, 1 << 136); |
| ... | @@ -1727,7 +1755,7 @@ fn testMax(comptime T: type, a: T, b: T, expected: T) !void { | ... | @@ -1727,7 +1755,7 @@ fn testMax(comptime T: type, a: T, b: T, expected: T) !void { |
| 1727 | 1755 | ||
| 1728 | test "@max > 128 bits" { | 1756 | test "@max > 128 bits" { |
| 1729 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1757 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1730 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1758 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1731 | 1759 | ||
| 1732 | try testMax(u140, 0, maxInt(u140), maxInt(u140)); | 1760 | try testMax(u140, 0, maxInt(u140), maxInt(u140)); |
| 1733 | try testMax(u140, 1 << 139, 1 << 138, 1 << 139); | 1761 | try testMax(u140, 1 << 139, 1 << 138, 1 << 139); |
| ... | @@ -1756,7 +1784,7 @@ fn testMin(comptime T: type, a: T, b: T, expected: T) !void { | ... | @@ -1756,7 +1784,7 @@ fn testMin(comptime T: type, a: T, b: T, expected: T) !void { |
| 1756 | 1784 | ||
| 1757 | test "@min > 128 bits" { | 1785 | test "@min > 128 bits" { |
| 1758 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1786 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1759 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1787 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1760 | 1788 | ||
| 1761 | try testMin(u140, 0, maxInt(u140), 0); | 1789 | try testMin(u140, 0, maxInt(u140), 0); |
| 1762 | try testMin(u140, 1 << 139, 1 << 138, 1 << 138); | 1790 | try testMin(u140, 1 << 139, 1 << 138, 1 << 138); |
| ... | @@ -1784,6 +1812,7 @@ fn testAbs(comptime T: type, a: T, expected: anytype) !void { | ... | @@ -1784,6 +1812,7 @@ fn testAbs(comptime T: type, a: T, expected: anytype) !void { |
| 1784 | } | 1812 | } |
| 1785 | 1813 | ||
| 1786 | test "@abs > 128 bits" { | 1814 | test "@abs > 128 bits" { |
| 1815 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1787 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1816 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1788 | 1817 | ||
| 1789 | try testAbs(u140, 0, 0); | 1818 | try testAbs(u140, 0, 0); |
| ... | @@ -1808,7 +1837,7 @@ fn testRem(comptime T: type, numerator: T, denominator: T, expected: T) !void { | ... | @@ -1808,7 +1837,7 @@ fn testRem(comptime T: type, numerator: T, denominator: T, expected: T) !void { |
| 1808 | 1837 | ||
| 1809 | test "@rem > 128 bits" { | 1838 | test "@rem > 128 bits" { |
| 1810 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1839 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1811 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1840 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1812 | 1841 | ||
| 1813 | try testRem(u140, 0, maxInt(u140), 0); | 1842 | try testRem(u140, 0, maxInt(u140), 0); |
| 1814 | try testRem(u140, maxInt(u140), maxInt(u140), 0); | 1843 | try testRem(u140, maxInt(u140), maxInt(u140), 0); |
| ... | @@ -1835,7 +1864,7 @@ fn testMod(comptime T: type, numerator: T, denominator: T, expected: T) !void { | ... | @@ -1835,7 +1864,7 @@ fn testMod(comptime T: type, numerator: T, denominator: T, expected: T) !void { |
| 1835 | 1864 | ||
| 1836 | test "@mod > 128 bits" { | 1865 | test "@mod > 128 bits" { |
| 1837 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1866 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1838 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1867 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1839 | 1868 | ||
| 1840 | try testMod(u140, 0, maxInt(u140), 0); | 1869 | try testMod(u140, 0, maxInt(u140), 0); |
| 1841 | try testMod(u140, maxInt(u140), maxInt(u140), 0); | 1870 | try testMod(u140, maxInt(u140), maxInt(u140), 0); |
| ... | @@ -1862,7 +1891,7 @@ fn testDivFloor(comptime T: type, numerator: T, denominator: T, expected: T) !vo | ... | @@ -1862,7 +1891,7 @@ fn testDivFloor(comptime T: type, numerator: T, denominator: T, expected: T) !vo |
| 1862 | 1891 | ||
| 1863 | test "@divFloor > 128 bits" { | 1892 | test "@divFloor > 128 bits" { |
| 1864 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1893 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1865 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1894 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1866 | 1895 | ||
| 1867 | try testDivFloor(u140, 0, maxInt(u140), 0); | 1896 | try testDivFloor(u140, 0, maxInt(u140), 0); |
| 1868 | try testDivFloor(u140, maxInt(u140), maxInt(u140), 1); | 1897 | try testDivFloor(u140, maxInt(u140), maxInt(u140), 1); |
| ... | @@ -1890,7 +1919,7 @@ fn testDivCeil(comptime T: type, numerator: T, denominator: T, expected: T) !voi | ... | @@ -1890,7 +1919,7 @@ fn testDivCeil(comptime T: type, numerator: T, denominator: T, expected: T) !voi |
| 1890 | 1919 | ||
| 1891 | test "@divCeil > 128 bits" { | 1920 | test "@divCeil > 128 bits" { |
| 1892 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1921 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1893 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1922 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1894 | 1923 | ||
| 1895 | try testDivCeil(u140, 0, maxInt(u140), 0); | 1924 | try testDivCeil(u140, 0, maxInt(u140), 0); |
| 1896 | try testDivCeil(u140, maxInt(u140), maxInt(u140), 1); | 1925 | try testDivCeil(u140, maxInt(u140), maxInt(u140), 1); |
| ... | @@ -1918,7 +1947,7 @@ fn testDivTrunc(comptime T: type, numerator: T, denominator: T, expected: T) !vo | ... | @@ -1918,7 +1947,7 @@ fn testDivTrunc(comptime T: type, numerator: T, denominator: T, expected: T) !vo |
| 1918 | 1947 | ||
| 1919 | test "@divTrunc > 128 bits" { | 1948 | test "@divTrunc > 128 bits" { |
| 1920 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1949 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1921 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1950 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1922 | 1951 | ||
| 1923 | try testDivTrunc(u140, 0, maxInt(u140), 0); | 1952 | try testDivTrunc(u140, 0, maxInt(u140), 0); |
| 1924 | try testDivTrunc(u140, maxInt(u140), maxInt(u140), 1); | 1953 | try testDivTrunc(u140, maxInt(u140), maxInt(u140), 1); |
| ... | @@ -1941,6 +1970,8 @@ test "@divTrunc > 128 bits" { | ... | @@ -1941,6 +1970,8 @@ test "@divTrunc > 128 bits" { |
| 1941 | } | 1970 | } |
| 1942 | 1971 | ||
| 1943 | test "overflow arithmetic with u0 values" { | 1972 | test "overflow arithmetic with u0 values" { |
| 1973 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1974 | |||
| 1944 | { | 1975 | { |
| 1945 | var a: u0 = 0; | 1976 | var a: u0 = 0; |
| 1946 | _ = &a; | 1977 | _ = &a; |
| ... | @@ -1972,6 +2003,8 @@ test "overflow arithmetic with u0 values" { | ... | @@ -1972,6 +2003,8 @@ test "overflow arithmetic with u0 values" { |
| 1972 | } | 2003 | } |
| 1973 | 2004 | ||
| 1974 | test "allow signed integer division/remainder when values are comptime-known and positive or exact" { | 2005 | test "allow signed integer division/remainder when values are comptime-known and positive or exact" { |
| 2006 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2007 | |||
| 1975 | try expect(5 / 3 == 1); | 2008 | try expect(5 / 3 == 1); |
| 1976 | try expect(-5 / -3 == 1); | 2009 | try expect(-5 / -3 == 1); |
| 1977 | try expect(-6 / 3 == -2); | 2010 | try expect(-6 / 3 == -2); |
| ... | @@ -1983,7 +2016,7 @@ test "allow signed integer division/remainder when values are comptime-known and | ... | @@ -1983,7 +2016,7 @@ test "allow signed integer division/remainder when values are comptime-known and |
| 1983 | test "quad hex float literal parsing accurate" { | 2016 | test "quad hex float literal parsing accurate" { |
| 1984 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2017 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1985 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2018 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1986 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2019 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1987 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2020 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1988 | 2021 | ||
| 1989 | const a: f128 = 0x1.1111222233334444555566667777p+0; | 2022 | const a: f128 = 0x1.1111222233334444555566667777p+0; |
| ... | @@ -2089,6 +2122,7 @@ fn testShlTrunc(x: u16) !void { | ... | @@ -2089,6 +2122,7 @@ fn testShlTrunc(x: u16) !void { |
| 2089 | } | 2122 | } |
| 2090 | 2123 | ||
| 2091 | test "exact shift left" { | 2124 | test "exact shift left" { |
| 2125 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2092 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2126 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2093 | 2127 | ||
| 2094 | try testShlExact(0b00110101); | 2128 | try testShlExact(0b00110101); |
| ... | @@ -2141,7 +2175,7 @@ test "remainder division" { | ... | @@ -2141,7 +2175,7 @@ test "remainder division" { |
| 2141 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2175 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2142 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2176 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2143 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2177 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2144 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2178 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2145 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2179 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2146 | 2180 | ||
| 2147 | if (builtin.zig_backend == .stage2_x86_64 and builtin.object_format == .coff and builtin.abi != .gnu) return error.SkipZigTest; | 2181 | if (builtin.zig_backend == .stage2_x86_64 and builtin.object_format == .coff and builtin.abi != .gnu) return error.SkipZigTest; |
| ... | @@ -2174,7 +2208,7 @@ fn remdivOne(comptime T: type, a: T, b: T, c: T) !void { | ... | @@ -2174,7 +2208,7 @@ fn remdivOne(comptime T: type, a: T, b: T, c: T) !void { |
| 2174 | test "float remainder division using @rem" { | 2208 | test "float remainder division using @rem" { |
| 2175 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2209 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2176 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2210 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2177 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2211 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2178 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2212 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2179 | 2213 | ||
| 2180 | try comptime frem(f16); | 2214 | try comptime frem(f16); |
| ... | @@ -2216,7 +2250,7 @@ test "float modulo division using @mod" { | ... | @@ -2216,7 +2250,7 @@ test "float modulo division using @mod" { |
| 2216 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2250 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2217 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2251 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2218 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2252 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2219 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2253 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2220 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2254 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2221 | 2255 | ||
| 2222 | if (builtin.zig_backend == .stage2_x86_64 and builtin.object_format == .coff and builtin.abi != .gnu) return error.SkipZigTest; | 2256 | if (builtin.zig_backend == .stage2_x86_64 and builtin.object_format == .coff and builtin.abi != .gnu) return error.SkipZigTest; |
| ... | @@ -2284,7 +2318,7 @@ test "@round f32/f64" { | ... | @@ -2284,7 +2318,7 @@ test "@round f32/f64" { |
| 2284 | test "@round f80" { | 2318 | test "@round f80" { |
| 2285 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2319 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2286 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2320 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2287 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2321 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2288 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2322 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2289 | 2323 | ||
| 2290 | try testRound(f80, 12.0); | 2324 | try testRound(f80, 12.0); |
| ... | @@ -2294,7 +2328,7 @@ test "@round f80" { | ... | @@ -2294,7 +2328,7 @@ test "@round f80" { |
| 2294 | test "@round f128" { | 2328 | test "@round f128" { |
| 2295 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2329 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2296 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2330 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2297 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2331 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2298 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2332 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2299 | 2333 | ||
| 2300 | try testRound(f128, 12.0); | 2334 | try testRound(f128, 12.0); |
| ... | @@ -2312,7 +2346,7 @@ test "vector integer addition" { | ... | @@ -2312,7 +2346,7 @@ test "vector integer addition" { |
| 2312 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2346 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2313 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2347 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2314 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2348 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2315 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2349 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2316 | 2350 | ||
| 2317 | const S = struct { | 2351 | const S = struct { |
| 2318 | fn doTheTest() !void { | 2352 | fn doTheTest() !void { |
| ... | @@ -2332,7 +2366,7 @@ test "vector integer addition" { | ... | @@ -2332,7 +2366,7 @@ test "vector integer addition" { |
| 2332 | test "NaN comparison" { | 2366 | test "NaN comparison" { |
| 2333 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2367 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2334 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2368 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2335 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2369 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2336 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2370 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2337 | 2371 | ||
| 2338 | try testNanEqNan(f16); | 2372 | try testNanEqNan(f16); |
| ... | @@ -2348,7 +2382,7 @@ test "NaN comparison" { | ... | @@ -2348,7 +2382,7 @@ test "NaN comparison" { |
| 2348 | test "NaN comparison f80" { | 2382 | test "NaN comparison f80" { |
| 2349 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2383 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2350 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2384 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2351 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2385 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2352 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2386 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2353 | 2387 | ||
| 2354 | try testNanEqNan(f80); | 2388 | try testNanEqNan(f80); |
| ... | @@ -2372,7 +2406,7 @@ test "vector comparison" { | ... | @@ -2372,7 +2406,7 @@ test "vector comparison" { |
| 2372 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2406 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2373 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2407 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2374 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2408 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2375 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2409 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2376 | 2410 | ||
| 2377 | const S = struct { | 2411 | const S = struct { |
| 2378 | fn doTheTest() !void { | 2412 | fn doTheTest() !void { |
| ... | @@ -2401,7 +2435,7 @@ test "compare undefined literal with comptime_int" { | ... | @@ -2401,7 +2435,7 @@ test "compare undefined literal with comptime_int" { |
| 2401 | test "signed zeros are represented properly" { | 2435 | test "signed zeros are represented properly" { |
| 2402 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2436 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2403 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2437 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2404 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2438 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2405 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2439 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2406 | 2440 | ||
| 2407 | const S = struct { | 2441 | const S = struct { |
| ... | @@ -2463,7 +2497,7 @@ test "@clz works on both vector and scalar inputs" { | ... | @@ -2463,7 +2497,7 @@ test "@clz works on both vector and scalar inputs" { |
| 2463 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2497 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2464 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2498 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2465 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2499 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2466 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2500 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2467 | 2501 | ||
| 2468 | var x: u32 = 0x1; | 2502 | var x: u32 = 0x1; |
| 2469 | _ = &x; | 2503 | _ = &x; |
| ... | @@ -2478,7 +2512,7 @@ test "@clz works on both vector and scalar inputs" { | ... | @@ -2478,7 +2512,7 @@ test "@clz works on both vector and scalar inputs" { |
| 2478 | test "runtime comparison to NaN is comptime-known" { | 2512 | test "runtime comparison to NaN is comptime-known" { |
| 2479 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2513 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2480 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2514 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2481 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2515 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2482 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2516 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2483 | 2517 | ||
| 2484 | const S = struct { | 2518 | const S = struct { |
| ... | @@ -2534,7 +2568,7 @@ test "float divide by zero" { | ... | @@ -2534,7 +2568,7 @@ test "float divide by zero" { |
| 2534 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2568 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2535 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2569 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2536 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2570 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2537 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2571 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2538 | 2572 | ||
| 2539 | if (builtin.zig_backend == .stage2_x86_64 and builtin.object_format == .coff and builtin.abi != .gnu) return error.SkipZigTest; | 2573 | if (builtin.zig_backend == .stage2_x86_64 and builtin.object_format == .coff and builtin.abi != .gnu) return error.SkipZigTest; |
| 2540 | 2574 | ||
| ... | @@ -2569,7 +2603,7 @@ test "partially-runtime integer vector division would be illegal if vector eleme | ... | @@ -2569,7 +2603,7 @@ test "partially-runtime integer vector division would be illegal if vector eleme |
| 2569 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2603 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2570 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2604 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2571 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2605 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2572 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2606 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2573 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; | 2607 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| 2574 | 2608 | ||
| 2575 | var lhs: @Vector(2, i8) = .{ -128, 5 }; | 2609 | var lhs: @Vector(2, i8) = .{ -128, 5 }; |
| ... | @@ -2593,6 +2627,7 @@ test "partially-runtime integer vector division would be illegal if vector eleme | ... | @@ -2593,6 +2627,7 @@ test "partially-runtime integer vector division would be illegal if vector eleme |
| 2593 | } | 2627 | } |
| 2594 | 2628 | ||
| 2595 | test "float vector division of comptime zero by runtime nan is nan" { | 2629 | test "float vector division of comptime zero by runtime nan is nan" { |
| 2630 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2596 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2631 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2597 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2632 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2598 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2633 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -2613,6 +2648,7 @@ test "float vector multiplication of comptime zero by runtime nan is nan" { | ... | @@ -2613,6 +2648,7 @@ test "float vector multiplication of comptime zero by runtime nan is nan" { |
| 2613 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2648 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2614 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2649 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2615 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2650 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2651 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Fails on lavapipe | ||
| 2616 | 2652 | ||
| 2617 | const ct_zero: @Vector(1, f32) = .{0}; | 2653 | const ct_zero: @Vector(1, f32) = .{0}; |
| 2618 | var rt_nan: @Vector(1, f32) = .{math.nan(f32)}; | 2654 | var rt_nan: @Vector(1, f32) = .{math.nan(f32)}; |
| ... | @@ -2649,7 +2685,7 @@ test "comptime float vector multiplication of zero by nan is nan" { | ... | @@ -2649,7 +2685,7 @@ test "comptime float vector multiplication of zero by nan is nan" { |
| 2649 | } | 2685 | } |
| 2650 | 2686 | ||
| 2651 | test "i96 operations" { | 2687 | test "i96 operations" { |
| 2652 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2688 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2653 | 2689 | ||
| 2654 | // This is coverage for some stuff used by std.Io timestamps, to catch | 2690 | // This is coverage for some stuff used by std.Io timestamps, to catch |
| 2655 | // issues earlier than bootstrapping. | 2691 | // issues earlier than bootstrapping. |
test/behavior/maximum_minimum.zig+16-7| ... | @@ -6,6 +6,7 @@ const expect = std.testing.expect; | ... | @@ -6,6 +6,7 @@ const expect = std.testing.expect; |
| 6 | const expectEqual = std.testing.expectEqual; | 6 | const expectEqual = std.testing.expectEqual; |
| 7 | 7 | ||
| 8 | test "@max" { | 8 | test "@max" { |
| 9 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 10 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 11 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 11 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 12 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -31,7 +32,7 @@ test "@max on vectors" { | ... | @@ -31,7 +32,7 @@ test "@max on vectors" { |
| 31 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 32 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 32 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 33 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 33 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 34 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 34 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 35 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 35 | 36 | ||
| 36 | const S = struct { | 37 | const S = struct { |
| 37 | fn doTheTest() !void { | 38 | fn doTheTest() !void { |
| ... | @@ -62,6 +63,7 @@ test "@min" { | ... | @@ -62,6 +63,7 @@ test "@min" { |
| 62 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 63 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 63 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 64 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 64 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 65 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 66 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Fails on lavapipe | ||
| 65 | 67 | ||
| 66 | const S = struct { | 68 | const S = struct { |
| 67 | fn doTheTest() !void { | 69 | fn doTheTest() !void { |
| ... | @@ -84,7 +86,7 @@ test "@min for vectors" { | ... | @@ -84,7 +86,7 @@ test "@min for vectors" { |
| 84 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 86 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 85 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 87 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 86 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 88 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 87 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 89 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 88 | 90 | ||
| 89 | const S = struct { | 91 | const S = struct { |
| 90 | fn doTheTest() !void { | 92 | fn doTheTest() !void { |
| ... | @@ -114,7 +116,7 @@ test "@min for vectors" { | ... | @@ -114,7 +116,7 @@ test "@min for vectors" { |
| 114 | test "@min/max for floats" { | 116 | test "@min/max for floats" { |
| 115 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 117 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 116 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 118 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 117 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 119 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 118 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 120 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 119 | 121 | ||
| 120 | const S = struct { | 122 | const S = struct { |
| ... | @@ -151,6 +153,8 @@ test "@min/@max on lazy values" { | ... | @@ -151,6 +153,8 @@ test "@min/@max on lazy values" { |
| 151 | } | 153 | } |
| 152 | 154 | ||
| 153 | test "@min/@max more than two arguments" { | 155 | test "@min/@max more than two arguments" { |
| 156 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 157 | |||
| 154 | const x: u32 = 30; | 158 | const x: u32 = 30; |
| 155 | const y: u32 = 10; | 159 | const y: u32 = 10; |
| 156 | const z: u32 = 20; | 160 | const z: u32 = 20; |
| ... | @@ -159,7 +163,7 @@ test "@min/@max more than two arguments" { | ... | @@ -159,7 +163,7 @@ test "@min/@max more than two arguments" { |
| 159 | } | 163 | } |
| 160 | 164 | ||
| 161 | test "@min/@max more than two vector arguments" { | 165 | test "@min/@max more than two vector arguments" { |
| 162 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 166 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 163 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 167 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 164 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 168 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 165 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 169 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -173,6 +177,7 @@ test "@min/@max more than two vector arguments" { | ... | @@ -173,6 +177,7 @@ test "@min/@max more than two vector arguments" { |
| 173 | } | 177 | } |
| 174 | 178 | ||
| 175 | test "@min/@max notices bounds" { | 179 | test "@min/@max notices bounds" { |
| 180 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 176 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 181 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 177 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 182 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 178 | 183 | ||
| ... | @@ -189,7 +194,7 @@ test "@min/@max notices bounds" { | ... | @@ -189,7 +194,7 @@ test "@min/@max notices bounds" { |
| 189 | } | 194 | } |
| 190 | 195 | ||
| 191 | test "@min/@max notices vector bounds" { | 196 | test "@min/@max notices vector bounds" { |
| 192 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 197 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 193 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 198 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 194 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 199 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 195 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 200 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -221,6 +226,7 @@ test "@min/@max on comptime_int" { | ... | @@ -221,6 +226,7 @@ test "@min/@max on comptime_int" { |
| 221 | } | 226 | } |
| 222 | 227 | ||
| 223 | test "@min/@max notices bounds from types" { | 228 | test "@min/@max notices bounds from types" { |
| 229 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 224 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 230 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 225 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 231 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 226 | 232 | ||
| ... | @@ -240,7 +246,7 @@ test "@min/@max notices bounds from types" { | ... | @@ -240,7 +246,7 @@ test "@min/@max notices bounds from types" { |
| 240 | } | 246 | } |
| 241 | 247 | ||
| 242 | test "@min/@max notices bounds from vector types" { | 248 | test "@min/@max notices bounds from vector types" { |
| 243 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 249 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 244 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 250 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 245 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 251 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 246 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 252 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -281,6 +287,7 @@ test "@min/@max notices bounds from types when comptime-known value is undef" { | ... | @@ -281,6 +287,7 @@ test "@min/@max notices bounds from types when comptime-known value is undef" { |
| 281 | } | 287 | } |
| 282 | 288 | ||
| 283 | test "@min/@max notices bounds from vector types when element of comptime-known vector is undef" { | 289 | test "@min/@max notices bounds from vector types when element of comptime-known vector is undef" { |
| 290 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 284 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 291 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 285 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 292 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 286 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 293 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -303,6 +310,8 @@ test "@min/@max notices bounds from vector types when element of comptime-known | ... | @@ -303,6 +310,8 @@ test "@min/@max notices bounds from vector types when element of comptime-known |
| 303 | } | 310 | } |
| 304 | 311 | ||
| 305 | test "@min/@max of signed and unsigned runtime integers" { | 312 | test "@min/@max of signed and unsigned runtime integers" { |
| 313 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 314 | |||
| 306 | var x: i32 = -1; | 315 | var x: i32 = -1; |
| 307 | var y: u31 = 1; | 316 | var y: u31 = 1; |
| 308 | _ = .{ &x, &y }; | 317 | _ = .{ &x, &y }; |
| ... | @@ -348,7 +357,7 @@ test "@min/@max with runtime signed and unsigned integers of same size" { | ... | @@ -348,7 +357,7 @@ test "@min/@max with runtime signed and unsigned integers of same size" { |
| 348 | } | 357 | } |
| 349 | 358 | ||
| 350 | test "@min/@max with runtime vectors of signed and unsigned integers of same size" { | 359 | test "@min/@max with runtime vectors of signed and unsigned integers of same size" { |
| 351 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 360 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 352 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 361 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 353 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 362 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 354 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 363 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
test/behavior/member_func.zig+2-2| ... | @@ -29,7 +29,7 @@ const HasFuncs = struct { | ... | @@ -29,7 +29,7 @@ const HasFuncs = struct { |
| 29 | test "standard field calls" { | 29 | test "standard field calls" { |
| 30 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 30 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 31 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 31 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 32 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 32 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 33 | 33 | ||
| 34 | try expect(HasFuncs.one(0) == 1); | 34 | try expect(HasFuncs.one(0) == 1); |
| 35 | try expect(HasFuncs.two(0) == 2); | 35 | try expect(HasFuncs.two(0) == 2); |
| ... | @@ -72,7 +72,7 @@ test "standard field calls" { | ... | @@ -72,7 +72,7 @@ test "standard field calls" { |
| 72 | test "@field field calls" { | 72 | test "@field field calls" { |
| 73 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 73 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 74 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 74 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 75 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 75 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 76 | 76 | ||
| 77 | try expect(@field(HasFuncs, "one")(0) == 1); | 77 | try expect(@field(HasFuncs, "one")(0) == 1); |
| 78 | try expect(@field(HasFuncs, "two")(0) == 2); | 78 | try expect(@field(HasFuncs, "two")(0) == 2); |
test/behavior/memcpy.zig+9-7| ... | @@ -6,7 +6,7 @@ const assert = std.debug.assert; | ... | @@ -6,7 +6,7 @@ const assert = std.debug.assert; |
| 6 | test "memcpy and memset intrinsics" { | 6 | test "memcpy and memset intrinsics" { |
| 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; // TODO | 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 9 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 9 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 10 | 10 | ||
| 11 | try testMemcpyMemset(); | 11 | try testMemcpyMemset(); |
| 12 | try comptime testMemcpyMemset(); | 12 | try comptime testMemcpyMemset(); |
| ... | @@ -27,7 +27,7 @@ fn testMemcpyMemset() !void { | ... | @@ -27,7 +27,7 @@ fn testMemcpyMemset() !void { |
| 27 | test "@memcpy with both operands single-ptr-to-array, one is null-terminated" { | 27 | test "@memcpy with both operands single-ptr-to-array, one is null-terminated" { |
| 28 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 28 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 29 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 29 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 30 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 30 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 31 | 31 | ||
| 32 | try testMemcpyBothSinglePtrArrayOneIsNullTerminated(); | 32 | try testMemcpyBothSinglePtrArrayOneIsNullTerminated(); |
| 33 | try comptime testMemcpyBothSinglePtrArrayOneIsNullTerminated(); | 33 | try comptime testMemcpyBothSinglePtrArrayOneIsNullTerminated(); |
| ... | @@ -47,7 +47,7 @@ fn testMemcpyBothSinglePtrArrayOneIsNullTerminated() !void { | ... | @@ -47,7 +47,7 @@ fn testMemcpyBothSinglePtrArrayOneIsNullTerminated() !void { |
| 47 | test "@memcpy dest many pointer" { | 47 | test "@memcpy dest many pointer" { |
| 48 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 48 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 49 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 49 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 50 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 50 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 51 | 51 | ||
| 52 | try testMemcpyDestManyPtr(); | 52 | try testMemcpyDestManyPtr(); |
| 53 | try comptime testMemcpyDestManyPtr(); | 53 | try comptime testMemcpyDestManyPtr(); |
| ... | @@ -69,7 +69,7 @@ fn testMemcpyDestManyPtr() !void { | ... | @@ -69,7 +69,7 @@ fn testMemcpyDestManyPtr() !void { |
| 69 | test "@memcpy C pointer" { | 69 | test "@memcpy C pointer" { |
| 70 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 70 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 71 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 71 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 72 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 72 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 73 | 73 | ||
| 74 | try testMemcpyCPointer(); | 74 | try testMemcpyCPointer(); |
| 75 | try comptime testMemcpyCPointer(); | 75 | try comptime testMemcpyCPointer(); |
| ... | @@ -90,7 +90,7 @@ test "@memcpy slice" { | ... | @@ -90,7 +90,7 @@ test "@memcpy slice" { |
| 90 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 90 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 91 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 91 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 92 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 92 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 93 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 93 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 94 | 94 | ||
| 95 | try testMemcpySlice(); | 95 | try testMemcpySlice(); |
| 96 | try comptime testMemcpySlice(); | 96 | try comptime testMemcpySlice(); |
| ... | @@ -133,7 +133,7 @@ test "@memcpy comptime-only type" { | ... | @@ -133,7 +133,7 @@ test "@memcpy comptime-only type" { |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | test "@memcpy zero-bit type with aliasing" { | 135 | test "@memcpy zero-bit type with aliasing" { |
| 136 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 136 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 137 | 137 | ||
| 138 | const S = struct { | 138 | const S = struct { |
| 139 | fn doTheTest() void { | 139 | fn doTheTest() void { |
| ... | @@ -153,7 +153,7 @@ test "@memcpy zero-bit type with aliasing" { | ... | @@ -153,7 +153,7 @@ test "@memcpy zero-bit type with aliasing" { |
| 153 | 153 | ||
| 154 | test "@memcpy with sentinel" { | 154 | test "@memcpy with sentinel" { |
| 155 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 155 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 156 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 156 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 157 | 157 | ||
| 158 | const S = struct { | 158 | const S = struct { |
| 159 | fn doTheTest() void { | 159 | fn doTheTest() void { |
| ... | @@ -182,6 +182,8 @@ test "@memcpy no sentinel source into sentinel destination" { | ... | @@ -182,6 +182,8 @@ test "@memcpy no sentinel source into sentinel destination" { |
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | test "@memcpy a global array" { | 184 | test "@memcpy a global array" { |
| 185 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 186 | |||
| 185 | const S = struct { | 187 | const S = struct { |
| 186 | var array_u8: [1]u8 = .{1}; | 188 | var array_u8: [1]u8 = .{1}; |
| 187 | const slice_u8: []u8 = &array_u8; | 189 | const slice_u8: []u8 = &array_u8; |
test/behavior/memmove.zig+6-4| ... | @@ -5,7 +5,7 @@ const expect = std.testing.expect; | ... | @@ -5,7 +5,7 @@ const expect = std.testing.expect; |
| 5 | test "memmove and memset intrinsics" { | 5 | test "memmove and memset intrinsics" { |
| 6 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 6 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 7 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 7 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 8 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 8 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 9 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 9 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 10 | 10 | ||
| 11 | try testMemmoveMemset(); | 11 | try testMemmoveMemset(); |
| ... | @@ -32,7 +32,7 @@ fn testMemmoveMemset() !void { | ... | @@ -32,7 +32,7 @@ fn testMemmoveMemset() !void { |
| 32 | test "@memmove with both operands single-ptr-to-array, one is null-terminated" { | 32 | test "@memmove with both operands single-ptr-to-array, one is null-terminated" { |
| 33 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 33 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 34 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 34 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 35 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 35 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 36 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 36 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 37 | 37 | ||
| 38 | try testMemmoveBothSinglePtrArrayOneIsNullTerminated(); | 38 | try testMemmoveBothSinglePtrArrayOneIsNullTerminated(); |
| ... | @@ -75,7 +75,7 @@ fn testMemmoveBothSinglePtrArrayOneIsNullTerminated() !void { | ... | @@ -75,7 +75,7 @@ fn testMemmoveBothSinglePtrArrayOneIsNullTerminated() !void { |
| 75 | test "@memmove dest many pointer" { | 75 | test "@memmove dest many pointer" { |
| 76 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 76 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 77 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 77 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 78 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 78 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 79 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 79 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 80 | 80 | ||
| 81 | try testMemmoveDestManyPtr(); | 81 | try testMemmoveDestManyPtr(); |
| ... | @@ -117,7 +117,7 @@ test "@memmove slice" { | ... | @@ -117,7 +117,7 @@ test "@memmove slice" { |
| 117 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 117 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 118 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 118 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 119 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 119 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 120 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 120 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 121 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 121 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 122 | 122 | ||
| 123 | try testMemmoveSlice(); | 123 | try testMemmoveSlice(); |
| ... | @@ -172,6 +172,8 @@ comptime { | ... | @@ -172,6 +172,8 @@ comptime { |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | test "@memmove a global array" { | 174 | test "@memmove a global array" { |
| 175 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 176 | |||
| 175 | const S = struct { | 177 | const S = struct { |
| 176 | var array_u8: [1]u8 = .{1}; | 178 | var array_u8: [1]u8 = .{1}; |
| 177 | const slice_u8: []u8 = &array_u8; | 179 | const slice_u8: []u8 = &array_u8; |
test/behavior/memset.zig+12-12| ... | @@ -5,7 +5,7 @@ const expect = std.testing.expect; | ... | @@ -5,7 +5,7 @@ const expect = std.testing.expect; |
| 5 | test "@memset on array pointers" { | 5 | test "@memset on array pointers" { |
| 6 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 6 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 7 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 7 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 8 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 8 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 9 | 9 | ||
| 10 | try testMemsetArray(); | 10 | try testMemsetArray(); |
| 11 | try comptime testMemsetArray(); | 11 | try comptime testMemsetArray(); |
| ... | @@ -33,7 +33,7 @@ fn testMemsetArray() !void { | ... | @@ -33,7 +33,7 @@ fn testMemsetArray() !void { |
| 33 | test "@memset preserves array sentinel" { | 33 | test "@memset preserves array sentinel" { |
| 34 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 34 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 35 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 35 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 36 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 36 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 37 | 37 | ||
| 38 | try testMemsetArraySentinel(); | 38 | try testMemsetArraySentinel(); |
| 39 | try comptime testMemsetArraySentinel(); | 39 | try comptime testMemsetArraySentinel(); |
| ... | @@ -55,7 +55,7 @@ fn testMemsetArraySentinel() !void { | ... | @@ -55,7 +55,7 @@ fn testMemsetArraySentinel() !void { |
| 55 | test "@memset on slices" { | 55 | test "@memset on slices" { |
| 56 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 56 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 57 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 57 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 58 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 58 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 59 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 59 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 60 | 60 | ||
| 61 | try testMemsetSlice(); | 61 | try testMemsetSlice(); |
| ... | @@ -90,7 +90,7 @@ fn testMemsetSlice() !void { | ... | @@ -90,7 +90,7 @@ fn testMemsetSlice() !void { |
| 90 | test "memset with bool element" { | 90 | test "memset with bool element" { |
| 91 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 91 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 92 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 92 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 93 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 93 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 94 | 94 | ||
| 95 | var buf: [5]bool = undefined; | 95 | var buf: [5]bool = undefined; |
| 96 | @memset(&buf, true); | 96 | @memset(&buf, true); |
| ... | @@ -101,7 +101,7 @@ test "memset with bool element" { | ... | @@ -101,7 +101,7 @@ test "memset with bool element" { |
| 101 | test "memset with 1-byte struct element" { | 101 | test "memset with 1-byte struct element" { |
| 102 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 102 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 103 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 103 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 104 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 104 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 105 | 105 | ||
| 106 | const S = struct { x: bool }; | 106 | const S = struct { x: bool }; |
| 107 | var buf: [5]S = undefined; | 107 | var buf: [5]S = undefined; |
| ... | @@ -113,7 +113,7 @@ test "memset with 1-byte struct element" { | ... | @@ -113,7 +113,7 @@ test "memset with 1-byte struct element" { |
| 113 | test "memset with 1-byte array element" { | 113 | test "memset with 1-byte array element" { |
| 114 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 114 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 115 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 115 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 116 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 116 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 117 | 117 | ||
| 118 | const A = [1]bool; | 118 | const A = [1]bool; |
| 119 | var buf: [5]A = undefined; | 119 | var buf: [5]A = undefined; |
| ... | @@ -126,7 +126,7 @@ test "memset with large array element, runtime known" { | ... | @@ -126,7 +126,7 @@ test "memset with large array element, runtime known" { |
| 126 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 126 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 127 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 127 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 128 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 128 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 129 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 129 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 130 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 130 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 131 | 131 | ||
| 132 | const A = [128]u64; | 132 | const A = [128]u64; |
| ... | @@ -144,7 +144,7 @@ test "memset with large array element, runtime known" { | ... | @@ -144,7 +144,7 @@ test "memset with large array element, runtime known" { |
| 144 | test "memset with large array element, comptime known" { | 144 | test "memset with large array element, comptime known" { |
| 145 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 145 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 146 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 146 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 147 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 147 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 148 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 148 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 149 | 149 | ||
| 150 | const A = [128]u64; | 150 | const A = [128]u64; |
| ... | @@ -161,7 +161,7 @@ test "memset with large array element, comptime known" { | ... | @@ -161,7 +161,7 @@ test "memset with large array element, comptime known" { |
| 161 | test "@memset provides result type" { | 161 | test "@memset provides result type" { |
| 162 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 162 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 163 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 163 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 164 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 164 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 165 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 165 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 166 | 166 | ||
| 167 | const S = struct { x: u32 }; | 167 | const S = struct { x: u32 }; |
| ... | @@ -179,7 +179,7 @@ test "@memset provides result type" { | ... | @@ -179,7 +179,7 @@ test "@memset provides result type" { |
| 179 | test "zero keys with @memset" { | 179 | test "zero keys with @memset" { |
| 180 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 180 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 181 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 181 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 182 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 182 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 183 | 183 | ||
| 184 | const Keys = struct { | 184 | const Keys = struct { |
| 185 | up: bool, | 185 | up: bool, |
| ... | @@ -201,7 +201,7 @@ test "@memset with zero-length array" { | ... | @@ -201,7 +201,7 @@ test "@memset with zero-length array" { |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | test "@memset a global array" { | 203 | test "@memset a global array" { |
| 204 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 204 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 205 | 205 | ||
| 206 | const S = struct { | 206 | const S = struct { |
| 207 | var array_u8: [1]u8 = .{1}; | 207 | var array_u8: [1]u8 = .{1}; |
| ... | @@ -232,7 +232,7 @@ test "@memset a global array" { | ... | @@ -232,7 +232,7 @@ test "@memset a global array" { |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | test "@memset array of booleans" { | 234 | test "@memset array of booleans" { |
| 235 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 235 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 236 | 236 | ||
| 237 | const S = struct { | 237 | const S = struct { |
| 238 | var x: bool = false; | 238 | var x: bool = false; |
test/behavior/merge_error_sets.zig+1| ... | @@ -12,6 +12,7 @@ fn foo() C!void { | ... | @@ -12,6 +12,7 @@ fn foo() C!void { |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | test "merge error sets" { | 14 | test "merge error sets" { |
| 15 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 15 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 16 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 16 | 17 | ||
| 17 | if (foo()) { | 18 | if (foo()) { |
test/behavior/muladd.zig+7-4| ... | @@ -48,7 +48,7 @@ fn testMulAdd16() !void { | ... | @@ -48,7 +48,7 @@ fn testMulAdd16() !void { |
| 48 | test "@mulAdd f80" { | 48 | test "@mulAdd f80" { |
| 49 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 49 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 50 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 50 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 51 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 51 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 52 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 52 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 53 | 53 | ||
| 54 | try comptime testMulAdd80(); | 54 | try comptime testMulAdd80(); |
| ... | @@ -66,7 +66,7 @@ fn testMulAdd80() !void { | ... | @@ -66,7 +66,7 @@ fn testMulAdd80() !void { |
| 66 | test "@mulAdd f128" { | 66 | test "@mulAdd f128" { |
| 67 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 67 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 68 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 68 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 69 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 69 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 70 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 70 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 71 | 71 | ||
| 72 | try comptime testMulAdd128(); | 72 | try comptime testMulAdd128(); |
| ... | @@ -95,6 +95,7 @@ fn vector16() !void { | ... | @@ -95,6 +95,7 @@ fn vector16() !void { |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | test "vector f16" { | 97 | test "vector f16" { |
| 98 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 98 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 99 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 99 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 100 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 100 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 101 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -118,6 +119,7 @@ fn vector32() !void { | ... | @@ -118,6 +119,7 @@ fn vector32() !void { |
| 118 | } | 119 | } |
| 119 | 120 | ||
| 120 | test "vector f32" { | 121 | test "vector f32" { |
| 122 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 121 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 123 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 122 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 124 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 123 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 125 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -141,6 +143,7 @@ fn vector64() !void { | ... | @@ -141,6 +143,7 @@ fn vector64() !void { |
| 141 | } | 143 | } |
| 142 | 144 | ||
| 143 | test "vector f64" { | 145 | test "vector f64" { |
| 146 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 144 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 147 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 145 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 148 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 146 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 149 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -166,7 +169,7 @@ test "vector f80" { | ... | @@ -166,7 +169,7 @@ test "vector f80" { |
| 166 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 169 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 167 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 170 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 168 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 171 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 169 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 172 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 170 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 173 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 171 | 174 | ||
| 172 | try comptime vector80(); | 175 | try comptime vector80(); |
| ... | @@ -190,7 +193,7 @@ test "vector f128" { | ... | @@ -190,7 +193,7 @@ test "vector f128" { |
| 190 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 193 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 191 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 194 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 192 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 195 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 193 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 196 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 194 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 197 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 195 | 198 | ||
| 196 | try comptime vector128(); | 199 | try comptime vector128(); |
test/behavior/multiple_externs_with_conflicting_types.zig+2-2| ... | @@ -5,7 +5,7 @@ const A = extern struct { | ... | @@ -5,7 +5,7 @@ const A = extern struct { |
| 5 | extern fn issue529(?*A) void; | 5 | extern fn issue529(?*A) void; |
| 6 | 6 | ||
| 7 | comptime { | 7 | comptime { |
| 8 | if (builtin.zig_backend != .stage2_spirv) { | 8 | if (!builtin.cpu.arch.isSpirv()) { |
| 9 | _ = @import("conflicting_externs/b.zig"); | 9 | _ = @import("conflicting_externs/b.zig"); |
| 10 | } | 10 | } |
| 11 | } | 11 | } |
| ... | @@ -15,7 +15,7 @@ const builtin = @import("builtin"); | ... | @@ -15,7 +15,7 @@ const builtin = @import("builtin"); |
| 15 | test "call extern function defined with conflicting type" { | 15 | test "call extern function defined with conflicting type" { |
| 16 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 16 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 17 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 17 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 18 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 18 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 19 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 19 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 20 | 20 | ||
| 21 | @import("conflicting_externs/a.zig").issue529(null); | 21 | @import("conflicting_externs/a.zig").issue529(null); |
test/behavior/nan.zig+1-1| ... | @@ -24,7 +24,7 @@ const snan_f128: f128 = math.snan(f128); | ... | @@ -24,7 +24,7 @@ const snan_f128: f128 = math.snan(f128); |
| 24 | test "nan memory equality" { | 24 | test "nan memory equality" { |
| 25 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 25 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 26 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | 26 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 27 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 27 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 28 | 28 | ||
| 29 | // signaled | 29 | // signaled |
| 30 | try testing.expect(mem.eql(u8, mem.asBytes(&snan_u16), mem.asBytes(&snan_f16))); | 30 | try testing.expect(mem.eql(u8, mem.asBytes(&snan_u16), mem.asBytes(&snan_f16))); |
test/behavior/null.zig+6-2| ... | @@ -29,6 +29,7 @@ test "optional type" { | ... | @@ -29,6 +29,7 @@ test "optional type" { |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | test "test maybe object and get a pointer to the inner value" { | 31 | test "test maybe object and get a pointer to the inner value" { |
| 32 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 32 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 33 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 33 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 34 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 34 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 35 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -50,6 +51,7 @@ test "rhs maybe unwrap return" { | ... | @@ -50,6 +51,7 @@ test "rhs maybe unwrap return" { |
| 50 | } | 51 | } |
| 51 | 52 | ||
| 52 | test "maybe return" { | 53 | test "maybe return" { |
| 54 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 53 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 55 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 54 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 56 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 55 | 57 | ||
| ... | @@ -69,6 +71,7 @@ fn foo(x: ?i32) ?bool { | ... | @@ -69,6 +71,7 @@ fn foo(x: ?i32) ?bool { |
| 69 | } | 71 | } |
| 70 | 72 | ||
| 71 | test "test null runtime" { | 73 | test "test null runtime" { |
| 74 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 72 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 75 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 73 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 76 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 74 | 77 | ||
| ... | @@ -130,7 +133,7 @@ test "null with default unwrap" { | ... | @@ -130,7 +133,7 @@ test "null with default unwrap" { |
| 130 | 133 | ||
| 131 | test "optional pointer to 0 bit type null value at runtime" { | 134 | test "optional pointer to 0 bit type null value at runtime" { |
| 132 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 135 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 133 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 136 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 134 | 137 | ||
| 135 | const EmptyStruct = struct {}; | 138 | const EmptyStruct = struct {}; |
| 136 | var x: ?*EmptyStruct = null; | 139 | var x: ?*EmptyStruct = null; |
| ... | @@ -139,6 +142,7 @@ test "optional pointer to 0 bit type null value at runtime" { | ... | @@ -139,6 +142,7 @@ test "optional pointer to 0 bit type null value at runtime" { |
| 139 | } | 142 | } |
| 140 | 143 | ||
| 141 | test "if var maybe pointer" { | 144 | test "if var maybe pointer" { |
| 145 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 142 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 146 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 143 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 147 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 144 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 148 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -183,7 +187,7 @@ const SillyStruct = struct { | ... | @@ -183,7 +187,7 @@ const SillyStruct = struct { |
| 183 | const here_is_a_null_literal = SillyStruct{ .context = null }; | 187 | const here_is_a_null_literal = SillyStruct{ .context = null }; |
| 184 | 188 | ||
| 185 | test "unwrap optional which is field of global var" { | 189 | test "unwrap optional which is field of global var" { |
| 186 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 190 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 187 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 191 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 188 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 192 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 189 | 193 |
test/behavior/optional.zig+28-14| ... | @@ -7,6 +7,7 @@ const expectEqual = testing.expectEqual; | ... | @@ -7,6 +7,7 @@ const expectEqual = testing.expectEqual; |
| 7 | const expectEqualStrings = std.testing.expectEqualStrings; | 7 | const expectEqualStrings = std.testing.expectEqualStrings; |
| 8 | 8 | ||
| 9 | test "passing an optional integer as a parameter" { | 9 | test "passing an optional integer as a parameter" { |
| 10 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 10 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 11 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 11 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 12 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 12 | 13 | ||
| ... | @@ -28,7 +29,7 @@ pub const EmptyStruct = struct {}; | ... | @@ -28,7 +29,7 @@ pub const EmptyStruct = struct {}; |
| 28 | 29 | ||
| 29 | test "optional pointer to size zero struct" { | 30 | test "optional pointer to size zero struct" { |
| 30 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 31 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 31 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 32 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 32 | 33 | ||
| 33 | var e = EmptyStruct{}; | 34 | var e = EmptyStruct{}; |
| 34 | const o: ?*EmptyStruct = &e; | 35 | const o: ?*EmptyStruct = &e; |
| ... | @@ -36,7 +37,7 @@ test "optional pointer to size zero struct" { | ... | @@ -36,7 +37,7 @@ test "optional pointer to size zero struct" { |
| 36 | } | 37 | } |
| 37 | 38 | ||
| 38 | test "equality compare optional pointers" { | 39 | test "equality compare optional pointers" { |
| 39 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 40 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 40 | 41 | ||
| 41 | try testNullPtrsEql(); | 42 | try testNullPtrsEql(); |
| 42 | try comptime testNullPtrsEql(); | 43 | try comptime testNullPtrsEql(); |
| ... | @@ -94,7 +95,7 @@ test "optional error equality" { | ... | @@ -94,7 +95,7 @@ test "optional error equality" { |
| 94 | 95 | ||
| 95 | test "optional with zero-bit type" { | 96 | test "optional with zero-bit type" { |
| 96 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 97 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 97 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 98 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 98 | 99 | ||
| 99 | const S = struct { | 100 | const S = struct { |
| 100 | fn doTheTest(comptime ZeroBit: type, comptime zero_bit: ZeroBit) !void { | 101 | fn doTheTest(comptime ZeroBit: type, comptime zero_bit: ZeroBit) !void { |
| ... | @@ -147,7 +148,7 @@ test "address of unwrap optional" { | ... | @@ -147,7 +148,7 @@ test "address of unwrap optional" { |
| 147 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 148 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 148 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 149 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 149 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 150 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 150 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 151 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 151 | 152 | ||
| 152 | const S = struct { | 153 | const S = struct { |
| 153 | const Foo = struct { | 154 | const Foo = struct { |
| ... | @@ -166,6 +167,7 @@ test "address of unwrap optional" { | ... | @@ -166,6 +167,7 @@ test "address of unwrap optional" { |
| 166 | } | 167 | } |
| 167 | 168 | ||
| 168 | test "nested optional field in struct" { | 169 | test "nested optional field in struct" { |
| 170 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 169 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 171 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 170 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 172 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 171 | 173 | ||
| ... | @@ -183,6 +185,7 @@ test "nested optional field in struct" { | ... | @@ -183,6 +185,7 @@ test "nested optional field in struct" { |
| 183 | } | 185 | } |
| 184 | 186 | ||
| 185 | test "equality compare optionals and non-optionals" { | 187 | test "equality compare optionals and non-optionals" { |
| 188 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 186 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 189 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 187 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 190 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 188 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 191 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -242,6 +245,7 @@ test "equality compare optionals and non-optionals" { | ... | @@ -242,6 +245,7 @@ test "equality compare optionals and non-optionals" { |
| 242 | } | 245 | } |
| 243 | 246 | ||
| 244 | test "compare optionals with modified payloads" { | 247 | test "compare optionals with modified payloads" { |
| 248 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 245 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 249 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 246 | 250 | ||
| 247 | var lhs: ?bool = false; | 251 | var lhs: ?bool = false; |
| ... | @@ -269,7 +273,7 @@ test "compare optionals with modified payloads" { | ... | @@ -269,7 +273,7 @@ test "compare optionals with modified payloads" { |
| 269 | 273 | ||
| 270 | test "unwrap function call with optional pointer return value" { | 274 | test "unwrap function call with optional pointer return value" { |
| 271 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 275 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 272 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 276 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 273 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 277 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 274 | 278 | ||
| 275 | const S = struct { | 279 | const S = struct { |
| ... | @@ -290,6 +294,7 @@ test "unwrap function call with optional pointer return value" { | ... | @@ -290,6 +294,7 @@ test "unwrap function call with optional pointer return value" { |
| 290 | } | 294 | } |
| 291 | 295 | ||
| 292 | test "nested orelse" { | 296 | test "nested orelse" { |
| 297 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 293 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 298 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 294 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 299 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 295 | 300 | ||
| ... | @@ -318,7 +323,7 @@ test "nested orelse" { | ... | @@ -318,7 +323,7 @@ test "nested orelse" { |
| 318 | test "self-referential struct through a slice of optional" { | 323 | test "self-referential struct through a slice of optional" { |
| 319 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 324 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 320 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 325 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 321 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 326 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 322 | 327 | ||
| 323 | const S = struct { | 328 | const S = struct { |
| 324 | const Node = struct { | 329 | const Node = struct { |
| ... | @@ -351,6 +356,7 @@ test "assigning to an unwrapped optional field in an inline loop" { | ... | @@ -351,6 +356,7 @@ test "assigning to an unwrapped optional field in an inline loop" { |
| 351 | } | 356 | } |
| 352 | 357 | ||
| 353 | test "coerce an anon struct literal to optional struct" { | 358 | test "coerce an anon struct literal to optional struct" { |
| 359 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 354 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 360 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 355 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 361 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 356 | 362 | ||
| ... | @@ -369,6 +375,7 @@ test "coerce an anon struct literal to optional struct" { | ... | @@ -369,6 +375,7 @@ test "coerce an anon struct literal to optional struct" { |
| 369 | } | 375 | } |
| 370 | 376 | ||
| 371 | test "0-bit child type coerced to optional return ptr result location" { | 377 | test "0-bit child type coerced to optional return ptr result location" { |
| 378 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 372 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 379 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 373 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 380 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 374 | const S = struct { | 381 | const S = struct { |
| ... | @@ -395,7 +402,7 @@ test "0-bit child type coerced to optional return ptr result location" { | ... | @@ -395,7 +402,7 @@ test "0-bit child type coerced to optional return ptr result location" { |
| 395 | test "0-bit child type coerced to optional" { | 402 | test "0-bit child type coerced to optional" { |
| 396 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 403 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 397 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 404 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 398 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 405 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 399 | const S = struct { | 406 | const S = struct { |
| 400 | fn doTheTest() !void { | 407 | fn doTheTest() !void { |
| 401 | var it: Foo = .{ | 408 | var it: Foo = .{ |
| ... | @@ -419,6 +426,7 @@ test "0-bit child type coerced to optional" { | ... | @@ -419,6 +426,7 @@ test "0-bit child type coerced to optional" { |
| 419 | } | 426 | } |
| 420 | 427 | ||
| 421 | test "array of optional unaligned types" { | 428 | test "array of optional unaligned types" { |
| 429 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 422 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 430 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 423 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 431 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 424 | 432 | ||
| ... | @@ -454,6 +462,7 @@ test "array of optional unaligned types" { | ... | @@ -454,6 +462,7 @@ test "array of optional unaligned types" { |
| 454 | } | 462 | } |
| 455 | 463 | ||
| 456 | test "optional pointer to zero bit optional payload" { | 464 | test "optional pointer to zero bit optional payload" { |
| 465 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 457 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 466 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 458 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 467 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 459 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 468 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -475,7 +484,7 @@ test "optional pointer to zero bit optional payload" { | ... | @@ -475,7 +484,7 @@ test "optional pointer to zero bit optional payload" { |
| 475 | test "optional pointer to zero bit error union payload" { | 484 | test "optional pointer to zero bit error union payload" { |
| 476 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 485 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 477 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 486 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 478 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 487 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 479 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 488 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 480 | 489 | ||
| 481 | const B = struct { | 490 | const B = struct { |
| ... | @@ -509,7 +518,7 @@ const NoReturn = struct { | ... | @@ -509,7 +518,7 @@ const NoReturn = struct { |
| 509 | }; | 518 | }; |
| 510 | 519 | ||
| 511 | test "optional of noreturn used with if" { | 520 | test "optional of noreturn used with if" { |
| 512 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 521 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 513 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 522 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 514 | 523 | ||
| 515 | NoReturn.a = 64; | 524 | NoReturn.a = 64; |
| ... | @@ -521,7 +530,7 @@ test "optional of noreturn used with if" { | ... | @@ -521,7 +530,7 @@ test "optional of noreturn used with if" { |
| 521 | } | 530 | } |
| 522 | 531 | ||
| 523 | test "optional of noreturn used with orelse" { | 532 | test "optional of noreturn used with orelse" { |
| 524 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 533 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 525 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 534 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 526 | 535 | ||
| 527 | NoReturn.a = 64; | 536 | NoReturn.a = 64; |
| ... | @@ -551,6 +560,7 @@ test "orelse on C pointer" { | ... | @@ -551,6 +560,7 @@ test "orelse on C pointer" { |
| 551 | } | 560 | } |
| 552 | 561 | ||
| 553 | test "alignment of wrapping an optional payload" { | 562 | test "alignment of wrapping an optional payload" { |
| 563 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 554 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 564 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 555 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 565 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 556 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 566 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -571,7 +581,7 @@ test "alignment of wrapping an optional payload" { | ... | @@ -571,7 +581,7 @@ test "alignment of wrapping an optional payload" { |
| 571 | test "Optional slice size is optimized" { | 581 | test "Optional slice size is optimized" { |
| 572 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 582 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 573 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 583 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 574 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 584 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 575 | 585 | ||
| 576 | try expect(@sizeOf(?[]u8) == @sizeOf([]u8)); | 586 | try expect(@sizeOf(?[]u8) == @sizeOf([]u8)); |
| 577 | var a: ?[]const u8 = null; | 587 | var a: ?[]const u8 = null; |
| ... | @@ -584,7 +594,7 @@ test "Optional slice passed to function" { | ... | @@ -584,7 +594,7 @@ test "Optional slice passed to function" { |
| 584 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 594 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 585 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 595 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 586 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 596 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 587 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 597 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 588 | 598 | ||
| 589 | const S = struct { | 599 | const S = struct { |
| 590 | fn foo(a: ?[]const u8) !void { | 600 | fn foo(a: ?[]const u8) !void { |
| ... | @@ -599,6 +609,7 @@ test "Optional slice passed to function" { | ... | @@ -599,6 +609,7 @@ test "Optional slice passed to function" { |
| 599 | } | 609 | } |
| 600 | 610 | ||
| 601 | test "peer type resolution in nested if expressions" { | 611 | test "peer type resolution in nested if expressions" { |
| 612 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 602 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 613 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 603 | 614 | ||
| 604 | const Thing = struct { n: i32 }; | 615 | const Thing = struct { n: i32 }; |
| ... | @@ -626,7 +637,7 @@ test "peer type resolution in nested if expressions" { | ... | @@ -626,7 +637,7 @@ test "peer type resolution in nested if expressions" { |
| 626 | test "cast slice to const slice nested in error union and optional" { | 637 | test "cast slice to const slice nested in error union and optional" { |
| 627 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 638 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 628 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 639 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 629 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 640 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 630 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 641 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 631 | 642 | ||
| 632 | const S = struct { | 643 | const S = struct { |
| ... | @@ -647,6 +658,7 @@ test "variable of optional of noreturn" { | ... | @@ -647,6 +658,7 @@ test "variable of optional of noreturn" { |
| 647 | } | 658 | } |
| 648 | 659 | ||
| 649 | test "copied optional doesn't alias source" { | 660 | test "copied optional doesn't alias source" { |
| 661 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 650 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 662 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 651 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 663 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 652 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 664 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -664,7 +676,7 @@ test "result location initialization of optional with OPV payload" { | ... | @@ -664,7 +676,7 @@ test "result location initialization of optional with OPV payload" { |
| 664 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 676 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 665 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 677 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 666 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 678 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 667 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 679 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 668 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 680 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 669 | 681 | ||
| 670 | const S = struct { | 682 | const S = struct { |
| ... | @@ -697,6 +709,8 @@ test "global comptime only optional" { | ... | @@ -697,6 +709,8 @@ test "global comptime only optional" { |
| 697 | } | 709 | } |
| 698 | 710 | ||
| 699 | test "optional ptr payload alignment" { | 711 | test "optional ptr payload alignment" { |
| 712 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 713 | |||
| 700 | const S = struct { | 714 | const S = struct { |
| 701 | fn doTheTest(p: *align(1) ?u32) !void { | 715 | fn doTheTest(p: *align(1) ?u32) !void { |
| 702 | comptime assert(@TypeOf(&p.*.?) == *align(1) u32); | 716 | comptime assert(@TypeOf(&p.*.?) == *align(1) u32); |
test/behavior/overlapping_assign.zig+1-1| ... | @@ -3,7 +3,7 @@ const std = @import("std"); | ... | @@ -3,7 +3,7 @@ const std = @import("std"); |
| 3 | const expect = std.testing.expect; | 3 | const expect = std.testing.expect; |
| 4 | 4 | ||
| 5 | test "assignment to overlapping memory" { | 5 | test "assignment to overlapping memory" { |
| 6 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 6 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 7 | 7 | ||
| 8 | try theTest(); | 8 | try theTest(); |
| 9 | try comptime theTest(); | 9 | try comptime theTest(); |
test/behavior/packed-struct.zig+30-16| ... | @@ -119,6 +119,7 @@ test "consistent size of packed structs" { | ... | @@ -119,6 +119,7 @@ test "consistent size of packed structs" { |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | test "correct sizeOf and offsets in packed structs" { | 121 | test "correct sizeOf and offsets in packed structs" { |
| 122 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 122 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 123 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 123 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 124 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 124 | 125 | ||
| ... | @@ -183,6 +184,7 @@ test "correct sizeOf and offsets in packed structs" { | ... | @@ -183,6 +184,7 @@ test "correct sizeOf and offsets in packed structs" { |
| 183 | } | 184 | } |
| 184 | 185 | ||
| 185 | test "nested packed structs" { | 186 | test "nested packed structs" { |
| 187 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 186 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 188 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 187 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 189 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 188 | 190 | ||
| ... | @@ -225,6 +227,7 @@ test "nested packed structs" { | ... | @@ -225,6 +227,7 @@ test "nested packed structs" { |
| 225 | } | 227 | } |
| 226 | 228 | ||
| 227 | test "regular in irregular packed struct" { | 229 | test "regular in irregular packed struct" { |
| 230 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 228 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 231 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 229 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 232 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 230 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 233 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| ... | @@ -247,7 +250,8 @@ test "nested packed struct unaligned" { | ... | @@ -247,7 +250,8 @@ test "nested packed struct unaligned" { |
| 247 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 250 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 248 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 251 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 249 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 252 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 250 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 253 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 254 | |||
| 251 | const S1 = packed struct { | 255 | const S1 = packed struct { |
| 252 | a: u4, | 256 | a: u4, |
| 253 | b: u4, | 257 | b: u4, |
| ... | @@ -316,7 +320,7 @@ test "nested packed struct unaligned" { | ... | @@ -316,7 +320,7 @@ test "nested packed struct unaligned" { |
| 316 | test "byte-aligned field pointer offsets" { | 320 | test "byte-aligned field pointer offsets" { |
| 317 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 321 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 318 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 322 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 319 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 323 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 320 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 324 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 321 | 325 | ||
| 322 | const S = struct { | 326 | const S = struct { |
| ... | @@ -403,7 +407,7 @@ test "nested packed struct field pointers" { | ... | @@ -403,7 +407,7 @@ test "nested packed struct field pointers" { |
| 403 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 407 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 404 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 408 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 405 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 409 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 406 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 410 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 407 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 411 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 408 | const S2 = packed struct { | 412 | const S2 = packed struct { |
| 409 | base: u8, | 413 | base: u8, |
| ... | @@ -438,7 +442,7 @@ test "nested packed struct field pointers" { | ... | @@ -438,7 +442,7 @@ test "nested packed struct field pointers" { |
| 438 | test "@intFromPtr on a packed struct field" { | 442 | test "@intFromPtr on a packed struct field" { |
| 439 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 443 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 440 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 444 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 441 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 445 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 442 | 446 | ||
| 443 | const S = struct { | 447 | const S = struct { |
| 444 | const P = packed struct { | 448 | const P = packed struct { |
| ... | @@ -459,7 +463,7 @@ test "@intFromPtr on a packed struct field" { | ... | @@ -459,7 +463,7 @@ test "@intFromPtr on a packed struct field" { |
| 459 | test "@intFromPtr on a packed struct field unaligned and nested" { | 463 | test "@intFromPtr on a packed struct field unaligned and nested" { |
| 460 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 464 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 461 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 465 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 462 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 466 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 463 | 467 | ||
| 464 | const S1 = packed struct { | 468 | const S1 = packed struct { |
| 465 | a: u4, | 469 | a: u4, |
| ... | @@ -555,7 +559,7 @@ test "packed struct fields modification" { | ... | @@ -555,7 +559,7 @@ test "packed struct fields modification" { |
| 555 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 559 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 556 | 560 | ||
| 557 | // Originally reported at https://github.com/ziglang/zig/issues/16615 | 561 | // Originally reported at https://github.com/ziglang/zig/issues/16615 |
| 558 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 562 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 559 | 563 | ||
| 560 | const Small = packed struct(u16) { | 564 | const Small = packed struct(u16) { |
| 561 | val: u8 = 0, | 565 | val: u8 = 0, |
| ... | @@ -580,7 +584,7 @@ test "packed struct fields modification" { | ... | @@ -580,7 +584,7 @@ test "packed struct fields modification" { |
| 580 | test "nested packed struct field access test" { | 584 | test "nested packed struct field access test" { |
| 581 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 585 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 582 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 586 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 583 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 587 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 584 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 588 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 585 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 589 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 586 | 590 | ||
| ... | @@ -698,7 +702,7 @@ test "nested packed struct field access test" { | ... | @@ -698,7 +702,7 @@ test "nested packed struct field access test" { |
| 698 | 702 | ||
| 699 | test "nested packed struct at non-zero offset" { | 703 | test "nested packed struct at non-zero offset" { |
| 700 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 704 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 701 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 705 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 702 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 706 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 703 | 707 | ||
| 704 | const Pair = packed struct(u24) { | 708 | const Pair = packed struct(u24) { |
| ... | @@ -730,7 +734,7 @@ test "nested packed struct at non-zero offset 2" { | ... | @@ -730,7 +734,7 @@ test "nested packed struct at non-zero offset 2" { |
| 730 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 734 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 731 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 735 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 732 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 736 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 733 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 737 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 734 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 738 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 735 | 739 | ||
| 736 | const S = struct { | 740 | const S = struct { |
| ... | @@ -792,6 +796,7 @@ test "nested packed struct at non-zero offset 2" { | ... | @@ -792,6 +796,7 @@ test "nested packed struct at non-zero offset 2" { |
| 792 | } | 796 | } |
| 793 | 797 | ||
| 794 | test "runtime init of unnamed packed struct type" { | 798 | test "runtime init of unnamed packed struct type" { |
| 799 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 795 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 800 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 796 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 801 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 797 | 802 | ||
| ... | @@ -810,7 +815,7 @@ test "packed struct passed to callconv(.c) function" { | ... | @@ -810,7 +815,7 @@ test "packed struct passed to callconv(.c) function" { |
| 810 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 815 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 811 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 816 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 812 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 817 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 813 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 818 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 814 | 819 | ||
| 815 | const S = struct { | 820 | const S = struct { |
| 816 | const Packed = packed struct(u64) { | 821 | const Packed = packed struct(u64) { |
| ... | @@ -835,7 +840,7 @@ test "packed struct passed to callconv(.c) function" { | ... | @@ -835,7 +840,7 @@ test "packed struct passed to callconv(.c) function" { |
| 835 | test "overaligned pointer to packed struct" { | 840 | test "overaligned pointer to packed struct" { |
| 836 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 841 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 837 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 842 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 838 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 843 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 839 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 844 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 840 | 845 | ||
| 841 | const S = packed struct { a: u32, b: u32 }; | 846 | const S = packed struct { a: u32, b: u32 }; |
| ... | @@ -862,7 +867,7 @@ test "pointer to container level packed struct field" { | ... | @@ -862,7 +867,7 @@ test "pointer to container level packed struct field" { |
| 862 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 867 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 863 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 868 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 864 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 869 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 865 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 870 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 866 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 871 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 867 | 872 | ||
| 868 | const S = packed struct(u32) { | 873 | const S = packed struct(u32) { |
| ... | @@ -885,6 +890,7 @@ test "pointer to container level packed struct field" { | ... | @@ -885,6 +890,7 @@ test "pointer to container level packed struct field" { |
| 885 | } | 890 | } |
| 886 | 891 | ||
| 887 | test "store undefined to packed result location" { | 892 | test "store undefined to packed result location" { |
| 893 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 888 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 894 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 889 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 895 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 890 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 896 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -907,6 +913,7 @@ test "bitcast back and forth" { | ... | @@ -907,6 +913,7 @@ test "bitcast back and forth" { |
| 907 | 913 | ||
| 908 | // Originally reported at https://github.com/ziglang/zig/issues/14200 | 914 | // Originally reported at https://github.com/ziglang/zig/issues/14200 |
| 909 | test "field access of packed struct smaller than its abi size inside struct initialized with rls" { | 915 | test "field access of packed struct smaller than its abi size inside struct initialized with rls" { |
| 916 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 910 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 917 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 911 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 918 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 912 | 919 | ||
| ... | @@ -929,7 +936,7 @@ test "modify nested packed struct aligned field" { | ... | @@ -929,7 +936,7 @@ test "modify nested packed struct aligned field" { |
| 929 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 936 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 930 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 937 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 931 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 938 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 932 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 939 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 933 | 940 | ||
| 934 | const Options = packed struct { | 941 | const Options = packed struct { |
| 935 | foo: bool = false, | 942 | foo: bool = false, |
| ... | @@ -958,7 +965,7 @@ test "modify nested packed struct aligned field" { | ... | @@ -958,7 +965,7 @@ test "modify nested packed struct aligned field" { |
| 958 | test "assigning packed struct inside another packed struct" { | 965 | test "assigning packed struct inside another packed struct" { |
| 959 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 966 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 960 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 967 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 961 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 968 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 962 | 969 | ||
| 963 | const S = struct { | 970 | const S = struct { |
| 964 | const Inner = packed struct { | 971 | const Inner = packed struct { |
| ... | @@ -1001,6 +1008,7 @@ test "packed struct acts as a namespace" { | ... | @@ -1001,6 +1008,7 @@ test "packed struct acts as a namespace" { |
| 1001 | } | 1008 | } |
| 1002 | 1009 | ||
| 1003 | test "assignment to non-byte-aligned field in packed struct" { | 1010 | test "assignment to non-byte-aligned field in packed struct" { |
| 1011 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 1004 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1012 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1005 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1013 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1006 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 1014 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| ... | @@ -1023,7 +1031,7 @@ test "assignment to non-byte-aligned field in packed struct" { | ... | @@ -1023,7 +1031,7 @@ test "assignment to non-byte-aligned field in packed struct" { |
| 1023 | test "packed struct field pointer aligned properly" { | 1031 | test "packed struct field pointer aligned properly" { |
| 1024 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1032 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1025 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1033 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1026 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 1034 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 1027 | 1035 | ||
| 1028 | const Foo = packed struct { | 1036 | const Foo = packed struct { |
| 1029 | a: i32, | 1037 | a: i32, |
| ... | @@ -1039,6 +1047,7 @@ test "packed struct field pointer aligned properly" { | ... | @@ -1039,6 +1047,7 @@ test "packed struct field pointer aligned properly" { |
| 1039 | } | 1047 | } |
| 1040 | 1048 | ||
| 1041 | test "load flag from packed struct in union" { | 1049 | test "load flag from packed struct in union" { |
| 1050 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 1042 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1051 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1043 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1052 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1044 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1053 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| ... | @@ -1116,7 +1125,7 @@ test "2-byte packed struct argument in C calling convention" { | ... | @@ -1116,7 +1125,7 @@ test "2-byte packed struct argument in C calling convention" { |
| 1116 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1125 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1117 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 1126 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 1118 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1127 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1119 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1128 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1120 | 1129 | ||
| 1121 | const S = packed struct(u16) { | 1130 | const S = packed struct(u16) { |
| 1122 | x: u15 = 0, | 1131 | x: u15 = 0, |
| ... | @@ -1162,6 +1171,7 @@ test "packed struct equality" { | ... | @@ -1162,6 +1171,7 @@ test "packed struct equality" { |
| 1162 | } | 1171 | } |
| 1163 | 1172 | ||
| 1164 | test "packed struct equality ignores padding bits" { | 1173 | test "packed struct equality ignores padding bits" { |
| 1174 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 1165 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1175 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1166 | 1176 | ||
| 1167 | const S = packed struct { b: bool }; | 1177 | const S = packed struct { b: bool }; |
| ... | @@ -1172,6 +1182,7 @@ test "packed struct equality ignores padding bits" { | ... | @@ -1172,6 +1182,7 @@ test "packed struct equality ignores padding bits" { |
| 1172 | } | 1182 | } |
| 1173 | 1183 | ||
| 1174 | test "packed struct with signed field" { | 1184 | test "packed struct with signed field" { |
| 1185 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 1175 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1186 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1176 | 1187 | ||
| 1177 | var s: packed struct { | 1188 | var s: packed struct { |
| ... | @@ -1184,6 +1195,7 @@ test "packed struct with signed field" { | ... | @@ -1184,6 +1195,7 @@ test "packed struct with signed field" { |
| 1184 | } | 1195 | } |
| 1185 | 1196 | ||
| 1186 | test "assign packed struct initialized with RLS to packed struct literal field" { | 1197 | test "assign packed struct initialized with RLS to packed struct literal field" { |
| 1198 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 1187 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1199 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1188 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1200 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1189 | 1201 | ||
| ... | @@ -1200,6 +1212,7 @@ test "assign packed struct initialized with RLS to packed struct literal field" | ... | @@ -1200,6 +1212,7 @@ test "assign packed struct initialized with RLS to packed struct literal field" |
| 1200 | } | 1212 | } |
| 1201 | 1213 | ||
| 1202 | test "packed struct store of comparison result" { | 1214 | test "packed struct store of comparison result" { |
| 1215 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 1203 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1216 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1204 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 1217 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 1205 | 1218 | ||
| ... | @@ -1250,6 +1263,7 @@ test "convert from/to backing int" { | ... | @@ -1250,6 +1263,7 @@ test "convert from/to backing int" { |
| 1250 | } | 1263 | } |
| 1251 | 1264 | ||
| 1252 | test "equality with wide backing integer" { | 1265 | test "equality with wide backing integer" { |
| 1266 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1253 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/35982 | 1267 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/35982 |
| 1254 | 1268 | ||
| 1255 | const S = packed struct(i200) { | 1269 | const S = packed struct(i200) { |
test/behavior/packed-union.zig+8-8| ... | @@ -8,7 +8,7 @@ test "flags in packed union" { | ... | @@ -8,7 +8,7 @@ test "flags in packed union" { |
| 8 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 8 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 11 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 11 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 12 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 12 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 13 | 13 | ||
| 14 | try testFlagsInPackedUnion(); | 14 | try testFlagsInPackedUnion(); |
| ... | @@ -51,7 +51,7 @@ test "flags in packed union at offset" { | ... | @@ -51,7 +51,7 @@ test "flags in packed union at offset" { |
| 51 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 51 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 52 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 52 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 53 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 53 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 54 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 54 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 55 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 55 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 56 | 56 | ||
| 57 | try testFlagsInPackedUnionAtOffset(); | 57 | try testFlagsInPackedUnionAtOffset(); |
| ... | @@ -107,7 +107,7 @@ fn testFlagsInPackedUnionAtOffset() !void { | ... | @@ -107,7 +107,7 @@ fn testFlagsInPackedUnionAtOffset() !void { |
| 107 | test "packed union in packed struct" { | 107 | test "packed union in packed struct" { |
| 108 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 108 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 109 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 109 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 110 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 110 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 111 | 111 | ||
| 112 | try testPackedUnionInPackedStruct(); | 112 | try testPackedUnionInPackedStruct(); |
| 113 | try comptime testPackedUnionInPackedStruct(); | 113 | try comptime testPackedUnionInPackedStruct(); |
| ... | @@ -144,7 +144,7 @@ test "packed union initialized with a runtime value" { | ... | @@ -144,7 +144,7 @@ test "packed union initialized with a runtime value" { |
| 144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 145 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 145 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 146 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 146 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 147 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 147 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 148 | 148 | ||
| 149 | const Fields = packed struct { | 149 | const Fields = packed struct { |
| 150 | timestamp: u50, | 150 | timestamp: u50, |
| ... | @@ -182,7 +182,7 @@ test "assigning to non-active field at comptime" { | ... | @@ -182,7 +182,7 @@ test "assigning to non-active field at comptime" { |
| 182 | test "packed union with explicit backing integer" { | 182 | test "packed union with explicit backing integer" { |
| 183 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 183 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 184 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 184 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 185 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 185 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 186 | 186 | ||
| 187 | const U = packed union(i32) { | 187 | const U = packed union(i32) { |
| 188 | raw: i32, | 188 | raw: i32, |
| ... | @@ -201,7 +201,7 @@ test "packed union with explicit backing integer" { | ... | @@ -201,7 +201,7 @@ test "packed union with explicit backing integer" { |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | test "packed union equality" { | 203 | test "packed union equality" { |
| 204 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 204 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 205 | 205 | ||
| 206 | const Foo = packed union { | 206 | const Foo = packed union { |
| 207 | a: u4, | 207 | a: u4, |
| ... | @@ -229,7 +229,7 @@ test "initialize packed union field to undefined at comptime" { | ... | @@ -229,7 +229,7 @@ test "initialize packed union field to undefined at comptime" { |
| 229 | } | 229 | } |
| 230 | 230 | ||
| 231 | test "convert from/to backing int" { | 231 | test "convert from/to backing int" { |
| 232 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 232 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 233 | 233 | ||
| 234 | const U = packed union(u10) { | 234 | const U = packed union(u10) { |
| 235 | a: i10, | 235 | a: i10, |
| ... | @@ -246,7 +246,7 @@ test "convert from/to backing int" { | ... | @@ -246,7 +246,7 @@ test "convert from/to backing int" { |
| 246 | 246 | ||
| 247 | test "equality with wide backing integer" { | 247 | test "equality with wide backing integer" { |
| 248 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/35982 | 248 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/35982 |
| 249 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 249 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 250 | 250 | ||
| 251 | const U = packed union(i200) { | 251 | const U = packed union(i200) { |
| 252 | x: u200, | 252 | x: u200, |
test/behavior/packed_struct_explicit_backing_int.zig+1| ... | @@ -5,6 +5,7 @@ const expectEqual = std.testing.expectEqual; | ... | @@ -5,6 +5,7 @@ const expectEqual = std.testing.expectEqual; |
| 5 | const native_endian = builtin.cpu.arch.endian(); | 5 | const native_endian = builtin.cpu.arch.endian(); |
| 6 | 6 | ||
| 7 | test "packed struct explicit backing integer" { | 7 | test "packed struct explicit backing integer" { |
| 8 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 10 | 11 |
test/behavior/pointers.zig+36-28| ... | @@ -20,7 +20,7 @@ fn testDerefPtr() !void { | ... | @@ -20,7 +20,7 @@ fn testDerefPtr() !void { |
| 20 | test "pointer-integer arithmetic" { | 20 | test "pointer-integer arithmetic" { |
| 21 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 21 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 22 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 22 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 23 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 23 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 24 | 24 | ||
| 25 | var ptr: [*]const u8 = "abcd"; | 25 | var ptr: [*]const u8 = "abcd"; |
| 26 | 26 | ||
| ... | @@ -45,7 +45,7 @@ test "pointer-integer arithmetic" { | ... | @@ -45,7 +45,7 @@ test "pointer-integer arithmetic" { |
| 45 | 45 | ||
| 46 | test "pointer subtraction" { | 46 | test "pointer subtraction" { |
| 47 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 47 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 48 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 48 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 49 | 49 | ||
| 50 | { | 50 | { |
| 51 | const a: *u8 = @ptrFromInt(100); | 51 | const a: *u8 = @ptrFromInt(100); |
| ... | @@ -100,7 +100,7 @@ test "pointer subtraction" { | ... | @@ -100,7 +100,7 @@ test "pointer subtraction" { |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | test "pointer arithmetic with non-trivial RHS" { | 102 | test "pointer arithmetic with non-trivial RHS" { |
| 103 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 103 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 104 | 104 | ||
| 105 | var t: bool = undefined; | 105 | var t: bool = undefined; |
| 106 | t = true; | 106 | t = true; |
| ... | @@ -126,7 +126,7 @@ fn PtrOf(comptime T: type) type { | ... | @@ -126,7 +126,7 @@ fn PtrOf(comptime T: type) type { |
| 126 | 126 | ||
| 127 | test "implicit cast single item pointer to C pointer and back" { | 127 | test "implicit cast single item pointer to C pointer and back" { |
| 128 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 128 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 129 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 129 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 130 | 130 | ||
| 131 | var y: u8 = 11; | 131 | var y: u8 = 11; |
| 132 | const x: [*c]u8 = &y; | 132 | const x: [*c]u8 = &y; |
| ... | @@ -143,7 +143,7 @@ test "initialize const optional C pointer to null" { | ... | @@ -143,7 +143,7 @@ test "initialize const optional C pointer to null" { |
| 143 | 143 | ||
| 144 | test "assigning integer to C pointer" { | 144 | test "assigning integer to C pointer" { |
| 145 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 145 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 146 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 146 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 147 | var x: i32 = 0; | 147 | var x: i32 = 0; |
| 148 | var y: i32 = 1; | 148 | var y: i32 = 1; |
| 149 | var ptr: [*c]u8 = 0; | 149 | var ptr: [*c]u8 = 0; |
| ... | @@ -160,7 +160,7 @@ test "assigning integer to C pointer" { | ... | @@ -160,7 +160,7 @@ test "assigning integer to C pointer" { |
| 160 | 160 | ||
| 161 | test "C pointer comparison and arithmetic" { | 161 | test "C pointer comparison and arithmetic" { |
| 162 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 162 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 163 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 163 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 164 | 164 | ||
| 165 | const S = struct { | 165 | const S = struct { |
| 166 | fn doTheTest() !void { | 166 | fn doTheTest() !void { |
| ... | @@ -204,7 +204,7 @@ fn testDerefPtrOneVal() !void { | ... | @@ -204,7 +204,7 @@ fn testDerefPtrOneVal() !void { |
| 204 | } | 204 | } |
| 205 | 205 | ||
| 206 | test "peer type resolution with C pointers" { | 206 | test "peer type resolution with C pointers" { |
| 207 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 207 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 208 | 208 | ||
| 209 | const ptr_one: *u8 = undefined; | 209 | const ptr_one: *u8 = undefined; |
| 210 | const ptr_many: [*]u8 = undefined; | 210 | const ptr_many: [*]u8 = undefined; |
| ... | @@ -222,6 +222,7 @@ test "peer type resolution with C pointers" { | ... | @@ -222,6 +222,7 @@ test "peer type resolution with C pointers" { |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | test "peer type resolution with C pointer and const pointer" { | 224 | test "peer type resolution with C pointer and const pointer" { |
| 225 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 225 | var ptr_c: [*c]u8 = undefined; | 226 | var ptr_c: [*c]u8 = undefined; |
| 226 | var ptr_const: *const u8 = &undefined; | 227 | var ptr_const: *const u8 = &undefined; |
| 227 | _ = .{ &ptr_c, &ptr_const }; | 228 | _ = .{ &ptr_c, &ptr_const }; |
| ... | @@ -232,7 +233,7 @@ test "implicit casting between C pointer and optional non-C pointer" { | ... | @@ -232,7 +233,7 @@ test "implicit casting between C pointer and optional non-C pointer" { |
| 232 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 233 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 233 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 234 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 234 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 235 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 235 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 236 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 236 | 237 | ||
| 237 | var slice: []const u8 = "aoeu"; | 238 | var slice: []const u8 = "aoeu"; |
| 238 | _ = &slice; | 239 | _ = &slice; |
| ... | @@ -247,7 +248,7 @@ test "implicit casting between C pointer and optional non-C pointer" { | ... | @@ -247,7 +248,7 @@ test "implicit casting between C pointer and optional non-C pointer" { |
| 247 | test "implicit cast error unions with non-optional to optional pointer" { | 248 | test "implicit cast error unions with non-optional to optional pointer" { |
| 248 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 249 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 249 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 250 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 250 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 251 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 251 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 252 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 252 | 253 | ||
| 253 | const S = struct { | 254 | const S = struct { |
| ... | @@ -276,7 +277,7 @@ test "allowzero pointer and slice" { | ... | @@ -276,7 +277,7 @@ test "allowzero pointer and slice" { |
| 276 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | 277 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 277 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 278 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 278 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 279 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 279 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 280 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 280 | 281 | ||
| 281 | var ptr: [*]allowzero i32 = @ptrFromInt(0); | 282 | var ptr: [*]allowzero i32 = @ptrFromInt(0); |
| 282 | const opt_ptr: ?[*]allowzero i32 = ptr; | 283 | const opt_ptr: ?[*]allowzero i32 = ptr; |
| ... | @@ -295,7 +296,7 @@ test "allowzero pointer and slice" { | ... | @@ -295,7 +296,7 @@ test "allowzero pointer and slice" { |
| 295 | test "assign null directly to C pointer and test null equality" { | 296 | test "assign null directly to C pointer and test null equality" { |
| 296 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 297 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 297 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 298 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 298 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 299 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 299 | 300 | ||
| 300 | var x: [*c]i32 = null; | 301 | var x: [*c]i32 = null; |
| 301 | _ = &x; | 302 | _ = &x; |
| ... | @@ -353,6 +354,8 @@ test "assign null directly to C pointer and test null equality" { | ... | @@ -353,6 +354,8 @@ test "assign null directly to C pointer and test null equality" { |
| 353 | } | 354 | } |
| 354 | 355 | ||
| 355 | test "array initialization types" { | 356 | test "array initialization types" { |
| 357 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 358 | |||
| 356 | const E = enum { A, B, C }; | 359 | const E = enum { A, B, C }; |
| 357 | try expect(@TypeOf([_]u8{}) == [0]u8); | 360 | try expect(@TypeOf([_]u8{}) == [0]u8); |
| 358 | try expect(@TypeOf([_:0]u8{}) == [0:0]u8); | 361 | try expect(@TypeOf([_:0]u8{}) == [0:0]u8); |
| ... | @@ -362,7 +365,7 @@ test "array initialization types" { | ... | @@ -362,7 +365,7 @@ test "array initialization types" { |
| 362 | 365 | ||
| 363 | test "null terminated pointer" { | 366 | test "null terminated pointer" { |
| 364 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 367 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 365 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 368 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 366 | 369 | ||
| 367 | const S = struct { | 370 | const S = struct { |
| 368 | fn doTheTest() !void { | 371 | fn doTheTest() !void { |
| ... | @@ -380,7 +383,7 @@ test "null terminated pointer" { | ... | @@ -380,7 +383,7 @@ test "null terminated pointer" { |
| 380 | test "allow any sentinel" { | 383 | test "allow any sentinel" { |
| 381 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 384 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 382 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 385 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 383 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 386 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 384 | 387 | ||
| 385 | const S = struct { | 388 | const S = struct { |
| 386 | fn doTheTest() !void { | 389 | fn doTheTest() !void { |
| ... | @@ -396,7 +399,7 @@ test "allow any sentinel" { | ... | @@ -396,7 +399,7 @@ test "allow any sentinel" { |
| 396 | test "pointer sentinel with enums" { | 399 | test "pointer sentinel with enums" { |
| 397 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 400 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 398 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 401 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 399 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 402 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 400 | 403 | ||
| 401 | const S = struct { | 404 | const S = struct { |
| 402 | const Number = enum { | 405 | const Number = enum { |
| ... | @@ -419,7 +422,7 @@ test "pointer sentinel with optional element" { | ... | @@ -419,7 +422,7 @@ test "pointer sentinel with optional element" { |
| 419 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 422 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 420 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 423 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 421 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 424 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 422 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 425 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 423 | 426 | ||
| 424 | const S = struct { | 427 | const S = struct { |
| 425 | fn doTheTest() !void { | 428 | fn doTheTest() !void { |
| ... | @@ -436,7 +439,7 @@ test "pointer sentinel with +inf" { | ... | @@ -436,7 +439,7 @@ test "pointer sentinel with +inf" { |
| 436 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 439 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 437 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 440 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 438 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 441 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 439 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 442 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 440 | 443 | ||
| 441 | const S = struct { | 444 | const S = struct { |
| 442 | fn doTheTest() !void { | 445 | fn doTheTest() !void { |
| ... | @@ -458,7 +461,7 @@ test "pointer to array at fixed address" { | ... | @@ -458,7 +461,7 @@ test "pointer to array at fixed address" { |
| 458 | } | 461 | } |
| 459 | 462 | ||
| 460 | test "pointer-integer arithmetic affects the alignment" { | 463 | test "pointer-integer arithmetic affects the alignment" { |
| 461 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 464 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 462 | 465 | ||
| 463 | { | 466 | { |
| 464 | var ptr: [*]align(8) u32 = undefined; | 467 | var ptr: [*]align(8) u32 = undefined; |
| ... | @@ -507,7 +510,7 @@ test "@intFromPtr on null optional at comptime" { | ... | @@ -507,7 +510,7 @@ test "@intFromPtr on null optional at comptime" { |
| 507 | test "indexing array with sentinel returns correct type" { | 510 | test "indexing array with sentinel returns correct type" { |
| 508 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 511 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 509 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 512 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 510 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 513 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 511 | 514 | ||
| 512 | var s: [:0]const u8 = "abc"; | 515 | var s: [:0]const u8 = "abc"; |
| 513 | try testing.expectEqualSlices(u8, "*const u8", @typeName(@TypeOf(&s[0]))); | 516 | try testing.expectEqualSlices(u8, "*const u8", @typeName(@TypeOf(&s[0]))); |
| ... | @@ -515,7 +518,7 @@ test "indexing array with sentinel returns correct type" { | ... | @@ -515,7 +518,7 @@ test "indexing array with sentinel returns correct type" { |
| 515 | 518 | ||
| 516 | test "element pointer to slice" { | 519 | test "element pointer to slice" { |
| 517 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 520 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 518 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 521 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 519 | 522 | ||
| 520 | const S = struct { | 523 | const S = struct { |
| 521 | fn doTheTest() !void { | 524 | fn doTheTest() !void { |
| ... | @@ -537,7 +540,7 @@ test "element pointer to slice" { | ... | @@ -537,7 +540,7 @@ test "element pointer to slice" { |
| 537 | 540 | ||
| 538 | test "element pointer arithmetic to slice" { | 541 | test "element pointer arithmetic to slice" { |
| 539 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 542 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 540 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 543 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 541 | 544 | ||
| 542 | const S = struct { | 545 | const S = struct { |
| 543 | fn doTheTest() !void { | 546 | fn doTheTest() !void { |
| ... | @@ -562,7 +565,7 @@ test "element pointer arithmetic to slice" { | ... | @@ -562,7 +565,7 @@ test "element pointer arithmetic to slice" { |
| 562 | 565 | ||
| 563 | test "array slicing to slice" { | 566 | test "array slicing to slice" { |
| 564 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 567 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 565 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 568 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 566 | 569 | ||
| 567 | const S = struct { | 570 | const S = struct { |
| 568 | fn doTheTest() !void { | 571 | fn doTheTest() !void { |
| ... | @@ -592,7 +595,7 @@ test "pointer to constant decl preserves alignment" { | ... | @@ -592,7 +595,7 @@ test "pointer to constant decl preserves alignment" { |
| 592 | test "ptrCast comptime known slice to C pointer" { | 595 | test "ptrCast comptime known slice to C pointer" { |
| 593 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 596 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 594 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 597 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 595 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 598 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 596 | 599 | ||
| 597 | const s: [:0]const u8 = "foo"; | 600 | const s: [:0]const u8 = "foo"; |
| 598 | var p: [*c]const u8 = @ptrCast(s); | 601 | var p: [*c]const u8 = @ptrCast(s); |
| ... | @@ -611,7 +614,7 @@ test "pointer alignment and element type include call expression" { | ... | @@ -611,7 +614,7 @@ test "pointer alignment and element type include call expression" { |
| 611 | } | 614 | } |
| 612 | 615 | ||
| 613 | test "pointer to array has explicit alignment" { | 616 | test "pointer to array has explicit alignment" { |
| 614 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 617 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 615 | 618 | ||
| 616 | const S = struct { | 619 | const S = struct { |
| 617 | const Base = extern struct { a: u8 }; | 620 | const Base = extern struct { a: u8 }; |
| ... | @@ -636,6 +639,8 @@ test "result type preserved through multiple references" { | ... | @@ -636,6 +639,8 @@ test "result type preserved through multiple references" { |
| 636 | } | 639 | } |
| 637 | 640 | ||
| 638 | test "result type found through optional pointer" { | 641 | test "result type found through optional pointer" { |
| 642 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 643 | |||
| 639 | const ptr1: ?*const u32 = &@intCast(123); | 644 | const ptr1: ?*const u32 = &@intCast(123); |
| 640 | const ptr2: ?[]const u8 = &.{ @intCast(123), @truncate(0xABCD) }; | 645 | const ptr2: ?[]const u8 = &.{ @intCast(123), @truncate(0xABCD) }; |
| 641 | try expect(ptr1.?.* == 123); | 646 | try expect(ptr1.?.* == 123); |
| ... | @@ -688,14 +693,15 @@ fn constant() !void { | ... | @@ -688,14 +693,15 @@ fn constant() !void { |
| 688 | 693 | ||
| 689 | test "pointer-to-array constness for zero-size elements, var" { | 694 | test "pointer-to-array constness for zero-size elements, var" { |
| 690 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 695 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 691 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 696 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 697 | |||
| 692 | try mutable(); | 698 | try mutable(); |
| 693 | try comptime mutable(); | 699 | try comptime mutable(); |
| 694 | } | 700 | } |
| 695 | 701 | ||
| 696 | test "pointer-to-array constness for zero-size elements, const" { | 702 | test "pointer-to-array constness for zero-size elements, const" { |
| 697 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 703 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 698 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 704 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 699 | 705 | ||
| 700 | try constant(); | 706 | try constant(); |
| 701 | try comptime constant(); | 707 | try comptime constant(); |
| ... | @@ -735,7 +741,7 @@ test "comptime pointer equality through distinct fields with well-defined layout | ... | @@ -735,7 +741,7 @@ test "comptime pointer equality through distinct fields with well-defined layout |
| 735 | } | 741 | } |
| 736 | 742 | ||
| 737 | test "comptime pointer equality through distinct elements with well-defined layout" { | 743 | test "comptime pointer equality through distinct elements with well-defined layout" { |
| 738 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 744 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 739 | 745 | ||
| 740 | const buf: [2]u32 = .{ 123, 456 }; | 746 | const buf: [2]u32 = .{ 123, 456 }; |
| 741 | 747 | ||
| ... | @@ -749,7 +755,7 @@ test "comptime pointer equality through distinct elements with well-defined layo | ... | @@ -749,7 +755,7 @@ test "comptime pointer equality through distinct elements with well-defined layo |
| 749 | } | 755 | } |
| 750 | 756 | ||
| 751 | test "pointers to elements of slice of zero-bit type" { | 757 | test "pointers to elements of slice of zero-bit type" { |
| 752 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 758 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 753 | 759 | ||
| 754 | var slice: []const u0 = undefined; | 760 | var slice: []const u0 = undefined; |
| 755 | slice = &.{ 0, 0 }; | 761 | slice = &.{ 0, 0 }; |
| ... | @@ -761,7 +767,7 @@ test "pointers to elements of slice of zero-bit type" { | ... | @@ -761,7 +767,7 @@ test "pointers to elements of slice of zero-bit type" { |
| 761 | } | 767 | } |
| 762 | 768 | ||
| 763 | test "pointers to elements of many-ptr to zero-bit type" { | 769 | test "pointers to elements of many-ptr to zero-bit type" { |
| 764 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 770 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 765 | 771 | ||
| 766 | var many_ptr: [*]const u0 = undefined; | 772 | var many_ptr: [*]const u0 = undefined; |
| 767 | many_ptr = &.{ 0, 0 }; | 773 | many_ptr = &.{ 0, 0 }; |
| ... | @@ -773,6 +779,8 @@ test "pointers to elements of many-ptr to zero-bit type" { | ... | @@ -773,6 +779,8 @@ test "pointers to elements of many-ptr to zero-bit type" { |
| 773 | } | 779 | } |
| 774 | 780 | ||
| 775 | test "comptime C pointer to optional pointer" { | 781 | test "comptime C pointer to optional pointer" { |
| 782 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 783 | |||
| 776 | const opt: ?*u8 = @ptrFromInt(0x1000); | 784 | const opt: ?*u8 = @ptrFromInt(0x1000); |
| 777 | const outer_ptr: [*c]const ?*u8 = &opt; | 785 | const outer_ptr: [*c]const ?*u8 = &opt; |
| 778 | const inner_ptr = &outer_ptr.*.?; | 786 | const inner_ptr = &outer_ptr.*.?; |
test/behavior/popcount.zig+3-3| ... | @@ -6,7 +6,7 @@ const expectEqual = std.testing.expectEqual; | ... | @@ -6,7 +6,7 @@ const expectEqual = std.testing.expectEqual; |
| 6 | test "@popCount integers" { | 6 | test "@popCount integers" { |
| 7 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 7 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 9 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 9 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 10 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 10 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 11 | 11 | ||
| 12 | try comptime testPopCountIntegers(); | 12 | try comptime testPopCountIntegers(); |
| ... | @@ -17,7 +17,7 @@ test "@popCount 128bit integer" { | ... | @@ -17,7 +17,7 @@ test "@popCount 128bit integer" { |
| 17 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 17 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 18 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 18 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 19 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 19 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 20 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 20 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 21 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 21 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 22 | 22 | ||
| 23 | comptime { | 23 | comptime { |
| ... | @@ -79,7 +79,7 @@ test "@popCount vectors" { | ... | @@ -79,7 +79,7 @@ test "@popCount vectors" { |
| 79 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 79 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 80 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 80 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 81 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 81 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 82 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 82 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 83 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 83 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 84 | 84 | ||
| 85 | try comptime testPopCountVectors(); | 85 | try comptime testPopCountVectors(); |
test/behavior/prefetch.zig+1-1| ... | @@ -2,7 +2,7 @@ const builtin = @import("builtin"); | ... | @@ -2,7 +2,7 @@ const builtin = @import("builtin"); |
| 2 | const std = @import("std"); | 2 | const std = @import("std"); |
| 3 | 3 | ||
| 4 | test "@prefetch()" { | 4 | test "@prefetch()" { |
| 5 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 5 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 6 | 6 | ||
| 7 | var a: [2]u32 = .{ 42, 42 }; | 7 | var a: [2]u32 = .{ 42, 42 }; |
| 8 | var a_len = a.len; | 8 | var a_len = a.len; |
test/behavior/ptrcast.zig+22-19| ... | @@ -6,7 +6,7 @@ const native_endian = builtin.target.cpu.arch.endian(); | ... | @@ -6,7 +6,7 @@ const native_endian = builtin.target.cpu.arch.endian(); |
| 6 | 6 | ||
| 7 | test "reinterpret bytes as integer with nonzero offset" { | 7 | test "reinterpret bytes as integer with nonzero offset" { |
| 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 9 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 9 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 10 | 10 | ||
| 11 | try testReinterpretBytesAsInteger(); | 11 | try testReinterpretBytesAsInteger(); |
| 12 | try comptime testReinterpretBytesAsInteger(); | 12 | try comptime testReinterpretBytesAsInteger(); |
| ... | @@ -22,6 +22,7 @@ fn testReinterpretBytesAsInteger() !void { | ... | @@ -22,6 +22,7 @@ fn testReinterpretBytesAsInteger() !void { |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | test "reinterpret an array over multiple elements, with no well-defined layout" { | 24 | test "reinterpret an array over multiple elements, with no well-defined layout" { |
| 25 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 25 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 26 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 26 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 27 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 27 | 28 | ||
| ... | @@ -39,7 +40,7 @@ fn testReinterpretWithOffsetAndNoWellDefinedLayout() !void { | ... | @@ -39,7 +40,7 @@ fn testReinterpretWithOffsetAndNoWellDefinedLayout() !void { |
| 39 | 40 | ||
| 40 | test "reinterpret bytes inside auto-layout struct as integer with nonzero offset" { | 41 | test "reinterpret bytes inside auto-layout struct as integer with nonzero offset" { |
| 41 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 42 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 42 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 43 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 43 | 44 | ||
| 44 | try testReinterpretStructWrappedBytesAsInteger(); | 45 | try testReinterpretStructWrappedBytesAsInteger(); |
| 45 | try comptime testReinterpretStructWrappedBytesAsInteger(); | 46 | try comptime testReinterpretStructWrappedBytesAsInteger(); |
| ... | @@ -57,7 +58,7 @@ fn testReinterpretStructWrappedBytesAsInteger() !void { | ... | @@ -57,7 +58,7 @@ fn testReinterpretStructWrappedBytesAsInteger() !void { |
| 57 | 58 | ||
| 58 | test "reinterpret bytes of an array into an extern struct" { | 59 | test "reinterpret bytes of an array into an extern struct" { |
| 59 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 60 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 60 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 61 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 61 | 62 | ||
| 62 | try testReinterpretBytesAsExternStruct(); | 63 | try testReinterpretBytesAsExternStruct(); |
| 63 | try comptime testReinterpretBytesAsExternStruct(); | 64 | try comptime testReinterpretBytesAsExternStruct(); |
| ... | @@ -171,7 +172,7 @@ test "lower reinterpreted comptime field ptr" { | ... | @@ -171,7 +172,7 @@ test "lower reinterpreted comptime field ptr" { |
| 171 | 172 | ||
| 172 | test "reinterpret struct field at comptime" { | 173 | test "reinterpret struct field at comptime" { |
| 173 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 174 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 174 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 175 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 175 | 176 | ||
| 176 | const numNative = comptime Bytes.init(0x12345678); | 177 | const numNative = comptime Bytes.init(0x12345678); |
| 177 | if (native_endian != .little) { | 178 | if (native_endian != .little) { |
| ... | @@ -194,7 +195,7 @@ const Bytes = struct { | ... | @@ -194,7 +195,7 @@ const Bytes = struct { |
| 194 | 195 | ||
| 195 | test "ptrcast of const integer has the correct object size" { | 196 | test "ptrcast of const integer has the correct object size" { |
| 196 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 197 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 197 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 198 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 198 | 199 | ||
| 199 | const is_value = ~@as(isize, @intCast(std.math.minInt(isize))); | 200 | const is_value = ~@as(isize, @intCast(std.math.minInt(isize))); |
| 200 | const is_bytes = @as([*]const u8, @ptrCast(&is_value))[0..@sizeOf(isize)]; | 201 | const is_bytes = @as([*]const u8, @ptrCast(&is_value))[0..@sizeOf(isize)]; |
| ... | @@ -229,7 +230,7 @@ test "ptrcast of const integer has the correct object size" { | ... | @@ -229,7 +230,7 @@ test "ptrcast of const integer has the correct object size" { |
| 229 | test "implicit optional pointer to optional anyopaque pointer" { | 230 | test "implicit optional pointer to optional anyopaque pointer" { |
| 230 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 231 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 231 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 232 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 232 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 233 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 233 | 234 | ||
| 234 | var buf: [4]u8 = "aoeu".*; | 235 | var buf: [4]u8 = "aoeu".*; |
| 235 | const x: ?[*]u8 = &buf; | 236 | const x: ?[*]u8 = &buf; |
| ... | @@ -241,7 +242,7 @@ test "implicit optional pointer to optional anyopaque pointer" { | ... | @@ -241,7 +242,7 @@ test "implicit optional pointer to optional anyopaque pointer" { |
| 241 | test "@ptrCast slice to slice" { | 242 | test "@ptrCast slice to slice" { |
| 242 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 243 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 243 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 244 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 244 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 245 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 245 | 246 | ||
| 246 | const S = struct { | 247 | const S = struct { |
| 247 | fn foo(slice: []u32) []i32 { | 248 | fn foo(slice: []u32) []i32 { |
| ... | @@ -281,6 +282,8 @@ test "@ptrCast undefined value at comptime" { | ... | @@ -281,6 +282,8 @@ test "@ptrCast undefined value at comptime" { |
| 281 | } | 282 | } |
| 282 | 283 | ||
| 283 | test "comptime @ptrCast with packed struct leaves value unmodified" { | 284 | test "comptime @ptrCast with packed struct leaves value unmodified" { |
| 285 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 286 | |||
| 284 | const S = packed struct { three: u3 }; | 287 | const S = packed struct { three: u3 }; |
| 285 | const st: S = .{ .three = 6 }; | 288 | const st: S = .{ .three = 6 }; |
| 286 | try expect(st.three == 6); | 289 | try expect(st.three == 6); |
| ... | @@ -332,7 +335,7 @@ test "@ptrCast restructures comptime-only array" { | ... | @@ -332,7 +335,7 @@ test "@ptrCast restructures comptime-only array" { |
| 332 | } | 335 | } |
| 333 | 336 | ||
| 334 | test "@ptrCast restructures sliced comptime-only array" { | 337 | test "@ptrCast restructures sliced comptime-only array" { |
| 335 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 338 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 336 | 339 | ||
| 337 | const a3a2: [4][2]comptime_int = .{ | 340 | const a3a2: [4][2]comptime_int = .{ |
| 338 | .{ 1, 2 }, | 341 | .{ 1, 2 }, |
| ... | @@ -351,7 +354,7 @@ test "@ptrCast restructures sliced comptime-only array" { | ... | @@ -351,7 +354,7 @@ test "@ptrCast restructures sliced comptime-only array" { |
| 351 | test "@ptrCast slice multiplying length" { | 354 | test "@ptrCast slice multiplying length" { |
| 352 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 355 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 353 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 356 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 354 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 357 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 355 | 358 | ||
| 356 | const S = struct { | 359 | const S = struct { |
| 357 | fn doTheTest(zero: u32) !void { | 360 | fn doTheTest(zero: u32) !void { |
| ... | @@ -368,7 +371,7 @@ test "@ptrCast slice multiplying length" { | ... | @@ -368,7 +371,7 @@ test "@ptrCast slice multiplying length" { |
| 368 | test "@ptrCast array pointer to slice multiplying length" { | 371 | test "@ptrCast array pointer to slice multiplying length" { |
| 369 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 372 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 370 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 373 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 371 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 374 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 372 | 375 | ||
| 373 | const S = struct { | 376 | const S = struct { |
| 374 | fn doTheTest(zero: u32) !void { | 377 | fn doTheTest(zero: u32) !void { |
| ... | @@ -385,7 +388,7 @@ test "@ptrCast array pointer to slice multiplying length" { | ... | @@ -385,7 +388,7 @@ test "@ptrCast array pointer to slice multiplying length" { |
| 385 | test "@ptrCast slice dividing length" { | 388 | test "@ptrCast slice dividing length" { |
| 386 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 389 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 387 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 390 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 388 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 391 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 389 | 392 | ||
| 390 | const S = struct { | 393 | const S = struct { |
| 391 | fn doTheTest(zero: u8) !void { | 394 | fn doTheTest(zero: u8) !void { |
| ... | @@ -402,7 +405,7 @@ test "@ptrCast slice dividing length" { | ... | @@ -402,7 +405,7 @@ test "@ptrCast slice dividing length" { |
| 402 | test "@ptrCast array pointer to slice dividing length" { | 405 | test "@ptrCast array pointer to slice dividing length" { |
| 403 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 406 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 404 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 407 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 405 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 408 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 406 | 409 | ||
| 407 | const S = struct { | 410 | const S = struct { |
| 408 | fn doTheTest(zero: u8) !void { | 411 | fn doTheTest(zero: u8) !void { |
| ... | @@ -419,7 +422,7 @@ test "@ptrCast array pointer to slice dividing length" { | ... | @@ -419,7 +422,7 @@ test "@ptrCast array pointer to slice dividing length" { |
| 419 | test "@ptrCast slice with complex length increase" { | 422 | test "@ptrCast slice with complex length increase" { |
| 420 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 423 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 421 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 424 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 422 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 425 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 423 | 426 | ||
| 424 | const TwoBytes = [2]u8; | 427 | const TwoBytes = [2]u8; |
| 425 | const ThreeBytes = [3]u8; | 428 | const ThreeBytes = [3]u8; |
| ... | @@ -439,7 +442,7 @@ test "@ptrCast slice with complex length increase" { | ... | @@ -439,7 +442,7 @@ test "@ptrCast slice with complex length increase" { |
| 439 | test "@ptrCast array pointer to slice with complex length increase" { | 442 | test "@ptrCast array pointer to slice with complex length increase" { |
| 440 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 443 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 441 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 444 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 442 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 445 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 443 | 446 | ||
| 444 | const TwoBytes = [2]u8; | 447 | const TwoBytes = [2]u8; |
| 445 | const ThreeBytes = [3]u8; | 448 | const ThreeBytes = [3]u8; |
| ... | @@ -459,7 +462,7 @@ test "@ptrCast array pointer to slice with complex length increase" { | ... | @@ -459,7 +462,7 @@ test "@ptrCast array pointer to slice with complex length increase" { |
| 459 | test "@ptrCast slice with complex length decrease" { | 462 | test "@ptrCast slice with complex length decrease" { |
| 460 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 463 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 461 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 464 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 462 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 465 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 463 | 466 | ||
| 464 | const TwoBytes = [2]u8; | 467 | const TwoBytes = [2]u8; |
| 465 | const ThreeBytes = [3]u8; | 468 | const ThreeBytes = [3]u8; |
| ... | @@ -479,7 +482,7 @@ test "@ptrCast slice with complex length decrease" { | ... | @@ -479,7 +482,7 @@ test "@ptrCast slice with complex length decrease" { |
| 479 | test "@ptrCast array pointer to slice with complex length decrease" { | 482 | test "@ptrCast array pointer to slice with complex length decrease" { |
| 480 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 483 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 481 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 484 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 482 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 485 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 483 | 486 | ||
| 484 | const TwoBytes = [2]u8; | 487 | const TwoBytes = [2]u8; |
| 485 | const ThreeBytes = [3]u8; | 488 | const ThreeBytes = [3]u8; |
| ... | @@ -499,7 +502,7 @@ test "@ptrCast array pointer to slice with complex length decrease" { | ... | @@ -499,7 +502,7 @@ test "@ptrCast array pointer to slice with complex length decrease" { |
| 499 | test "@ptrCast slice of zero-bit type to different slice" { | 502 | test "@ptrCast slice of zero-bit type to different slice" { |
| 500 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 503 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 501 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 504 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 502 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 505 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 503 | 506 | ||
| 504 | const S = struct { | 507 | const S = struct { |
| 505 | fn doTheTest(comptime T: type, zero_bits: []const T) !void { | 508 | fn doTheTest(comptime T: type, zero_bits: []const T) !void { |
| ... | @@ -518,7 +521,7 @@ test "@ptrCast slice of zero-bit type to different slice" { | ... | @@ -518,7 +521,7 @@ test "@ptrCast slice of zero-bit type to different slice" { |
| 518 | test "@ptrCast single-item pointer to slice with length 1" { | 521 | test "@ptrCast single-item pointer to slice with length 1" { |
| 519 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 522 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 520 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 523 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 521 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 524 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 522 | 525 | ||
| 523 | const S = struct { | 526 | const S = struct { |
| 524 | fn doTheTest(comptime T: type, ptr: *const T) !void { | 527 | fn doTheTest(comptime T: type, ptr: *const T) !void { |
| ... | @@ -538,7 +541,7 @@ test "@ptrCast single-item pointer to slice with length 1" { | ... | @@ -538,7 +541,7 @@ test "@ptrCast single-item pointer to slice with length 1" { |
| 538 | test "@ptrCast single-item pointer to slice of bytes" { | 541 | test "@ptrCast single-item pointer to slice of bytes" { |
| 539 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 542 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 540 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 543 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 541 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 544 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 542 | 545 | ||
| 543 | const S = struct { | 546 | const S = struct { |
| 544 | fn doTheTest(comptime T: type, ptr: *const T) !void { | 547 | fn doTheTest(comptime T: type, ptr: *const T) !void { |
test/behavior/ptrfromint.zig+4-3| ... | @@ -3,7 +3,7 @@ const builtin = @import("builtin"); | ... | @@ -3,7 +3,7 @@ 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_spirv) return error.SkipZigTest; | 6 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 7 | 7 | ||
| 8 | addressToFunction(); | 8 | addressToFunction(); |
| 9 | comptime addressToFunction(); | 9 | comptime addressToFunction(); |
| ... | @@ -18,7 +18,7 @@ fn addressToFunction() void { | ... | @@ -18,7 +18,7 @@ fn addressToFunction() void { |
| 18 | test "mutate through ptr initialized with constant ptrFromInt value" { | 18 | test "mutate through ptr initialized with constant ptrFromInt value" { |
| 19 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 19 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 20 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 20 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 21 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 21 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 22 | 22 | ||
| 23 | forceCompilerAnalyzeBranchHardCodedPtrDereference(false); | 23 | forceCompilerAnalyzeBranchHardCodedPtrDereference(false); |
| 24 | } | 24 | } |
| ... | @@ -35,13 +35,14 @@ fn forceCompilerAnalyzeBranchHardCodedPtrDereference(x: bool) void { | ... | @@ -35,13 +35,14 @@ fn forceCompilerAnalyzeBranchHardCodedPtrDereference(x: bool) void { |
| 35 | test "@ptrFromInt creates null pointer" { | 35 | test "@ptrFromInt creates null pointer" { |
| 36 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 36 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 37 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 37 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 38 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 38 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 39 | 39 | ||
| 40 | const ptr = @as(?*u32, @ptrFromInt(0)); | 40 | const ptr = @as(?*u32, @ptrFromInt(0)); |
| 41 | try expectEqual(@as(?*u32, null), ptr); | 41 | try expectEqual(@as(?*u32, null), ptr); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | test "@ptrFromInt creates allowzero zero pointer" { | 44 | test "@ptrFromInt creates allowzero zero pointer" { |
| 45 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 45 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 46 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 46 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 47 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 47 | 48 |
test/behavior/ref_var_in_if_after_if_2nd_switch_prong.zig+1-1| ... | @@ -7,7 +7,7 @@ var ok: bool = false; | ... | @@ -7,7 +7,7 @@ var ok: bool = false; |
| 7 | test "reference a variable in an if after an if in the 2nd switch prong" { | 7 | test "reference a variable in an if after an if in the 2nd switch prong" { |
| 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 10 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 10 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 11 | 11 | ||
| 12 | try foo(true, Num.Two, false, "aoeu"); | 12 | try foo(true, Num.Two, false, "aoeu"); |
| 13 | try expect(!ok); | 13 | try expect(!ok); |
test/behavior/reflection.zig+1| ... | @@ -26,6 +26,7 @@ fn dummy(a: bool, b: i32, c: f32) i32 { | ... | @@ -26,6 +26,7 @@ fn dummy(a: bool, b: i32, c: f32) i32 { |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | test "reflection: @field" { | 28 | test "reflection: @field" { |
| 29 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 29 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 30 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 30 | 31 | ||
| 31 | var f = Foo{ | 32 | var f = Foo{ |
test/behavior/return_address.zig+1-1| ... | @@ -8,7 +8,7 @@ fn retAddr() usize { | ... | @@ -8,7 +8,7 @@ fn retAddr() usize { |
| 8 | test "return address" { | 8 | test "return address" { |
| 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 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_spirv) return error.SkipZigTest; | 11 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 12 | 12 | ||
| 13 | _ = retAddr(); | 13 | _ = retAddr(); |
| 14 | // TODO: #14938 | 14 | // TODO: #14938 |
test/behavior/saturating_arithmetic.zig+14-14| ... | @@ -16,7 +16,7 @@ test "saturating add" { | ... | @@ -16,7 +16,7 @@ test "saturating add" { |
| 16 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 16 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 17 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 17 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 18 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 18 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 19 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 19 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 20 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 20 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 21 | 21 | ||
| 22 | const S = struct { | 22 | const S = struct { |
| ... | @@ -55,7 +55,7 @@ test "saturating add 128bit" { | ... | @@ -55,7 +55,7 @@ test "saturating add 128bit" { |
| 55 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 55 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 56 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 56 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 57 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 57 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 58 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 58 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 59 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 59 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 60 | 60 | ||
| 61 | const S = struct { | 61 | const S = struct { |
| ... | @@ -82,7 +82,7 @@ test "saturating subtraction" { | ... | @@ -82,7 +82,7 @@ test "saturating subtraction" { |
| 82 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 82 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 83 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 83 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 84 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 84 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 85 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 85 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 86 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 86 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 87 | 87 | ||
| 88 | const S = struct { | 88 | const S = struct { |
| ... | @@ -120,7 +120,7 @@ test "saturating subtraction 128bit" { | ... | @@ -120,7 +120,7 @@ test "saturating subtraction 128bit" { |
| 120 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 120 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 121 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 121 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 122 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 122 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 123 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 123 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 124 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 124 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 125 | 125 | ||
| 126 | const S = struct { | 126 | const S = struct { |
| ... | @@ -143,7 +143,7 @@ fn testSatMul(comptime T: type, a: T, b: T, expected: T) !void { | ... | @@ -143,7 +143,7 @@ fn testSatMul(comptime T: type, a: T, b: T, expected: T) !void { |
| 143 | test "saturating multiplication <= 32 bits" { | 143 | test "saturating multiplication <= 32 bits" { |
| 144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 145 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 145 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 146 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 146 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 147 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 147 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 148 | 148 | ||
| 149 | try testSatMul(u8, 0, maxInt(u8), 0); | 149 | try testSatMul(u8, 0, maxInt(u8), 0); |
| ... | @@ -207,7 +207,7 @@ test "saturating multiplication <= 32 bits" { | ... | @@ -207,7 +207,7 @@ test "saturating multiplication <= 32 bits" { |
| 207 | test "saturating mul i64, i128" { | 207 | test "saturating mul i64, i128" { |
| 208 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 208 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 209 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 209 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 210 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 210 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 211 | 211 | ||
| 212 | try testSatMul(i64, 0, maxInt(i64), 0); | 212 | try testSatMul(i64, 0, maxInt(i64), 0); |
| 213 | try testSatMul(i64, 0, minInt(i64), 0); | 213 | try testSatMul(i64, 0, minInt(i64), 0); |
| ... | @@ -236,7 +236,7 @@ test "saturating multiplication" { | ... | @@ -236,7 +236,7 @@ test "saturating multiplication" { |
| 236 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 236 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 237 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 237 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 238 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 238 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 239 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 239 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 240 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 240 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 241 | 241 | ||
| 242 | const S = struct { | 242 | const S = struct { |
| ... | @@ -276,7 +276,7 @@ test "saturating shift-left" { | ... | @@ -276,7 +276,7 @@ test "saturating shift-left" { |
| 276 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 276 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 277 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 277 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 278 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 278 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 279 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 279 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 280 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 280 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 281 | 281 | ||
| 282 | const S = struct { | 282 | const S = struct { |
| ... | @@ -312,7 +312,7 @@ test "saturating shift-left" { | ... | @@ -312,7 +312,7 @@ test "saturating shift-left" { |
| 312 | test "saturating shift-left large rhs" { | 312 | test "saturating shift-left large rhs" { |
| 313 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 313 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 314 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 314 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 315 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 315 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 316 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | 316 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| 317 | 317 | ||
| 318 | { | 318 | { |
| ... | @@ -330,7 +330,7 @@ test "saturating shl uses the LHS type" { | ... | @@ -330,7 +330,7 @@ test "saturating shl uses the LHS type" { |
| 330 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 330 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 331 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 331 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 332 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 332 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 333 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 333 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 334 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 334 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 335 | 335 | ||
| 336 | const lhs_const: u8 = 1; | 336 | const lhs_const: u8 = 1; |
| ... | @@ -358,7 +358,7 @@ test "saturating shl uses the LHS type" { | ... | @@ -358,7 +358,7 @@ test "saturating shl uses the LHS type" { |
| 358 | 358 | ||
| 359 | test "sat add > 128 bits" { | 359 | test "sat add > 128 bits" { |
| 360 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 360 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 361 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 361 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 362 | 362 | ||
| 363 | try testSatAdd(u140, 0, 0, 0); | 363 | try testSatAdd(u140, 0, 0, 0); |
| 364 | try testSatAdd(u140, maxInt(u140), 1, maxInt(u140)); | 364 | try testSatAdd(u140, maxInt(u140), 1, maxInt(u140)); |
| ... | @@ -373,7 +373,7 @@ test "sat add > 128 bits" { | ... | @@ -373,7 +373,7 @@ test "sat add > 128 bits" { |
| 373 | 373 | ||
| 374 | test "sat sub > 128 bits" { | 374 | test "sat sub > 128 bits" { |
| 375 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 375 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 376 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 376 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 377 | 377 | ||
| 378 | try testSatSub(u140, 0, 1, 0); | 378 | try testSatSub(u140, 0, 1, 0); |
| 379 | try testSatSub(u140, maxInt(u140), maxInt(u140), 0); | 379 | try testSatSub(u140, maxInt(u140), maxInt(u140), 0); |
| ... | @@ -388,7 +388,7 @@ test "sat sub > 128 bits" { | ... | @@ -388,7 +388,7 @@ test "sat sub > 128 bits" { |
| 388 | 388 | ||
| 389 | test "sat mul > 128 bits" { | 389 | test "sat mul > 128 bits" { |
| 390 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 390 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 391 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 391 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 392 | 392 | ||
| 393 | try testSatMul(u140, 0, maxInt(u140), 0); | 393 | try testSatMul(u140, 0, maxInt(u140), 0); |
| 394 | try testSatMul(u140, 1 << 70, 1 << 69, 1 << 139); | 394 | try testSatMul(u140, 1 << 70, 1 << 69, 1 << 139); |
| ... | @@ -403,7 +403,7 @@ test "sat mul > 128 bits" { | ... | @@ -403,7 +403,7 @@ test "sat mul > 128 bits" { |
| 403 | 403 | ||
| 404 | test "sat shl > 128 bits" { | 404 | test "sat shl > 128 bits" { |
| 405 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 405 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 406 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 406 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 407 | 407 | ||
| 408 | try testSatShl(u140, 0, u8, 17, 0); | 408 | try testSatShl(u140, 0, u8, 17, 0); |
| 409 | try testSatShl(u140, 1 << 100, u8, 20, 1 << 120); | 409 | try testSatShl(u140, 1 << 100, u8, 20, 1 << 120); |
test/behavior/select.zig+2-2| ... | @@ -8,7 +8,7 @@ test "@select vectors" { | ... | @@ -8,7 +8,7 @@ test "@select vectors" { |
| 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 10 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 10 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 11 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 11 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 12 | 12 | ||
| 13 | try comptime selectVectors(); | 13 | try comptime selectVectors(); |
| 14 | try selectVectors(); | 14 | try selectVectors(); |
| ... | @@ -52,7 +52,7 @@ test "@select arrays" { | ... | @@ -52,7 +52,7 @@ test "@select arrays" { |
| 52 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 52 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 53 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 53 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 54 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 54 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 55 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 55 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 56 | 56 | ||
| 57 | try comptime selectArrays(); | 57 | try comptime selectArrays(); |
| 58 | try selectArrays(); | 58 | try selectArrays(); |
test/behavior/shuffle.zig+5-3| ... | @@ -9,7 +9,7 @@ test "@shuffle int" { | ... | @@ -9,7 +9,7 @@ test "@shuffle int" { |
| 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 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; | 11 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 12 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 12 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 13 | 13 | ||
| 14 | const S = struct { | 14 | const S = struct { |
| 15 | fn doTheTest() !void { | 15 | fn doTheTest() !void { |
| ... | @@ -50,6 +50,7 @@ test "@shuffle int" { | ... | @@ -50,6 +50,7 @@ test "@shuffle int" { |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | test "@shuffle int strange sizes" { | 52 | test "@shuffle int strange sizes" { |
| 53 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 53 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 54 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 54 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 55 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 55 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 56 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -133,7 +134,8 @@ test "@shuffle bool 1" { | ... | @@ -133,7 +134,8 @@ test "@shuffle bool 1" { |
| 133 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 134 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 134 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 135 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 135 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 136 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 136 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 137 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 138 | |||
| 137 | const S = struct { | 139 | const S = struct { |
| 138 | fn doTheTest() !void { | 140 | fn doTheTest() !void { |
| 139 | var x: @Vector(4, bool) = [4]bool{ false, true, false, true }; | 141 | var x: @Vector(4, bool) = [4]bool{ false, true, false, true }; |
| ... | @@ -154,7 +156,7 @@ test "@shuffle bool 2" { | ... | @@ -154,7 +156,7 @@ test "@shuffle bool 2" { |
| 154 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 156 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 155 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 157 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 156 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 158 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 157 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 159 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 158 | 160 | ||
| 159 | const S = struct { | 161 | const S = struct { |
| 160 | fn doTheTest() !void { | 162 | fn doTheTest() !void { |
test/behavior/sizeof_and_typeof.zig+16-6| ... | @@ -12,6 +12,8 @@ const x: u16 = 13; | ... | @@ -12,6 +12,8 @@ const x: u16 = 13; |
| 12 | const z: @TypeOf(x) = 19; | 12 | const z: @TypeOf(x) = 19; |
| 13 | 13 | ||
| 14 | test "@TypeOf() with multiple arguments" { | 14 | test "@TypeOf() with multiple arguments" { |
| 15 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 16 | |||
| 15 | { | 17 | { |
| 16 | var var_1: u32 = undefined; | 18 | var var_1: u32 = undefined; |
| 17 | var var_2: u8 = undefined; | 19 | var var_2: u8 = undefined; |
| ... | @@ -73,7 +75,7 @@ const P = packed struct { | ... | @@ -73,7 +75,7 @@ const P = packed struct { |
| 73 | 75 | ||
| 74 | test "@offsetOf" { | 76 | test "@offsetOf" { |
| 75 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 77 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 76 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 78 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 77 | 79 | ||
| 78 | // Packed structs have fixed memory layout | 80 | // Packed structs have fixed memory layout |
| 79 | try expect(@offsetOf(P, "a") == 0); | 81 | try expect(@offsetOf(P, "a") == 0); |
| ... | @@ -100,6 +102,7 @@ test "@offsetOf" { | ... | @@ -100,6 +102,7 @@ test "@offsetOf" { |
| 100 | } | 102 | } |
| 101 | 103 | ||
| 102 | test "@bitOffsetOf" { | 104 | test "@bitOffsetOf" { |
| 105 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 103 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 106 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 104 | 107 | ||
| 105 | // Packed structs have fixed memory layout | 108 | // Packed structs have fixed memory layout |
| ... | @@ -134,7 +137,7 @@ test "@TypeOf() has no runtime side effects" { | ... | @@ -134,7 +137,7 @@ test "@TypeOf() has no runtime side effects" { |
| 134 | } | 137 | } |
| 135 | 138 | ||
| 136 | test "branching logic inside @TypeOf" { | 139 | test "branching logic inside @TypeOf" { |
| 137 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 140 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 138 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 141 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 139 | 142 | ||
| 140 | const S = struct { | 143 | const S = struct { |
| ... | @@ -150,6 +153,8 @@ test "branching logic inside @TypeOf" { | ... | @@ -150,6 +153,8 @@ test "branching logic inside @TypeOf" { |
| 150 | } | 153 | } |
| 151 | 154 | ||
| 152 | test "@bitSizeOf" { | 155 | test "@bitSizeOf" { |
| 156 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 157 | |||
| 153 | try expect(@bitSizeOf(u2) == 2); | 158 | try expect(@bitSizeOf(u2) == 2); |
| 154 | try expect(@bitSizeOf(u8) == @sizeOf(u8) * 8); | 159 | try expect(@bitSizeOf(u8) == @sizeOf(u8) * 8); |
| 155 | try expect(@bitSizeOf(packed struct { | 160 | try expect(@bitSizeOf(packed struct { |
| ... | @@ -158,6 +163,8 @@ test "@bitSizeOf" { | ... | @@ -158,6 +163,8 @@ test "@bitSizeOf" { |
| 158 | } | 163 | } |
| 159 | 164 | ||
| 160 | test "@sizeOf comparison against zero" { | 165 | test "@sizeOf comparison against zero" { |
| 166 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 167 | |||
| 161 | const S0 = struct { | 168 | const S0 = struct { |
| 162 | f: *@This(), | 169 | f: *@This(), |
| 163 | }; | 170 | }; |
| ... | @@ -240,6 +247,7 @@ test "lazy size cast to float" { | ... | @@ -240,6 +247,7 @@ test "lazy size cast to float" { |
| 240 | } | 247 | } |
| 241 | 248 | ||
| 242 | test "runtime instructions inside typeof in comptime only scope" { | 249 | test "runtime instructions inside typeof in comptime only scope" { |
| 250 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 243 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 251 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 244 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 252 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 245 | 253 | ||
| ... | @@ -288,7 +296,8 @@ test "lazy abi size used in comparison" { | ... | @@ -288,7 +296,8 @@ test "lazy abi size used in comparison" { |
| 288 | 296 | ||
| 289 | test "peer type resolution with @TypeOf doesn't trigger dependency loop check" { | 297 | test "peer type resolution with @TypeOf doesn't trigger dependency loop check" { |
| 290 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 298 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 291 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 299 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 300 | |||
| 292 | const T = struct { | 301 | const T = struct { |
| 293 | next: @TypeOf(null, @as(*const @This(), undefined)), | 302 | next: @TypeOf(null, @as(*const @This(), undefined)), |
| 294 | }; | 303 | }; |
| ... | @@ -327,11 +336,11 @@ const exp = struct { | ... | @@ -327,11 +336,11 @@ const exp = struct { |
| 327 | } | 336 | } |
| 328 | }; | 337 | }; |
| 329 | comptime { | 338 | comptime { |
| 330 | if (builtin.zig_backend != .stage2_spirv) _ = exp; | 339 | if (!builtin.cpu.arch.isSpirv()) _ = exp; |
| 331 | } | 340 | } |
| 332 | 341 | ||
| 333 | test "Extern function calls in @TypeOf" { | 342 | test "Extern function calls in @TypeOf" { |
| 334 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 343 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 335 | 344 | ||
| 336 | const S = extern struct { | 345 | const S = extern struct { |
| 337 | state: c_short, | 346 | state: c_short, |
| ... | @@ -382,6 +391,7 @@ test "Peer resolution of extern function calls in @TypeOf" { | ... | @@ -382,6 +391,7 @@ test "Peer resolution of extern function calls in @TypeOf" { |
| 382 | } | 391 | } |
| 383 | 392 | ||
| 384 | test "Extern function calls, dereferences and field access in @TypeOf" { | 393 | test "Extern function calls, dereferences and field access in @TypeOf" { |
| 394 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 385 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 395 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 386 | 396 | ||
| 387 | const Test = struct { | 397 | const Test = struct { |
| ... | @@ -406,7 +416,7 @@ test "Extern function calls, dereferences and field access in @TypeOf" { | ... | @@ -406,7 +416,7 @@ test "Extern function calls, dereferences and field access in @TypeOf" { |
| 406 | } | 416 | } |
| 407 | 417 | ||
| 408 | test "@sizeOf struct is resolved when used as operand of slicing" { | 418 | test "@sizeOf struct is resolved when used as operand of slicing" { |
| 409 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 419 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 410 | 420 | ||
| 411 | const dummy = struct {}; | 421 | const dummy = struct {}; |
| 412 | const S = struct { | 422 | const S = struct { |
test/behavior/slice.zig+55-43| ... | @@ -30,7 +30,7 @@ comptime { | ... | @@ -30,7 +30,7 @@ comptime { |
| 30 | 30 | ||
| 31 | test "slicing" { | 31 | test "slicing" { |
| 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_spirv) return error.SkipZigTest; | 33 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 34 | 34 | ||
| 35 | var array: [20]i32 = undefined; | 35 | var array: [20]i32 = undefined; |
| 36 | 36 | ||
| ... | @@ -59,7 +59,7 @@ test "const slice" { | ... | @@ -59,7 +59,7 @@ test "const slice" { |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | test "comptime slice of undefined pointer of length 0" { | 61 | test "comptime slice of undefined pointer of length 0" { |
| 62 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 62 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 63 | 63 | ||
| 64 | const slice1 = @as([*]i32, undefined)[0..0]; | 64 | const slice1 = @as([*]i32, undefined)[0..0]; |
| 65 | try expect(slice1.len == 0); | 65 | try expect(slice1.len == 0); |
| ... | @@ -69,7 +69,7 @@ test "comptime slice of undefined pointer of length 0" { | ... | @@ -69,7 +69,7 @@ test "comptime slice of undefined pointer of length 0" { |
| 69 | 69 | ||
| 70 | test "implicitly cast array of size 0 to slice" { | 70 | test "implicitly cast array of size 0 to slice" { |
| 71 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 71 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 72 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 72 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 73 | 73 | ||
| 74 | var msg = [_]u8{}; | 74 | var msg = [_]u8{}; |
| 75 | try assertLenIsZero(&msg); | 75 | try assertLenIsZero(&msg); |
| ... | @@ -81,7 +81,7 @@ fn assertLenIsZero(msg: []const u8) !void { | ... | @@ -81,7 +81,7 @@ fn assertLenIsZero(msg: []const u8) !void { |
| 81 | 81 | ||
| 82 | test "access len index of sentinel-terminated slice" { | 82 | test "access len index of sentinel-terminated slice" { |
| 83 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 83 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 84 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 84 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 85 | 85 | ||
| 86 | const S = struct { | 86 | const S = struct { |
| 87 | fn doTheTest() !void { | 87 | fn doTheTest() !void { |
| ... | @@ -105,7 +105,7 @@ test "comptime slice of slice preserves comptime var" { | ... | @@ -105,7 +105,7 @@ test "comptime slice of slice preserves comptime var" { |
| 105 | 105 | ||
| 106 | test "open slice of open slice with sentinel" { | 106 | test "open slice of open slice with sentinel" { |
| 107 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 107 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 108 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 108 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 109 | 109 | ||
| 110 | var slice: [:0]const u8 = "hello"; | 110 | var slice: [:0]const u8 = "hello"; |
| 111 | _ = &slice; | 111 | _ = &slice; |
| ... | @@ -123,7 +123,7 @@ test "open slice of open slice with sentinel" { | ... | @@ -123,7 +123,7 @@ test "open slice of open slice with sentinel" { |
| 123 | 123 | ||
| 124 | test "open slice with sentinel of slice with end index" { | 124 | test "open slice with sentinel of slice with end index" { |
| 125 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 125 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 126 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 126 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 127 | 127 | ||
| 128 | var slice: [:0]const u8 = "hello"; | 128 | var slice: [:0]const u8 = "hello"; |
| 129 | _ = &slice; | 129 | _ = &slice; |
| ... | @@ -162,6 +162,8 @@ test "slice of type" { | ... | @@ -162,6 +162,8 @@ test "slice of type" { |
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | test "pass a slice of types to a function" { | 164 | test "pass a slice of types to a function" { |
| 165 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 166 | |||
| 165 | const S = struct { | 167 | const S = struct { |
| 166 | fn checkTypesSlice(comptime types_slice: []const type) !void { | 168 | fn checkTypesSlice(comptime types_slice: []const type) !void { |
| 167 | try expect(types_slice.len == 2); | 169 | try expect(types_slice.len == 2); |
| ... | @@ -175,7 +177,7 @@ test "pass a slice of types to a function" { | ... | @@ -175,7 +177,7 @@ test "pass a slice of types to a function" { |
| 175 | 177 | ||
| 176 | test "generic malloc free" { | 178 | test "generic malloc free" { |
| 177 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 179 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 178 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 180 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 179 | 181 | ||
| 180 | const a = memAlloc(u8, 10) catch unreachable; | 182 | const a = memAlloc(u8, 10) catch unreachable; |
| 181 | memFree(u8, a); | 183 | memFree(u8, a); |
| ... | @@ -189,7 +191,8 @@ fn memFree(comptime T: type, memory: []T) void { | ... | @@ -189,7 +191,8 @@ fn memFree(comptime T: type, memory: []T) void { |
| 189 | } | 191 | } |
| 190 | 192 | ||
| 191 | test "slice of hardcoded address to pointer" { | 193 | test "slice of hardcoded address to pointer" { |
| 192 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 194 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 195 | |||
| 193 | const S = struct { | 196 | const S = struct { |
| 194 | fn doTheTest() !void { | 197 | fn doTheTest() !void { |
| 195 | const pointer = @as([*]u8, @ptrFromInt(0x04))[0..2]; | 198 | const pointer = @as([*]u8, @ptrFromInt(0x04))[0..2]; |
| ... | @@ -213,7 +216,7 @@ test "comptime slice of pointer preserves comptime var" { | ... | @@ -213,7 +216,7 @@ test "comptime slice of pointer preserves comptime var" { |
| 213 | } | 216 | } |
| 214 | 217 | ||
| 215 | test "comptime pointer cast array and then slice" { | 218 | test "comptime pointer cast array and then slice" { |
| 216 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 219 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 217 | 220 | ||
| 218 | const array = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 }; | 221 | const array = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 }; |
| 219 | 222 | ||
| ... | @@ -229,7 +232,8 @@ test "comptime pointer cast array and then slice" { | ... | @@ -229,7 +232,8 @@ test "comptime pointer cast array and then slice" { |
| 229 | 232 | ||
| 230 | test "slicing zero length array" { | 233 | test "slicing zero length array" { |
| 231 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 234 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 232 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 235 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 236 | |||
| 233 | const s1 = ""[0..]; | 237 | const s1 = ""[0..]; |
| 234 | const s2 = ([_]u32{})[0..]; | 238 | const s2 = ([_]u32{})[0..]; |
| 235 | try expect(s1.len == 0); | 239 | try expect(s1.len == 0); |
| ... | @@ -239,7 +243,7 @@ test "slicing zero length array" { | ... | @@ -239,7 +243,7 @@ test "slicing zero length array" { |
| 239 | } | 243 | } |
| 240 | 244 | ||
| 241 | test "slicing pointer by length" { | 245 | test "slicing pointer by length" { |
| 242 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 246 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 243 | 247 | ||
| 244 | const array = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 }; | 248 | const array = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 }; |
| 245 | const ptr: [*]const u8 = @as([*]const u8, @ptrCast(&array)); | 249 | const ptr: [*]const u8 = @as([*]const u8, @ptrCast(&array)); |
| ... | @@ -254,6 +258,8 @@ test "slicing pointer by length" { | ... | @@ -254,6 +258,8 @@ test "slicing pointer by length" { |
| 254 | const x = @as([*]i32, @ptrFromInt(0x1000))[0..0x500]; | 258 | const x = @as([*]i32, @ptrFromInt(0x1000))[0..0x500]; |
| 255 | const y = x[0x100..]; | 259 | const y = x[0x100..]; |
| 256 | test "compile time slice of pointer to hard coded address" { | 260 | test "compile time slice of pointer to hard coded address" { |
| 261 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 262 | |||
| 257 | try expect(@intFromPtr(x) == 0x1000); | 263 | try expect(@intFromPtr(x) == 0x1000); |
| 258 | try expect(x.len == 0x500); | 264 | try expect(x.len == 0x500); |
| 259 | 265 | ||
| ... | @@ -262,7 +268,7 @@ test "compile time slice of pointer to hard coded address" { | ... | @@ -262,7 +268,7 @@ test "compile time slice of pointer to hard coded address" { |
| 262 | } | 268 | } |
| 263 | 269 | ||
| 264 | test "slice string literal has correct type" { | 270 | test "slice string literal has correct type" { |
| 265 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 271 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 266 | 272 | ||
| 267 | comptime { | 273 | comptime { |
| 268 | try expect(@TypeOf("aoeu"[0..]) == *const [4:0]u8); | 274 | try expect(@TypeOf("aoeu"[0..]) == *const [4:0]u8); |
| ... | @@ -278,7 +284,7 @@ test "slice string literal has correct type" { | ... | @@ -278,7 +284,7 @@ test "slice string literal has correct type" { |
| 278 | 284 | ||
| 279 | test "result location zero sized array inside struct field implicit cast to slice" { | 285 | test "result location zero sized array inside struct field implicit cast to slice" { |
| 280 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 286 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 281 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 287 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 282 | 288 | ||
| 283 | const E = struct { | 289 | const E = struct { |
| 284 | entries: []u32, | 290 | entries: []u32, |
| ... | @@ -291,7 +297,7 @@ test "result location zero sized array inside struct field implicit cast to slic | ... | @@ -291,7 +297,7 @@ test "result location zero sized array inside struct field implicit cast to slic |
| 291 | test "runtime safety lets us slice from len..len" { | 297 | test "runtime safety lets us slice from len..len" { |
| 292 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 298 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 293 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 299 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 294 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 300 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 295 | 301 | ||
| 296 | var an_array = [_]u8{ 1, 2, 3 }; | 302 | var an_array = [_]u8{ 1, 2, 3 }; |
| 297 | try expect(mem.eql(u8, sliceFromLenToLen(an_array[0..], 3, 3), "")); | 303 | try expect(mem.eql(u8, sliceFromLenToLen(an_array[0..], 3, 3), "")); |
| ... | @@ -303,7 +309,7 @@ fn sliceFromLenToLen(a_slice: []u8, start: usize, end: usize) []u8 { | ... | @@ -303,7 +309,7 @@ fn sliceFromLenToLen(a_slice: []u8, start: usize, end: usize) []u8 { |
| 303 | 309 | ||
| 304 | test "C pointer" { | 310 | test "C pointer" { |
| 305 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 311 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 306 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 312 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 307 | 313 | ||
| 308 | var buf: [*c]const u8 = "kjdhfkjdhfdkjhfkfjhdfkjdhfkdjhfdkjhf"; | 314 | var buf: [*c]const u8 = "kjdhfkjdhfdkjhfkfjhdfkjdhfkdjhfdkjhf"; |
| 309 | var len: u32 = 10; | 315 | var len: u32 = 10; |
| ... | @@ -315,7 +321,7 @@ test "C pointer" { | ... | @@ -315,7 +321,7 @@ test "C pointer" { |
| 315 | test "C pointer slice access" { | 321 | test "C pointer slice access" { |
| 316 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 322 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 317 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 323 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 318 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 324 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 319 | 325 | ||
| 320 | var buf: [10]u32 = @splat(42); | 326 | var buf: [10]u32 = @splat(42); |
| 321 | const c_ptr = @as([*c]const u32, @ptrCast(&buf)); | 327 | const c_ptr = @as([*c]const u32, @ptrCast(&buf)); |
| ... | @@ -345,7 +351,7 @@ fn sliceSum(comptime q: []const u8) i32 { | ... | @@ -345,7 +351,7 @@ fn sliceSum(comptime q: []const u8) i32 { |
| 345 | 351 | ||
| 346 | test "slice type with custom alignment" { | 352 | test "slice type with custom alignment" { |
| 347 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 353 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 348 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 354 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 349 | 355 | ||
| 350 | const LazilyResolvedType = struct { | 356 | const LazilyResolvedType = struct { |
| 351 | anything: i32, | 357 | anything: i32, |
| ... | @@ -359,7 +365,7 @@ test "slice type with custom alignment" { | ... | @@ -359,7 +365,7 @@ test "slice type with custom alignment" { |
| 359 | 365 | ||
| 360 | test "obtaining a null terminated slice" { | 366 | test "obtaining a null terminated slice" { |
| 361 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 367 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 362 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 368 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 363 | 369 | ||
| 364 | // here we have a normal array | 370 | // here we have a normal array |
| 365 | var buf: [50]u8 = undefined; | 371 | var buf: [50]u8 = undefined; |
| ... | @@ -385,6 +391,8 @@ test "obtaining a null terminated slice" { | ... | @@ -385,6 +391,8 @@ test "obtaining a null terminated slice" { |
| 385 | } | 391 | } |
| 386 | 392 | ||
| 387 | test "empty array to slice" { | 393 | test "empty array to slice" { |
| 394 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 395 | |||
| 388 | const S = struct { | 396 | const S = struct { |
| 389 | fn doTheTest() !void { | 397 | fn doTheTest() !void { |
| 390 | const empty: []align(16) u8 = &[_]u8{}; | 398 | const empty: []align(16) u8 = &[_]u8{}; |
| ... | @@ -422,7 +430,7 @@ test "comptime-known slice of a global constant" { | ... | @@ -422,7 +430,7 @@ test "comptime-known slice of a global constant" { |
| 422 | 430 | ||
| 423 | test "@ptrCast slice to pointer" { | 431 | test "@ptrCast slice to pointer" { |
| 424 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 432 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 425 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 433 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 426 | 434 | ||
| 427 | const S = struct { | 435 | const S = struct { |
| 428 | fn doTheTest() !void { | 436 | fn doTheTest() !void { |
| ... | @@ -439,7 +447,7 @@ test "@ptrCast slice to pointer" { | ... | @@ -439,7 +447,7 @@ test "@ptrCast slice to pointer" { |
| 439 | 447 | ||
| 440 | test "slice multi-pointer without end" { | 448 | test "slice multi-pointer without end" { |
| 441 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 449 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 442 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 450 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 443 | 451 | ||
| 444 | const S = struct { | 452 | const S = struct { |
| 445 | fn doTheTest() !void { | 453 | fn doTheTest() !void { |
| ... | @@ -477,7 +485,7 @@ test "slice multi-pointer without end" { | ... | @@ -477,7 +485,7 @@ test "slice multi-pointer without end" { |
| 477 | test "slice syntax resulting in pointer-to-array" { | 485 | test "slice syntax resulting in pointer-to-array" { |
| 478 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 486 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 479 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 487 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 480 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 488 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 481 | 489 | ||
| 482 | const S = struct { | 490 | const S = struct { |
| 483 | fn doTheTest() !void { | 491 | fn doTheTest() !void { |
| ... | @@ -692,7 +700,7 @@ test "slice syntax resulting in pointer-to-array" { | ... | @@ -692,7 +700,7 @@ test "slice syntax resulting in pointer-to-array" { |
| 692 | 700 | ||
| 693 | test "slice pointer-to-array null terminated" { | 701 | test "slice pointer-to-array null terminated" { |
| 694 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 702 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 695 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 703 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 696 | 704 | ||
| 697 | comptime { | 705 | comptime { |
| 698 | var array = [5:0]u8{ 1, 2, 3, 4, 5 }; | 706 | var array = [5:0]u8{ 1, 2, 3, 4, 5 }; |
| ... | @@ -711,7 +719,7 @@ test "slice pointer-to-array null terminated" { | ... | @@ -711,7 +719,7 @@ test "slice pointer-to-array null terminated" { |
| 711 | 719 | ||
| 712 | test "slice pointer-to-array zero length" { | 720 | test "slice pointer-to-array zero length" { |
| 713 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 721 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 714 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 722 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 715 | 723 | ||
| 716 | comptime { | 724 | comptime { |
| 717 | { | 725 | { |
| ... | @@ -745,7 +753,7 @@ test "slice pointer-to-array zero length" { | ... | @@ -745,7 +753,7 @@ test "slice pointer-to-array zero length" { |
| 745 | test "type coercion of pointer to anon struct literal to pointer to slice" { | 753 | test "type coercion of pointer to anon struct literal to pointer to slice" { |
| 746 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 754 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 747 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 755 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 748 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 756 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 749 | 757 | ||
| 750 | const S = struct { | 758 | const S = struct { |
| 751 | const U = union { | 759 | const U = union { |
| ... | @@ -792,7 +800,7 @@ test "array concat of slices gives ptr to array" { | ... | @@ -792,7 +800,7 @@ test "array concat of slices gives ptr to array" { |
| 792 | 800 | ||
| 793 | test "slice bounds in comptime concatenation" { | 801 | test "slice bounds in comptime concatenation" { |
| 794 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 802 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 795 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 803 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 796 | 804 | ||
| 797 | const bs = comptime blk: { | 805 | const bs = comptime blk: { |
| 798 | const b = "........1........"; | 806 | const b = "........1........"; |
| ... | @@ -808,6 +816,8 @@ test "slice bounds in comptime concatenation" { | ... | @@ -808,6 +816,8 @@ test "slice bounds in comptime concatenation" { |
| 808 | } | 816 | } |
| 809 | 817 | ||
| 810 | test "slice sentinel access at comptime" { | 818 | test "slice sentinel access at comptime" { |
| 819 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 820 | |||
| 811 | { | 821 | { |
| 812 | const str0 = &[_:0]u8{ '1', '2', '3' }; | 822 | const str0 = &[_:0]u8{ '1', '2', '3' }; |
| 813 | const slice0: [:0]const u8 = str0; | 823 | const slice0: [:0]const u8 = str0; |
| ... | @@ -833,7 +843,8 @@ test "slice sentinel access at comptime" { | ... | @@ -833,7 +843,8 @@ test "slice sentinel access at comptime" { |
| 833 | 843 | ||
| 834 | test "slicing array with sentinel as end index" { | 844 | test "slicing array with sentinel as end index" { |
| 835 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 845 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 836 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 846 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 847 | |||
| 837 | const S = struct { | 848 | const S = struct { |
| 838 | fn do() !void { | 849 | fn do() !void { |
| 839 | var array = [_:0]u8{ 1, 2, 3, 4 }; | 850 | var array = [_:0]u8{ 1, 2, 3, 4 }; |
| ... | @@ -850,7 +861,7 @@ test "slicing array with sentinel as end index" { | ... | @@ -850,7 +861,7 @@ test "slicing array with sentinel as end index" { |
| 850 | 861 | ||
| 851 | test "slicing slice with sentinel as end index" { | 862 | test "slicing slice with sentinel as end index" { |
| 852 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 863 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 853 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 864 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 854 | 865 | ||
| 855 | const S = struct { | 866 | const S = struct { |
| 856 | fn do() !void { | 867 | fn do() !void { |
| ... | @@ -879,7 +890,8 @@ test "slice len modification at comptime" { | ... | @@ -879,7 +890,8 @@ test "slice len modification at comptime" { |
| 879 | } | 890 | } |
| 880 | 891 | ||
| 881 | test "slice field ptr const" { | 892 | test "slice field ptr const" { |
| 882 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 893 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 894 | |||
| 883 | const const_slice: []const u8 = "string"; | 895 | const const_slice: []const u8 = "string"; |
| 884 | 896 | ||
| 885 | const const_ptr_const_slice = &const_slice; | 897 | const const_ptr_const_slice = &const_slice; |
| ... | @@ -909,7 +921,7 @@ test "global slice field access" { | ... | @@ -909,7 +921,7 @@ test "global slice field access" { |
| 909 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 921 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 910 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 922 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 911 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 923 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 912 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 924 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 913 | 925 | ||
| 914 | const S = struct { | 926 | const S = struct { |
| 915 | var slice: []const u8 = undefined; | 927 | var slice: []const u8 = undefined; |
| ... | @@ -921,7 +933,7 @@ test "global slice field access" { | ... | @@ -921,7 +933,7 @@ test "global slice field access" { |
| 921 | } | 933 | } |
| 922 | 934 | ||
| 923 | test "slice of void" { | 935 | test "slice of void" { |
| 924 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 936 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 925 | 937 | ||
| 926 | var n: usize = 10; | 938 | var n: usize = 10; |
| 927 | _ = &n; | 939 | _ = &n; |
| ... | @@ -931,7 +943,7 @@ test "slice of void" { | ... | @@ -931,7 +943,7 @@ test "slice of void" { |
| 931 | } | 943 | } |
| 932 | 944 | ||
| 933 | test "slice with dereferenced value" { | 945 | test "slice with dereferenced value" { |
| 934 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 946 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 935 | 947 | ||
| 936 | var a: usize = 0; | 948 | var a: usize = 0; |
| 937 | const idx: *usize = &a; | 949 | const idx: *usize = &a; |
| ... | @@ -947,7 +959,7 @@ test "slice with dereferenced value" { | ... | @@ -947,7 +959,7 @@ test "slice with dereferenced value" { |
| 947 | } | 959 | } |
| 948 | 960 | ||
| 949 | test "empty slice ptr is non null" { | 961 | test "empty slice ptr is non null" { |
| 950 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // Test assumes `undefined` is non-zero | 962 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Test assumes `undefined` is non-zero |
| 951 | 963 | ||
| 952 | { | 964 | { |
| 953 | const empty_slice: []u8 = &[_]u8{}; | 965 | const empty_slice: []u8 = &[_]u8{}; |
| ... | @@ -965,7 +977,7 @@ test "empty slice ptr is non null" { | ... | @@ -965,7 +977,7 @@ test "empty slice ptr is non null" { |
| 965 | 977 | ||
| 966 | test "slice decays to many pointer" { | 978 | test "slice decays to many pointer" { |
| 967 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 979 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 968 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 980 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 969 | 981 | ||
| 970 | var buf: [8]u8 = "abcdefg\x00".*; | 982 | var buf: [8]u8 = "abcdefg\x00".*; |
| 971 | const p: [*:0]const u8 = buf[0..7 :0]; | 983 | const p: [*:0]const u8 = buf[0..7 :0]; |
| ... | @@ -975,7 +987,7 @@ test "slice decays to many pointer" { | ... | @@ -975,7 +987,7 @@ test "slice decays to many pointer" { |
| 975 | test "write through pointer to optional slice arg" { | 987 | test "write through pointer to optional slice arg" { |
| 976 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 988 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 977 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 989 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 978 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 990 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 979 | 991 | ||
| 980 | const S = struct { | 992 | const S = struct { |
| 981 | fn bar(foo: *?[]const u8) !void { | 993 | fn bar(foo: *?[]const u8) !void { |
| ... | @@ -994,7 +1006,7 @@ test "write through pointer to optional slice arg" { | ... | @@ -994,7 +1006,7 @@ test "write through pointer to optional slice arg" { |
| 994 | test "modify slice length at comptime" { | 1006 | test "modify slice length at comptime" { |
| 995 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 1007 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 996 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 1008 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 997 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1009 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 998 | 1010 | ||
| 999 | const arr: [2]u8 = .{ 10, 20 }; | 1011 | const arr: [2]u8 = .{ 10, 20 }; |
| 1000 | comptime var s: []const u8 = arr[0..0]; | 1012 | comptime var s: []const u8 = arr[0..0]; |
| ... | @@ -1009,7 +1021,7 @@ test "modify slice length at comptime" { | ... | @@ -1009,7 +1021,7 @@ test "modify slice length at comptime" { |
| 1009 | 1021 | ||
| 1010 | test "slicing zero length array field of struct" { | 1022 | test "slicing zero length array field of struct" { |
| 1011 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1023 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1012 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1024 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1013 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1025 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1014 | 1026 | ||
| 1015 | const S = struct { | 1027 | const S = struct { |
| ... | @@ -1024,7 +1036,7 @@ test "slicing zero length array field of struct" { | ... | @@ -1024,7 +1036,7 @@ test "slicing zero length array field of struct" { |
| 1024 | 1036 | ||
| 1025 | test "slicing slices gives correct result" { | 1037 | test "slicing slices gives correct result" { |
| 1026 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1038 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1027 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1039 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1028 | 1040 | ||
| 1029 | const foo = "1234"; | 1041 | const foo = "1234"; |
| 1030 | const bar = foo[0..4]; | 1042 | const bar = foo[0..4]; |
| ... | @@ -1037,7 +1049,7 @@ test "slicing slices gives correct result" { | ... | @@ -1037,7 +1049,7 @@ test "slicing slices gives correct result" { |
| 1037 | 1049 | ||
| 1038 | test "get address of element of zero-sized slice" { | 1050 | test "get address of element of zero-sized slice" { |
| 1039 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1051 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1040 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1052 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1041 | 1053 | ||
| 1042 | const S = struct { | 1054 | const S = struct { |
| 1043 | fn destroy(_: *void) void {} | 1055 | fn destroy(_: *void) void {} |
| ... | @@ -1049,7 +1061,7 @@ test "get address of element of zero-sized slice" { | ... | @@ -1049,7 +1061,7 @@ test "get address of element of zero-sized slice" { |
| 1049 | 1061 | ||
| 1050 | test "sentinel-terminated 0-length slices" { | 1062 | test "sentinel-terminated 0-length slices" { |
| 1051 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1063 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1052 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1064 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1053 | 1065 | ||
| 1054 | const u32s: [4]u32 = [_]u32{ 0, 1, 2, 3 }; | 1066 | const u32s: [4]u32 = [_]u32{ 0, 1, 2, 3 }; |
| 1055 | 1067 | ||
| ... | @@ -1068,7 +1080,7 @@ test "sentinel-terminated 0-length slices" { | ... | @@ -1068,7 +1080,7 @@ test "sentinel-terminated 0-length slices" { |
| 1068 | } | 1080 | } |
| 1069 | 1081 | ||
| 1070 | test "peer slices keep abi alignment with empty struct" { | 1082 | test "peer slices keep abi alignment with empty struct" { |
| 1071 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1083 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1072 | 1084 | ||
| 1073 | var cond: bool = undefined; | 1085 | var cond: bool = undefined; |
| 1074 | cond = false; | 1086 | cond = false; |
| ... | @@ -1078,7 +1090,7 @@ test "peer slices keep abi alignment with empty struct" { | ... | @@ -1078,7 +1090,7 @@ test "peer slices keep abi alignment with empty struct" { |
| 1078 | } | 1090 | } |
| 1079 | 1091 | ||
| 1080 | test "sentinel expression in slice operation has result type" { | 1092 | test "sentinel expression in slice operation has result type" { |
| 1081 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1093 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1082 | 1094 | ||
| 1083 | const sentinel = std.math.maxInt(u16); | 1095 | const sentinel = std.math.maxInt(u16); |
| 1084 | 1096 | ||
| ... | @@ -1101,7 +1113,7 @@ test "sentinel expression in slice operation has result type" { | ... | @@ -1101,7 +1113,7 @@ test "sentinel expression in slice operation has result type" { |
| 1101 | } | 1113 | } |
| 1102 | 1114 | ||
| 1103 | test "conditionally return second argument slice" { | 1115 | test "conditionally return second argument slice" { |
| 1104 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1116 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1105 | 1117 | ||
| 1106 | const S = struct { | 1118 | const S = struct { |
| 1107 | fn foo(cond: bool, slice: []const u8) []const u8 { | 1119 | fn foo(cond: bool, slice: []const u8) []const u8 { |
| ... | @@ -1115,7 +1127,7 @@ test "conditionally return second argument slice" { | ... | @@ -1115,7 +1127,7 @@ test "conditionally return second argument slice" { |
| 1115 | } | 1127 | } |
| 1116 | 1128 | ||
| 1117 | test "slice field alignment" { | 1129 | test "slice field alignment" { |
| 1118 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1130 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1119 | 1131 | ||
| 1120 | const S = struct { | 1132 | const S = struct { |
| 1121 | fn doTheTest(p: *align(1) const []u8) !void { | 1133 | fn doTheTest(p: *align(1) const []u8) !void { |
test/behavior/spirv.zig+5| ... | @@ -1,4 +1,5 @@ | ... | @@ -1,4 +1,5 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | ||
| 2 | const expect = std.testing.expect; | 3 | const expect = std.testing.expect; |
| 3 | 4 | ||
| 4 | const Sampler = @SpirvType(.sampler); | 5 | const Sampler = @SpirvType(.sampler); |
| ... | @@ -50,6 +51,8 @@ test "@SpirvType" { | ... | @@ -50,6 +51,8 @@ test "@SpirvType" { |
| 50 | } | 51 | } |
| 51 | 52 | ||
| 52 | test "@ptrCast to first field type" { | 53 | test "@ptrCast to first field type" { |
| 54 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 55 | |||
| 53 | const Inner = extern struct { a: u32 }; | 56 | const Inner = extern struct { a: u32 }; |
| 54 | const Outer = extern struct { a: Inner, b: u32 }; | 57 | const Outer = extern struct { a: Inner, b: u32 }; |
| 55 | var outer: Outer = undefined; | 58 | var outer: Outer = undefined; |
| ... | @@ -58,6 +61,8 @@ test "@ptrCast to first field type" { | ... | @@ -58,6 +61,8 @@ test "@ptrCast to first field type" { |
| 58 | } | 61 | } |
| 59 | 62 | ||
| 60 | test "@SpirvType equality" { | 63 | test "@SpirvType equality" { |
| 64 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 65 | |||
| 61 | try expect(@SpirvType(.sampler) == Sampler); | 66 | try expect(@SpirvType(.sampler) == Sampler); |
| 62 | try expect(@SpirvType(.{ .runtime_array = u32 }) == RuntimeArray); | 67 | try expect(@SpirvType(.{ .runtime_array = u32 }) == RuntimeArray); |
| 63 | try expect(@SpirvType(.{ .sampled_image = Image }) == SampledImage); | 68 | try expect(@SpirvType(.{ .sampled_image = Image }) == SampledImage); |
test/behavior/splat.zig+6-3| ... | @@ -5,6 +5,7 @@ const expect = std.testing.expect; | ... | @@ -5,6 +5,7 @@ const expect = std.testing.expect; |
| 5 | const assert = std.debug.assert; | 5 | const assert = std.debug.assert; |
| 6 | 6 | ||
| 7 | test "@splat array" { | 7 | test "@splat array" { |
| 8 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 10 | 11 | ||
| ... | @@ -33,7 +34,7 @@ test "@splat array" { | ... | @@ -33,7 +34,7 @@ test "@splat array" { |
| 33 | } | 34 | } |
| 34 | 35 | ||
| 35 | test "@splat array with sentinel" { | 36 | test "@splat array with sentinel" { |
| 36 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 37 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 37 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 38 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 38 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 39 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 39 | 40 | ||
| ... | @@ -56,7 +57,7 @@ test "@splat array with sentinel" { | ... | @@ -56,7 +57,7 @@ test "@splat array with sentinel" { |
| 56 | } | 57 | } |
| 57 | 58 | ||
| 58 | test "@splat zero-length array" { | 59 | test "@splat zero-length array" { |
| 59 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 60 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 60 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 61 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 61 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 62 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 62 | 63 | ||
| ... | @@ -79,6 +80,7 @@ test "@splat zero-length array" { | ... | @@ -79,6 +80,7 @@ test "@splat zero-length array" { |
| 79 | } | 80 | } |
| 80 | 81 | ||
| 81 | test "splat with an error union or optional result type" { | 82 | test "splat with an error union or optional result type" { |
| 83 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 82 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 84 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 83 | 85 | ||
| 84 | const S = struct { | 86 | const S = struct { |
| ... | @@ -92,7 +94,7 @@ test "splat with an error union or optional result type" { | ... | @@ -92,7 +94,7 @@ test "splat with an error union or optional result type" { |
| 92 | } | 94 | } |
| 93 | 95 | ||
| 94 | test "read/write through global variable array of struct fields initialized via splat" { | 96 | test "read/write through global variable array of struct fields initialized via splat" { |
| 95 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 97 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 96 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 98 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 97 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 99 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 98 | 100 | ||
| ... | @@ -113,6 +115,7 @@ test "read/write through global variable array of struct fields initialized via | ... | @@ -113,6 +115,7 @@ test "read/write through global variable array of struct fields initialized via |
| 113 | } | 115 | } |
| 114 | 116 | ||
| 115 | test "vector @splat" { | 117 | test "vector @splat" { |
| 118 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 116 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 119 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 117 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 120 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 118 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 121 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
test/behavior/src.zig+1-1| ... | @@ -18,7 +18,7 @@ const expectEqualStrings = std.testing.expectEqualStrings; | ... | @@ -18,7 +18,7 @@ const expectEqualStrings = std.testing.expectEqualStrings; |
| 18 | test "@src" { | 18 | test "@src" { |
| 19 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 19 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 21 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 21 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 22 | 22 | ||
| 23 | try doTheTest(); | 23 | try doTheTest(); |
| 24 | } | 24 | } |
test/behavior/string_literals.zig+8-7| ... | @@ -7,7 +7,7 @@ const ptr_tag_name: [*:0]const u8 = tag_name; | ... | @@ -7,7 +7,7 @@ const ptr_tag_name: [*:0]const u8 = tag_name; |
| 7 | 7 | ||
| 8 | test "@tagName() returns a string literal" { | 8 | test "@tagName() returns a string literal" { |
| 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 10 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 10 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 11 | 11 | ||
| 12 | try std.testing.expect(*const [13:0]u8 == @TypeOf(tag_name)); | 12 | try std.testing.expect(*const [13:0]u8 == @TypeOf(tag_name)); |
| 13 | try std.testing.expect(std.mem.eql(u8, "TestEnumValue", tag_name)); | 13 | try std.testing.expect(std.mem.eql(u8, "TestEnumValue", tag_name)); |
| ... | @@ -20,7 +20,7 @@ const ptr_error_name: [*:0]const u8 = error_name; | ... | @@ -20,7 +20,7 @@ const ptr_error_name: [*:0]const u8 = error_name; |
| 20 | 20 | ||
| 21 | test "@errorName() returns a string literal" { | 21 | test "@errorName() returns a string literal" { |
| 22 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 22 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 23 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 23 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 24 | 24 | ||
| 25 | try std.testing.expect(*const [13:0]u8 == @TypeOf(error_name)); | 25 | try std.testing.expect(*const [13:0]u8 == @TypeOf(error_name)); |
| 26 | try std.testing.expect(std.mem.eql(u8, "TestErrorCode", error_name)); | 26 | try std.testing.expect(std.mem.eql(u8, "TestErrorCode", error_name)); |
| ... | @@ -33,7 +33,7 @@ const ptr_type_name: [*:0]const u8 = type_name; | ... | @@ -33,7 +33,7 @@ const ptr_type_name: [*:0]const u8 = type_name; |
| 33 | 33 | ||
| 34 | test "@typeName() returns a string literal" { | 34 | test "@typeName() returns a string literal" { |
| 35 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 35 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 36 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 36 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 37 | 37 | ||
| 38 | try std.testing.expect(*const [type_name.len:0]u8 == @TypeOf(type_name)); | 38 | try std.testing.expect(*const [type_name.len:0]u8 == @TypeOf(type_name)); |
| 39 | try std.testing.expect(std.mem.eql(u8, "behavior.string_literals.TestType", type_name)); | 39 | try std.testing.expect(std.mem.eql(u8, "behavior.string_literals.TestType", type_name)); |
| ... | @@ -47,7 +47,7 @@ const expected_contents = "hello zig\n"; | ... | @@ -47,7 +47,7 @@ const expected_contents = "hello zig\n"; |
| 47 | test "@embedFile() returns a string literal" { | 47 | test "@embedFile() returns a string literal" { |
| 48 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 48 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 49 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 49 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 50 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 50 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 51 | 51 | ||
| 52 | try std.testing.expect(*const [expected_contents.len:0]u8 == @TypeOf(actual_contents)); | 52 | try std.testing.expect(*const [expected_contents.len:0]u8 == @TypeOf(actual_contents)); |
| 53 | try std.testing.expect(std.mem.eql(u8, expected_contents, actual_contents)); | 53 | try std.testing.expect(std.mem.eql(u8, expected_contents, actual_contents)); |
| ... | @@ -62,7 +62,7 @@ fn testFnForSrc() std.builtin.SourceLocation { | ... | @@ -62,7 +62,7 @@ fn testFnForSrc() std.builtin.SourceLocation { |
| 62 | test "@src() returns a struct containing 0-terminated string slices" { | 62 | test "@src() returns a struct containing 0-terminated string slices" { |
| 63 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 63 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 64 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 64 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 65 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 65 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 66 | 66 | ||
| 67 | const src = testFnForSrc(); | 67 | const src = testFnForSrc(); |
| 68 | try std.testing.expect([:0]const u8 == @TypeOf(src.file)); | 68 | try std.testing.expect([:0]const u8 == @TypeOf(src.file)); |
| ... | @@ -84,7 +84,7 @@ test "string literal pointer sentinel" { | ... | @@ -84,7 +84,7 @@ test "string literal pointer sentinel" { |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | test "sentinel slice of string literal" { | 86 | test "sentinel slice of string literal" { |
| 87 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 87 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 88 | 88 | ||
| 89 | const string = "Hello!\x00World!"; | 89 | const string = "Hello!\x00World!"; |
| 90 | try std.testing.expect(@TypeOf(string) == *const [13:0]u8); | 90 | try std.testing.expect(@TypeOf(string) == *const [13:0]u8); |
| ... | @@ -102,7 +102,8 @@ test "Peer type resolution with string literals and unknown length u8 pointers" | ... | @@ -102,7 +102,8 @@ test "Peer type resolution with string literals and unknown length u8 pointers" |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | test "including the sentinel when dereferencing a string literal" { | 104 | test "including the sentinel when dereferencing a string literal" { |
| 105 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 105 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 106 | |||
| 106 | var var_str = "abc"; | 107 | var var_str = "abc"; |
| 107 | const var_derefed = var_str[0 .. var_str.len + 1].*; | 108 | const var_derefed = var_str[0 .. var_str.len + 1].*; |
| 108 | 109 |
test/behavior/struct.zig+105-42| ... | @@ -10,6 +10,7 @@ const maxInt = std.math.maxInt; | ... | @@ -10,6 +10,7 @@ const maxInt = std.math.maxInt; |
| 10 | top_level_field: i32, | 10 | top_level_field: i32, |
| 11 | 11 | ||
| 12 | test "top level fields" { | 12 | test "top level fields" { |
| 13 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 13 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 14 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 14 | 15 | ||
| 15 | var instance = @This(){ | 16 | var instance = @This(){ |
| ... | @@ -43,6 +44,7 @@ const StructWithFields = struct { | ... | @@ -43,6 +44,7 @@ const StructWithFields = struct { |
| 43 | }; | 44 | }; |
| 44 | 45 | ||
| 45 | test "non-packed struct has fields padded out to the required alignment" { | 46 | test "non-packed struct has fields padded out to the required alignment" { |
| 47 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 46 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 48 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 47 | 49 | ||
| 48 | const foo = StructWithFields{ .a = 5, .b = 1, .c = 10, .d = 2 }; | 50 | const foo = StructWithFields{ .a = 5, .b = 1, .c = 10, .d = 2 }; |
| ... | @@ -66,6 +68,7 @@ const SmallStruct = struct { | ... | @@ -66,6 +68,7 @@ const SmallStruct = struct { |
| 66 | }; | 68 | }; |
| 67 | 69 | ||
| 68 | test "lower unnamed constants" { | 70 | test "lower unnamed constants" { |
| 71 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 69 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 72 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 70 | 73 | ||
| 71 | var foo = SmallStruct{ .a = 1, .b = 255 }; | 74 | var foo = SmallStruct{ .a = 1, .b = 255 }; |
| ... | @@ -88,7 +91,7 @@ const StructFoo = struct { | ... | @@ -88,7 +91,7 @@ const StructFoo = struct { |
| 88 | test "structs" { | 91 | test "structs" { |
| 89 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 92 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 90 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 93 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 91 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 94 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 92 | 95 | ||
| 93 | var foo: StructFoo = undefined; | 96 | var foo: StructFoo = undefined; |
| 94 | @memset(@as([*]u8, @ptrCast(&foo))[0..@sizeOf(StructFoo)], 0); | 97 | @memset(@as([*]u8, @ptrCast(&foo))[0..@sizeOf(StructFoo)], 0); |
| ... | @@ -106,6 +109,7 @@ fn testMutation(foo: *StructFoo) void { | ... | @@ -106,6 +109,7 @@ fn testMutation(foo: *StructFoo) void { |
| 106 | } | 109 | } |
| 107 | 110 | ||
| 108 | test "struct byval assign" { | 111 | test "struct byval assign" { |
| 112 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 109 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 113 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 110 | 114 | ||
| 111 | var foo1: StructFoo = undefined; | 115 | var foo1: StructFoo = undefined; |
| ... | @@ -170,6 +174,7 @@ const MemberFnTestFoo = struct { | ... | @@ -170,6 +174,7 @@ const MemberFnTestFoo = struct { |
| 170 | }; | 174 | }; |
| 171 | 175 | ||
| 172 | test "call member function directly" { | 176 | test "call member function directly" { |
| 177 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 173 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 178 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 174 | 179 | ||
| 175 | const instance = MemberFnTestFoo{ .x = 1234 }; | 180 | const instance = MemberFnTestFoo{ .x = 1234 }; |
| ... | @@ -178,6 +183,7 @@ test "call member function directly" { | ... | @@ -178,6 +183,7 @@ test "call member function directly" { |
| 178 | } | 183 | } |
| 179 | 184 | ||
| 180 | test "store member function in variable" { | 185 | test "store member function in variable" { |
| 186 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 181 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 187 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 182 | 188 | ||
| 183 | const instance = MemberFnTestFoo{ .x = 1234 }; | 189 | const instance = MemberFnTestFoo{ .x = 1234 }; |
| ... | @@ -187,6 +193,7 @@ test "store member function in variable" { | ... | @@ -187,6 +193,7 @@ test "store member function in variable" { |
| 187 | } | 193 | } |
| 188 | 194 | ||
| 189 | test "member functions" { | 195 | test "member functions" { |
| 196 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 190 | const r = MemberFnRand{ .seed = 1234 }; | 197 | const r = MemberFnRand{ .seed = 1234 }; |
| 191 | try expect(r.getSeed() == 1234); | 198 | try expect(r.getSeed() == 1234); |
| 192 | } | 199 | } |
| ... | @@ -198,6 +205,7 @@ const MemberFnRand = struct { | ... | @@ -198,6 +205,7 @@ const MemberFnRand = struct { |
| 198 | }; | 205 | }; |
| 199 | 206 | ||
| 200 | test "return struct byval from function" { | 207 | test "return struct byval from function" { |
| 208 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 201 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 209 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 202 | 210 | ||
| 203 | const Bar = struct { | 211 | const Bar = struct { |
| ... | @@ -215,6 +223,7 @@ test "return struct byval from function" { | ... | @@ -215,6 +223,7 @@ test "return struct byval from function" { |
| 215 | } | 223 | } |
| 216 | 224 | ||
| 217 | test "call method with mutable reference to struct with no fields" { | 225 | test "call method with mutable reference to struct with no fields" { |
| 226 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 218 | const S = struct { | 227 | const S = struct { |
| 219 | fn doC(s: *const @This()) bool { | 228 | fn doC(s: *const @This()) bool { |
| 220 | _ = s; | 229 | _ = s; |
| ... | @@ -234,6 +243,7 @@ test "call method with mutable reference to struct with no fields" { | ... | @@ -234,6 +243,7 @@ test "call method with mutable reference to struct with no fields" { |
| 234 | } | 243 | } |
| 235 | 244 | ||
| 236 | test "struct field init with catch" { | 245 | test "struct field init with catch" { |
| 246 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 237 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 247 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 238 | 248 | ||
| 239 | const S = struct { | 249 | const S = struct { |
| ... | @@ -277,7 +287,7 @@ const Val = struct { | ... | @@ -277,7 +287,7 @@ const Val = struct { |
| 277 | 287 | ||
| 278 | test "struct point to self" { | 288 | test "struct point to self" { |
| 279 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 289 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 280 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 290 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 281 | 291 | ||
| 282 | var root: Node = undefined; | 292 | var root: Node = undefined; |
| 283 | root.val.x = 1; | 293 | root.val.x = 1; |
| ... | @@ -320,7 +330,7 @@ fn testReturnEmptyStructFromFn() EmptyStruct2 { | ... | @@ -320,7 +330,7 @@ fn testReturnEmptyStructFromFn() EmptyStruct2 { |
| 320 | 330 | ||
| 321 | test "pass slice of empty struct to fn" { | 331 | test "pass slice of empty struct to fn" { |
| 322 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 332 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 323 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 333 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 324 | 334 | ||
| 325 | try expect(testPassSliceOfEmptyStructToFn(&[_]EmptyStruct2{EmptyStruct2{}}) == 1); | 335 | try expect(testPassSliceOfEmptyStructToFn(&[_]EmptyStruct2{EmptyStruct2{}}) == 1); |
| 326 | } | 336 | } |
| ... | @@ -331,7 +341,7 @@ fn testPassSliceOfEmptyStructToFn(slice: []const EmptyStruct2) usize { | ... | @@ -331,7 +341,7 @@ fn testPassSliceOfEmptyStructToFn(slice: []const EmptyStruct2) usize { |
| 331 | test "self-referencing struct via array member" { | 341 | test "self-referencing struct via array member" { |
| 332 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 342 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 333 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 343 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 334 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 344 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 335 | 345 | ||
| 336 | const T = struct { | 346 | const T = struct { |
| 337 | children: [1]*@This(), | 347 | children: [1]*@This(), |
| ... | @@ -342,6 +352,8 @@ test "self-referencing struct via array member" { | ... | @@ -342,6 +352,8 @@ test "self-referencing struct via array member" { |
| 342 | } | 352 | } |
| 343 | 353 | ||
| 344 | test "empty struct method call" { | 354 | test "empty struct method call" { |
| 355 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 356 | |||
| 345 | const es = EmptyStruct{}; | 357 | const es = EmptyStruct{}; |
| 346 | try expect(es.method() == 1234); | 358 | try expect(es.method() == 1234); |
| 347 | } | 359 | } |
| ... | @@ -355,7 +367,7 @@ const EmptyStruct = struct { | ... | @@ -355,7 +367,7 @@ const EmptyStruct = struct { |
| 355 | test "align 1 field before self referential align 8 field as slice return type" { | 367 | test "align 1 field before self referential align 8 field as slice return type" { |
| 356 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 368 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 357 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 369 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 358 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 370 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 359 | 371 | ||
| 360 | const result = alloc(Expr); | 372 | const result = alloc(Expr); |
| 361 | try expect(result.len == 0); | 373 | try expect(result.len == 0); |
| ... | @@ -376,6 +388,7 @@ const APackedStruct = packed struct { | ... | @@ -376,6 +388,7 @@ const APackedStruct = packed struct { |
| 376 | }; | 388 | }; |
| 377 | 389 | ||
| 378 | test "packed struct" { | 390 | test "packed struct" { |
| 391 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 379 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 392 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 380 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 393 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 381 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 394 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| ... | @@ -401,7 +414,7 @@ const Foo96Bits = packed struct { | ... | @@ -401,7 +414,7 @@ const Foo96Bits = packed struct { |
| 401 | 414 | ||
| 402 | test "packed struct 24bits" { | 415 | test "packed struct 24bits" { |
| 403 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 416 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 404 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 417 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 405 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 418 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 406 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 419 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 407 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 420 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| ... | @@ -443,7 +456,7 @@ test "packed struct 24bits" { | ... | @@ -443,7 +456,7 @@ test "packed struct 24bits" { |
| 443 | } | 456 | } |
| 444 | 457 | ||
| 445 | test "runtime struct initialization of bitfield" { | 458 | test "runtime struct initialization of bitfield" { |
| 446 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 459 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 447 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 460 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 448 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 461 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 449 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 462 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -486,7 +499,8 @@ test "packed struct fields are ordered from LSB to MSB" { | ... | @@ -486,7 +499,8 @@ test "packed struct fields are ordered from LSB to MSB" { |
| 486 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 499 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 487 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 500 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 488 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 501 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 489 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 502 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 503 | |||
| 490 | var all: u64 = 0x7765443322221111; | 504 | var all: u64 = 0x7765443322221111; |
| 491 | var bytes: [8]u8 align(@alignOf(Bitfields)) = undefined; | 505 | var bytes: [8]u8 align(@alignOf(Bitfields)) = undefined; |
| 492 | @memcpy(bytes[0..8], @as([*]u8, @ptrCast(&all))); | 506 | @memcpy(bytes[0..8], @as([*]u8, @ptrCast(&all))); |
| ... | @@ -502,6 +516,7 @@ test "packed struct fields are ordered from LSB to MSB" { | ... | @@ -502,6 +516,7 @@ test "packed struct fields are ordered from LSB to MSB" { |
| 502 | } | 516 | } |
| 503 | 517 | ||
| 504 | test "implicit cast packed struct field to const ptr" { | 518 | test "implicit cast packed struct field to const ptr" { |
| 519 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 505 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 520 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 506 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 521 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 507 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 522 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -523,6 +538,7 @@ test "implicit cast packed struct field to const ptr" { | ... | @@ -523,6 +538,7 @@ test "implicit cast packed struct field to const ptr" { |
| 523 | } | 538 | } |
| 524 | 539 | ||
| 525 | test "zero-bit field in packed struct" { | 540 | test "zero-bit field in packed struct" { |
| 541 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 526 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 542 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 527 | 543 | ||
| 528 | const S = packed struct { | 544 | const S = packed struct { |
| ... | @@ -537,7 +553,7 @@ test "packed struct with non-ABI-aligned field" { | ... | @@ -537,7 +553,7 @@ test "packed struct with non-ABI-aligned field" { |
| 537 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 553 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 538 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 554 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 539 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 555 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 540 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 556 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 541 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 557 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 542 | 558 | ||
| 543 | const S = packed struct { | 559 | const S = packed struct { |
| ... | @@ -564,6 +580,7 @@ const bit_field_1 = BitField1{ | ... | @@ -564,6 +580,7 @@ const bit_field_1 = BitField1{ |
| 564 | }; | 580 | }; |
| 565 | 581 | ||
| 566 | test "bit field access" { | 582 | test "bit field access" { |
| 583 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 567 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 584 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 568 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 585 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 569 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 586 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -596,6 +613,7 @@ fn getC(data: *const BitField1) u2 { | ... | @@ -596,6 +613,7 @@ fn getC(data: *const BitField1) u2 { |
| 596 | } | 613 | } |
| 597 | 614 | ||
| 598 | test "default struct initialization fields" { | 615 | test "default struct initialization fields" { |
| 616 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 599 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 617 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 600 | 618 | ||
| 601 | const S = struct { | 619 | const S = struct { |
| ... | @@ -622,7 +640,7 @@ test "packed array 24bits" { | ... | @@ -622,7 +640,7 @@ test "packed array 24bits" { |
| 622 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 640 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 623 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 641 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 624 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 642 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 625 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 643 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 626 | 644 | ||
| 627 | comptime { | 645 | comptime { |
| 628 | try expect(@sizeOf([9]Foo32Bits) == 9 * 4); | 646 | try expect(@sizeOf([9]Foo32Bits) == 9 * 4); |
| ... | @@ -686,6 +704,7 @@ const FooArrayOfAligned = packed struct { | ... | @@ -686,6 +704,7 @@ const FooArrayOfAligned = packed struct { |
| 686 | }; | 704 | }; |
| 687 | 705 | ||
| 688 | test "pointer to packed struct member in a stack variable" { | 706 | test "pointer to packed struct member in a stack variable" { |
| 707 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 689 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 708 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 690 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 709 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 691 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 710 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -715,7 +734,7 @@ test "packed struct with u0 field access" { | ... | @@ -715,7 +734,7 @@ test "packed struct with u0 field access" { |
| 715 | } | 734 | } |
| 716 | 735 | ||
| 717 | test "access to global struct fields" { | 736 | test "access to global struct fields" { |
| 718 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 737 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 719 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 738 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 720 | 739 | ||
| 721 | g_foo.bar.value = 42; | 740 | g_foo.bar.value = 42; |
| ... | @@ -739,7 +758,7 @@ var g_foo: S0 = S0.init(); | ... | @@ -739,7 +758,7 @@ var g_foo: S0 = S0.init(); |
| 739 | test "packed struct with fp fields" { | 758 | test "packed struct with fp fields" { |
| 740 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 759 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 741 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 760 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 742 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 761 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 743 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 762 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 744 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 763 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 745 | 764 | ||
| ... | @@ -766,6 +785,7 @@ test "packed struct with fp fields" { | ... | @@ -766,6 +785,7 @@ test "packed struct with fp fields" { |
| 766 | } | 785 | } |
| 767 | 786 | ||
| 768 | test "fn with C calling convention returns struct by value" { | 787 | test "fn with C calling convention returns struct by value" { |
| 788 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 769 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 789 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 770 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 790 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 771 | 791 | ||
| ... | @@ -792,7 +812,7 @@ test "fn with C calling convention returns struct by value" { | ... | @@ -792,7 +812,7 @@ test "fn with C calling convention returns struct by value" { |
| 792 | test "non-packed struct with u128 entry in union" { | 812 | test "non-packed struct with u128 entry in union" { |
| 793 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 813 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 794 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 814 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 795 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 815 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 796 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 816 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 797 | 817 | ||
| 798 | const U = union(enum) { | 818 | const U = union(enum) { |
| ... | @@ -815,6 +835,7 @@ test "non-packed struct with u128 entry in union" { | ... | @@ -815,6 +835,7 @@ test "non-packed struct with u128 entry in union" { |
| 815 | } | 835 | } |
| 816 | 836 | ||
| 817 | test "packed struct field passed to generic function" { | 837 | test "packed struct field passed to generic function" { |
| 838 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 818 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 839 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 819 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 840 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 820 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 841 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -839,6 +860,7 @@ test "packed struct field passed to generic function" { | ... | @@ -839,6 +860,7 @@ test "packed struct field passed to generic function" { |
| 839 | } | 860 | } |
| 840 | 861 | ||
| 841 | test "anonymous struct literal syntax" { | 862 | test "anonymous struct literal syntax" { |
| 863 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 842 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 864 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 843 | 865 | ||
| 844 | const S = struct { | 866 | const S = struct { |
| ... | @@ -862,6 +884,8 @@ test "anonymous struct literal syntax" { | ... | @@ -862,6 +884,8 @@ test "anonymous struct literal syntax" { |
| 862 | } | 884 | } |
| 863 | 885 | ||
| 864 | test "fully anonymous struct" { | 886 | test "fully anonymous struct" { |
| 887 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 888 | |||
| 865 | const S = struct { | 889 | const S = struct { |
| 866 | fn doTheTest() !void { | 890 | fn doTheTest() !void { |
| 867 | try dump(.{ | 891 | try dump(.{ |
| ... | @@ -884,6 +908,8 @@ test "fully anonymous struct" { | ... | @@ -884,6 +908,8 @@ test "fully anonymous struct" { |
| 884 | } | 908 | } |
| 885 | 909 | ||
| 886 | test "fully anonymous list literal" { | 910 | test "fully anonymous list literal" { |
| 911 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 912 | |||
| 887 | const S = struct { | 913 | const S = struct { |
| 888 | fn doTheTest() !void { | 914 | fn doTheTest() !void { |
| 889 | try dump(.{ @as(u32, 1234), @as(f64, 12.34), true, "hi" }); | 915 | try dump(.{ @as(u32, 1234), @as(f64, 12.34), true, "hi" }); |
| ... | @@ -901,6 +927,8 @@ test "fully anonymous list literal" { | ... | @@ -901,6 +927,8 @@ test "fully anonymous list literal" { |
| 901 | } | 927 | } |
| 902 | 928 | ||
| 903 | test "tuple assigned to variable" { | 929 | test "tuple assigned to variable" { |
| 930 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 931 | |||
| 904 | var vec = .{ @as(i32, 22), @as(i32, 55), @as(i32, 99) }; | 932 | var vec = .{ @as(i32, 22), @as(i32, 55), @as(i32, 99) }; |
| 905 | _ = &vec; | 933 | _ = &vec; |
| 906 | try expect(vec.@"0" == 22); | 934 | try expect(vec.@"0" == 22); |
| ... | @@ -912,6 +940,7 @@ test "tuple assigned to variable" { | ... | @@ -912,6 +940,7 @@ test "tuple assigned to variable" { |
| 912 | } | 940 | } |
| 913 | 941 | ||
| 914 | test "comptime struct field" { | 942 | test "comptime struct field" { |
| 943 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 915 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 944 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 916 | 945 | ||
| 917 | const T = struct { | 946 | const T = struct { |
| ... | @@ -927,7 +956,7 @@ test "comptime struct field" { | ... | @@ -927,7 +956,7 @@ test "comptime struct field" { |
| 927 | } | 956 | } |
| 928 | 957 | ||
| 929 | test "tuple element initialized with fn call" { | 958 | test "tuple element initialized with fn call" { |
| 930 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 959 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 931 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 960 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 932 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 961 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 933 | 962 | ||
| ... | @@ -945,6 +974,7 @@ test "tuple element initialized with fn call" { | ... | @@ -945,6 +974,7 @@ test "tuple element initialized with fn call" { |
| 945 | } | 974 | } |
| 946 | 975 | ||
| 947 | test "struct with union field" { | 976 | test "struct with union field" { |
| 977 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 948 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 978 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 949 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 979 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 950 | 980 | ||
| ... | @@ -965,6 +995,7 @@ test "struct with union field" { | ... | @@ -965,6 +995,7 @@ test "struct with union field" { |
| 965 | } | 995 | } |
| 966 | 996 | ||
| 967 | test "struct with 0-length union array field" { | 997 | test "struct with 0-length union array field" { |
| 998 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 968 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 999 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 969 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1000 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 970 | 1001 | ||
| ... | @@ -983,7 +1014,7 @@ test "struct with 0-length union array field" { | ... | @@ -983,7 +1014,7 @@ test "struct with 0-length union array field" { |
| 983 | } | 1014 | } |
| 984 | 1015 | ||
| 985 | test "packed struct with undefined initializers" { | 1016 | test "packed struct with undefined initializers" { |
| 986 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1017 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 987 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1018 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 988 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1019 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 989 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1020 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -1014,7 +1045,7 @@ test "packed struct with undefined initializers" { | ... | @@ -1014,7 +1045,7 @@ test "packed struct with undefined initializers" { |
| 1014 | } | 1045 | } |
| 1015 | 1046 | ||
| 1016 | test "for loop over pointers to struct, getting field from struct pointer" { | 1047 | test "for loop over pointers to struct, getting field from struct pointer" { |
| 1017 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1048 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1018 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1049 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1019 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1050 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1020 | 1051 | ||
| ... | @@ -1056,7 +1087,7 @@ test "anon init through error unions and optionals" { | ... | @@ -1056,7 +1087,7 @@ test "anon init through error unions and optionals" { |
| 1056 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1087 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1057 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1088 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1058 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1089 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1059 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1090 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1060 | 1091 | ||
| 1061 | const S = struct { | 1092 | const S = struct { |
| 1062 | a: u32, | 1093 | a: u32, |
| ... | @@ -1080,6 +1111,7 @@ test "anon init through error unions and optionals" { | ... | @@ -1080,6 +1111,7 @@ test "anon init through error unions and optionals" { |
| 1080 | } | 1111 | } |
| 1081 | 1112 | ||
| 1082 | test "anon init through optional" { | 1113 | test "anon init through optional" { |
| 1114 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1083 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1115 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1084 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1116 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1085 | 1117 | ||
| ... | @@ -1100,7 +1132,7 @@ test "anon init through optional" { | ... | @@ -1100,7 +1132,7 @@ test "anon init through optional" { |
| 1100 | test "anon init through error union" { | 1132 | test "anon init through error union" { |
| 1101 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1133 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1102 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1134 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1103 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1135 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1104 | 1136 | ||
| 1105 | const S = struct { | 1137 | const S = struct { |
| 1106 | a: u32, | 1138 | a: u32, |
| ... | @@ -1117,6 +1149,7 @@ test "anon init through error union" { | ... | @@ -1117,6 +1149,7 @@ test "anon init through error union" { |
| 1117 | } | 1149 | } |
| 1118 | 1150 | ||
| 1119 | test "typed init through error unions and optionals" { | 1151 | test "typed init through error unions and optionals" { |
| 1152 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1120 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1153 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1121 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1154 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1122 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1155 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -1143,6 +1176,7 @@ test "typed init through error unions and optionals" { | ... | @@ -1143,6 +1176,7 @@ test "typed init through error unions and optionals" { |
| 1143 | } | 1176 | } |
| 1144 | 1177 | ||
| 1145 | test "initialize struct with empty literal" { | 1178 | test "initialize struct with empty literal" { |
| 1179 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1146 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1180 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1147 | 1181 | ||
| 1148 | const S = struct { x: i32 = 1234 }; | 1182 | const S = struct { x: i32 = 1234 }; |
| ... | @@ -1152,6 +1186,7 @@ test "initialize struct with empty literal" { | ... | @@ -1152,6 +1186,7 @@ test "initialize struct with empty literal" { |
| 1152 | } | 1186 | } |
| 1153 | 1187 | ||
| 1154 | test "loading a struct pointer perfoms a copy" { | 1188 | test "loading a struct pointer perfoms a copy" { |
| 1189 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1155 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1190 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1156 | 1191 | ||
| 1157 | const S = struct { | 1192 | const S = struct { |
| ... | @@ -1197,6 +1232,7 @@ test "packed struct aggregate init" { | ... | @@ -1197,6 +1232,7 @@ test "packed struct aggregate init" { |
| 1197 | } | 1232 | } |
| 1198 | 1233 | ||
| 1199 | test "packed struct field access via pointer" { | 1234 | test "packed struct field access via pointer" { |
| 1235 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 1200 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1236 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1201 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1237 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1202 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1238 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -1237,6 +1273,7 @@ test "store to comptime field" { | ... | @@ -1237,6 +1273,7 @@ test "store to comptime field" { |
| 1237 | } | 1273 | } |
| 1238 | 1274 | ||
| 1239 | test "struct field init value is size of the struct" { | 1275 | test "struct field init value is size of the struct" { |
| 1276 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1240 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1277 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1241 | 1278 | ||
| 1242 | const namespace = struct { | 1279 | const namespace = struct { |
| ... | @@ -1253,7 +1290,7 @@ test "struct field init value is size of the struct" { | ... | @@ -1253,7 +1290,7 @@ test "struct field init value is size of the struct" { |
| 1253 | test "under-aligned struct field" { | 1290 | test "under-aligned struct field" { |
| 1254 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1291 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1255 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1292 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1256 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1293 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1257 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1294 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1258 | 1295 | ||
| 1259 | const U = extern union { | 1296 | const U = extern union { |
| ... | @@ -1275,7 +1312,7 @@ test "under-aligned struct field" { | ... | @@ -1275,7 +1312,7 @@ test "under-aligned struct field" { |
| 1275 | 1312 | ||
| 1276 | test "fieldParentPtr of a zero-bit field" { | 1313 | test "fieldParentPtr of a zero-bit field" { |
| 1277 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1314 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1278 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1315 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1279 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1316 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1280 | 1317 | ||
| 1281 | const S = struct { | 1318 | const S = struct { |
| ... | @@ -1323,7 +1360,7 @@ test "fieldParentPtr of a zero-bit field" { | ... | @@ -1323,7 +1360,7 @@ test "fieldParentPtr of a zero-bit field" { |
| 1323 | } | 1360 | } |
| 1324 | 1361 | ||
| 1325 | test "struct field has a pointer to an aligned version of itself" { | 1362 | test "struct field has a pointer to an aligned version of itself" { |
| 1326 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1363 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1327 | 1364 | ||
| 1328 | const E = struct { | 1365 | const E = struct { |
| 1329 | next: *align(1) @This(), | 1366 | next: *align(1) @This(), |
| ... | @@ -1335,7 +1372,7 @@ test "struct field has a pointer to an aligned version of itself" { | ... | @@ -1335,7 +1372,7 @@ test "struct field has a pointer to an aligned version of itself" { |
| 1335 | } | 1372 | } |
| 1336 | 1373 | ||
| 1337 | test "struct has only one reference" { | 1374 | test "struct has only one reference" { |
| 1338 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1375 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1339 | 1376 | ||
| 1340 | const S = struct { | 1377 | const S = struct { |
| 1341 | fn optionalStructParam(_: ?struct { x: u8 }) void {} | 1378 | fn optionalStructParam(_: ?struct { x: u8 }) void {} |
| ... | @@ -1384,7 +1421,7 @@ test "struct has only one reference" { | ... | @@ -1384,7 +1421,7 @@ test "struct has only one reference" { |
| 1384 | 1421 | ||
| 1385 | test "no dependency loop on pointer to optional struct" { | 1422 | test "no dependency loop on pointer to optional struct" { |
| 1386 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1423 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1387 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1424 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1388 | 1425 | ||
| 1389 | const S = struct { | 1426 | const S = struct { |
| 1390 | const A = struct { b: B }; | 1427 | const A = struct { b: B }; |
| ... | @@ -1404,7 +1441,7 @@ test "discarded struct initialization works as expected" { | ... | @@ -1404,7 +1441,7 @@ test "discarded struct initialization works as expected" { |
| 1404 | } | 1441 | } |
| 1405 | 1442 | ||
| 1406 | test "function pointer in struct returns the struct" { | 1443 | test "function pointer in struct returns the struct" { |
| 1407 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1444 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1408 | 1445 | ||
| 1409 | const A = struct { | 1446 | const A = struct { |
| 1410 | const A = @This(); | 1447 | const A = @This(); |
| ... | @@ -1420,7 +1457,7 @@ test "function pointer in struct returns the struct" { | ... | @@ -1420,7 +1457,7 @@ test "function pointer in struct returns the struct" { |
| 1420 | } | 1457 | } |
| 1421 | 1458 | ||
| 1422 | test "no dependency loop on optional field wrapped in generic function" { | 1459 | test "no dependency loop on optional field wrapped in generic function" { |
| 1423 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1460 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1424 | 1461 | ||
| 1425 | const S = struct { | 1462 | const S = struct { |
| 1426 | fn Atomic(comptime T: type) type { | 1463 | fn Atomic(comptime T: type) type { |
| ... | @@ -1438,6 +1475,7 @@ test "no dependency loop on optional field wrapped in generic function" { | ... | @@ -1438,6 +1475,7 @@ test "no dependency loop on optional field wrapped in generic function" { |
| 1438 | } | 1475 | } |
| 1439 | 1476 | ||
| 1440 | test "optional field init with tuple" { | 1477 | test "optional field init with tuple" { |
| 1478 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1441 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1479 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1442 | 1480 | ||
| 1443 | const S = struct { | 1481 | const S = struct { |
| ... | @@ -1452,6 +1490,8 @@ test "optional field init with tuple" { | ... | @@ -1452,6 +1490,8 @@ test "optional field init with tuple" { |
| 1452 | } | 1490 | } |
| 1453 | 1491 | ||
| 1454 | test "if inside struct init inside if" { | 1492 | test "if inside struct init inside if" { |
| 1493 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1494 | |||
| 1455 | const MyStruct = struct { x: u32 }; | 1495 | const MyStruct = struct { x: u32 }; |
| 1456 | const b: u32 = 5; | 1496 | const b: u32 = 5; |
| 1457 | var i: u32 = 1; | 1497 | var i: u32 = 1; |
| ... | @@ -1478,7 +1518,7 @@ test "optional generic function label struct field" { | ... | @@ -1478,7 +1518,7 @@ test "optional generic function label struct field" { |
| 1478 | } | 1518 | } |
| 1479 | 1519 | ||
| 1480 | test "struct fields get automatically reordered" { | 1520 | test "struct fields get automatically reordered" { |
| 1481 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1521 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1482 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 1522 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 1483 | 1523 | ||
| 1484 | const S1 = struct { | 1524 | const S1 = struct { |
| ... | @@ -1539,7 +1579,7 @@ test "instantiate struct with comptime field" { | ... | @@ -1539,7 +1579,7 @@ test "instantiate struct with comptime field" { |
| 1539 | test "struct field pointer has correct alignment" { | 1579 | test "struct field pointer has correct alignment" { |
| 1540 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1580 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1541 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1581 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1542 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1582 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1543 | 1583 | ||
| 1544 | const S = struct { | 1584 | const S = struct { |
| 1545 | fn doTheTest() !void { | 1585 | fn doTheTest() !void { |
| ... | @@ -1568,7 +1608,7 @@ test "struct field pointer has correct alignment" { | ... | @@ -1568,7 +1608,7 @@ test "struct field pointer has correct alignment" { |
| 1568 | test "extern struct field pointer has correct alignment" { | 1608 | test "extern struct field pointer has correct alignment" { |
| 1569 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1609 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1570 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1610 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1571 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1611 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1572 | 1612 | ||
| 1573 | const S = struct { | 1613 | const S = struct { |
| 1574 | fn doTheTest() !void { | 1614 | fn doTheTest() !void { |
| ... | @@ -1617,6 +1657,8 @@ fn countFields(v: anytype) usize { | ... | @@ -1617,6 +1657,8 @@ fn countFields(v: anytype) usize { |
| 1617 | } | 1657 | } |
| 1618 | 1658 | ||
| 1619 | test "struct init with no result pointer sets field result types" { | 1659 | test "struct init with no result pointer sets field result types" { |
| 1660 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1661 | |||
| 1620 | const S = struct { | 1662 | const S = struct { |
| 1621 | // A function parameter has a result type, but no result pointer. | 1663 | // A function parameter has a result type, but no result pointer. |
| 1622 | fn f(s: struct { x: u32 }) u32 { | 1664 | fn f(s: struct { x: u32 }) u32 { |
| ... | @@ -1631,6 +1673,8 @@ test "struct init with no result pointer sets field result types" { | ... | @@ -1631,6 +1673,8 @@ test "struct init with no result pointer sets field result types" { |
| 1631 | } | 1673 | } |
| 1632 | 1674 | ||
| 1633 | test "runtime side-effects in comptime-known struct init" { | 1675 | test "runtime side-effects in comptime-known struct init" { |
| 1676 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1677 | |||
| 1634 | var side_effects: u4 = 0; | 1678 | var side_effects: u4 = 0; |
| 1635 | const S = struct { a: u4, b: u4, c: u4, d: u4 }; | 1679 | const S = struct { a: u4, b: u4, c: u4, d: u4 }; |
| 1636 | const init = S{ | 1680 | const init = S{ |
| ... | @@ -1656,7 +1700,7 @@ test "runtime side-effects in comptime-known struct init" { | ... | @@ -1656,7 +1700,7 @@ test "runtime side-effects in comptime-known struct init" { |
| 1656 | } | 1700 | } |
| 1657 | 1701 | ||
| 1658 | test "pointer to struct initialized through reference to anonymous initializer provides result types" { | 1702 | test "pointer to struct initialized through reference to anonymous initializer provides result types" { |
| 1659 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1703 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1660 | 1704 | ||
| 1661 | const S = struct { a: u8, b: u16, c: *const anyopaque }; | 1705 | const S = struct { a: u8, b: u16, c: *const anyopaque }; |
| 1662 | var my_u16: u16 = 0xABCD; | 1706 | var my_u16: u16 = 0xABCD; |
| ... | @@ -1693,6 +1737,8 @@ test "comptimeness of optional and error union payload is analyzed properly" { | ... | @@ -1693,6 +1737,8 @@ test "comptimeness of optional and error union payload is analyzed properly" { |
| 1693 | } | 1737 | } |
| 1694 | 1738 | ||
| 1695 | test "initializer uses own alignment" { | 1739 | test "initializer uses own alignment" { |
| 1740 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1741 | |||
| 1696 | const S = struct { | 1742 | const S = struct { |
| 1697 | x: u32 = @alignOf(@This()) + 1, | 1743 | x: u32 = @alignOf(@This()) + 1, |
| 1698 | }; | 1744 | }; |
| ... | @@ -1704,6 +1750,8 @@ test "initializer uses own alignment" { | ... | @@ -1704,6 +1750,8 @@ test "initializer uses own alignment" { |
| 1704 | } | 1750 | } |
| 1705 | 1751 | ||
| 1706 | test "initializer uses own size" { | 1752 | test "initializer uses own size" { |
| 1753 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1754 | |||
| 1707 | const S = struct { | 1755 | const S = struct { |
| 1708 | x: u32 = @sizeOf(@This()) + 1, | 1756 | x: u32 = @sizeOf(@This()) + 1, |
| 1709 | }; | 1757 | }; |
| ... | @@ -1715,7 +1763,7 @@ test "initializer uses own size" { | ... | @@ -1715,7 +1763,7 @@ test "initializer uses own size" { |
| 1715 | } | 1763 | } |
| 1716 | 1764 | ||
| 1717 | test "initializer takes a pointer to a variable inside its struct" { | 1765 | test "initializer takes a pointer to a variable inside its struct" { |
| 1718 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1766 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1719 | 1767 | ||
| 1720 | const namespace = struct { | 1768 | const namespace = struct { |
| 1721 | const S = struct { | 1769 | const S = struct { |
| ... | @@ -1735,7 +1783,7 @@ test "initializer takes a pointer to a variable inside its struct" { | ... | @@ -1735,7 +1783,7 @@ test "initializer takes a pointer to a variable inside its struct" { |
| 1735 | } | 1783 | } |
| 1736 | 1784 | ||
| 1737 | test "circular dependency through pointer field of a struct" { | 1785 | test "circular dependency through pointer field of a struct" { |
| 1738 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1786 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1739 | 1787 | ||
| 1740 | const S = struct { | 1788 | const S = struct { |
| 1741 | const StructInner = extern struct { | 1789 | const StructInner = extern struct { |
| ... | @@ -1758,7 +1806,7 @@ test "circular dependency through pointer field of a struct" { | ... | @@ -1758,7 +1806,7 @@ test "circular dependency through pointer field of a struct" { |
| 1758 | } | 1806 | } |
| 1759 | 1807 | ||
| 1760 | test "field calls do not force struct field init resolution" { | 1808 | test "field calls do not force struct field init resolution" { |
| 1761 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1809 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1762 | 1810 | ||
| 1763 | const S = struct { | 1811 | const S = struct { |
| 1764 | x: u32 = blk: { | 1812 | x: u32 = blk: { |
| ... | @@ -1787,6 +1835,7 @@ test "tuple with comptime-only field" { | ... | @@ -1787,6 +1835,7 @@ test "tuple with comptime-only field" { |
| 1787 | } | 1835 | } |
| 1788 | 1836 | ||
| 1789 | test "extern struct fields are aligned to 1" { | 1837 | test "extern struct fields are aligned to 1" { |
| 1838 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1790 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1839 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1791 | 1840 | ||
| 1792 | const Foo = extern struct { | 1841 | const Foo = extern struct { |
| ... | @@ -1806,7 +1855,7 @@ test "assign to slice.len of global variable" { | ... | @@ -1806,7 +1855,7 @@ test "assign to slice.len of global variable" { |
| 1806 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1855 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1807 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1856 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1808 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1857 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1809 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1858 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1810 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1859 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1811 | 1860 | ||
| 1812 | const S = struct { | 1861 | const S = struct { |
| ... | @@ -1819,6 +1868,8 @@ test "assign to slice.len of global variable" { | ... | @@ -1819,6 +1868,8 @@ test "assign to slice.len of global variable" { |
| 1819 | } | 1868 | } |
| 1820 | 1869 | ||
| 1821 | test "pointers to fields of volatile pointer to struct are also volatile" { | 1870 | test "pointers to fields of volatile pointer to struct are also volatile" { |
| 1871 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1872 | |||
| 1822 | const B = extern struct { | 1873 | const B = extern struct { |
| 1823 | a: u32, | 1874 | a: u32, |
| 1824 | b: i32, | 1875 | b: i32, |
| ... | @@ -1833,6 +1884,8 @@ test "pointers to fields of volatile pointer to struct are also volatile" { | ... | @@ -1833,6 +1884,8 @@ test "pointers to fields of volatile pointer to struct are also volatile" { |
| 1833 | } | 1884 | } |
| 1834 | 1885 | ||
| 1835 | test "pointers to fields of volatile pointer to union are also volatile" { | 1886 | test "pointers to fields of volatile pointer to union are also volatile" { |
| 1887 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1888 | |||
| 1836 | const D = extern union { | 1889 | const D = extern union { |
| 1837 | a: u32, | 1890 | a: u32, |
| 1838 | b: i32, | 1891 | b: i32, |
| ... | @@ -1856,7 +1909,7 @@ test "array of structs inside struct initialized with undefined" { | ... | @@ -1856,7 +1909,7 @@ test "array of structs inside struct initialized with undefined" { |
| 1856 | 1909 | ||
| 1857 | test "runtime call in nested initializer" { | 1910 | test "runtime call in nested initializer" { |
| 1858 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1911 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1859 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1912 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1860 | 1913 | ||
| 1861 | const Holder = struct { | 1914 | const Holder = struct { |
| 1862 | array: []const u8, | 1915 | array: []const u8, |
| ... | @@ -1886,6 +1939,7 @@ test "runtime call in nested initializer" { | ... | @@ -1886,6 +1939,7 @@ test "runtime call in nested initializer" { |
| 1886 | } | 1939 | } |
| 1887 | 1940 | ||
| 1888 | test "runtime value in nested initializer passed as pointer to function" { | 1941 | test "runtime value in nested initializer passed as pointer to function" { |
| 1942 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1889 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1943 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1890 | 1944 | ||
| 1891 | const Bar = struct { | 1945 | const Bar = struct { |
| ... | @@ -1909,7 +1963,7 @@ test "runtime value in nested initializer passed as pointer to function" { | ... | @@ -1909,7 +1963,7 @@ test "runtime value in nested initializer passed as pointer to function" { |
| 1909 | } | 1963 | } |
| 1910 | 1964 | ||
| 1911 | test "struct field default value is a call" { | 1965 | test "struct field default value is a call" { |
| 1912 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1966 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1913 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1967 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1914 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1968 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1915 | 1969 | ||
| ... | @@ -1943,6 +1997,8 @@ test "struct field default value is a call" { | ... | @@ -1943,6 +1997,8 @@ test "struct field default value is a call" { |
| 1943 | } | 1997 | } |
| 1944 | 1998 | ||
| 1945 | test "aggregate initializers should allow initializing comptime fields, verifying equality" { | 1999 | test "aggregate initializers should allow initializing comptime fields, verifying equality" { |
| 2000 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2001 | |||
| 1946 | var x: u32 = 15; | 2002 | var x: u32 = 15; |
| 1947 | _ = &x; | 2003 | _ = &x; |
| 1948 | const T = @TypeOf(.{ @as(i32, -1234), @as(u32, 5678), x }); | 2004 | const T = @TypeOf(.{ @as(i32, -1234), @as(u32, 5678), x }); |
| ... | @@ -1954,6 +2010,7 @@ test "aggregate initializers should allow initializing comptime fields, verifyin | ... | @@ -1954,6 +2010,7 @@ test "aggregate initializers should allow initializing comptime fields, verifyin |
| 1954 | } | 2010 | } |
| 1955 | 2011 | ||
| 1956 | test "assignment of field with padding" { | 2012 | test "assignment of field with padding" { |
| 2013 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1957 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 2014 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1958 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2015 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1959 | 2016 | ||
| ... | @@ -1983,7 +2040,7 @@ test "assignment of field with padding" { | ... | @@ -1983,7 +2040,7 @@ test "assignment of field with padding" { |
| 1983 | } | 2040 | } |
| 1984 | 2041 | ||
| 1985 | test "initiate global variable with runtime value" { | 2042 | test "initiate global variable with runtime value" { |
| 1986 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2043 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1987 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 2044 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1988 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2045 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1989 | 2046 | ||
| ... | @@ -2002,7 +2059,7 @@ test "initiate global variable with runtime value" { | ... | @@ -2002,7 +2059,7 @@ test "initiate global variable with runtime value" { |
| 2002 | } | 2059 | } |
| 2003 | 2060 | ||
| 2004 | test "struct containing optional pointer to array of @This()" { | 2061 | test "struct containing optional pointer to array of @This()" { |
| 2005 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2062 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2006 | 2063 | ||
| 2007 | const S = struct { | 2064 | const S = struct { |
| 2008 | x: ?*const [1]@This(), | 2065 | x: ?*const [1]@This(), |
| ... | @@ -2075,6 +2132,7 @@ test "anonymous struct equivalence" { | ... | @@ -2075,6 +2132,7 @@ test "anonymous struct equivalence" { |
| 2075 | } | 2132 | } |
| 2076 | 2133 | ||
| 2077 | test "field access through mem ptr arg" { | 2134 | test "field access through mem ptr arg" { |
| 2135 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2078 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2136 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2079 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2137 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2080 | 2138 | ||
| ... | @@ -2118,7 +2176,7 @@ test "field access through mem ptr arg" { | ... | @@ -2118,7 +2176,7 @@ test "field access through mem ptr arg" { |
| 2118 | } | 2176 | } |
| 2119 | 2177 | ||
| 2120 | test "align 1 struct parameter dereferenced and returned" { | 2178 | test "align 1 struct parameter dereferenced and returned" { |
| 2121 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2179 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2122 | 2180 | ||
| 2123 | const S = extern struct { | 2181 | const S = extern struct { |
| 2124 | a: u32, | 2182 | a: u32, |
| ... | @@ -2169,7 +2227,8 @@ test "pass a pointer to a comptime-only struct field to a function" { | ... | @@ -2169,7 +2227,8 @@ test "pass a pointer to a comptime-only struct field to a function" { |
| 2169 | } | 2227 | } |
| 2170 | 2228 | ||
| 2171 | test "overaligned extern struct fields" { | 2229 | test "overaligned extern struct fields" { |
| 2172 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2230 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2231 | |||
| 2173 | const A = struct { | 2232 | const A = struct { |
| 2174 | a: *anyopaque, | 2233 | a: *anyopaque, |
| 2175 | b: u64, | 2234 | b: u64, |
| ... | @@ -2219,7 +2278,8 @@ test "overaligned extern struct fields" { | ... | @@ -2219,7 +2278,8 @@ test "overaligned extern struct fields" { |
| 2219 | } | 2278 | } |
| 2220 | 2279 | ||
| 2221 | test "runtime-known slice of comptime-only struct" { | 2280 | test "runtime-known slice of comptime-only struct" { |
| 2222 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2281 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2282 | |||
| 2223 | const Mixed = struct { index: u32, T: type }; | 2283 | const Mixed = struct { index: u32, T: type }; |
| 2224 | 2284 | ||
| 2225 | const static = struct { | 2285 | const static = struct { |
| ... | @@ -2241,7 +2301,8 @@ test "runtime-known slice of comptime-only struct" { | ... | @@ -2241,7 +2301,8 @@ test "runtime-known slice of comptime-only struct" { |
| 2241 | } | 2301 | } |
| 2242 | 2302 | ||
| 2243 | test "struct contains aligned pointer to itself through type decl" { | 2303 | test "struct contains aligned pointer to itself through type decl" { |
| 2244 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2304 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2305 | |||
| 2245 | const Slab = struct { | 2306 | const Slab = struct { |
| 2246 | const Ptr = *align(64) const @This(); | 2307 | const Ptr = *align(64) const @This(); |
| 2247 | next: Ptr, | 2308 | next: Ptr, |
| ... | @@ -2259,7 +2320,7 @@ test "struct contains aligned pointer to itself through type decl" { | ... | @@ -2259,7 +2320,7 @@ test "struct contains aligned pointer to itself through type decl" { |
| 2259 | } | 2320 | } |
| 2260 | 2321 | ||
| 2261 | test "struct contains underaligned field with overaligned pointer to itself" { | 2322 | test "struct contains underaligned field with overaligned pointer to itself" { |
| 2262 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2323 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2263 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | 2324 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 2264 | 2325 | ||
| 2265 | const S = struct { | 2326 | const S = struct { |
| ... | @@ -2295,6 +2356,8 @@ test "struct queries typeinfo of struct containing pointer back to first struct" | ... | @@ -2295,6 +2356,8 @@ test "struct queries typeinfo of struct containing pointer back to first struct" |
| 2295 | } | 2356 | } |
| 2296 | 2357 | ||
| 2297 | test "pointer to runtime field of struct containing struct containing comptime-only optional" { | 2358 | test "pointer to runtime field of struct containing struct containing comptime-only optional" { |
| 2359 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2360 | |||
| 2298 | const Foo = struct { | 2361 | const Foo = struct { |
| 2299 | padding: struct { a: u8, b: ?comptime_int }, | 2362 | padding: struct { a: u8, b: ?comptime_int }, |
| 2300 | number: u8, | 2363 | number: u8, |
test/behavior/struct_contains_null_ptr_itself.zig+1-1| ... | @@ -4,7 +4,7 @@ const builtin = @import("builtin"); | ... | @@ -4,7 +4,7 @@ const builtin = @import("builtin"); |
| 4 | 4 | ||
| 5 | test "struct contains null pointer which contains original struct" { | 5 | test "struct contains null pointer which contains original struct" { |
| 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_spirv) return error.SkipZigTest; | 7 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 8 | 8 | ||
| 9 | var x: ?*NodeLineComment = null; | 9 | var x: ?*NodeLineComment = null; |
| 10 | _ = &x; | 10 | _ = &x; |
test/behavior/struct_contains_slice_of_itself.zig+2-2| ... | @@ -13,7 +13,7 @@ const NodeAligned = struct { | ... | @@ -13,7 +13,7 @@ const NodeAligned = struct { |
| 13 | 13 | ||
| 14 | test "struct contains slice of itself" { | 14 | test "struct contains slice of itself" { |
| 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_spirv) return error.SkipZigTest; | 16 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 17 | 17 | ||
| 18 | var other_nodes = [_]Node{ | 18 | var other_nodes = [_]Node{ |
| 19 | Node{ | 19 | Node{ |
| ... | @@ -53,7 +53,7 @@ test "struct contains slice of itself" { | ... | @@ -53,7 +53,7 @@ test "struct contains slice of itself" { |
| 53 | 53 | ||
| 54 | test "struct contains aligned slice of itself" { | 54 | test "struct contains aligned slice of itself" { |
| 55 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 55 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 56 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 56 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 57 | 57 | ||
| 58 | var other_nodes = [_]NodeAligned{ | 58 | var other_nodes = [_]NodeAligned{ |
| 59 | NodeAligned{ | 59 | NodeAligned{ |
test/behavior/switch.zig+52-13| ... | @@ -23,6 +23,7 @@ fn testSwitchWithNumbers(x: u32) !void { | ... | @@ -23,6 +23,7 @@ fn testSwitchWithNumbers(x: u32) !void { |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | test "switch with all ranges" { | 25 | test "switch with all ranges" { |
| 26 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 26 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 27 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 27 | 28 | ||
| 28 | try expect(testSwitchWithAllRanges(50, 3) == 1); | 29 | try expect(testSwitchWithAllRanges(50, 3) == 1); |
| ... | @@ -44,7 +45,7 @@ test "switch arbitrary int size" { | ... | @@ -44,7 +45,7 @@ test "switch arbitrary int size" { |
| 44 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 45 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 45 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 46 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 46 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 47 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 47 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 48 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 48 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 49 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 49 | 50 | ||
| 50 | const S = struct { | 51 | const S = struct { |
| ... | @@ -258,6 +259,7 @@ fn trueIfBoolFalseOtherwise(comptime T: type) bool { | ... | @@ -258,6 +259,7 @@ fn trueIfBoolFalseOtherwise(comptime T: type) bool { |
| 258 | } | 259 | } |
| 259 | 260 | ||
| 260 | test "switching on booleans" { | 261 | test "switching on booleans" { |
| 262 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 261 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 263 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 262 | 264 | ||
| 263 | try testSwitchOnBools(); | 265 | try testSwitchOnBools(); |
| ... | @@ -313,6 +315,7 @@ test "undefined.u0" { | ... | @@ -313,6 +315,7 @@ test "undefined.u0" { |
| 313 | } | 315 | } |
| 314 | 316 | ||
| 315 | test "switch with disjoint range" { | 317 | test "switch with disjoint range" { |
| 318 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 316 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 319 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 317 | var q: u8 = 0; | 320 | var q: u8 = 0; |
| 318 | _ = &q; | 321 | _ = &q; |
| ... | @@ -324,6 +327,8 @@ test "switch with disjoint range" { | ... | @@ -324,6 +327,8 @@ test "switch with disjoint range" { |
| 324 | } | 327 | } |
| 325 | 328 | ||
| 326 | test "switch variable for range and multiple prongs" { | 329 | test "switch variable for range and multiple prongs" { |
| 330 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 331 | |||
| 327 | const S = struct { | 332 | const S = struct { |
| 328 | fn doTheTest() !void { | 333 | fn doTheTest() !void { |
| 329 | try doTheSwitch(16); | 334 | try doTheSwitch(16); |
| ... | @@ -354,7 +359,7 @@ fn poll() void { | ... | @@ -354,7 +359,7 @@ fn poll() void { |
| 354 | } | 359 | } |
| 355 | 360 | ||
| 356 | test "switch on global mutable var isn't constant-folded" { | 361 | test "switch on global mutable var isn't constant-folded" { |
| 357 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 362 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 358 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 363 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 359 | 364 | ||
| 360 | while (state < 2) { | 365 | while (state < 2) { |
| ... | @@ -369,6 +374,7 @@ const SwitchProngWithVarEnum = union(enum) { | ... | @@ -369,6 +374,7 @@ const SwitchProngWithVarEnum = union(enum) { |
| 369 | }; | 374 | }; |
| 370 | 375 | ||
| 371 | test "switch prong with variable" { | 376 | test "switch prong with variable" { |
| 377 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 372 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 378 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 373 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 379 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 374 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 380 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -394,6 +400,7 @@ fn switchProngWithVarFn(a: SwitchProngWithVarEnum) !void { | ... | @@ -394,6 +400,7 @@ fn switchProngWithVarFn(a: SwitchProngWithVarEnum) !void { |
| 394 | } | 400 | } |
| 395 | 401 | ||
| 396 | test "switch on enum using pointer capture" { | 402 | test "switch on enum using pointer capture" { |
| 403 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 397 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 404 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 398 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 405 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 399 | 406 | ||
| ... | @@ -414,6 +421,7 @@ fn testSwitchEnumPtrCapture() !void { | ... | @@ -414,6 +421,7 @@ fn testSwitchEnumPtrCapture() !void { |
| 414 | } | 421 | } |
| 415 | 422 | ||
| 416 | test "switch handles all cases of number" { | 423 | test "switch handles all cases of number" { |
| 424 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 417 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 425 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 418 | 426 | ||
| 419 | try testSwitchHandleAllCases(); | 427 | try testSwitchHandleAllCases(); |
| ... | @@ -453,6 +461,7 @@ fn testSwitchHandleAllCasesRange(x: u8) u8 { | ... | @@ -453,6 +461,7 @@ fn testSwitchHandleAllCasesRange(x: u8) u8 { |
| 453 | } | 461 | } |
| 454 | 462 | ||
| 455 | test "switch on union with some prongs capturing" { | 463 | test "switch on union with some prongs capturing" { |
| 464 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 456 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 465 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 457 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 466 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 458 | 467 | ||
| ... | @@ -490,6 +499,7 @@ test "switch on const enum with var" { | ... | @@ -490,6 +499,7 @@ test "switch on const enum with var" { |
| 490 | } | 499 | } |
| 491 | 500 | ||
| 492 | test "anon enum literal used in switch on union enum" { | 501 | test "anon enum literal used in switch on union enum" { |
| 502 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 493 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 503 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 494 | 504 | ||
| 495 | const Foo = union(enum) { | 505 | const Foo = union(enum) { |
| ... | @@ -506,6 +516,7 @@ test "anon enum literal used in switch on union enum" { | ... | @@ -506,6 +516,7 @@ test "anon enum literal used in switch on union enum" { |
| 506 | } | 516 | } |
| 507 | 517 | ||
| 508 | test "switch all prongs unreachable" { | 518 | test "switch all prongs unreachable" { |
| 519 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 509 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 520 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 510 | 521 | ||
| 511 | try testAllProngsUnreachable(); | 522 | try testAllProngsUnreachable(); |
| ... | @@ -529,6 +540,7 @@ fn switchWithUnreachable(x: i32) i32 { | ... | @@ -529,6 +540,7 @@ fn switchWithUnreachable(x: i32) i32 { |
| 529 | } | 540 | } |
| 530 | 541 | ||
| 531 | test "capture value of switch with all unreachable prongs" { | 542 | test "capture value of switch with all unreachable prongs" { |
| 543 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 532 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 544 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 533 | 545 | ||
| 534 | const x = return_a_number() catch |err| switch (err) { | 546 | const x = return_a_number() catch |err| switch (err) { |
| ... | @@ -562,7 +574,7 @@ test "switch on integer with else capturing expr" { | ... | @@ -562,7 +574,7 @@ test "switch on integer with else capturing expr" { |
| 562 | test "else prong of switch on error set excludes other cases" { | 574 | test "else prong of switch on error set excludes other cases" { |
| 563 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 575 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 564 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 576 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 565 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 577 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 566 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 578 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 567 | 579 | ||
| 568 | const S = struct { | 580 | const S = struct { |
| ... | @@ -597,7 +609,7 @@ test "else prong of switch on error set excludes other cases" { | ... | @@ -597,7 +609,7 @@ test "else prong of switch on error set excludes other cases" { |
| 597 | test "switch prongs with error set cases make a new error set type for capture value" { | 609 | test "switch prongs with error set cases make a new error set type for capture value" { |
| 598 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 610 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 599 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 611 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 600 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 612 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 601 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 613 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 602 | 614 | ||
| 603 | const S = struct { | 615 | const S = struct { |
| ... | @@ -632,6 +644,7 @@ test "switch prongs with error set cases make a new error set type for capture v | ... | @@ -632,6 +644,7 @@ test "switch prongs with error set cases make a new error set type for capture v |
| 632 | } | 644 | } |
| 633 | 645 | ||
| 634 | test "return result loc and then switch with range implicit casted to error union" { | 646 | test "return result loc and then switch with range implicit casted to error union" { |
| 647 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 635 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 648 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 636 | 649 | ||
| 637 | const S = struct { | 650 | const S = struct { |
| ... | @@ -650,6 +663,7 @@ test "return result loc and then switch with range implicit casted to error unio | ... | @@ -650,6 +663,7 @@ test "return result loc and then switch with range implicit casted to error unio |
| 650 | } | 663 | } |
| 651 | 664 | ||
| 652 | test "switch with null and T peer types and inferred result location type" { | 665 | test "switch with null and T peer types and inferred result location type" { |
| 666 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 653 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 667 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 654 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 668 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 655 | 669 | ||
| ... | @@ -669,6 +683,7 @@ test "switch with null and T peer types and inferred result location type" { | ... | @@ -669,6 +683,7 @@ test "switch with null and T peer types and inferred result location type" { |
| 669 | } | 683 | } |
| 670 | 684 | ||
| 671 | test "switch prongs with cases with identical payload types" { | 685 | test "switch prongs with cases with identical payload types" { |
| 686 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 672 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 687 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 673 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 688 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 674 | 689 | ||
| ... | @@ -777,7 +792,7 @@ test "switch prong pointer capture alignment" { | ... | @@ -777,7 +792,7 @@ test "switch prong pointer capture alignment" { |
| 777 | test "switch on pointer type" { | 792 | test "switch on pointer type" { |
| 778 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 793 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 779 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 794 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 780 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 795 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 781 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/176634 | 796 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/176634 |
| 782 | 797 | ||
| 783 | const S = struct { | 798 | const S = struct { |
| ... | @@ -824,6 +839,7 @@ test "switch on error set with single else" { | ... | @@ -824,6 +839,7 @@ test "switch on error set with single else" { |
| 824 | } | 839 | } |
| 825 | 840 | ||
| 826 | test "switch capture copies its payload" { | 841 | test "switch capture copies its payload" { |
| 842 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 827 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 843 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 828 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 844 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 829 | 845 | ||
| ... | @@ -915,6 +931,8 @@ test "comptime inline switch" { | ... | @@ -915,6 +931,8 @@ test "comptime inline switch" { |
| 915 | } | 931 | } |
| 916 | 932 | ||
| 917 | test "switch capture peer type resolution" { | 933 | test "switch capture peer type resolution" { |
| 934 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 935 | |||
| 918 | const U = union(enum) { | 936 | const U = union(enum) { |
| 919 | a: u32, | 937 | a: u32, |
| 920 | b: u64, | 938 | b: u64, |
| ... | @@ -930,6 +948,7 @@ test "switch capture peer type resolution" { | ... | @@ -930,6 +948,7 @@ test "switch capture peer type resolution" { |
| 930 | } | 948 | } |
| 931 | 949 | ||
| 932 | test "switch capture peer type resolution for in-memory coercible payloads" { | 950 | test "switch capture peer type resolution for in-memory coercible payloads" { |
| 951 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 933 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 952 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 934 | 953 | ||
| 935 | const T1 = c_int; | 954 | const T1 = c_int; |
| ... | @@ -954,7 +973,7 @@ test "switch capture peer type resolution for in-memory coercible payloads" { | ... | @@ -954,7 +973,7 @@ test "switch capture peer type resolution for in-memory coercible payloads" { |
| 954 | 973 | ||
| 955 | test "switch pointer capture peer type resolution" { | 974 | test "switch pointer capture peer type resolution" { |
| 956 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 975 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 957 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 976 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 958 | 977 | ||
| 959 | const T1 = c_int; | 978 | const T1 = c_int; |
| 960 | const t1_info = @typeInfo(T1).int; | 979 | const t1_info = @typeInfo(T1).int; |
| ... | @@ -983,6 +1002,8 @@ test "switch pointer capture peer type resolution" { | ... | @@ -983,6 +1002,8 @@ test "switch pointer capture peer type resolution" { |
| 983 | } | 1002 | } |
| 984 | 1003 | ||
| 985 | test "inline switch range that includes the maximum value of the switched type" { | 1004 | test "inline switch range that includes the maximum value of the switched type" { |
| 1005 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1006 | |||
| 986 | const inputs: [3]u8 = .{ 0, 254, 255 }; | 1007 | const inputs: [3]u8 = .{ 0, 254, 255 }; |
| 987 | for (inputs) |input| { | 1008 | for (inputs) |input| { |
| 988 | switch (input) { | 1009 | switch (input) { |
| ... | @@ -995,7 +1016,7 @@ test "inline switch range that includes the maximum value of the switched type" | ... | @@ -995,7 +1016,7 @@ test "inline switch range that includes the maximum value of the switched type" |
| 995 | test "nested break ignores switch conditions and breaks instead" { | 1016 | test "nested break ignores switch conditions and breaks instead" { |
| 996 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1017 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 997 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1018 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 998 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1019 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 999 | 1020 | ||
| 1000 | const S = struct { | 1021 | const S = struct { |
| 1001 | fn register_to_address(ident: []const u8) !u8 { | 1022 | fn register_to_address(ident: []const u8) !u8 { |
| ... | @@ -1016,7 +1037,7 @@ test "nested break ignores switch conditions and breaks instead" { | ... | @@ -1016,7 +1037,7 @@ test "nested break ignores switch conditions and breaks instead" { |
| 1016 | } | 1037 | } |
| 1017 | 1038 | ||
| 1018 | test "peer type resolution on switch captures ignores unused payload bits" { | 1039 | test "peer type resolution on switch captures ignores unused payload bits" { |
| 1019 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1040 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1020 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1041 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1021 | 1042 | ||
| 1022 | const Foo = union(enum) { | 1043 | const Foo = union(enum) { |
| ... | @@ -1042,7 +1063,7 @@ test "peer type resolution on switch captures ignores unused payload bits" { | ... | @@ -1042,7 +1063,7 @@ test "peer type resolution on switch captures ignores unused payload bits" { |
| 1042 | 1063 | ||
| 1043 | test "switch prong captures range" { | 1064 | test "switch prong captures range" { |
| 1044 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1065 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1045 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 1066 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 1046 | 1067 | ||
| 1047 | const S = struct { | 1068 | const S = struct { |
| 1048 | fn a(b: []u3, c: u3) void { | 1069 | fn a(b: []u3, c: u3) void { |
| ... | @@ -1060,6 +1081,8 @@ test "switch prong captures range" { | ... | @@ -1060,6 +1081,8 @@ test "switch prong captures range" { |
| 1060 | } | 1081 | } |
| 1061 | 1082 | ||
| 1062 | test "prong with inline call to unreachable" { | 1083 | test "prong with inline call to unreachable" { |
| 1084 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1085 | |||
| 1063 | const U = union(enum) { | 1086 | const U = union(enum) { |
| 1064 | void: void, | 1087 | void: void, |
| 1065 | bool: bool, | 1088 | bool: bool, |
| ... | @@ -1077,6 +1100,8 @@ test "prong with inline call to unreachable" { | ... | @@ -1077,6 +1100,8 @@ test "prong with inline call to unreachable" { |
| 1077 | } | 1100 | } |
| 1078 | 1101 | ||
| 1079 | test "block error return trace index is reset between prongs" { | 1102 | test "block error return trace index is reset between prongs" { |
| 1103 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1104 | |||
| 1080 | const S = struct { | 1105 | const S = struct { |
| 1081 | fn returnError() error{TestFailed} { | 1106 | fn returnError() error{TestFailed} { |
| 1082 | return error.TestFailed; | 1107 | return error.TestFailed; |
| ... | @@ -1105,6 +1130,8 @@ test "block error return trace index is reset between prongs" { | ... | @@ -1105,6 +1130,8 @@ test "block error return trace index is reset between prongs" { |
| 1105 | } | 1130 | } |
| 1106 | 1131 | ||
| 1107 | test "labeled switch with break" { | 1132 | test "labeled switch with break" { |
| 1133 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1134 | |||
| 1108 | var six: u32 = undefined; | 1135 | var six: u32 = undefined; |
| 1109 | six = 6; | 1136 | six = 6; |
| 1110 | 1137 | ||
| ... | @@ -1144,6 +1171,8 @@ test "unlabeled break ignores switch" { | ... | @@ -1144,6 +1171,8 @@ test "unlabeled break ignores switch" { |
| 1144 | } | 1171 | } |
| 1145 | 1172 | ||
| 1146 | test "switch on a signed value smaller than the smallest prong value" { | 1173 | test "switch on a signed value smaller than the smallest prong value" { |
| 1174 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1175 | |||
| 1147 | var v: i32 = undefined; | 1176 | var v: i32 = undefined; |
| 1148 | v = -1; | 1177 | v = -1; |
| 1149 | switch (v) { | 1178 | switch (v) { |
| ... | @@ -1153,6 +1182,8 @@ test "switch on a signed value smaller than the smallest prong value" { | ... | @@ -1153,6 +1182,8 @@ test "switch on a signed value smaller than the smallest prong value" { |
| 1153 | } | 1182 | } |
| 1154 | 1183 | ||
| 1155 | test "switch on 8-bit mod result" { | 1184 | test "switch on 8-bit mod result" { |
| 1185 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1186 | |||
| 1156 | var x: u8 = undefined; | 1187 | var x: u8 = undefined; |
| 1157 | x = 16; | 1188 | x = 16; |
| 1158 | switch (x % 4) { | 1189 | switch (x % 4) { |
| ... | @@ -1261,6 +1292,8 @@ test "switch with uninstantiable union fields" { | ... | @@ -1261,6 +1292,8 @@ test "switch with uninstantiable union fields" { |
| 1261 | } | 1292 | } |
| 1262 | 1293 | ||
| 1263 | test "switch with tag capture" { | 1294 | test "switch with tag capture" { |
| 1295 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1296 | |||
| 1264 | const U = union(enum) { | 1297 | const U = union(enum) { |
| 1265 | a, | 1298 | a, |
| 1266 | b: i32, | 1299 | b: i32, |
| ... | @@ -1312,6 +1345,8 @@ test "switch with tag capture" { | ... | @@ -1312,6 +1345,8 @@ test "switch with tag capture" { |
| 1312 | } | 1345 | } |
| 1313 | 1346 | ||
| 1314 | test "switch with complex item expressions" { | 1347 | test "switch with complex item expressions" { |
| 1348 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1349 | |||
| 1315 | const S = struct { | 1350 | const S = struct { |
| 1316 | fn doTheTest() !void { | 1351 | fn doTheTest() !void { |
| 1317 | try doTheSwitch(2000, 20); | 1352 | try doTheSwitch(2000, 20); |
| ... | @@ -1414,7 +1449,7 @@ test "single range switch prong capture" { | ... | @@ -1414,7 +1449,7 @@ test "single range switch prong capture" { |
| 1414 | } | 1449 | } |
| 1415 | 1450 | ||
| 1416 | test "switch on packed struct" { | 1451 | test "switch on packed struct" { |
| 1417 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1452 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1418 | 1453 | ||
| 1419 | const P = packed struct { | 1454 | const P = packed struct { |
| 1420 | a: u1, | 1455 | a: u1, |
| ... | @@ -1446,7 +1481,7 @@ test "switch on packed struct" { | ... | @@ -1446,7 +1481,7 @@ test "switch on packed struct" { |
| 1446 | } | 1481 | } |
| 1447 | 1482 | ||
| 1448 | test "switch on packed union" { | 1483 | test "switch on packed union" { |
| 1449 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1484 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1450 | 1485 | ||
| 1451 | const P = packed union(u2) { | 1486 | const P = packed union(u2) { |
| 1452 | a: u2, | 1487 | a: u2, |
| ... | @@ -1495,7 +1530,7 @@ test "switch on packed union" { | ... | @@ -1495,7 +1530,7 @@ test "switch on packed union" { |
| 1495 | } | 1530 | } |
| 1496 | 1531 | ||
| 1497 | test "switch on nested packed containers" { | 1532 | test "switch on nested packed containers" { |
| 1498 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1533 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1499 | 1534 | ||
| 1500 | const P = packed struct { | 1535 | const P = packed struct { |
| 1501 | iu: u17, | 1536 | iu: u17, |
| ... | @@ -1550,7 +1585,7 @@ test "switch on nested packed containers" { | ... | @@ -1550,7 +1585,7 @@ test "switch on nested packed containers" { |
| 1550 | } | 1585 | } |
| 1551 | 1586 | ||
| 1552 | test "switch on large types" { | 1587 | test "switch on large types" { |
| 1553 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1588 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1554 | 1589 | ||
| 1555 | const S = struct { | 1590 | const S = struct { |
| 1556 | fn doTheTest(a: u128, b: i500) !void { | 1591 | fn doTheTest(a: u128, b: i500) !void { |
| ... | @@ -1652,6 +1687,8 @@ test "repeated switch analysis overrides previous analysis results" { | ... | @@ -1652,6 +1687,8 @@ test "repeated switch analysis overrides previous analysis results" { |
| 1652 | } | 1687 | } |
| 1653 | 1688 | ||
| 1654 | test "union field pointer capture preserves alignment in inline prong" { | 1689 | test "union field pointer capture preserves alignment in inline prong" { |
| 1690 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1691 | |||
| 1655 | const U = union(enum) { | 1692 | const U = union(enum) { |
| 1656 | a: u32, | 1693 | a: u32, |
| 1657 | b: u32, | 1694 | b: u32, |
| ... | @@ -1671,6 +1708,8 @@ test "union field pointer capture preserves alignment in inline prong" { | ... | @@ -1671,6 +1708,8 @@ test "union field pointer capture preserves alignment in inline prong" { |
| 1671 | } | 1708 | } |
| 1672 | 1709 | ||
| 1673 | test "switch on expression" { | 1710 | test "switch on expression" { |
| 1711 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 1712 | |||
| 1674 | var a: []const []const u8 = &.{ "b", "b", "A", "A", "b" }; | 1713 | var a: []const []const u8 = &.{ "b", "b", "A", "A", "b" }; |
| 1675 | _ = &a; | 1714 | _ = &a; |
| 1676 | var c: isize = 0; | 1715 | var c: isize = 0; |
test/behavior/switch_loop.zig+19-7| ... | @@ -4,6 +4,7 @@ const assert = std.debug.assert; | ... | @@ -4,6 +4,7 @@ const assert = std.debug.assert; |
| 4 | const expect = std.testing.expect; | 4 | const expect = std.testing.expect; |
| 5 | 5 | ||
| 6 | test "simple switch loop" { | 6 | test "simple switch loop" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 7 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 8 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -27,6 +28,7 @@ test "simple switch loop" { | ... | @@ -27,6 +28,7 @@ test "simple switch loop" { |
| 27 | } | 28 | } |
| 28 | 29 | ||
| 29 | test "switch loop with ranges" { | 30 | test "switch loop with ranges" { |
| 31 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 30 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 32 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 31 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 33 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 32 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 34 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -47,6 +49,7 @@ test "switch loop with ranges" { | ... | @@ -47,6 +49,7 @@ test "switch loop with ranges" { |
| 47 | } | 49 | } |
| 48 | 50 | ||
| 49 | test "switch loop on enum" { | 51 | test "switch loop on enum" { |
| 52 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 50 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 53 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 51 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 54 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 52 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 55 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -70,6 +73,7 @@ test "switch loop on enum" { | ... | @@ -70,6 +73,7 @@ test "switch loop on enum" { |
| 70 | } | 73 | } |
| 71 | 74 | ||
| 72 | test "switch loop with error set" { | 75 | test "switch loop with error set" { |
| 76 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 73 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 77 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 74 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 78 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 75 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 79 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -93,6 +97,7 @@ test "switch loop with error set" { | ... | @@ -93,6 +97,7 @@ test "switch loop with error set" { |
| 93 | } | 97 | } |
| 94 | 98 | ||
| 95 | test "switch loop on tagged union" { | 99 | test "switch loop on tagged union" { |
| 100 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 96 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 101 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 97 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 102 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 98 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 103 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -128,7 +133,7 @@ test "switch loop dispatching instructions" { | ... | @@ -128,7 +133,7 @@ test "switch loop dispatching instructions" { |
| 128 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 133 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 129 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 134 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 130 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 135 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 131 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 136 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 132 | 137 | ||
| 133 | const S = struct { | 138 | const S = struct { |
| 134 | const Inst = union(enum) { | 139 | const Inst = union(enum) { |
| ... | @@ -175,6 +180,7 @@ test "switch loop dispatching instructions" { | ... | @@ -175,6 +180,7 @@ test "switch loop dispatching instructions" { |
| 175 | } | 180 | } |
| 176 | 181 | ||
| 177 | test "switch loop with pointer capture" { | 182 | test "switch loop with pointer capture" { |
| 183 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 178 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 184 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 179 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 185 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 180 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 186 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -222,7 +228,7 @@ test "unanalyzed continue with operand" { | ... | @@ -222,7 +228,7 @@ test "unanalyzed continue with operand" { |
| 222 | 228 | ||
| 223 | test "switch loop on larger than pointer integer" { | 229 | test "switch loop on larger than pointer integer" { |
| 224 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 230 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 225 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 231 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 226 | 232 | ||
| 227 | var entry: @Int(.unsigned, @bitSizeOf(usize) + 1) = undefined; | 233 | var entry: @Int(.unsigned, @bitSizeOf(usize) + 1) = undefined; |
| 228 | entry = 0; | 234 | entry = 0; |
| ... | @@ -242,6 +248,7 @@ test "switch loop on larger than pointer integer" { | ... | @@ -242,6 +248,7 @@ test "switch loop on larger than pointer integer" { |
| 242 | } | 248 | } |
| 243 | 249 | ||
| 244 | test "switch loop on non-exhaustive enum" { | 250 | test "switch loop on non-exhaustive enum" { |
| 251 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 245 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 252 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 246 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 253 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 247 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 254 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -290,6 +297,8 @@ test "switch loop with discarded tag capture" { | ... | @@ -290,6 +297,8 @@ test "switch loop with discarded tag capture" { |
| 290 | } | 297 | } |
| 291 | 298 | ||
| 292 | test "switch loop with single catch-all prong" { | 299 | test "switch loop with single catch-all prong" { |
| 300 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 301 | |||
| 293 | const S = struct { | 302 | const S = struct { |
| 294 | const E = enum { a, b, c }; | 303 | const E = enum { a, b, c }; |
| 295 | const U = union(E) { a: u32, b: u16, c: u8 }; | 304 | const U = union(E) { a: u32, b: u16, c: u8 }; |
| ... | @@ -337,7 +346,7 @@ test "switch loop with single catch-all prong" { | ... | @@ -337,7 +346,7 @@ test "switch loop with single catch-all prong" { |
| 337 | } | 346 | } |
| 338 | 347 | ||
| 339 | test "switch loop on type with opv" { | 348 | test "switch loop on type with opv" { |
| 340 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 349 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 341 | 350 | ||
| 342 | const S = struct { | 351 | const S = struct { |
| 343 | const E = enum { opv }; | 352 | const E = enum { opv }; |
| ... | @@ -385,7 +394,7 @@ test "switch loop on type with opv" { | ... | @@ -385,7 +394,7 @@ test "switch loop on type with opv" { |
| 385 | } | 394 | } |
| 386 | 395 | ||
| 387 | test "switch loop with tag capture" { | 396 | test "switch loop with tag capture" { |
| 388 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 397 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 389 | 398 | ||
| 390 | const U = union(enum) { | 399 | const U = union(enum) { |
| 391 | a, | 400 | a, |
| ... | @@ -456,6 +465,8 @@ test "switch loop with tag capture" { | ... | @@ -456,6 +465,8 @@ test "switch loop with tag capture" { |
| 456 | } | 465 | } |
| 457 | 466 | ||
| 458 | test "switch loop for error handling" { | 467 | test "switch loop for error handling" { |
| 468 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 469 | |||
| 459 | const Error = error{ MyError, MyOtherError }; | 470 | const Error = error{ MyError, MyOtherError }; |
| 460 | const S = struct { | 471 | const S = struct { |
| 461 | fn doTheTest() !void { | 472 | fn doTheTest() !void { |
| ... | @@ -500,7 +511,8 @@ test "switch loop for error handling" { | ... | @@ -500,7 +511,8 @@ test "switch loop for error handling" { |
| 500 | } | 511 | } |
| 501 | 512 | ||
| 502 | test "switch loop with packed structs" { | 513 | test "switch loop with packed structs" { |
| 503 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 514 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 515 | |||
| 504 | const P = packed struct { | 516 | const P = packed struct { |
| 505 | a: u7, | 517 | a: u7, |
| 506 | b: u20, | 518 | b: u20, |
| ... | @@ -518,7 +530,7 @@ test "switch loop with packed structs" { | ... | @@ -518,7 +530,7 @@ test "switch loop with packed structs" { |
| 518 | } | 530 | } |
| 519 | 531 | ||
| 520 | test "switch loop with packed unions" { | 532 | test "switch loop with packed unions" { |
| 521 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 533 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 522 | 534 | ||
| 523 | const P = packed union { | 535 | const P = packed union { |
| 524 | a: u7, | 536 | a: u7, |
| ... | @@ -558,7 +570,7 @@ test "switch loop with packed unions with OPV" { | ... | @@ -558,7 +570,7 @@ test "switch loop with packed unions with OPV" { |
| 558 | } | 570 | } |
| 559 | 571 | ||
| 560 | test "switch loop on large types" { | 572 | test "switch loop on large types" { |
| 561 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 573 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 562 | 574 | ||
| 563 | const S = struct { | 575 | const S = struct { |
| 564 | fn doTheTest(a: u128, b: i500) !void { | 576 | fn doTheTest(a: u128, b: i500) !void { |
test/behavior/switch_on_captured_error.zig+2-2| ... | @@ -6,7 +6,7 @@ const expectEqual = std.testing.expectEqual; | ... | @@ -6,7 +6,7 @@ const expectEqual = std.testing.expectEqual; |
| 6 | const builtin = @import("builtin"); | 6 | const builtin = @import("builtin"); |
| 7 | 7 | ||
| 8 | test "switch on error union catch capture" { | 8 | test "switch on error union catch capture" { |
| 9 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 9 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 10 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 10 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 11 | 11 | ||
| 12 | const S = struct { | 12 | const S = struct { |
| ... | @@ -370,7 +370,7 @@ test "switch on error union catch capture" { | ... | @@ -370,7 +370,7 @@ test "switch on error union catch capture" { |
| 370 | } | 370 | } |
| 371 | 371 | ||
| 372 | test "switch on error union if else capture" { | 372 | test "switch on error union if else capture" { |
| 373 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 373 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 374 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 374 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 375 | 375 | ||
| 376 | const S = struct { | 376 | const S = struct { |
test/behavior/switch_prong_err_enum.zig+1-1| ... | @@ -24,7 +24,7 @@ test "switch prong returns error enum" { | ... | @@ -24,7 +24,7 @@ test "switch prong returns error enum" { |
| 24 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 24 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 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; | 26 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 27 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 27 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 28 | 28 | ||
| 29 | switch (doThing(17) catch unreachable) { | 29 | switch (doThing(17) catch unreachable) { |
| 30 | FormValue.Address => |payload| { | 30 | FormValue.Address => |payload| { |
test/behavior/switch_prong_implicit_cast.zig+1| ... | @@ -15,6 +15,7 @@ fn foo(id: u64) !FormValue { | ... | @@ -15,6 +15,7 @@ fn foo(id: u64) !FormValue { |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | test "switch prong implicit cast" { | 17 | test "switch prong implicit cast" { |
| 18 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 18 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 19 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 19 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 20 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 21 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
test/behavior/this.zig+2-1| ... | @@ -26,6 +26,7 @@ test "this refer to module call private fn" { | ... | @@ -26,6 +26,7 @@ test "this refer to module call private fn" { |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | test "this refer to container" { | 28 | test "this refer to container" { |
| 29 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 29 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 30 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 30 | 31 | ||
| 31 | var pt: Point(i32) = undefined; | 32 | var pt: Point(i32) = undefined; |
| ... | @@ -48,7 +49,7 @@ fn prev(p: ?State) void { | ... | @@ -48,7 +49,7 @@ fn prev(p: ?State) void { |
| 48 | test "this used as optional function parameter" { | 49 | test "this used as optional function parameter" { |
| 49 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 50 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 50 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 51 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 51 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 52 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 52 | 53 | ||
| 53 | var global: State = undefined; | 54 | var global: State = undefined; |
| 54 | global.enter = prev; | 55 | global.enter = prev; |
test/behavior/threadlocal.zig+2-2| ... | @@ -19,7 +19,7 @@ test "pointer to thread local array" { | ... | @@ -19,7 +19,7 @@ test "pointer to thread local array" { |
| 19 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | 19 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 21 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 21 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 22 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 22 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 23 | 23 | ||
| 24 | const s = "Hello world"; | 24 | const s = "Hello world"; |
| 25 | @memcpy(buffer[0..s.len], s); | 25 | @memcpy(buffer[0..s.len], s); |
| ... | @@ -32,7 +32,7 @@ test "reference a global threadlocal variable" { | ... | @@ -32,7 +32,7 @@ test "reference a global threadlocal variable" { |
| 32 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | 32 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 33 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 33 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 34 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 34 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 35 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 35 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 36 | 36 | ||
| 37 | try nrfx_uart_rx(&g_uart0); | 37 | try nrfx_uart_rx(&g_uart0); |
| 38 | } | 38 | } |
test/behavior/truncate.zig+4-2| ... | @@ -32,6 +32,8 @@ test "truncate.u0.var" { | ... | @@ -32,6 +32,8 @@ test "truncate.u0.var" { |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | test "truncate on comptime integer" { | 34 | test "truncate on comptime integer" { |
| 35 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 36 | |||
| 35 | const x: u16 = @truncate(9999); | 37 | const x: u16 = @truncate(9999); |
| 36 | try expect(x == 9999); | 38 | try expect(x == 9999); |
| 37 | const y: u16 = @truncate(-21555); | 39 | const y: u16 = @truncate(-21555); |
| ... | @@ -49,7 +51,7 @@ fn testTruncate(comptime S: type, a: S, comptime D: type, expected: D) !void { | ... | @@ -49,7 +51,7 @@ fn testTruncate(comptime S: type, a: S, comptime D: type, expected: D) !void { |
| 49 | 51 | ||
| 50 | test "@truncate > 128 bits" { | 52 | test "@truncate > 128 bits" { |
| 51 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 53 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 52 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 54 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 53 | 55 | ||
| 54 | try testTruncate(u140, 0, u128, 0); | 56 | try testTruncate(u140, 0, u128, 0); |
| 55 | try testTruncate(u140, maxInt(u140), u128, maxInt(u128)); | 57 | try testTruncate(u140, maxInt(u140), u128, maxInt(u128)); |
| ... | @@ -90,7 +92,7 @@ test "truncate on vectors" { | ... | @@ -90,7 +92,7 @@ test "truncate on vectors" { |
| 90 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 92 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 91 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 93 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 92 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 94 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 93 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 95 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 94 | 96 | ||
| 95 | const S = struct { | 97 | const S = struct { |
| 96 | fn doTheTest() !void { | 98 | fn doTheTest() !void { |
test/behavior/try.zig+9-3| ... | @@ -4,6 +4,7 @@ const assert = std.debug.assert; | ... | @@ -4,6 +4,7 @@ const assert = std.debug.assert; |
| 4 | const expect = std.testing.expect; | 4 | const expect = std.testing.expect; |
| 5 | 5 | ||
| 6 | test "try on error union" { | 6 | test "try on error union" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 7 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 8 | 9 | ||
| 9 | try tryOnErrorUnionImpl(); | 10 | try tryOnErrorUnionImpl(); |
| ... | @@ -49,7 +50,7 @@ test "try then not executed with assignment" { | ... | @@ -49,7 +50,7 @@ test "try then not executed with assignment" { |
| 49 | 50 | ||
| 50 | test "`try`ing an if/else expression" { | 51 | test "`try`ing an if/else expression" { |
| 51 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 52 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 52 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 53 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 53 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 54 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 54 | 55 | ||
| 55 | const S = struct { | 56 | const S = struct { |
| ... | @@ -68,6 +69,7 @@ test "`try`ing an if/else expression" { | ... | @@ -68,6 +69,7 @@ test "`try`ing an if/else expression" { |
| 68 | } | 69 | } |
| 69 | 70 | ||
| 70 | test "'return try' of empty error set in function returning non-error" { | 71 | test "'return try' of empty error set in function returning non-error" { |
| 72 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 71 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 73 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 72 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 74 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 73 | 75 | ||
| ... | @@ -102,6 +104,8 @@ test "'return try' of empty error set in function returning non-error" { | ... | @@ -102,6 +104,8 @@ test "'return try' of empty error set in function returning non-error" { |
| 102 | } | 104 | } |
| 103 | 105 | ||
| 104 | test "'return try' through conditional" { | 106 | test "'return try' through conditional" { |
| 107 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 108 | |||
| 105 | const S = struct { | 109 | const S = struct { |
| 106 | fn get(t: bool) !u32 { | 110 | fn get(t: bool) !u32 { |
| 107 | return try if (t) inner() else error.TestFailed; | 111 | return try if (t) inner() else error.TestFailed; |
| ... | @@ -124,7 +128,7 @@ test "'return try' through conditional" { | ... | @@ -124,7 +128,7 @@ test "'return try' through conditional" { |
| 124 | 128 | ||
| 125 | test "try ptr propagation const" { | 129 | test "try ptr propagation const" { |
| 126 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 130 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 127 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 131 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 128 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 132 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 129 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 133 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 130 | 134 | ||
| ... | @@ -156,7 +160,7 @@ test "try ptr propagation const" { | ... | @@ -156,7 +160,7 @@ test "try ptr propagation const" { |
| 156 | 160 | ||
| 157 | test "try ptr propagation mutate" { | 161 | test "try ptr propagation mutate" { |
| 158 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 162 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 159 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 163 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 160 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; | 164 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 161 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 165 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 162 | 166 | ||
| ... | @@ -200,6 +204,8 @@ test "try ptr propagation mutate" { | ... | @@ -200,6 +204,8 @@ test "try ptr propagation mutate" { |
| 200 | } | 204 | } |
| 201 | 205 | ||
| 202 | test "try pointer expression alignment" { | 206 | test "try pointer expression alignment" { |
| 207 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 208 | |||
| 203 | const S = struct { | 209 | const S = struct { |
| 204 | fn doTheTest(p: *align(1) (anyerror!u32)) !void { | 210 | fn doTheTest(p: *align(1) (anyerror!u32)) !void { |
| 205 | comptime assert(@TypeOf(&(try p.*)) == *align(1) u32); | 211 | comptime assert(@TypeOf(&(try p.*)) == *align(1) u32); |
test/behavior/tuple.zig+21-11| ... | @@ -7,6 +7,7 @@ const expectEqualStrings = std.testing.expectEqualStrings; | ... | @@ -7,6 +7,7 @@ const expectEqualStrings = std.testing.expectEqualStrings; |
| 7 | const expectEqual = std.testing.expectEqual; | 7 | const expectEqual = std.testing.expectEqual; |
| 8 | 8 | ||
| 9 | test "tuple concatenation" { | 9 | test "tuple concatenation" { |
| 10 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 10 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 11 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 11 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 12 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 12 | 13 | ||
| ... | @@ -29,7 +30,7 @@ test "tuple concatenation" { | ... | @@ -29,7 +30,7 @@ test "tuple concatenation" { |
| 29 | test "more tuple concatenation" { | 30 | test "more tuple concatenation" { |
| 30 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 31 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 31 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 32 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 32 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 33 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 33 | 34 | ||
| 34 | const T = struct { | 35 | const T = struct { |
| 35 | fn consume_tuple(tuple: anytype, len: usize) !void { | 36 | fn consume_tuple(tuple: anytype, len: usize) !void { |
| ... | @@ -104,7 +105,9 @@ test "tuple initializer for var" { | ... | @@ -104,7 +105,9 @@ test "tuple initializer for var" { |
| 104 | } | 105 | } |
| 105 | 106 | ||
| 106 | test "array-like initializer for tuple types" { | 107 | test "array-like initializer for tuple types" { |
| 108 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 107 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 109 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 110 | |||
| 108 | const T = @Tuple(&.{ i32, u8 }); | 111 | const T = @Tuple(&.{ i32, u8 }); |
| 109 | const S = struct { | 112 | const S = struct { |
| 110 | fn doTheTest() !void { | 113 | fn doTheTest() !void { |
| ... | @@ -169,7 +172,8 @@ test "fieldParentPtr of tuple" { | ... | @@ -169,7 +172,8 @@ test "fieldParentPtr of tuple" { |
| 169 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 172 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 170 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 173 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 171 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 174 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 172 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 175 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 176 | |||
| 173 | var x: u32 = 0; | 177 | var x: u32 = 0; |
| 174 | _ = &x; | 178 | _ = &x; |
| 175 | const tuple = .{ x, x }; | 179 | const tuple = .{ x, x }; |
| ... | @@ -180,7 +184,7 @@ test "fieldParentPtr of anon struct" { | ... | @@ -180,7 +184,7 @@ test "fieldParentPtr of anon struct" { |
| 180 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 184 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 181 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 185 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 182 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 186 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 183 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 187 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 184 | 188 | ||
| 185 | var x: u32 = 0; | 189 | var x: u32 = 0; |
| 186 | _ = &x; | 190 | _ = &x; |
| ... | @@ -238,6 +242,7 @@ test "tuple in tuple passed to generic function" { | ... | @@ -238,6 +242,7 @@ test "tuple in tuple passed to generic function" { |
| 238 | } | 242 | } |
| 239 | 243 | ||
| 240 | test "coerce tuple to tuple" { | 244 | test "coerce tuple to tuple" { |
| 245 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 241 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 246 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 242 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 247 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 243 | 248 | ||
| ... | @@ -285,6 +290,7 @@ test "tuple type with void field and a runtime field" { | ... | @@ -285,6 +290,7 @@ test "tuple type with void field and a runtime field" { |
| 285 | } | 290 | } |
| 286 | 291 | ||
| 287 | test "branching inside tuple literal" { | 292 | test "branching inside tuple literal" { |
| 293 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 288 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 294 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 289 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 295 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 290 | 296 | ||
| ... | @@ -303,7 +309,7 @@ test "tuple initialized with a runtime known value" { | ... | @@ -303,7 +309,7 @@ test "tuple initialized with a runtime known value" { |
| 303 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 309 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 304 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 310 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 305 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 311 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 306 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 312 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 307 | 313 | ||
| 308 | const E = union(enum) { e: []const u8 }; | 314 | const E = union(enum) { e: []const u8 }; |
| 309 | const W = union(enum) { w: E }; | 315 | const W = union(enum) { w: E }; |
| ... | @@ -317,7 +323,7 @@ test "tuple of struct concatenation and coercion to array" { | ... | @@ -317,7 +323,7 @@ test "tuple of struct concatenation and coercion to array" { |
| 317 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 323 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 318 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 324 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 319 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 325 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 320 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 326 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 321 | 327 | ||
| 322 | const StructWithDefault = struct { value: f32 = 42 }; | 328 | const StructWithDefault = struct { value: f32 = 42 }; |
| 323 | const SomeStruct = struct { array: [4]StructWithDefault }; | 329 | const SomeStruct = struct { array: [4]StructWithDefault }; |
| ... | @@ -331,7 +337,7 @@ test "tuple of struct concatenation and coercion to array" { | ... | @@ -331,7 +337,7 @@ test "tuple of struct concatenation and coercion to array" { |
| 331 | test "nested runtime conditionals in tuple initializer" { | 337 | test "nested runtime conditionals in tuple initializer" { |
| 332 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 338 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 333 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 339 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 334 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 340 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 335 | 341 | ||
| 336 | var data: u8 = 0; | 342 | var data: u8 = 0; |
| 337 | _ = &data; | 343 | _ = &data; |
| ... | @@ -364,6 +370,7 @@ test "sentinel slice in tuple" { | ... | @@ -364,6 +370,7 @@ test "sentinel slice in tuple" { |
| 364 | } | 370 | } |
| 365 | 371 | ||
| 366 | test "tuple pointer is indexable" { | 372 | test "tuple pointer is indexable" { |
| 373 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 367 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 374 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 368 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 375 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 369 | 376 | ||
| ... | @@ -386,6 +393,7 @@ test "tuple pointer is indexable" { | ... | @@ -386,6 +393,7 @@ test "tuple pointer is indexable" { |
| 386 | } | 393 | } |
| 387 | 394 | ||
| 388 | test "coerce anon tuple to tuple" { | 395 | test "coerce anon tuple to tuple" { |
| 396 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 389 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 397 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 390 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 398 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 391 | 399 | ||
| ... | @@ -423,7 +431,7 @@ test "tuple with runtime value coerced into a slice with a sentinel" { | ... | @@ -423,7 +431,7 @@ test "tuple with runtime value coerced into a slice with a sentinel" { |
| 423 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 431 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 424 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 432 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 425 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 433 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 426 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 434 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 427 | 435 | ||
| 428 | const S = struct { | 436 | const S = struct { |
| 429 | fn f(a: [:null]const ?u8) !void { | 437 | fn f(a: [:null]const ?u8) !void { |
| ... | @@ -442,6 +450,8 @@ test "tuple with runtime value coerced into a slice with a sentinel" { | ... | @@ -442,6 +450,8 @@ test "tuple with runtime value coerced into a slice with a sentinel" { |
| 442 | } | 450 | } |
| 443 | 451 | ||
| 444 | test "tuple implicitly coerced to optional/error union struct/union" { | 452 | test "tuple implicitly coerced to optional/error union struct/union" { |
| 453 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 454 | |||
| 445 | const SomeUnion = union(enum) { | 455 | const SomeUnion = union(enum) { |
| 446 | variant: u8, | 456 | variant: u8, |
| 447 | }; | 457 | }; |
| ... | @@ -495,7 +505,7 @@ test "comptime fields in tuple can be initialized" { | ... | @@ -495,7 +505,7 @@ test "comptime fields in tuple can be initialized" { |
| 495 | test "empty struct in tuple" { | 505 | test "empty struct in tuple" { |
| 496 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 506 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 497 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 507 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 498 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 508 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 499 | 509 | ||
| 500 | const T = struct { struct {} }; | 510 | const T = struct { struct {} }; |
| 501 | const info = @typeInfo(T); | 511 | const info = @typeInfo(T); |
| ... | @@ -507,7 +517,7 @@ test "empty struct in tuple" { | ... | @@ -507,7 +517,7 @@ test "empty struct in tuple" { |
| 507 | test "empty union in tuple" { | 517 | test "empty union in tuple" { |
| 508 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 518 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 509 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 519 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 510 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 520 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 511 | 521 | ||
| 512 | const T = struct { union {} }; | 522 | const T = struct { union {} }; |
| 513 | const info = @typeInfo(T); | 523 | const info = @typeInfo(T); |
| ... | @@ -517,7 +527,7 @@ test "empty union in tuple" { | ... | @@ -517,7 +527,7 @@ test "empty union in tuple" { |
| 517 | } | 527 | } |
| 518 | 528 | ||
| 519 | test "field pointer of underaligned tuple" { | 529 | test "field pointer of underaligned tuple" { |
| 520 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 530 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 521 | 531 | ||
| 522 | const S = struct { | 532 | const S = struct { |
| 523 | fn doTheTest() !void { | 533 | fn doTheTest() !void { |
| ... | @@ -546,7 +556,7 @@ test "OPV tuple fields aren't comptime" { | ... | @@ -546,7 +556,7 @@ test "OPV tuple fields aren't comptime" { |
| 546 | } | 556 | } |
| 547 | 557 | ||
| 548 | test "array of tuples that end with a zero-bit field followed by padding" { | 558 | test "array of tuples that end with a zero-bit field followed by padding" { |
| 549 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 559 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 550 | 560 | ||
| 551 | const S = struct { | 561 | const S = struct { |
| 552 | var foo: [2]struct { u32, u8, void } = .{ .{ 1, 2, {} }, .{ 3, 4, {} } }; | 562 | var foo: [2]struct { u32, u8, void } = .{ .{ 1, 2, {} }, .{ 3, 4, {} } }; |
test/behavior/tuple_declarations.zig+2-2| ... | @@ -6,7 +6,7 @@ const expectEqualStrings = testing.expectEqualStrings; | ... | @@ -6,7 +6,7 @@ const expectEqualStrings = testing.expectEqualStrings; |
| 6 | 6 | ||
| 7 | test "tuple declaration type info" { | 7 | test "tuple declaration type info" { |
| 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 9 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 9 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 10 | 10 | ||
| 11 | { | 11 | { |
| 12 | const T = struct { comptime u32 = 1, []const u8 }; | 12 | const T = struct { comptime u32 = 1, []const u8 }; |
| ... | @@ -34,7 +34,7 @@ test "tuple declaration type info" { | ... | @@ -34,7 +34,7 @@ test "tuple declaration type info" { |
| 34 | 34 | ||
| 35 | test "tuple declaration usage" { | 35 | test "tuple declaration usage" { |
| 36 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 36 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 37 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 37 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 38 | 38 | ||
| 39 | const T = struct { u32, []const u8 }; | 39 | const T = struct { u32, []const u8 }; |
| 40 | var t: T = .{ 1, "foo" }; | 40 | var t: T = .{ 1, "foo" }; |
test/behavior/type.zig+17-5| ... | @@ -5,6 +5,8 @@ const testing = std.testing; | ... | @@ -5,6 +5,8 @@ const testing = std.testing; |
| 5 | const assert = std.debug.assert; | 5 | const assert = std.debug.assert; |
| 6 | 6 | ||
| 7 | test "Type.Int" { | 7 | test "Type.Int" { |
| 8 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 9 | |||
| 8 | try testing.expect(u1 == @Int(.unsigned, 1)); | 10 | try testing.expect(u1 == @Int(.unsigned, 1)); |
| 9 | try testing.expect(i1 == @Int(.signed, 1)); | 11 | try testing.expect(i1 == @Int(.signed, 1)); |
| 10 | try testing.expect(u8 == @Int(.unsigned, 8)); | 12 | try testing.expect(u8 == @Int(.unsigned, 8)); |
| ... | @@ -14,6 +16,8 @@ test "Type.Int" { | ... | @@ -14,6 +16,8 @@ test "Type.Int" { |
| 14 | } | 16 | } |
| 15 | 17 | ||
| 16 | test "Type.Pointer" { | 18 | test "Type.Pointer" { |
| 19 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 20 | |||
| 17 | inline for (&[_]type{ | 21 | inline for (&[_]type{ |
| 18 | // One Value Pointer Types | 22 | // One Value Pointer Types |
| 19 | *u8, *const u8, | 23 | *u8, *const u8, |
| ... | @@ -72,6 +76,8 @@ test "@Pointer create slice with null sentinel" { | ... | @@ -72,6 +76,8 @@ test "@Pointer create slice with null sentinel" { |
| 72 | } | 76 | } |
| 73 | 77 | ||
| 74 | test "@Pointer on @typeInfo round-trips sentinels" { | 78 | test "@Pointer on @typeInfo round-trips sentinels" { |
| 79 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 80 | |||
| 75 | inline for (&[_]type{ | 81 | inline for (&[_]type{ |
| 76 | [*:0]u8, [*:0]const u8, | 82 | [*:0]u8, [*:0]const u8, |
| 77 | [*:0]volatile u8, [*:0]const volatile u8, | 83 | [*:0]volatile u8, [*:0]const volatile u8, |
| ... | @@ -105,7 +111,7 @@ test "Type.Opaque" { | ... | @@ -105,7 +111,7 @@ test "Type.Opaque" { |
| 105 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 111 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 106 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 112 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 107 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 113 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 108 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 114 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 109 | 115 | ||
| 110 | const Opaque = opaque {}; | 116 | const Opaque = opaque {}; |
| 111 | try testing.expect(Opaque != opaque {}); | 117 | try testing.expect(Opaque != opaque {}); |
| ... | @@ -124,7 +130,7 @@ test "Type.Struct" { | ... | @@ -124,7 +130,7 @@ test "Type.Struct" { |
| 124 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 130 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 125 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 131 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 126 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 132 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 127 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 133 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 128 | 134 | ||
| 129 | const A = @Struct(.auto, null, &.{ "x", "y" }, &.{ u8, u32 }, &@splat(.{})); | 135 | const A = @Struct(.auto, null, &.{ "x", "y" }, &.{ u8, u32 }, &@splat(.{})); |
| 130 | const infoA = @typeInfo(A).@"struct"; | 136 | const infoA = @typeInfo(A).@"struct"; |
| ... | @@ -193,7 +199,7 @@ test "Type.Struct" { | ... | @@ -193,7 +199,7 @@ test "Type.Struct" { |
| 193 | 199 | ||
| 194 | test "Type.Enum" { | 200 | test "Type.Enum" { |
| 195 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 201 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 196 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 202 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 197 | 203 | ||
| 198 | const Foo = @Enum(u8, .exhaustive, &.{ "a", "b" }, &.{ 1, 5 }); | 204 | const Foo = @Enum(u8, .exhaustive, &.{ "a", "b" }, &.{ 1, 5 }); |
| 199 | try testing.expectEqual(std.builtin.Type.Enum.Mode.exhaustive, @typeInfo(Foo).@"enum".mode); | 205 | try testing.expectEqual(std.builtin.Type.Enum.Mode.exhaustive, @typeInfo(Foo).@"enum".mode); |
| ... | @@ -229,7 +235,7 @@ test "Type.Enum" { | ... | @@ -229,7 +235,7 @@ test "Type.Enum" { |
| 229 | 235 | ||
| 230 | test "Type.Union" { | 236 | test "Type.Union" { |
| 231 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 237 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 232 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 238 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 233 | 239 | ||
| 234 | const Untagged = @Union(.@"extern", null, &.{ "int", "float" }, &.{ i32, f32 }, &.{ .{}, .{} }); | 240 | const Untagged = @Union(.@"extern", null, &.{ "int", "float" }, &.{ i32, f32 }, &.{ .{}, .{} }); |
| 235 | var untagged = Untagged{ .int = 1 }; | 241 | var untagged = Untagged{ .int = 1 }; |
| ... | @@ -264,6 +270,8 @@ test "Type.Union from regular enum" { | ... | @@ -264,6 +270,8 @@ test "Type.Union from regular enum" { |
| 264 | } | 270 | } |
| 265 | 271 | ||
| 266 | test "Type.Union from empty regular enum" { | 272 | test "Type.Union from empty regular enum" { |
| 273 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 274 | |||
| 267 | const E = enum {}; | 275 | const E = enum {}; |
| 268 | const U = @Union(.auto, E, &.{}, &.{}, &.{}); | 276 | const U = @Union(.auto, E, &.{}, &.{}, &.{}); |
| 269 | 277 | ||
| ... | @@ -274,6 +282,8 @@ test "Type.Union from empty regular enum" { | ... | @@ -274,6 +282,8 @@ test "Type.Union from empty regular enum" { |
| 274 | } | 282 | } |
| 275 | 283 | ||
| 276 | test "Type.Union from empty Type.Enum" { | 284 | test "Type.Union from empty Type.Enum" { |
| 285 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 286 | |||
| 277 | const E = @Enum(noreturn, .exhaustive, &.{}, &.{}); | 287 | const E = @Enum(noreturn, .exhaustive, &.{}, &.{}); |
| 278 | const U = @Union(.auto, E, &.{}, &.{}, &.{}); | 288 | const U = @Union(.auto, E, &.{}, &.{}, &.{}); |
| 279 | 289 | ||
| ... | @@ -285,7 +295,7 @@ test "Type.Union from empty Type.Enum" { | ... | @@ -285,7 +295,7 @@ test "Type.Union from empty Type.Enum" { |
| 285 | 295 | ||
| 286 | test "Type.Fn" { | 296 | test "Type.Fn" { |
| 287 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 297 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 288 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 298 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 289 | 299 | ||
| 290 | const some_opaque = opaque {}; | 300 | const some_opaque = opaque {}; |
| 291 | const some_ptr = *some_opaque; | 301 | const some_ptr = *some_opaque; |
| ... | @@ -406,6 +416,8 @@ test "matching captures causes opaque equivalence" { | ... | @@ -406,6 +416,8 @@ test "matching captures causes opaque equivalence" { |
| 406 | } | 416 | } |
| 407 | 417 | ||
| 408 | test "reify enum where fields refers to part of array" { | 418 | test "reify enum where fields refers to part of array" { |
| 419 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 420 | |||
| 409 | const field_names: [3][]const u8 = .{ "foo", "bar", undefined }; | 421 | const field_names: [3][]const u8 = .{ "foo", "bar", undefined }; |
| 410 | const field_values: [3]u8 = .{ undefined, 0, 1 }; | 422 | const field_values: [3]u8 = .{ undefined, 0, 1 }; |
| 411 | const E = @Enum(u8, .exhaustive, field_names[0..2], field_values[1..3]); | 423 | const E = @Enum(u8, .exhaustive, field_names[0..2], field_values[1..3]); |
test/behavior/type_info.zig+35-10| ... | @@ -10,6 +10,8 @@ const expect = std.testing.expect; | ... | @@ -10,6 +10,8 @@ const expect = std.testing.expect; |
| 10 | const expectEqualStrings = std.testing.expectEqualStrings; | 10 | const expectEqualStrings = std.testing.expectEqualStrings; |
| 11 | 11 | ||
| 12 | test "type info: integer, floating point type info" { | 12 | test "type info: integer, floating point type info" { |
| 13 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 14 | |||
| 13 | try testIntFloat(); | 15 | try testIntFloat(); |
| 14 | try comptime testIntFloat(); | 16 | try comptime testIntFloat(); |
| 15 | } | 17 | } |
| ... | @@ -37,6 +39,8 @@ fn testOptional() !void { | ... | @@ -37,6 +39,8 @@ fn testOptional() !void { |
| 37 | } | 39 | } |
| 38 | 40 | ||
| 39 | test "type info: C pointer type info" { | 41 | test "type info: C pointer type info" { |
| 42 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 43 | |||
| 40 | try testCPtr(); | 44 | try testCPtr(); |
| 41 | try comptime testCPtr(); | 45 | try comptime testCPtr(); |
| 42 | } | 46 | } |
| ... | @@ -60,6 +64,8 @@ test "type info: value is correctly copied" { | ... | @@ -60,6 +64,8 @@ test "type info: value is correctly copied" { |
| 60 | } | 64 | } |
| 61 | 65 | ||
| 62 | test "type info: tag type, void info" { | 66 | test "type info: tag type, void info" { |
| 67 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 68 | |||
| 63 | try testBasic(); | 69 | try testBasic(); |
| 64 | try comptime testBasic(); | 70 | try comptime testBasic(); |
| 65 | } | 71 | } |
| ... | @@ -72,6 +78,8 @@ fn testBasic() !void { | ... | @@ -72,6 +78,8 @@ fn testBasic() !void { |
| 72 | } | 78 | } |
| 73 | 79 | ||
| 74 | test "type info: pointer type info" { | 80 | test "type info: pointer type info" { |
| 81 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 82 | |||
| 75 | try testPointer(); | 83 | try testPointer(); |
| 76 | try comptime testPointer(); | 84 | try comptime testPointer(); |
| 77 | } | 85 | } |
| ... | @@ -88,6 +96,8 @@ fn testPointer() !void { | ... | @@ -88,6 +96,8 @@ fn testPointer() !void { |
| 88 | } | 96 | } |
| 89 | 97 | ||
| 90 | test "type info: unknown length pointer type info" { | 98 | test "type info: unknown length pointer type info" { |
| 99 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 100 | |||
| 91 | try testUnknownLenPtr(); | 101 | try testUnknownLenPtr(); |
| 92 | try comptime testUnknownLenPtr(); | 102 | try comptime testUnknownLenPtr(); |
| 93 | } | 103 | } |
| ... | @@ -104,6 +114,8 @@ fn testUnknownLenPtr() !void { | ... | @@ -104,6 +114,8 @@ fn testUnknownLenPtr() !void { |
| 104 | } | 114 | } |
| 105 | 115 | ||
| 106 | test "type info: null terminated pointer type info" { | 116 | test "type info: null terminated pointer type info" { |
| 117 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 118 | |||
| 107 | try testNullTerminatedPtr(); | 119 | try testNullTerminatedPtr(); |
| 108 | try comptime testNullTerminatedPtr(); | 120 | try comptime testNullTerminatedPtr(); |
| 109 | } | 121 | } |
| ... | @@ -120,6 +132,8 @@ fn testNullTerminatedPtr() !void { | ... | @@ -120,6 +132,8 @@ fn testNullTerminatedPtr() !void { |
| 120 | } | 132 | } |
| 121 | 133 | ||
| 122 | test "type info: slice type info" { | 134 | test "type info: slice type info" { |
| 135 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 136 | |||
| 123 | try testSlice(); | 137 | try testSlice(); |
| 124 | try comptime testSlice(); | 138 | try comptime testSlice(); |
| 125 | } | 139 | } |
| ... | @@ -135,6 +149,8 @@ fn testSlice() !void { | ... | @@ -135,6 +149,8 @@ fn testSlice() !void { |
| 135 | } | 149 | } |
| 136 | 150 | ||
| 137 | test "type info: array type info" { | 151 | test "type info: array type info" { |
| 152 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 153 | |||
| 138 | try testArray(); | 154 | try testArray(); |
| 139 | try comptime testArray(); | 155 | try comptime testArray(); |
| 140 | } | 156 | } |
| ... | @@ -160,7 +176,7 @@ fn testArray() !void { | ... | @@ -160,7 +176,7 @@ fn testArray() !void { |
| 160 | test "type info: error set, error union info, anyerror" { | 176 | test "type info: error set, error union info, anyerror" { |
| 161 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 177 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 162 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 178 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 163 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 179 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 164 | 180 | ||
| 165 | try testErrorSet(); | 181 | try testErrorSet(); |
| 166 | try comptime testErrorSet(); | 182 | try comptime testErrorSet(); |
| ... | @@ -191,7 +207,7 @@ fn testErrorSet() !void { | ... | @@ -191,7 +207,7 @@ fn testErrorSet() !void { |
| 191 | test "type info: error set single value" { | 207 | test "type info: error set single value" { |
| 192 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 208 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 193 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 209 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 194 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 210 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 195 | 211 | ||
| 196 | const TestSet = error.One; | 212 | const TestSet = error.One; |
| 197 | 213 | ||
| ... | @@ -204,7 +220,7 @@ test "type info: error set single value" { | ... | @@ -204,7 +220,7 @@ test "type info: error set single value" { |
| 204 | test "type info: error set merged" { | 220 | test "type info: error set merged" { |
| 205 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 221 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 206 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 222 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 207 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 223 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 208 | 224 | ||
| 209 | const TestSet = error{ One, Two } || error{Three}; | 225 | const TestSet = error{ One, Two } || error{Three}; |
| 210 | 226 | ||
| ... | @@ -219,7 +235,7 @@ test "type info: error set merged" { | ... | @@ -219,7 +235,7 @@ test "type info: error set merged" { |
| 219 | test "type info: enum info" { | 235 | test "type info: enum info" { |
| 220 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 236 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 221 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 237 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 222 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 238 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 223 | 239 | ||
| 224 | try testEnum(); | 240 | try testEnum(); |
| 225 | try comptime testEnum(); | 241 | try comptime testEnum(); |
| ... | @@ -244,6 +260,8 @@ fn testEnum() !void { | ... | @@ -244,6 +260,8 @@ fn testEnum() !void { |
| 244 | } | 260 | } |
| 245 | 261 | ||
| 246 | test "type info: union info" { | 262 | test "type info: union info" { |
| 263 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 264 | |||
| 247 | try testUnion(); | 265 | try testUnion(); |
| 248 | try comptime testUnion(); | 266 | try comptime testUnion(); |
| 249 | } | 267 | } |
| ... | @@ -287,7 +305,7 @@ fn testUnion() !void { | ... | @@ -287,7 +305,7 @@ fn testUnion() !void { |
| 287 | 305 | ||
| 288 | test "type info: struct info" { | 306 | test "type info: struct info" { |
| 289 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 307 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 290 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 308 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 291 | 309 | ||
| 292 | try testStruct(); | 310 | try testStruct(); |
| 293 | try comptime testStruct(); | 311 | try comptime testStruct(); |
| ... | @@ -310,6 +328,8 @@ const TestStruct = struct { | ... | @@ -310,6 +328,8 @@ const TestStruct = struct { |
| 310 | }; | 328 | }; |
| 311 | 329 | ||
| 312 | test "type info: packed struct info" { | 330 | test "type info: packed struct info" { |
| 331 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 332 | |||
| 313 | try testPackedStruct(); | 333 | try testPackedStruct(); |
| 314 | try comptime testPackedStruct(); | 334 | try comptime testPackedStruct(); |
| 315 | } | 335 | } |
| ... | @@ -361,7 +381,7 @@ fn testOpaque() !void { | ... | @@ -361,7 +381,7 @@ fn testOpaque() !void { |
| 361 | } | 381 | } |
| 362 | 382 | ||
| 363 | test "type info: function type info" { | 383 | test "type info: function type info" { |
| 364 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 384 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 365 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 385 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 366 | 386 | ||
| 367 | try testFunction(); | 387 | try testFunction(); |
| ... | @@ -429,6 +449,8 @@ extern fn typeInfoFoo(a: usize, b: bool, ...) callconv(.c) usize; | ... | @@ -429,6 +449,8 @@ extern fn typeInfoFoo(a: usize, b: bool, ...) callconv(.c) usize; |
| 429 | extern fn typeInfoFooAligned(a: usize, b: bool, ...) align(4) callconv(.c) usize; | 449 | extern fn typeInfoFooAligned(a: usize, b: bool, ...) align(4) callconv(.c) usize; |
| 430 | 450 | ||
| 431 | test "type info: generic function types" { | 451 | test "type info: generic function types" { |
| 452 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 453 | |||
| 432 | const G1 = @typeInfo(@TypeOf(generic1)); | 454 | const G1 = @typeInfo(@TypeOf(generic1)); |
| 433 | try expect(G1.@"fn".param_types.len == 1); | 455 | try expect(G1.@"fn".param_types.len == 1); |
| 434 | try expect(G1.@"fn".param_types.len == G1.@"fn".param_attrs.len); | 456 | try expect(G1.@"fn".param_types.len == G1.@"fn".param_attrs.len); |
| ... | @@ -477,6 +499,8 @@ test "typeInfo with comptime parameter in struct fn def" { | ... | @@ -477,6 +499,8 @@ test "typeInfo with comptime parameter in struct fn def" { |
| 477 | } | 499 | } |
| 478 | 500 | ||
| 479 | test "type info: vectors" { | 501 | test "type info: vectors" { |
| 502 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 503 | |||
| 480 | try testVector(); | 504 | try testVector(); |
| 481 | try comptime testVector(); | 505 | try comptime testVector(); |
| 482 | } | 506 | } |
| ... | @@ -549,7 +573,7 @@ fn add(a: i32, b: i32) i32 { | ... | @@ -549,7 +573,7 @@ fn add(a: i32, b: i32) i32 { |
| 549 | 573 | ||
| 550 | test "Declarations are returned in declaration order" { | 574 | test "Declarations are returned in declaration order" { |
| 551 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 575 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 552 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 576 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 553 | 577 | ||
| 554 | const S = struct { | 578 | const S = struct { |
| 555 | pub const a = 1; | 579 | pub const a = 1; |
| ... | @@ -571,8 +595,7 @@ test "Struct.is_tuple for anon list literal" { | ... | @@ -571,8 +595,7 @@ test "Struct.is_tuple for anon list literal" { |
| 571 | } | 595 | } |
| 572 | 596 | ||
| 573 | test "Struct.is_tuple for anon struct literal" { | 597 | test "Struct.is_tuple for anon struct literal" { |
| 574 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 598 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 575 | |||
| 576 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 599 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 577 | 600 | ||
| 578 | const info = @typeInfo(@TypeOf(.{ .a = 0 })); | 601 | const info = @typeInfo(@TypeOf(.{ .a = 0 })); |
| ... | @@ -594,6 +617,7 @@ test "value from struct @typeInfo default_value_ptr can be loaded at comptime" { | ... | @@ -594,6 +617,7 @@ test "value from struct @typeInfo default_value_ptr can be loaded at comptime" { |
| 594 | } | 617 | } |
| 595 | 618 | ||
| 596 | test "type info of tuple of string literal default value" { | 619 | test "type info of tuple of string literal default value" { |
| 620 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 597 | const struct_info = @typeInfo(@TypeOf(.{"hi"})).@"struct"; | 621 | const struct_info = @typeInfo(@TypeOf(.{"hi"})).@"struct"; |
| 598 | const struct_field_attrs = struct_info.field_attrs[0]; | 622 | const struct_field_attrs = struct_info.field_attrs[0]; |
| 599 | const struct_field_type = struct_info.field_types[0]; | 623 | const struct_field_type = struct_info.field_types[0]; |
| ... | @@ -611,7 +635,8 @@ test "@typeInfo function with generic return type and inferred error set" { | ... | @@ -611,7 +635,8 @@ test "@typeInfo function with generic return type and inferred error set" { |
| 611 | } | 635 | } |
| 612 | 636 | ||
| 613 | test "type info: spirv info" { | 637 | test "type info: spirv info" { |
| 614 | if (builtin.zig_backend != .stage2_spirv) return error.SkipZigTest; | 638 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 639 | if (!builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | ||
| 615 | 640 | ||
| 616 | try testSpirv(); | 641 | try testSpirv(); |
| 617 | try comptime testSpirv(); | 642 | try comptime testSpirv(); |
test/behavior/typename.zig+8-8| ... | @@ -14,7 +14,7 @@ const expectStringStartsWith = std.testing.expectStringStartsWith; | ... | @@ -14,7 +14,7 @@ const expectStringStartsWith = std.testing.expectStringStartsWith; |
| 14 | test "anon fn param" { | 14 | test "anon fn param" { |
| 15 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 15 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 16 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 16 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 17 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 17 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 18 | 18 | ||
| 19 | // https://github.com/ziglang/zig/issues/9339 | 19 | // https://github.com/ziglang/zig/issues/9339 |
| 20 | try expectEqualStringsIgnoreDigits( | 20 | try expectEqualStringsIgnoreDigits( |
| ... | @@ -39,7 +39,7 @@ test "anon fn param" { | ... | @@ -39,7 +39,7 @@ test "anon fn param" { |
| 39 | test "anon field init" { | 39 | test "anon field init" { |
| 40 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 40 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 41 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 41 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 42 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 42 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 43 | 43 | ||
| 44 | const Foo = .{ | 44 | const Foo = .{ |
| 45 | .T1 = struct {}, | 45 | .T1 = struct {}, |
| ... | @@ -64,7 +64,7 @@ test "anon field init" { | ... | @@ -64,7 +64,7 @@ test "anon field init" { |
| 64 | test "basic" { | 64 | test "basic" { |
| 65 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 65 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 66 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 66 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 67 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 67 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 68 | 68 | ||
| 69 | try expectEqualStrings("i64", @typeName(i64)); | 69 | try expectEqualStrings("i64", @typeName(i64)); |
| 70 | try expectEqualStrings("*usize", @typeName(*usize)); | 70 | try expectEqualStrings("*usize", @typeName(*usize)); |
| ... | @@ -85,7 +85,7 @@ test "basic" { | ... | @@ -85,7 +85,7 @@ test "basic" { |
| 85 | test "top level decl" { | 85 | test "top level decl" { |
| 86 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 86 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 87 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 87 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 88 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 88 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 89 | 89 | ||
| 90 | try expectEqualStrings( | 90 | try expectEqualStrings( |
| 91 | "behavior.typename.A_Struct", | 91 | "behavior.typename.A_Struct", |
| ... | @@ -134,7 +134,7 @@ const B = struct { | ... | @@ -134,7 +134,7 @@ const B = struct { |
| 134 | test "fn param" { | 134 | test "fn param" { |
| 135 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 135 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 136 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 136 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 137 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 137 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 138 | 138 | ||
| 139 | // https://github.com/ziglang/zig/issues/675 | 139 | // https://github.com/ziglang/zig/issues/675 |
| 140 | try expectEqualStrings( | 140 | try expectEqualStrings( |
| ... | @@ -213,7 +213,7 @@ pub fn expectEqualStringsIgnoreDigits(expected: []const u8, actual: []const u8) | ... | @@ -213,7 +213,7 @@ pub fn expectEqualStringsIgnoreDigits(expected: []const u8, actual: []const u8) |
| 213 | test "local variable" { | 213 | test "local variable" { |
| 214 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 214 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 215 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 215 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 216 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 216 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 217 | 217 | ||
| 218 | const Foo = struct { a: u32 }; | 218 | const Foo = struct { a: u32 }; |
| 219 | const Bar = union { a: u32 }; | 219 | const Bar = union { a: u32 }; |
| ... | @@ -231,7 +231,7 @@ test "local variable" { | ... | @@ -231,7 +231,7 @@ test "local variable" { |
| 231 | test "comptime parameters not converted to anytype in function type" { | 231 | test "comptime parameters not converted to anytype in function type" { |
| 232 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 232 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 233 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 233 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 234 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 234 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 235 | 235 | ||
| 236 | const T = fn (comptime fn (comptime type) void, void) void; | 236 | const T = fn (comptime fn (comptime type) void, void) void; |
| 237 | try expectEqualStrings("fn (comptime fn (comptime type) void, void) void", @typeName(T)); | 237 | try expectEqualStrings("fn (comptime fn (comptime type) void, void) void", @typeName(T)); |
| ... | @@ -240,7 +240,7 @@ test "comptime parameters not converted to anytype in function type" { | ... | @@ -240,7 +240,7 @@ test "comptime parameters not converted to anytype in function type" { |
| 240 | test "anon name strategy used in sub expression" { | 240 | test "anon name strategy used in sub expression" { |
| 241 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 241 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 242 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 242 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 243 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 243 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 244 | 244 | ||
| 245 | const S = struct { | 245 | const S = struct { |
| 246 | fn getTheName() []const u8 { | 246 | fn getTheName() []const u8 { |
test/behavior/undefined.zig+6-3| ... | @@ -14,6 +14,7 @@ fn initStaticArray() [10]i32 { | ... | @@ -14,6 +14,7 @@ fn initStaticArray() [10]i32 { |
| 14 | } | 14 | } |
| 15 | const static_array = initStaticArray(); | 15 | const static_array = initStaticArray(); |
| 16 | test "init static array to undefined" { | 16 | test "init static array to undefined" { |
| 17 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 17 | // This test causes `initStaticArray()` to be codegen'd, and the | 18 | // This test causes `initStaticArray()` to be codegen'd, and the |
| 18 | // C backend does not yet support returning arrays, so it fails | 19 | // C backend does not yet support returning arrays, so it fails |
| 19 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| ... | @@ -45,6 +46,7 @@ fn setFooX(foo: *Foo) void { | ... | @@ -45,6 +46,7 @@ fn setFooX(foo: *Foo) void { |
| 45 | } | 46 | } |
| 46 | 47 | ||
| 47 | test "assign undefined to struct" { | 48 | test "assign undefined to struct" { |
| 49 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 48 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 50 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 49 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 51 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 50 | 52 | ||
| ... | @@ -61,6 +63,7 @@ test "assign undefined to struct" { | ... | @@ -61,6 +63,7 @@ test "assign undefined to struct" { |
| 61 | } | 63 | } |
| 62 | 64 | ||
| 63 | test "assign undefined to struct with method" { | 65 | test "assign undefined to struct with method" { |
| 66 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 64 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 67 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 65 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 68 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 66 | 69 | ||
| ... | @@ -77,7 +80,7 @@ test "assign undefined to struct with method" { | ... | @@ -77,7 +80,7 @@ test "assign undefined to struct with method" { |
| 77 | } | 80 | } |
| 78 | 81 | ||
| 79 | test "type name of undefined" { | 82 | test "type name of undefined" { |
| 80 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 83 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 81 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 84 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 82 | 85 | ||
| 83 | const x = undefined; | 86 | const x = undefined; |
| ... | @@ -88,7 +91,7 @@ var buf: []u8 = undefined; | ... | @@ -88,7 +91,7 @@ var buf: []u8 = undefined; |
| 88 | 91 | ||
| 89 | test "reslice of undefined global var slice" { | 92 | test "reslice of undefined global var slice" { |
| 90 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 93 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 91 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 94 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 92 | 95 | ||
| 93 | var stack_buf: [100]u8 = @splat(0); | 96 | var stack_buf: [100]u8 = @splat(0); |
| 94 | buf = &stack_buf; | 97 | buf = &stack_buf; |
| ... | @@ -98,7 +101,7 @@ test "reslice of undefined global var slice" { | ... | @@ -98,7 +101,7 @@ test "reslice of undefined global var slice" { |
| 98 | 101 | ||
| 99 | test "returned undef is 0xaa bytes when runtime safety is enabled" { | 102 | test "returned undef is 0xaa bytes when runtime safety is enabled" { |
| 100 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 103 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 101 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 104 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 102 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 105 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 103 | 106 | ||
| 104 | const Rect = struct { | 107 | const Rect = struct { |
test/behavior/underscore.zig+1| ... | @@ -7,6 +7,7 @@ test "ignore lval with underscore" { | ... | @@ -7,6 +7,7 @@ test "ignore lval with underscore" { |
| 7 | } | 7 | } |
| 8 | 8 | ||
| 9 | test "ignore lval with underscore (while loop)" { | 9 | test "ignore lval with underscore (while loop)" { |
| 10 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 11 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 11 | 12 | ||
| 12 | while (optionalReturnError()) |_| { | 13 | while (optionalReturnError()) |_| { |
test/behavior/union.zig+85-39| ... | @@ -15,7 +15,7 @@ test "basic unions with floats" { | ... | @@ -15,7 +15,7 @@ test "basic unions with floats" { |
| 15 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 15 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 16 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 16 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 17 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 17 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 18 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 18 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 19 | 19 | ||
| 20 | var foo = FooWithFloats{ .int = 1 }; | 20 | var foo = FooWithFloats{ .int = 1 }; |
| 21 | try expect(foo.int == 1); | 21 | try expect(foo.int == 1); |
| ... | @@ -28,6 +28,7 @@ fn setFloat(foo: *FooWithFloats, x: f64) void { | ... | @@ -28,6 +28,7 @@ fn setFloat(foo: *FooWithFloats, x: f64) void { |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | test "init union with runtime value - floats" { | 30 | test "init union with runtime value - floats" { |
| 31 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 31 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 32 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 32 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 33 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 33 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 34 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -41,7 +42,7 @@ test "init union with runtime value - floats" { | ... | @@ -41,7 +42,7 @@ test "init union with runtime value - floats" { |
| 41 | test "basic unions" { | 42 | test "basic unions" { |
| 42 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 43 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 43 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 44 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 44 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 45 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 45 | 46 | ||
| 46 | var foo = Foo{ .int = 1 }; | 47 | var foo = Foo{ .int = 1 }; |
| 47 | try expect(foo.int == 1); | 48 | try expect(foo.int == 1); |
| ... | @@ -60,7 +61,7 @@ test "init union with runtime value" { | ... | @@ -60,7 +61,7 @@ test "init union with runtime value" { |
| 60 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 61 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 61 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 62 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 62 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 63 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 63 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 64 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 64 | 65 | ||
| 65 | var foo: Foo = undefined; | 66 | var foo: Foo = undefined; |
| 66 | 67 | ||
| ... | @@ -98,7 +99,7 @@ const FooExtern = extern union { | ... | @@ -98,7 +99,7 @@ const FooExtern = extern union { |
| 98 | 99 | ||
| 99 | test "basic extern unions" { | 100 | test "basic extern unions" { |
| 100 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 101 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 101 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 102 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 102 | 103 | ||
| 103 | var foo = FooExtern{ .int = 1 }; | 104 | var foo = FooExtern{ .int = 1 }; |
| 104 | try expect(foo.int == 1); | 105 | try expect(foo.int == 1); |
| ... | @@ -160,6 +161,7 @@ test "unions embedded in aggregate types" { | ... | @@ -160,6 +161,7 @@ test "unions embedded in aggregate types" { |
| 160 | } | 161 | } |
| 161 | 162 | ||
| 162 | test "constant tagged union with payload" { | 163 | test "constant tagged union with payload" { |
| 164 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 163 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 165 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 164 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 166 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 165 | 167 | ||
| ... | @@ -212,7 +214,7 @@ test "union with specified enum tag" { | ... | @@ -212,7 +214,7 @@ test "union with specified enum tag" { |
| 212 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 214 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 213 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 215 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 214 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 216 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 215 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 217 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 216 | 218 | ||
| 217 | try doTest(); | 219 | try doTest(); |
| 218 | try comptime doTest(); | 220 | try comptime doTest(); |
| ... | @@ -245,7 +247,7 @@ fn testComparison() !void { | ... | @@ -245,7 +247,7 @@ fn testComparison() !void { |
| 245 | test "comparison between union and enum literal" { | 247 | test "comparison between union and enum literal" { |
| 246 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 248 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 247 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 249 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 248 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 250 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 249 | 251 | ||
| 250 | try testComparison(); | 252 | try testComparison(); |
| 251 | try comptime testComparison(); | 253 | try comptime testComparison(); |
| ... | @@ -258,6 +260,7 @@ const TheUnion = union(TheTag) { | ... | @@ -258,6 +260,7 @@ const TheUnion = union(TheTag) { |
| 258 | C: i32, | 260 | C: i32, |
| 259 | }; | 261 | }; |
| 260 | test "cast union to tag type of union" { | 262 | test "cast union to tag type of union" { |
| 263 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 261 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 264 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 262 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 265 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 263 | 266 | ||
| ... | @@ -272,12 +275,14 @@ fn testCastUnionToTag() !void { | ... | @@ -272,12 +275,14 @@ fn testCastUnionToTag() !void { |
| 272 | } | 275 | } |
| 273 | 276 | ||
| 274 | test "union field access gives the enum values" { | 277 | test "union field access gives the enum values" { |
| 278 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 275 | try expect(TheUnion.A == TheTag.A); | 279 | try expect(TheUnion.A == TheTag.A); |
| 276 | try expect(TheUnion.B == TheTag.B); | 280 | try expect(TheUnion.B == TheTag.B); |
| 277 | try expect(TheUnion.C == TheTag.C); | 281 | try expect(TheUnion.C == TheTag.C); |
| 278 | } | 282 | } |
| 279 | 283 | ||
| 280 | test "cast tag type of union to union" { | 284 | test "cast tag type of union to union" { |
| 285 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 281 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 286 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 282 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 287 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 283 | 288 | ||
| ... | @@ -293,6 +298,7 @@ const Value2 = union(Letter2) { | ... | @@ -293,6 +298,7 @@ const Value2 = union(Letter2) { |
| 293 | }; | 298 | }; |
| 294 | 299 | ||
| 295 | test "implicit cast union to its tag type" { | 300 | test "implicit cast union to its tag type" { |
| 301 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 296 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 302 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 297 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 303 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 298 | 304 | ||
| ... | @@ -315,7 +321,7 @@ pub const PackThis = union(enum) { | ... | @@ -315,7 +321,7 @@ pub const PackThis = union(enum) { |
| 315 | test "constant packed union" { | 321 | test "constant packed union" { |
| 316 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 322 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 317 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 323 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 318 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 324 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 319 | 325 | ||
| 320 | try testConstPackedUnion(&[_]PackThis{PackThis{ .StringLiteral = 1 }}); | 326 | try testConstPackedUnion(&[_]PackThis{PackThis{ .StringLiteral = 1 }}); |
| 321 | } | 327 | } |
| ... | @@ -407,7 +413,7 @@ test "tagged union with no payloads" { | ... | @@ -407,7 +413,7 @@ test "tagged union with no payloads" { |
| 407 | 413 | ||
| 408 | test "union with only 1 field casted to its enum type" { | 414 | test "union with only 1 field casted to its enum type" { |
| 409 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 415 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 410 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 416 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 411 | 417 | ||
| 412 | const Literal = union(enum) { | 418 | const Literal = union(enum) { |
| 413 | Number: f64, | 419 | Number: f64, |
| ... | @@ -442,7 +448,7 @@ const Foo1 = union(enum) { | ... | @@ -442,7 +448,7 @@ const Foo1 = union(enum) { |
| 442 | var glbl: Foo1 = undefined; | 448 | var glbl: Foo1 = undefined; |
| 443 | 449 | ||
| 444 | test "global union with single field is correctly initialized" { | 450 | test "global union with single field is correctly initialized" { |
| 445 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 451 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 446 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 452 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 447 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 453 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 448 | 454 | ||
| ... | @@ -462,7 +468,7 @@ var glbl_array: [2]FooUnion = undefined; | ... | @@ -462,7 +468,7 @@ var glbl_array: [2]FooUnion = undefined; |
| 462 | test "initialize global array of union" { | 468 | test "initialize global array of union" { |
| 463 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 469 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 464 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 470 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 465 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 471 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 466 | 472 | ||
| 467 | glbl_array[1] = FooUnion{ .U1 = 2 }; | 473 | glbl_array[1] = FooUnion{ .U1 = 2 }; |
| 468 | glbl_array[0] = FooUnion{ .U0 = 1 }; | 474 | glbl_array[0] = FooUnion{ .U0 = 1 }; |
| ... | @@ -471,6 +477,7 @@ test "initialize global array of union" { | ... | @@ -471,6 +477,7 @@ test "initialize global array of union" { |
| 471 | } | 477 | } |
| 472 | 478 | ||
| 473 | test "update the tag value for zero-sized unions" { | 479 | test "update the tag value for zero-sized unions" { |
| 480 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 474 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 481 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 475 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 482 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 476 | 483 | ||
| ... | @@ -485,6 +492,7 @@ test "update the tag value for zero-sized unions" { | ... | @@ -485,6 +492,7 @@ test "update the tag value for zero-sized unions" { |
| 485 | } | 492 | } |
| 486 | 493 | ||
| 487 | test "union initializer generates padding only if needed" { | 494 | test "union initializer generates padding only if needed" { |
| 495 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 488 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 496 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 489 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 497 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 490 | 498 | ||
| ... | @@ -499,7 +507,7 @@ test "union initializer generates padding only if needed" { | ... | @@ -499,7 +507,7 @@ test "union initializer generates padding only if needed" { |
| 499 | 507 | ||
| 500 | test "runtime tag name with single field" { | 508 | test "runtime tag name with single field" { |
| 501 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 509 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 502 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 510 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 503 | 511 | ||
| 504 | const U = union(enum) { | 512 | const U = union(enum) { |
| 505 | A: i32, | 513 | A: i32, |
| ... | @@ -511,6 +519,7 @@ test "runtime tag name with single field" { | ... | @@ -511,6 +519,7 @@ test "runtime tag name with single field" { |
| 511 | } | 519 | } |
| 512 | 520 | ||
| 513 | test "method call on an empty union" { | 521 | test "method call on an empty union" { |
| 522 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 514 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 523 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 515 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 524 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 516 | 525 | ||
| ... | @@ -551,6 +560,7 @@ const FooNoVoid = union(enum) { | ... | @@ -551,6 +560,7 @@ const FooNoVoid = union(enum) { |
| 551 | const Baz = enum { A, B, C, D }; | 560 | const Baz = enum { A, B, C, D }; |
| 552 | 561 | ||
| 553 | test "tagged union type" { | 562 | test "tagged union type" { |
| 563 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 554 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 564 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 555 | 565 | ||
| 556 | const foo1 = TaggedFoo{ .One = 13 }; | 566 | const foo1 = TaggedFoo{ .One = 13 }; |
| ... | @@ -572,6 +582,7 @@ test "tagged union type" { | ... | @@ -572,6 +582,7 @@ test "tagged union type" { |
| 572 | } | 582 | } |
| 573 | 583 | ||
| 574 | test "tagged union as return value" { | 584 | test "tagged union as return value" { |
| 585 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 575 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 586 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 576 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 587 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 577 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 588 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -588,6 +599,7 @@ fn returnAnInt(x: i32) TaggedFoo { | ... | @@ -588,6 +599,7 @@ fn returnAnInt(x: i32) TaggedFoo { |
| 588 | } | 599 | } |
| 589 | 600 | ||
| 590 | test "tagged union with all void fields but a meaningful tag" { | 601 | test "tagged union with all void fields but a meaningful tag" { |
| 602 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 591 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 603 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 592 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 604 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 593 | 605 | ||
| ... | @@ -615,6 +627,7 @@ test "tagged union with all void fields but a meaningful tag" { | ... | @@ -615,6 +627,7 @@ test "tagged union with all void fields but a meaningful tag" { |
| 615 | } | 627 | } |
| 616 | 628 | ||
| 617 | test "union(enum(u32)) with specified and unspecified tag values" { | 629 | test "union(enum(u32)) with specified and unspecified tag values" { |
| 630 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 618 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 631 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 619 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 632 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 620 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 633 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -652,6 +665,7 @@ fn testEnumWithSpecifiedAndUnspecifiedTagValues(x: MultipleChoice2) !void { | ... | @@ -652,6 +665,7 @@ fn testEnumWithSpecifiedAndUnspecifiedTagValues(x: MultipleChoice2) !void { |
| 652 | } | 665 | } |
| 653 | 666 | ||
| 654 | test "switch on union with only 1 field" { | 667 | test "switch on union with only 1 field" { |
| 668 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 655 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 669 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 656 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 670 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 657 | 671 | ||
| ... | @@ -682,7 +696,7 @@ const PartialInstWithPayload = union(enum) { | ... | @@ -682,7 +696,7 @@ const PartialInstWithPayload = union(enum) { |
| 682 | 696 | ||
| 683 | test "union with only 1 field casted to its enum type which has enum value specified" { | 697 | test "union with only 1 field casted to its enum type which has enum value specified" { |
| 684 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 698 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 685 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 699 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 686 | 700 | ||
| 687 | const Literal = union(enum) { | 701 | const Literal = union(enum) { |
| 688 | number: f64, | 702 | number: f64, |
| ... | @@ -705,6 +719,7 @@ test "union with only 1 field casted to its enum type which has enum value speci | ... | @@ -705,6 +719,7 @@ test "union with only 1 field casted to its enum type which has enum value speci |
| 705 | } | 719 | } |
| 706 | 720 | ||
| 707 | test "@intFromEnum works on unions" { | 721 | test "@intFromEnum works on unions" { |
| 722 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 708 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 723 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 709 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 724 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 710 | 725 | ||
| ... | @@ -724,6 +739,8 @@ test "@intFromEnum works on unions" { | ... | @@ -724,6 +739,8 @@ test "@intFromEnum works on unions" { |
| 724 | } | 739 | } |
| 725 | 740 | ||
| 726 | test "comptime union field value equality" { | 741 | test "comptime union field value equality" { |
| 742 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 743 | |||
| 727 | const a0 = Setter(Attribute{ .A = false }); | 744 | const a0 = Setter(Attribute{ .A = false }); |
| 728 | const a1 = Setter(Attribute{ .A = true }); | 745 | const a1 = Setter(Attribute{ .A = true }); |
| 729 | const a2 = Setter(Attribute{ .A = false }); | 746 | const a2 = Setter(Attribute{ .A = false }); |
| ... | @@ -763,6 +780,7 @@ fn Setter(comptime attr: Attribute) type { | ... | @@ -763,6 +780,7 @@ fn Setter(comptime attr: Attribute) type { |
| 763 | } | 780 | } |
| 764 | 781 | ||
| 765 | test "return union init with void payload" { | 782 | test "return union init with void payload" { |
| 783 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 766 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 784 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 767 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 785 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 768 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 786 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -787,6 +805,7 @@ test "return union init with void payload" { | ... | @@ -787,6 +805,7 @@ test "return union init with void payload" { |
| 787 | } | 805 | } |
| 788 | 806 | ||
| 789 | test "@unionInit stored to a const" { | 807 | test "@unionInit stored to a const" { |
| 808 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 790 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 809 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 791 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 810 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 792 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 811 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -817,6 +836,7 @@ test "@unionInit stored to a const" { | ... | @@ -817,6 +836,7 @@ test "@unionInit stored to a const" { |
| 817 | } | 836 | } |
| 818 | 837 | ||
| 819 | test "@unionInit can modify a union type" { | 838 | test "@unionInit can modify a union type" { |
| 839 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 820 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 840 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 821 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 841 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 822 | 842 | ||
| ... | @@ -839,6 +859,7 @@ test "@unionInit can modify a union type" { | ... | @@ -839,6 +859,7 @@ test "@unionInit can modify a union type" { |
| 839 | } | 859 | } |
| 840 | 860 | ||
| 841 | test "@unionInit can modify a pointer value" { | 861 | test "@unionInit can modify a pointer value" { |
| 862 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 842 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 863 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 843 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 864 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 844 | 865 | ||
| ... | @@ -860,7 +881,7 @@ test "@unionInit can modify a pointer value" { | ... | @@ -860,7 +881,7 @@ test "@unionInit can modify a pointer value" { |
| 860 | test "union no tag with struct member" { | 881 | test "union no tag with struct member" { |
| 861 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 882 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 862 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 883 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 863 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 884 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 864 | 885 | ||
| 865 | const Struct = struct {}; | 886 | const Struct = struct {}; |
| 866 | const Union = union { | 887 | const Union = union { |
| ... | @@ -887,7 +908,8 @@ test "anonymous union literal syntax" { | ... | @@ -887,7 +908,8 @@ test "anonymous union literal syntax" { |
| 887 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 908 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 888 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 909 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 889 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 910 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 890 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 911 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 912 | |||
| 891 | const S = struct { | 913 | const S = struct { |
| 892 | const Number = union { | 914 | const Number = union { |
| 893 | int: i32, | 915 | int: i32, |
| ... | @@ -911,6 +933,7 @@ test "anonymous union literal syntax" { | ... | @@ -911,6 +933,7 @@ test "anonymous union literal syntax" { |
| 911 | } | 933 | } |
| 912 | 934 | ||
| 913 | test "function call result coerces from tagged union to the tag" { | 935 | test "function call result coerces from tagged union to the tag" { |
| 936 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 914 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 937 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 915 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 938 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 916 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 939 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -946,6 +969,7 @@ test "function call result coerces from tagged union to the tag" { | ... | @@ -946,6 +969,7 @@ test "function call result coerces from tagged union to the tag" { |
| 946 | } | 969 | } |
| 947 | 970 | ||
| 948 | test "switching on non exhaustive union" { | 971 | test "switching on non exhaustive union" { |
| 972 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 949 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 973 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 950 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 974 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 951 | 975 | ||
| ... | @@ -973,6 +997,7 @@ test "switching on non exhaustive union" { | ... | @@ -973,6 +997,7 @@ test "switching on non exhaustive union" { |
| 973 | } | 997 | } |
| 974 | 998 | ||
| 975 | test "containers with single-field enums" { | 999 | test "containers with single-field enums" { |
| 1000 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 976 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1001 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 977 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1002 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 978 | 1003 | ||
| ... | @@ -1004,7 +1029,7 @@ test "containers with single-field enums" { | ... | @@ -1004,7 +1029,7 @@ test "containers with single-field enums" { |
| 1004 | test "@unionInit on union with u8 tag but no fields" { | 1029 | test "@unionInit on union with u8 tag but no fields" { |
| 1005 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1030 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1006 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1031 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1007 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1032 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1008 | 1033 | ||
| 1009 | const S = struct { | 1034 | const S = struct { |
| 1010 | const Type = enum(u8) { no_op = 105 }; | 1035 | const Type = enum(u8) { no_op = 105 }; |
| ... | @@ -1049,7 +1074,7 @@ test "union enum type gets a separate scope" { | ... | @@ -1049,7 +1074,7 @@ test "union enum type gets a separate scope" { |
| 1049 | test "global variable struct contains union initialized to non-most-aligned field" { | 1074 | test "global variable struct contains union initialized to non-most-aligned field" { |
| 1050 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1075 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1051 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1076 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1052 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1077 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1053 | 1078 | ||
| 1054 | const T = struct { | 1079 | const T = struct { |
| 1055 | const U = union(enum) { | 1080 | const U = union(enum) { |
| ... | @@ -1073,6 +1098,7 @@ test "global variable struct contains union initialized to non-most-aligned fiel | ... | @@ -1073,6 +1098,7 @@ test "global variable struct contains union initialized to non-most-aligned fiel |
| 1073 | } | 1098 | } |
| 1074 | 1099 | ||
| 1075 | test "union with no result loc initiated with a runtime value" { | 1100 | test "union with no result loc initiated with a runtime value" { |
| 1101 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1076 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1102 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1077 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1103 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1078 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1104 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1090,6 +1116,7 @@ test "union with no result loc initiated with a runtime value" { | ... | @@ -1090,6 +1116,7 @@ test "union with no result loc initiated with a runtime value" { |
| 1090 | } | 1116 | } |
| 1091 | 1117 | ||
| 1092 | test "union with a large struct field" { | 1118 | test "union with a large struct field" { |
| 1119 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1093 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1120 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1094 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1121 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1095 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1122 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1124,6 +1151,7 @@ test "comptime equality of extern unions with same tag" { | ... | @@ -1124,6 +1151,7 @@ test "comptime equality of extern unions with same tag" { |
| 1124 | } | 1151 | } |
| 1125 | 1152 | ||
| 1126 | test "union tag is set when initiated as a temporary value at runtime" { | 1153 | test "union tag is set when initiated as a temporary value at runtime" { |
| 1154 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1127 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1155 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1128 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1156 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1129 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1157 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1146,7 +1174,7 @@ test "extern union most-aligned field is smaller" { | ... | @@ -1146,7 +1174,7 @@ test "extern union most-aligned field is smaller" { |
| 1146 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1174 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1147 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1175 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1148 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1176 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1149 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1177 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1150 | 1178 | ||
| 1151 | const U = extern union { | 1179 | const U = extern union { |
| 1152 | in6: extern struct { | 1180 | in6: extern struct { |
| ... | @@ -1166,7 +1194,7 @@ test "return an extern union from C calling convention" { | ... | @@ -1166,7 +1194,7 @@ test "return an extern union from C calling convention" { |
| 1166 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1194 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1167 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1195 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1168 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1196 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1169 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1197 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1170 | 1198 | ||
| 1171 | const namespace = struct { | 1199 | const namespace = struct { |
| 1172 | const S = extern struct { | 1200 | const S = extern struct { |
| ... | @@ -1195,6 +1223,7 @@ test "return an extern union from C calling convention" { | ... | @@ -1195,6 +1223,7 @@ test "return an extern union from C calling convention" { |
| 1195 | } | 1223 | } |
| 1196 | 1224 | ||
| 1197 | test "noreturn field in union" { | 1225 | test "noreturn field in union" { |
| 1226 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1198 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1227 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1199 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1228 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1200 | const U = union(enum) { | 1229 | const U = union(enum) { |
| ... | @@ -1244,6 +1273,7 @@ test "noreturn field in union" { | ... | @@ -1244,6 +1273,7 @@ test "noreturn field in union" { |
| 1244 | } | 1273 | } |
| 1245 | 1274 | ||
| 1246 | test "@unionInit uses tag value instead of field index" { | 1275 | test "@unionInit uses tag value instead of field index" { |
| 1276 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1247 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1277 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1248 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1278 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1249 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1279 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -1274,7 +1304,7 @@ test "@unionInit uses tag value instead of field index" { | ... | @@ -1274,7 +1304,7 @@ test "@unionInit uses tag value instead of field index" { |
| 1274 | test "union field ptr - zero sized payload" { | 1304 | test "union field ptr - zero sized payload" { |
| 1275 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1305 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1276 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1306 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1277 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1307 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1278 | 1308 | ||
| 1279 | const U = union { | 1309 | const U = union { |
| 1280 | foo: void, | 1310 | foo: void, |
| ... | @@ -1288,7 +1318,7 @@ test "union field ptr - zero sized payload" { | ... | @@ -1288,7 +1318,7 @@ test "union field ptr - zero sized payload" { |
| 1288 | test "union field ptr - zero sized field" { | 1318 | test "union field ptr - zero sized field" { |
| 1289 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1319 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1290 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1320 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1291 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1321 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1292 | 1322 | ||
| 1293 | const U = union { | 1323 | const U = union { |
| 1294 | foo: void, | 1324 | foo: void, |
| ... | @@ -1303,7 +1333,7 @@ test "packed union in packed struct" { | ... | @@ -1303,7 +1333,7 @@ test "packed union in packed struct" { |
| 1303 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1333 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1304 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1334 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1305 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1335 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1306 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1336 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1307 | 1337 | ||
| 1308 | const S = packed struct { | 1338 | const S = packed struct { |
| 1309 | nested: packed union { | 1339 | nested: packed union { |
| ... | @@ -1353,7 +1383,7 @@ test "union int tag type is properly managed" { | ... | @@ -1353,7 +1383,7 @@ test "union int tag type is properly managed" { |
| 1353 | 1383 | ||
| 1354 | test "no dependency loop when function pointer in union returns the union" { | 1384 | test "no dependency loop when function pointer in union returns the union" { |
| 1355 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1385 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1356 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1386 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1357 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1387 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1358 | 1388 | ||
| 1359 | const U = union(enum) { | 1389 | const U = union(enum) { |
| ... | @@ -1373,6 +1403,7 @@ test "no dependency loop when function pointer in union returns the union" { | ... | @@ -1373,6 +1403,7 @@ test "no dependency loop when function pointer in union returns the union" { |
| 1373 | } | 1403 | } |
| 1374 | 1404 | ||
| 1375 | test "union reassignment can use previous value" { | 1405 | test "union reassignment can use previous value" { |
| 1406 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1376 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1407 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1377 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1408 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1378 | 1409 | ||
| ... | @@ -1387,7 +1418,7 @@ test "union reassignment can use previous value" { | ... | @@ -1387,7 +1418,7 @@ test "union reassignment can use previous value" { |
| 1387 | 1418 | ||
| 1388 | test "reinterpreting enum value inside packed union" { | 1419 | test "reinterpreting enum value inside packed union" { |
| 1389 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1420 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1390 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1421 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1391 | 1422 | ||
| 1392 | const U = packed union { | 1423 | const U = packed union { |
| 1393 | tag: enum(u8) { a, b }, | 1424 | tag: enum(u8) { a, b }, |
| ... | @@ -1404,7 +1435,7 @@ test "reinterpreting enum value inside packed union" { | ... | @@ -1404,7 +1435,7 @@ test "reinterpreting enum value inside packed union" { |
| 1404 | } | 1435 | } |
| 1405 | 1436 | ||
| 1406 | test "access the tag of a global tagged union" { | 1437 | test "access the tag of a global tagged union" { |
| 1407 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1438 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1408 | 1439 | ||
| 1409 | const U = union(enum) { | 1440 | const U = union(enum) { |
| 1410 | a, | 1441 | a, |
| ... | @@ -1415,6 +1446,8 @@ test "access the tag of a global tagged union" { | ... | @@ -1415,6 +1446,8 @@ test "access the tag of a global tagged union" { |
| 1415 | } | 1446 | } |
| 1416 | 1447 | ||
| 1417 | test "coerce enum literal to union in result loc" { | 1448 | test "coerce enum literal to union in result loc" { |
| 1449 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1450 | |||
| 1418 | const U = union(enum) { | 1451 | const U = union(enum) { |
| 1419 | a, | 1452 | a, |
| 1420 | b: u8, | 1453 | b: u8, |
| ... | @@ -1431,7 +1464,7 @@ test "coerce enum literal to union in result loc" { | ... | @@ -1431,7 +1464,7 @@ test "coerce enum literal to union in result loc" { |
| 1431 | test "defined-layout union field pointer has correct alignment" { | 1464 | test "defined-layout union field pointer has correct alignment" { |
| 1432 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1465 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1433 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1466 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1434 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1467 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1435 | 1468 | ||
| 1436 | const S = struct { | 1469 | const S = struct { |
| 1437 | fn doTheTest(comptime U: type) !void { | 1470 | fn doTheTest(comptime U: type) !void { |
| ... | @@ -1465,7 +1498,7 @@ test "defined-layout union field pointer has correct alignment" { | ... | @@ -1465,7 +1498,7 @@ test "defined-layout union field pointer has correct alignment" { |
| 1465 | test "undefined-layout union field pointer has correct alignment" { | 1498 | test "undefined-layout union field pointer has correct alignment" { |
| 1466 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1499 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1467 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1500 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1468 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1501 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1469 | 1502 | ||
| 1470 | const S = struct { | 1503 | const S = struct { |
| 1471 | fn doTheTest(comptime U: type) !void { | 1504 | fn doTheTest(comptime U: type) !void { |
| ... | @@ -1500,7 +1533,7 @@ test "packed union field pointer has correct alignment" { | ... | @@ -1500,7 +1533,7 @@ test "packed union field pointer has correct alignment" { |
| 1500 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1533 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1501 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1534 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1502 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1535 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1503 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 1536 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 1504 | 1537 | ||
| 1505 | const U = packed union { x: u20 }; | 1538 | const U = packed union { x: u20 }; |
| 1506 | const S = packed struct(u24) { a: u2, u: U, b: u2 }; | 1539 | const S = packed struct(u24) { a: u2, u: U, b: u2 }; |
| ... | @@ -1531,6 +1564,7 @@ test "packed union field pointer has correct alignment" { | ... | @@ -1531,6 +1564,7 @@ test "packed union field pointer has correct alignment" { |
| 1531 | } | 1564 | } |
| 1532 | 1565 | ||
| 1533 | test "union with 128 bit integer" { | 1566 | test "union with 128 bit integer" { |
| 1567 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1534 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1568 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1535 | 1569 | ||
| 1536 | const ValueTag = enum { int, other }; | 1570 | const ValueTag = enum { int, other }; |
| ... | @@ -1554,7 +1588,7 @@ test "union with 128 bit integer" { | ... | @@ -1554,7 +1588,7 @@ test "union with 128 bit integer" { |
| 1554 | } | 1588 | } |
| 1555 | 1589 | ||
| 1556 | test "memset extern union" { | 1590 | test "memset extern union" { |
| 1557 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1591 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1558 | 1592 | ||
| 1559 | const U = extern union { | 1593 | const U = extern union { |
| 1560 | foo: u8, | 1594 | foo: u8, |
| ... | @@ -1575,7 +1609,7 @@ test "memset extern union" { | ... | @@ -1575,7 +1609,7 @@ test "memset extern union" { |
| 1575 | } | 1609 | } |
| 1576 | 1610 | ||
| 1577 | test "memset packed union" { | 1611 | test "memset packed union" { |
| 1578 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1612 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1579 | 1613 | ||
| 1580 | const U = packed union { | 1614 | const U = packed union { |
| 1581 | a: u32, | 1615 | a: u32, |
| ... | @@ -1677,7 +1711,7 @@ test "reinterpret extern union" { | ... | @@ -1677,7 +1711,7 @@ test "reinterpret extern union" { |
| 1677 | 1711 | ||
| 1678 | test "reinterpret packed union" { | 1712 | test "reinterpret packed union" { |
| 1679 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1713 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1680 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1714 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1681 | 1715 | ||
| 1682 | const U = packed union { | 1716 | const U = packed union { |
| 1683 | foo: packed struct(u64) { | 1717 | foo: packed struct(u64) { |
| ... | @@ -1755,7 +1789,7 @@ test "reinterpret packed union" { | ... | @@ -1755,7 +1789,7 @@ test "reinterpret packed union" { |
| 1755 | 1789 | ||
| 1756 | test "reinterpret packed union inside packed struct" { | 1790 | test "reinterpret packed union inside packed struct" { |
| 1757 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1791 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1758 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1792 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1759 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 1793 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 1760 | 1794 | ||
| 1761 | const U = packed union { | 1795 | const U = packed union { |
| ... | @@ -1794,6 +1828,8 @@ test "reinterpret packed union inside packed struct" { | ... | @@ -1794,6 +1828,8 @@ test "reinterpret packed union inside packed struct" { |
| 1794 | } | 1828 | } |
| 1795 | 1829 | ||
| 1796 | test "inner struct initializer uses union layout" { | 1830 | test "inner struct initializer uses union layout" { |
| 1831 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1832 | |||
| 1797 | const namespace = struct { | 1833 | const namespace = struct { |
| 1798 | const U = union { | 1834 | const U = union { |
| 1799 | a: struct { | 1835 | a: struct { |
| ... | @@ -1818,6 +1854,8 @@ test "inner struct initializer uses union layout" { | ... | @@ -1818,6 +1854,8 @@ test "inner struct initializer uses union layout" { |
| 1818 | } | 1854 | } |
| 1819 | 1855 | ||
| 1820 | test "inner struct initializer uses packed union layout" { | 1856 | test "inner struct initializer uses packed union layout" { |
| 1857 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1858 | |||
| 1821 | const namespace = struct { | 1859 | const namespace = struct { |
| 1822 | const U = packed union { | 1860 | const U = packed union { |
| 1823 | a: packed struct { | 1861 | a: packed struct { |
| ... | @@ -1861,7 +1899,7 @@ test "extern union initialized via reintepreted struct field initializer" { | ... | @@ -1861,7 +1899,7 @@ test "extern union initialized via reintepreted struct field initializer" { |
| 1861 | 1899 | ||
| 1862 | test "packed union initialized via reintepreted struct field initializer" { | 1900 | test "packed union initialized via reintepreted struct field initializer" { |
| 1863 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1901 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1864 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1902 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1865 | 1903 | ||
| 1866 | const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd }; | 1904 | const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd }; |
| 1867 | 1905 | ||
| ... | @@ -1884,7 +1922,7 @@ test "packed union initialized via reintepreted struct field initializer" { | ... | @@ -1884,7 +1922,7 @@ test "packed union initialized via reintepreted struct field initializer" { |
| 1884 | } | 1922 | } |
| 1885 | 1923 | ||
| 1886 | test "store of comptime reinterpreted memory to extern union" { | 1924 | test "store of comptime reinterpreted memory to extern union" { |
| 1887 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1925 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1888 | 1926 | ||
| 1889 | const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd }; | 1927 | const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd }; |
| 1890 | 1928 | ||
| ... | @@ -1907,7 +1945,7 @@ test "store of comptime reinterpreted memory to extern union" { | ... | @@ -1907,7 +1945,7 @@ test "store of comptime reinterpreted memory to extern union" { |
| 1907 | 1945 | ||
| 1908 | test "store of comptime reinterpreted memory to packed union" { | 1946 | test "store of comptime reinterpreted memory to packed union" { |
| 1909 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1947 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1910 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1948 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1911 | 1949 | ||
| 1912 | const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd }; | 1950 | const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd }; |
| 1913 | 1951 | ||
| ... | @@ -1933,7 +1971,7 @@ test "store of comptime reinterpreted memory to packed union" { | ... | @@ -1933,7 +1971,7 @@ test "store of comptime reinterpreted memory to packed union" { |
| 1933 | 1971 | ||
| 1934 | test "union field is a pointer to an aligned version of itself" { | 1972 | test "union field is a pointer to an aligned version of itself" { |
| 1935 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1973 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1936 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1974 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1937 | 1975 | ||
| 1938 | const E = union { | 1976 | const E = union { |
| 1939 | next: *align(1) @This(), | 1977 | next: *align(1) @This(), |
| ... | @@ -1947,7 +1985,7 @@ test "union field is a pointer to an aligned version of itself" { | ... | @@ -1947,7 +1985,7 @@ test "union field is a pointer to an aligned version of itself" { |
| 1947 | test "pass register-sized field as non-register-sized union" { | 1985 | test "pass register-sized field as non-register-sized union" { |
| 1948 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1986 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1949 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1987 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1950 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1988 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1951 | 1989 | ||
| 1952 | const S = struct { | 1990 | const S = struct { |
| 1953 | fn taggedUnion(u: union(enum) { x: usize, y: [2]usize }) !void { | 1991 | fn taggedUnion(u: union(enum) { x: usize, y: [2]usize }) !void { |
| ... | @@ -1971,7 +2009,7 @@ test "pass register-sized field as non-register-sized union" { | ... | @@ -1971,7 +2009,7 @@ test "pass register-sized field as non-register-sized union" { |
| 1971 | } | 2009 | } |
| 1972 | 2010 | ||
| 1973 | test "circular dependency through pointer field of a union" { | 2011 | test "circular dependency through pointer field of a union" { |
| 1974 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2012 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1975 | 2013 | ||
| 1976 | const S = struct { | 2014 | const S = struct { |
| 1977 | const UnionInner = extern struct { | 2015 | const UnionInner = extern struct { |
| ... | @@ -1994,6 +2032,7 @@ test "circular dependency through pointer field of a union" { | ... | @@ -1994,6 +2032,7 @@ test "circular dependency through pointer field of a union" { |
| 1994 | } | 2032 | } |
| 1995 | 2033 | ||
| 1996 | test "pass nested union with rls" { | 2034 | test "pass nested union with rls" { |
| 2035 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1997 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2036 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1998 | 2037 | ||
| 1999 | const Union = union(enum) { | 2038 | const Union = union(enum) { |
| ... | @@ -2014,6 +2053,7 @@ test "pass nested union with rls" { | ... | @@ -2014,6 +2053,7 @@ test "pass nested union with rls" { |
| 2014 | } | 2053 | } |
| 2015 | 2054 | ||
| 2016 | test "runtime union init, most-aligned field != largest" { | 2055 | test "runtime union init, most-aligned field != largest" { |
| 2056 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2017 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2057 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2018 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2058 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2019 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2059 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -2039,6 +2079,7 @@ test "runtime union init, most-aligned field != largest" { | ... | @@ -2039,6 +2079,7 @@ test "runtime union init, most-aligned field != largest" { |
| 2039 | } | 2079 | } |
| 2040 | 2080 | ||
| 2041 | test "copied union field doesn't alias source" { | 2081 | test "copied union field doesn't alias source" { |
| 2082 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2042 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2083 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2043 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 2084 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2044 | 2085 | ||
| ... | @@ -2059,7 +2100,7 @@ test "copied union field doesn't alias source" { | ... | @@ -2059,7 +2100,7 @@ test "copied union field doesn't alias source" { |
| 2059 | test "create union(enum) from other union(enum)" { | 2100 | test "create union(enum) from other union(enum)" { |
| 2060 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 2101 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2061 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2102 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2062 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2103 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2063 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2104 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2064 | 2105 | ||
| 2065 | const string = "hello world"; | 2106 | const string = "hello world"; |
| ... | @@ -2192,6 +2233,7 @@ test "capture used as explicit field value" { | ... | @@ -2192,6 +2233,7 @@ test "capture used as explicit field value" { |
| 2192 | } | 2233 | } |
| 2193 | 2234 | ||
| 2194 | test "signed enum tag with negative value" { | 2235 | test "signed enum tag with negative value" { |
| 2236 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2195 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 2237 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2196 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 2238 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2197 | 2239 | ||
| ... | @@ -2247,7 +2289,7 @@ test "extern union @FieldType" { | ... | @@ -2247,7 +2289,7 @@ test "extern union @FieldType" { |
| 2247 | } | 2289 | } |
| 2248 | 2290 | ||
| 2249 | test "assign global tagged union" { | 2291 | test "assign global tagged union" { |
| 2250 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 2292 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 2251 | 2293 | ||
| 2252 | const U = union(enum) { | 2294 | const U = union(enum) { |
| 2253 | a: u16, | 2295 | a: u16, |
| ... | @@ -2268,6 +2310,8 @@ test "assign global tagged union" { | ... | @@ -2268,6 +2310,8 @@ test "assign global tagged union" { |
| 2268 | } | 2310 | } |
| 2269 | 2311 | ||
| 2270 | test "set mutable union by switching on same union" { | 2312 | test "set mutable union by switching on same union" { |
| 2313 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2314 | |||
| 2271 | const U = union(enum) { | 2315 | const U = union(enum) { |
| 2272 | foo, | 2316 | foo, |
| 2273 | bar: usize, | 2317 | bar: usize, |
| ... | @@ -2292,6 +2336,8 @@ test "initialize empty field of union inside comptime-known struct constant" { | ... | @@ -2292,6 +2336,8 @@ test "initialize empty field of union inside comptime-known struct constant" { |
| 2292 | } | 2336 | } |
| 2293 | 2337 | ||
| 2294 | test "union with function body field" { | 2338 | test "union with function body field" { |
| 2339 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 2340 | |||
| 2295 | const U = union { | 2341 | const U = union { |
| 2296 | f: fn () void, | 2342 | f: fn () void, |
| 2297 | fn foo() void {} | 2343 | fn foo() void {} |
test/behavior/var_args.zig+10-6| ... | @@ -14,6 +14,8 @@ fn add(args: anytype) i32 { | ... | @@ -14,6 +14,8 @@ fn add(args: anytype) i32 { |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | test "add arbitrary args" { | 16 | test "add arbitrary args" { |
| 17 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 18 | |||
| 17 | try expect(add(.{ @as(i32, 1), @as(i32, 2), @as(i32, 3), @as(i32, 4) }) == 10); | 19 | try expect(add(.{ @as(i32, 1), @as(i32, 2), @as(i32, 3), @as(i32, 4) }) == 10); |
| 18 | try expect(add(.{@as(i32, 1234)}) == 1234); | 20 | try expect(add(.{@as(i32, 1234)}) == 1234); |
| 19 | try expect(add(.{}) == 0); | 21 | try expect(add(.{}) == 0); |
| ... | @@ -28,6 +30,7 @@ test "send void arg to var args" { | ... | @@ -28,6 +30,7 @@ test "send void arg to var args" { |
| 28 | } | 30 | } |
| 29 | 31 | ||
| 30 | test "pass args directly" { | 32 | test "pass args directly" { |
| 33 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 31 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 34 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 32 | 35 | ||
| 33 | try expect(addSomeStuff(.{ @as(i32, 1), @as(i32, 2), @as(i32, 3), @as(i32, 4) }) == 10); | 36 | try expect(addSomeStuff(.{ @as(i32, 1), @as(i32, 2), @as(i32, 3), @as(i32, 4) }) == 10); |
| ... | @@ -40,6 +43,7 @@ fn addSomeStuff(args: anytype) i32 { | ... | @@ -40,6 +43,7 @@ fn addSomeStuff(args: anytype) i32 { |
| 40 | } | 43 | } |
| 41 | 44 | ||
| 42 | test "runtime parameter before var args" { | 45 | test "runtime parameter before var args" { |
| 46 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 43 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 47 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 44 | 48 | ||
| 45 | try expect((try extraFn(10, .{})) == 0); | 49 | try expect((try extraFn(10, .{})) == 0); |
| ... | @@ -94,7 +98,7 @@ fn doNothingWithFirstArg(args: anytype) void { | ... | @@ -94,7 +98,7 @@ fn doNothingWithFirstArg(args: anytype) void { |
| 94 | test "simple variadic function" { | 98 | test "simple variadic function" { |
| 95 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 99 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 96 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 100 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 97 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 101 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 98 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 102 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 99 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { | 103 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { |
| 100 | // https://github.com/ziglang/zig/issues/14096 | 104 | // https://github.com/ziglang/zig/issues/14096 |
| ... | @@ -155,7 +159,7 @@ test "simple variadic function" { | ... | @@ -155,7 +159,7 @@ test "simple variadic function" { |
| 155 | test "coerce reference to var arg" { | 159 | test "coerce reference to var arg" { |
| 156 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 160 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 157 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 161 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 158 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 162 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 159 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 163 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 160 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { | 164 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { |
| 161 | // https://github.com/ziglang/zig/issues/14096 | 165 | // https://github.com/ziglang/zig/issues/14096 |
| ... | @@ -187,7 +191,7 @@ test "variadic functions" { | ... | @@ -187,7 +191,7 @@ test "variadic functions" { |
| 187 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 191 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 188 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 192 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 189 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 193 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 190 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 194 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 191 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { | 195 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { |
| 192 | // https://github.com/ziglang/zig/issues/14096 | 196 | // https://github.com/ziglang/zig/issues/14096 |
| 193 | return error.SkipZigTest; | 197 | return error.SkipZigTest; |
| ... | @@ -238,7 +242,7 @@ test "variadic functions" { | ... | @@ -238,7 +242,7 @@ test "variadic functions" { |
| 238 | 242 | ||
| 239 | test "copy VaList" { | 243 | test "copy VaList" { |
| 240 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 244 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 241 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 245 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 242 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 246 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 243 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { | 247 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { |
| 244 | // https://github.com/ziglang/zig/issues/14096 | 248 | // https://github.com/ziglang/zig/issues/14096 |
| ... | @@ -272,7 +276,7 @@ test "copy VaList" { | ... | @@ -272,7 +276,7 @@ test "copy VaList" { |
| 272 | 276 | ||
| 273 | test "unused VaList arg" { | 277 | test "unused VaList arg" { |
| 274 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 278 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 275 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 279 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 276 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 280 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 277 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { | 281 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { |
| 278 | // https://github.com/ziglang/zig/issues/14096 | 282 | // https://github.com/ziglang/zig/issues/14096 |
| ... | @@ -303,7 +307,7 @@ test "unused VaList arg" { | ... | @@ -303,7 +307,7 @@ test "unused VaList arg" { |
| 303 | 307 | ||
| 304 | test "floating point VaList args" { | 308 | test "floating point VaList args" { |
| 305 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 309 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 306 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 310 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 307 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 311 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 308 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/16961 | 312 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/16961 |
| 309 | 313 |
test/behavior/vector.zig+49-37| ... | @@ -8,7 +8,7 @@ const expectEqual = std.testing.expectEqual; | ... | @@ -8,7 +8,7 @@ const expectEqual = std.testing.expectEqual; |
| 8 | 8 | ||
| 9 | test "implicit cast vector to array - bool" { | 9 | test "implicit cast vector to array - bool" { |
| 10 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 10 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 11 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 11 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 12 | 12 | ||
| 13 | const S = struct { | 13 | const S = struct { |
| 14 | fn doTheTest() !void { | 14 | fn doTheTest() !void { |
| ... | @@ -31,7 +31,7 @@ test "implicit cast vector to array - bool" { | ... | @@ -31,7 +31,7 @@ test "implicit cast vector to array - bool" { |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | test "implicit cast array to vector - bool" { | 33 | test "implicit cast array to vector - bool" { |
| 34 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 34 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 35 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 35 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 36 | 36 | ||
| 37 | const S = struct { | 37 | const S = struct { |
| ... | @@ -59,7 +59,7 @@ test "vector wrap operators" { | ... | @@ -59,7 +59,7 @@ test "vector wrap operators" { |
| 59 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 59 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 60 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 60 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 61 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 61 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 62 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 62 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 63 | 63 | ||
| 64 | const S = struct { | 64 | const S = struct { |
| 65 | fn doTheTest() !void { | 65 | fn doTheTest() !void { |
| ... | @@ -82,7 +82,7 @@ test "vector bin compares with mem.eql" { | ... | @@ -82,7 +82,7 @@ test "vector bin compares with mem.eql" { |
| 82 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 82 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 83 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 83 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 84 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 84 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 85 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 85 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 86 | 86 | ||
| 87 | const S = struct { | 87 | const S = struct { |
| 88 | fn doTheTest() !void { | 88 | fn doTheTest() !void { |
| ... | @@ -106,7 +106,7 @@ test "vector int operators" { | ... | @@ -106,7 +106,7 @@ test "vector int operators" { |
| 106 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 106 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 107 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 107 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 108 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 108 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 109 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 109 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 110 | 110 | ||
| 111 | const S = struct { | 111 | const S = struct { |
| 112 | fn doTheTest() !void { | 112 | fn doTheTest() !void { |
| ... | @@ -127,7 +127,7 @@ test "vector float operators" { | ... | @@ -127,7 +127,7 @@ test "vector float operators" { |
| 127 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 127 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 128 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 128 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 129 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 129 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 130 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 130 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 131 | 131 | ||
| 132 | const S = struct { | 132 | const S = struct { |
| 133 | fn doTheTest(T: type) !void { | 133 | fn doTheTest(T: type) !void { |
| ... | @@ -164,7 +164,7 @@ test "vector bit operators" { | ... | @@ -164,7 +164,7 @@ test "vector bit operators" { |
| 164 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 164 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 165 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 165 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 166 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 166 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 167 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 167 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 168 | 168 | ||
| 169 | const S = struct { | 169 | const S = struct { |
| 170 | fn doTheTest() !void { | 170 | fn doTheTest() !void { |
| ... | @@ -195,7 +195,7 @@ test "implicit cast vector to array" { | ... | @@ -195,7 +195,7 @@ test "implicit cast vector to array" { |
| 195 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 195 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 196 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 196 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 197 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 197 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 198 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 198 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 199 | 199 | ||
| 200 | const S = struct { | 200 | const S = struct { |
| 201 | fn doTheTest() !void { | 201 | fn doTheTest() !void { |
| ... | @@ -214,7 +214,7 @@ test "array to vector" { | ... | @@ -214,7 +214,7 @@ test "array to vector" { |
| 214 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 214 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 215 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 215 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 216 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 216 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 217 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 217 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 218 | 218 | ||
| 219 | const S = struct { | 219 | const S = struct { |
| 220 | fn doTheTest() !void { | 220 | fn doTheTest() !void { |
| ... | @@ -233,7 +233,7 @@ test "array of abi-sized integer to vector of same type" { | ... | @@ -233,7 +233,7 @@ test "array of abi-sized integer to vector of same type" { |
| 233 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 233 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 234 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 234 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 235 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 235 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 236 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 236 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 237 | 237 | ||
| 238 | const S = struct { | 238 | const S = struct { |
| 239 | const one: u32 = 1; | 239 | const one: u32 = 1; |
| ... | @@ -318,7 +318,7 @@ test "array of float to vector of same type" { | ... | @@ -318,7 +318,7 @@ test "array of float to vector of same type" { |
| 318 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 318 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 319 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 319 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 320 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 320 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 321 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 321 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 322 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 322 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 323 | 323 | ||
| 324 | const S = struct { | 324 | const S = struct { |
| ... | @@ -375,6 +375,7 @@ test "array of float to vector of same type" { | ... | @@ -375,6 +375,7 @@ test "array of float to vector of same type" { |
| 375 | } | 375 | } |
| 376 | 376 | ||
| 377 | test "array of non-abi-sized integer to vector of same type" { | 377 | test "array of non-abi-sized integer to vector of same type" { |
| 378 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 378 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 379 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 379 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 380 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 380 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 381 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -427,6 +428,7 @@ test "array of non-abi-sized integer to vector of same type" { | ... | @@ -427,6 +428,7 @@ test "array of non-abi-sized integer to vector of same type" { |
| 427 | } | 428 | } |
| 428 | 429 | ||
| 429 | test "array vector coercion - odd sizes" { | 430 | test "array vector coercion - odd sizes" { |
| 431 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 430 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 432 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 431 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 433 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 432 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 434 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -468,7 +470,7 @@ test "array to vector with element type coercion" { | ... | @@ -468,7 +470,7 @@ test "array to vector with element type coercion" { |
| 468 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 470 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 469 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 471 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 470 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 472 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 471 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 473 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 472 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 474 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 473 | 475 | ||
| 474 | const S = struct { | 476 | const S = struct { |
| ... | @@ -502,7 +504,7 @@ test "peer type resolution with coercible element types" { | ... | @@ -502,7 +504,7 @@ test "peer type resolution with coercible element types" { |
| 502 | } | 504 | } |
| 503 | 505 | ||
| 504 | test "tuple to vector" { | 506 | test "tuple to vector" { |
| 505 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 507 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 506 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 508 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 507 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 509 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 508 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 510 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -529,7 +531,7 @@ test "vector casts of sizes not divisible by 8" { | ... | @@ -529,7 +531,7 @@ test "vector casts of sizes not divisible by 8" { |
| 529 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 531 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 530 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 532 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 531 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 533 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 532 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 534 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 533 | 535 | ||
| 534 | const S = struct { | 536 | const S = struct { |
| 535 | fn doTheTest() !void { | 537 | fn doTheTest() !void { |
| ... | @@ -564,6 +566,7 @@ test "vector casts of sizes not divisible by 8" { | ... | @@ -564,6 +566,7 @@ test "vector casts of sizes not divisible by 8" { |
| 564 | } | 566 | } |
| 565 | 567 | ||
| 566 | test "load vector elements via comptime index" { | 568 | test "load vector elements via comptime index" { |
| 569 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 567 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 570 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 568 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 571 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 569 | 572 | ||
| ... | @@ -584,6 +587,7 @@ test "load vector elements via comptime index" { | ... | @@ -584,6 +587,7 @@ test "load vector elements via comptime index" { |
| 584 | } | 587 | } |
| 585 | 588 | ||
| 586 | test "store vector elements via comptime index" { | 589 | test "store vector elements via comptime index" { |
| 590 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 587 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 591 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 588 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 592 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 589 | 593 | ||
| ... | @@ -610,6 +614,7 @@ test "store vector elements via comptime index" { | ... | @@ -610,6 +614,7 @@ test "store vector elements via comptime index" { |
| 610 | } | 614 | } |
| 611 | 615 | ||
| 612 | test "initialize vector which is a struct field" { | 616 | test "initialize vector which is a struct field" { |
| 617 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 613 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 618 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 614 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 619 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 615 | 620 | ||
| ... | @@ -634,7 +639,7 @@ test "vector comparison operators" { | ... | @@ -634,7 +639,7 @@ test "vector comparison operators" { |
| 634 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 639 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 635 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 640 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 636 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 641 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 637 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 642 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 638 | 643 | ||
| 639 | const S = struct { | 644 | const S = struct { |
| 640 | fn doTheTest() !void { | 645 | fn doTheTest() !void { |
| ... | @@ -679,7 +684,7 @@ test "vector division operators" { | ... | @@ -679,7 +684,7 @@ test "vector division operators" { |
| 679 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 684 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 680 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 685 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 681 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 686 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 682 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 687 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 683 | 688 | ||
| 684 | const S = struct { | 689 | const S = struct { |
| 685 | fn doTheTestDiv(comptime T: type, x: @Vector(4, T), y: @Vector(4, T)) !void { | 690 | fn doTheTestDiv(comptime T: type, x: @Vector(4, T), y: @Vector(4, T)) !void { |
| ... | @@ -798,6 +803,7 @@ test "vector division operators" { | ... | @@ -798,6 +803,7 @@ test "vector division operators" { |
| 798 | } | 803 | } |
| 799 | 804 | ||
| 800 | test "vector bitwise not operator" { | 805 | test "vector bitwise not operator" { |
| 806 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 801 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 807 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 802 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 808 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 803 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 809 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -830,6 +836,7 @@ test "vector bitwise not operator" { | ... | @@ -830,6 +836,7 @@ test "vector bitwise not operator" { |
| 830 | } | 836 | } |
| 831 | 837 | ||
| 832 | test "vector boolean not operator" { | 838 | test "vector boolean not operator" { |
| 839 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 833 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 840 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 834 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 841 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 835 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 842 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -856,7 +863,7 @@ test "vector shift operators" { | ... | @@ -856,7 +863,7 @@ test "vector shift operators" { |
| 856 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 863 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 857 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 864 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 858 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 865 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 859 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 866 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 860 | 867 | ||
| 861 | const S = struct { | 868 | const S = struct { |
| 862 | fn doTheTestShift(x: anytype, y: anytype) !void { | 869 | fn doTheTestShift(x: anytype, y: anytype) !void { |
| ... | @@ -926,7 +933,7 @@ test "vector reduce operation" { | ... | @@ -926,7 +933,7 @@ test "vector reduce operation" { |
| 926 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 933 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 927 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 934 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 928 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 935 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 929 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 936 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 930 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 937 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 931 | 938 | ||
| 932 | const S = struct { | 939 | const S = struct { |
| ... | @@ -1087,7 +1094,7 @@ test "saturating add" { | ... | @@ -1087,7 +1094,7 @@ test "saturating add" { |
| 1087 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1094 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1088 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1095 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1089 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1096 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1090 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1097 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1091 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1098 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1092 | 1099 | ||
| 1093 | const S = struct { | 1100 | const S = struct { |
| ... | @@ -1187,7 +1194,7 @@ test "saturating subtraction" { | ... | @@ -1187,7 +1194,7 @@ test "saturating subtraction" { |
| 1187 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1194 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1188 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1195 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1189 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1196 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1190 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1197 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1191 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1198 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1192 | 1199 | ||
| 1193 | const S = struct { | 1200 | const S = struct { |
| ... | @@ -1279,7 +1286,7 @@ test "saturating multiplication" { | ... | @@ -1279,7 +1286,7 @@ test "saturating multiplication" { |
| 1279 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1286 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1280 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1287 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1281 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1288 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1282 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1289 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1283 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1290 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1284 | 1291 | ||
| 1285 | const S = struct { | 1292 | const S = struct { |
| ... | @@ -1303,7 +1310,7 @@ test "saturating shift-left" { | ... | @@ -1303,7 +1310,7 @@ test "saturating shift-left" { |
| 1303 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1310 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1304 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1311 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1305 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1312 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1306 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1313 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1307 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1314 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1308 | 1315 | ||
| 1309 | const S = struct { | 1316 | const S = struct { |
| ... | @@ -1323,6 +1330,7 @@ test "saturating shift-left" { | ... | @@ -1323,6 +1330,7 @@ test "saturating shift-left" { |
| 1323 | } | 1330 | } |
| 1324 | 1331 | ||
| 1325 | test "multiplication-assignment operator with an array operand" { | 1332 | test "multiplication-assignment operator with an array operand" { |
| 1333 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1326 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1334 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1327 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1335 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1328 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1336 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -1346,7 +1354,7 @@ test "@addWithOverflow" { | ... | @@ -1346,7 +1354,7 @@ test "@addWithOverflow" { |
| 1346 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1354 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1347 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1355 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1348 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1356 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1349 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1357 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1350 | 1358 | ||
| 1351 | const S = struct { | 1359 | const S = struct { |
| 1352 | fn doTheTest() !void { | 1360 | fn doTheTest() !void { |
| ... | @@ -1393,7 +1401,7 @@ test "@subWithOverflow" { | ... | @@ -1393,7 +1401,7 @@ test "@subWithOverflow" { |
| 1393 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1401 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1394 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1402 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1395 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1403 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1396 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1404 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1397 | 1405 | ||
| 1398 | const S = struct { | 1406 | const S = struct { |
| 1399 | fn doTheTest() !void { | 1407 | fn doTheTest() !void { |
| ... | @@ -1420,7 +1428,7 @@ test "@subWithOverflow" { | ... | @@ -1420,7 +1428,7 @@ test "@subWithOverflow" { |
| 1420 | } | 1428 | } |
| 1421 | 1429 | ||
| 1422 | test "@mulWithOverflow" { | 1430 | test "@mulWithOverflow" { |
| 1423 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1431 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1424 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1432 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1425 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1433 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1426 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1434 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -1441,7 +1449,7 @@ test "@mulWithOverflow" { | ... | @@ -1441,7 +1449,7 @@ test "@mulWithOverflow" { |
| 1441 | } | 1449 | } |
| 1442 | 1450 | ||
| 1443 | test "@shlWithOverflow" { | 1451 | test "@shlWithOverflow" { |
| 1444 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1452 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1445 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1453 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1446 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1454 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1447 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1455 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -1462,6 +1470,8 @@ test "@shlWithOverflow" { | ... | @@ -1462,6 +1470,8 @@ test "@shlWithOverflow" { |
| 1462 | } | 1470 | } |
| 1463 | 1471 | ||
| 1464 | test "alignment of vectors" { | 1472 | test "alignment of vectors" { |
| 1473 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1474 | |||
| 1465 | try expect(@alignOf(@Vector(2, u8)) == switch (builtin.zig_backend) { | 1475 | try expect(@alignOf(@Vector(2, u8)) == switch (builtin.zig_backend) { |
| 1466 | else => 2, | 1476 | else => 2, |
| 1467 | .stage2_c, .stage2_wasm => @alignOf(u8), | 1477 | .stage2_c, .stage2_wasm => @alignOf(u8), |
| ... | @@ -1487,7 +1497,7 @@ test "alignment of vectors" { | ... | @@ -1487,7 +1497,7 @@ test "alignment of vectors" { |
| 1487 | test "loading the second vector from a slice of vectors" { | 1497 | test "loading the second vector from a slice of vectors" { |
| 1488 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1498 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1489 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1499 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1490 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1500 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1491 | 1501 | ||
| 1492 | @setRuntimeSafety(false); | 1502 | @setRuntimeSafety(false); |
| 1493 | var small_bases = [2]@Vector(2, u8){ | 1503 | var small_bases = [2]@Vector(2, u8){ |
| ... | @@ -1503,7 +1513,7 @@ test "array of vectors is copied" { | ... | @@ -1503,7 +1513,7 @@ test "array of vectors is copied" { |
| 1503 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1513 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1504 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1514 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1505 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1515 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1506 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1516 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1507 | 1517 | ||
| 1508 | const Vec3 = @Vector(3, i32); | 1518 | const Vec3 = @Vector(3, i32); |
| 1509 | var points = [_]Vec3{ | 1519 | var points = [_]Vec3{ |
| ... | @@ -1567,7 +1577,7 @@ test "zero multiplicand" { | ... | @@ -1567,7 +1577,7 @@ test "zero multiplicand" { |
| 1567 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1577 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1568 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO | 1578 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 1569 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1579 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1570 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1580 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1571 | 1581 | ||
| 1572 | const zeros = @Vector(2, u32){ 0.0, 0.0 }; | 1582 | const zeros = @Vector(2, u32){ 0.0, 0.0 }; |
| 1573 | var ones = @Vector(2, u32){ 1.0, 1.0 }; | 1583 | var ones = @Vector(2, u32){ 1.0, 1.0 }; |
| ... | @@ -1610,7 +1620,7 @@ test "modRem with zero divisor" { | ... | @@ -1610,7 +1620,7 @@ test "modRem with zero divisor" { |
| 1610 | } | 1620 | } |
| 1611 | 1621 | ||
| 1612 | test "array operands to shuffle are coerced to vectors" { | 1622 | test "array operands to shuffle are coerced to vectors" { |
| 1613 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1623 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1614 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1624 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1615 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1625 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1616 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1626 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -1625,6 +1635,7 @@ test "array operands to shuffle are coerced to vectors" { | ... | @@ -1625,6 +1635,7 @@ test "array operands to shuffle are coerced to vectors" { |
| 1625 | } | 1635 | } |
| 1626 | 1636 | ||
| 1627 | test "load packed vector element" { | 1637 | test "load packed vector element" { |
| 1638 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1628 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1639 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1629 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1640 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1630 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1641 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -1636,7 +1647,7 @@ test "load packed vector element" { | ... | @@ -1636,7 +1647,7 @@ test "load packed vector element" { |
| 1636 | } | 1647 | } |
| 1637 | 1648 | ||
| 1638 | test "store packed vector element" { | 1649 | test "store packed vector element" { |
| 1639 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1650 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1640 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1651 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1641 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1652 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1642 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1653 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -1653,7 +1664,7 @@ test "store to vector in slice" { | ... | @@ -1653,7 +1664,7 @@ test "store to vector in slice" { |
| 1653 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1664 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1654 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1665 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1655 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1666 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1656 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1667 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1657 | 1668 | ||
| 1658 | var v = [_]@Vector(3, f32){ | 1669 | var v = [_]@Vector(3, f32){ |
| 1659 | .{ 1, 1, 1 }, | 1670 | .{ 1, 1, 1 }, |
| ... | @@ -1670,7 +1681,7 @@ test "store vector with memset" { | ... | @@ -1670,7 +1681,7 @@ test "store vector with memset" { |
| 1670 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1681 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1671 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1682 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1672 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1683 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1673 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | 1684 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO |
| 1674 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1685 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1675 | 1686 | ||
| 1676 | var a: [5]@Vector(2, i1) = undefined; | 1687 | var a: [5]@Vector(2, i1) = undefined; |
| ... | @@ -1697,7 +1708,7 @@ test "store vector with memset" { | ... | @@ -1697,7 +1708,7 @@ test "store vector with memset" { |
| 1697 | } | 1708 | } |
| 1698 | 1709 | ||
| 1699 | test "addition of vectors represented as strings" { | 1710 | test "addition of vectors represented as strings" { |
| 1700 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1711 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1701 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1712 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1702 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1713 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1703 | 1714 | ||
| ... | @@ -1708,7 +1719,7 @@ test "addition of vectors represented as strings" { | ... | @@ -1708,7 +1719,7 @@ test "addition of vectors represented as strings" { |
| 1708 | } | 1719 | } |
| 1709 | 1720 | ||
| 1710 | test "compare vectors with different element types" { | 1721 | test "compare vectors with different element types" { |
| 1711 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1722 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1712 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1723 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1713 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1724 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1714 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1725 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | @@ -1721,6 +1732,7 @@ test "compare vectors with different element types" { | ... | @@ -1721,6 +1732,7 @@ test "compare vectors with different element types" { |
| 1721 | } | 1732 | } |
| 1722 | 1733 | ||
| 1723 | test "vector pointer is indexable" { | 1734 | test "vector pointer is indexable" { |
| 1735 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 1724 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1736 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1725 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1737 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1726 | 1738 | ||
| ... | @@ -1758,7 +1770,7 @@ test "bitcast to vector with different child type" { | ... | @@ -1758,7 +1770,7 @@ test "bitcast to vector with different child type" { |
| 1758 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1770 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1759 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 1771 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1760 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1772 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1761 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1773 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1762 | 1774 | ||
| 1763 | const S = struct { | 1775 | const S = struct { |
| 1764 | fn doTheTest() !void { | 1776 | fn doTheTest() !void { |
| ... | @@ -1810,7 +1822,7 @@ test "@reduce on bool vector" { | ... | @@ -1810,7 +1822,7 @@ test "@reduce on bool vector" { |
| 1810 | test "bitcast vector to array of smaller vectors" { | 1822 | test "bitcast vector to array of smaller vectors" { |
| 1811 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1823 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1812 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 1824 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1813 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 1825 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 1814 | 1826 | ||
| 1815 | const u8x32 = @Vector(32, u8); | 1827 | const u8x32 = @Vector(32, u8); |
| 1816 | const u8x64 = @Vector(64, u8); | 1828 | const u8x64 = @Vector(64, u8); |
test/behavior/void.zig+1-1| ... | @@ -21,7 +21,7 @@ test "compare void with void compile time known" { | ... | @@ -21,7 +21,7 @@ test "compare void with void compile time known" { |
| 21 | test "iterate over a void slice" { | 21 | test "iterate over a void slice" { |
| 22 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 22 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 23 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 23 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 24 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 24 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 25 | 25 | ||
| 26 | var j: usize = 0; | 26 | var j: usize = 0; |
| 27 | for (times(10), 0..) |_, i| { | 27 | for (times(10), 0..) |_, i| { |
test/behavior/while.zig+18-6| ... | @@ -4,6 +4,7 @@ const expect = std.testing.expect; | ... | @@ -4,6 +4,7 @@ const expect = std.testing.expect; |
| 4 | const assert = std.debug.assert; | 4 | const assert = std.debug.assert; |
| 5 | 5 | ||
| 6 | test "while loop" { | 6 | test "while loop" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 7 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 8 | 9 | ||
| 9 | var i: i32 = 0; | 10 | var i: i32 = 0; |
| ... | @@ -50,6 +51,8 @@ test "while with continue expression" { | ... | @@ -50,6 +51,8 @@ test "while with continue expression" { |
| 50 | } | 51 | } |
| 51 | 52 | ||
| 52 | test "while with else" { | 53 | test "while with else" { |
| 54 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 55 | |||
| 53 | var sum: i32 = 0; | 56 | var sum: i32 = 0; |
| 54 | var i: i32 = 0; | 57 | var i: i32 = 0; |
| 55 | var got_else: i32 = 0; | 58 | var got_else: i32 = 0; |
| ... | @@ -104,6 +107,7 @@ fn testBreakOuter() void { | ... | @@ -104,6 +107,7 @@ fn testBreakOuter() void { |
| 104 | } | 107 | } |
| 105 | 108 | ||
| 106 | test "while copies its payload" { | 109 | test "while copies its payload" { |
| 110 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 107 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 111 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 108 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 112 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 109 | 113 | ||
| ... | @@ -122,7 +126,7 @@ test "while copies its payload" { | ... | @@ -122,7 +126,7 @@ test "while copies its payload" { |
| 122 | } | 126 | } |
| 123 | 127 | ||
| 124 | test "continue and break" { | 128 | test "continue and break" { |
| 125 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 129 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 126 | 130 | ||
| 127 | try runContinueAndBreakTest(); | 131 | try runContinueAndBreakTest(); |
| 128 | try expect(continue_and_break_counter == 8); | 132 | try expect(continue_and_break_counter == 8); |
| ... | @@ -142,7 +146,7 @@ fn runContinueAndBreakTest() !void { | ... | @@ -142,7 +146,7 @@ fn runContinueAndBreakTest() !void { |
| 142 | } | 146 | } |
| 143 | 147 | ||
| 144 | test "while with optional as condition" { | 148 | test "while with optional as condition" { |
| 145 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 149 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 146 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 150 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 147 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 151 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 148 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 152 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -156,7 +160,7 @@ test "while with optional as condition" { | ... | @@ -156,7 +160,7 @@ test "while with optional as condition" { |
| 156 | } | 160 | } |
| 157 | 161 | ||
| 158 | test "while with optional as condition with else" { | 162 | test "while with optional as condition with else" { |
| 159 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 163 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 160 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 164 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 161 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 165 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 162 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 166 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -175,7 +179,7 @@ test "while with optional as condition with else" { | ... | @@ -175,7 +179,7 @@ test "while with optional as condition with else" { |
| 175 | } | 179 | } |
| 176 | 180 | ||
| 177 | test "while with error union condition" { | 181 | test "while with error union condition" { |
| 178 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 182 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 179 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 183 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 180 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 184 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 181 | 185 | ||
| ... | @@ -207,6 +211,7 @@ test "while on bool with else result follow break prong" { | ... | @@ -207,6 +211,7 @@ test "while on bool with else result follow break prong" { |
| 207 | } | 211 | } |
| 208 | 212 | ||
| 209 | test "while on optional with else result follow else prong" { | 213 | test "while on optional with else result follow else prong" { |
| 214 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 210 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 215 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 211 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 216 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 212 | 217 | ||
| ... | @@ -217,6 +222,7 @@ test "while on optional with else result follow else prong" { | ... | @@ -217,6 +222,7 @@ test "while on optional with else result follow else prong" { |
| 217 | } | 222 | } |
| 218 | 223 | ||
| 219 | test "while on optional with else result follow break prong" { | 224 | test "while on optional with else result follow break prong" { |
| 225 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 220 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 226 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 221 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 227 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 222 | 228 | ||
| ... | @@ -255,6 +261,7 @@ fn returnWithImplicitCastFromWhileLoopTest() anyerror!void { | ... | @@ -255,6 +261,7 @@ fn returnWithImplicitCastFromWhileLoopTest() anyerror!void { |
| 255 | } | 261 | } |
| 256 | 262 | ||
| 257 | test "while on error union with else result follow else prong" { | 263 | test "while on error union with else result follow else prong" { |
| 264 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 258 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 265 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 259 | 266 | ||
| 260 | const result = while (returnError()) |value| { | 267 | const result = while (returnError()) |value| { |
| ... | @@ -264,6 +271,7 @@ test "while on error union with else result follow else prong" { | ... | @@ -264,6 +271,7 @@ test "while on error union with else result follow else prong" { |
| 264 | } | 271 | } |
| 265 | 272 | ||
| 266 | test "while on error union with else result follow break prong" { | 273 | test "while on error union with else result follow break prong" { |
| 274 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 267 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 275 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 268 | 276 | ||
| 269 | const result = while (returnSuccess(10)) |value| { | 277 | const result = while (returnSuccess(10)) |value| { |
| ... | @@ -288,6 +296,7 @@ test "while bool 2 break statements and an else" { | ... | @@ -288,6 +296,7 @@ test "while bool 2 break statements and an else" { |
| 288 | } | 296 | } |
| 289 | 297 | ||
| 290 | test "while optional 2 break statements and an else" { | 298 | test "while optional 2 break statements and an else" { |
| 299 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 291 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 300 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 292 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 301 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 293 | 302 | ||
| ... | @@ -306,6 +315,7 @@ test "while optional 2 break statements and an else" { | ... | @@ -306,6 +315,7 @@ test "while optional 2 break statements and an else" { |
| 306 | } | 315 | } |
| 307 | 316 | ||
| 308 | test "while error 2 break statements and an else" { | 317 | test "while error 2 break statements and an else" { |
| 318 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 309 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 319 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 310 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 320 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 311 | 321 | ||
| ... | @@ -344,7 +354,7 @@ test "else continue outer while" { | ... | @@ -344,7 +354,7 @@ test "else continue outer while" { |
| 344 | 354 | ||
| 345 | test "try terminating an infinite loop" { | 355 | test "try terminating an infinite loop" { |
| 346 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 356 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 347 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 357 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 348 | 358 | ||
| 349 | // Test coverage for https://github.com/ziglang/zig/issues/13546 | 359 | // Test coverage for https://github.com/ziglang/zig/issues/13546 |
| 350 | const Foo = struct { | 360 | const Foo = struct { |
| ... | @@ -370,6 +380,7 @@ test "while loop with comptime true condition needs no else block to return valu | ... | @@ -370,6 +380,7 @@ test "while loop with comptime true condition needs no else block to return valu |
| 370 | } | 380 | } |
| 371 | 381 | ||
| 372 | test "int returned from switch in while" { | 382 | test "int returned from switch in while" { |
| 383 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 373 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 384 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 374 | 385 | ||
| 375 | var x: u32 = 3; | 386 | var x: u32 = 3; |
| ... | @@ -381,6 +392,7 @@ test "int returned from switch in while" { | ... | @@ -381,6 +392,7 @@ test "int returned from switch in while" { |
| 381 | } | 392 | } |
| 382 | 393 | ||
| 383 | test "breaking from a loop in an if statement" { | 394 | test "breaking from a loop in an if statement" { |
| 395 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 384 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 396 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 385 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 397 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 386 | 398 | ||
| ... | @@ -402,7 +414,7 @@ test "breaking from a loop in an if statement" { | ... | @@ -402,7 +414,7 @@ test "breaking from a loop in an if statement" { |
| 402 | } | 414 | } |
| 403 | 415 | ||
| 404 | test "labeled break from else" { | 416 | test "labeled break from else" { |
| 405 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 417 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 406 | 418 | ||
| 407 | const S = struct { | 419 | const S = struct { |
| 408 | fn doTheTest(x: u32) !void { | 420 | fn doTheTest(x: u32) !void { |
test/behavior/widening.zig+5-4| ... | @@ -4,6 +4,7 @@ const mem = std.mem; | ... | @@ -4,6 +4,7 @@ const mem = std.mem; |
| 4 | const builtin = @import("builtin"); | 4 | const builtin = @import("builtin"); |
| 5 | 5 | ||
| 6 | test "integer widening" { | 6 | test "integer widening" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | ||
| 7 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 9 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 10 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | @@ -28,7 +29,7 @@ test "integer widening u0 to u8" { | ... | @@ -28,7 +29,7 @@ test "integer widening u0 to u8" { |
| 28 | 29 | ||
| 29 | test "implicit unsigned integer to signed integer" { | 30 | test "implicit unsigned integer to signed integer" { |
| 30 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 31 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 31 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 32 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 32 | 33 | ||
| 33 | var a: u8 = 250; | 34 | var a: u8 = 250; |
| 34 | var b: i16 = a; | 35 | var b: i16 = a; |
| ... | @@ -39,7 +40,7 @@ test "implicit unsigned integer to signed integer" { | ... | @@ -39,7 +40,7 @@ test "implicit unsigned integer to signed integer" { |
| 39 | test "float widening" { | 40 | test "float widening" { |
| 40 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 41 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 41 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 42 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 42 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 43 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 43 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 44 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 44 | 45 | ||
| 45 | var a: f16 = 12.34; | 46 | var a: f16 = 12.34; |
| ... | @@ -58,7 +59,7 @@ test "float widening" { | ... | @@ -58,7 +59,7 @@ test "float widening" { |
| 58 | test "float widening f16 to f128" { | 59 | test "float widening f16 to f128" { |
| 59 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 60 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 60 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 61 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 61 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 62 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 62 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 63 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 63 | 64 | ||
| 64 | var x: f16 = 12.34; | 65 | var x: f16 = 12.34; |
| ... | @@ -70,7 +71,7 @@ test "float widening f16 to f128" { | ... | @@ -70,7 +71,7 @@ test "float widening f16 to f128" { |
| 70 | test "cast small unsigned to larger signed" { | 71 | test "cast small unsigned to larger signed" { |
| 71 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | 72 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 72 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 73 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 73 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 74 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; |
| 74 | 75 | ||
| 75 | try expect(castSmallUnsignedToLargerSigned1(200) == @as(i16, 200)); | 76 | try expect(castSmallUnsignedToLargerSigned1(200) == @as(i16, 200)); |
| 76 | try expect(castSmallUnsignedToLargerSigned2(9999) == @as(i64, 9999)); | 77 | try expect(castSmallUnsignedToLargerSigned2(9999) == @as(i64, 9999)); |
test/cases/compile_errors/spirv_slices.zig+2-4| ... | @@ -19,7 +19,5 @@ export fn b() void { | ... | @@ -19,7 +19,5 @@ export fn b() void { |
| 19 | // target=spirv32-opengl,spirv32-vulkan | 19 | // target=spirv32-opengl,spirv32-vulkan |
| 20 | // cpu_features=baseline+variable_pointers | 20 | // cpu_features=baseline+variable_pointers |
| 21 | // | 21 | // |
| 22 | // :3:16: error: cannot construct slice from address space 'generic' | 22 | // :3:16: error: cannot construct slice from logical address space 'generic' |
| 23 | // :3:16: note: only 'shared' and 'storage_buffer' address spaces support slicing on SPIR-V | 23 | // :14:11: error: cannot construct slice from logical address space 'generic' |
| 24 | // :14:11: error: cannot construct slice from address space 'generic' | ||
| 25 | // :14:11: note: only 'shared' and 'storage_buffer' address spaces support slicing on SPIR-V |
test/cases/spirv_mergable_pointers.zig+3-3| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | export fn a() void { | 1 | export fn a() void { |
| 2 | var x: *addrspace(.global) i32 = undefined; | 2 | var x: *addrspace(.physical_storage_buffer) i32 = undefined; |
| 3 | _ = &x; | 3 | _ = &x; |
| 4 | var y: *addrspace(.global) i32 = undefined; | 4 | var y: *addrspace(.physical_storage_buffer) i32 = undefined; |
| 5 | _ = &y; | 5 | _ = &y; |
| 6 | var rt_cond = false; | 6 | var rt_cond = false; |
| 7 | _ = &rt_cond; | 7 | _ = &rt_cond; |
| ... | @@ -13,5 +13,5 @@ export fn a() void { | ... | @@ -13,5 +13,5 @@ export fn a() void { |
| 13 | // compile | 13 | // compile |
| 14 | // output_mode=Obj | 14 | // output_mode=Obj |
| 15 | // backend=selfhosted | 15 | // backend=selfhosted |
| 16 | // target=spirv32-vulkan | 16 | // target=spirv64-vulkan |
| 17 | // emit_bin=true | 17 | // emit_bin=true |
test/src/Cases.zig+1-1| ... | @@ -465,7 +465,7 @@ pub fn lowerToBuildSteps( | ... | @@ -465,7 +465,7 @@ pub fn lowerToBuildSteps( |
| 465 | if (options.skip_non_native and !std.zig.target.isNative(&case.target.query, &case.target.result, &b.graph.host.result)) | 465 | if (options.skip_non_native and !std.zig.target.isNative(&case.target.query, &case.target.result, &b.graph.host.result)) |
| 466 | continue; | 466 | continue; |
| 467 | 467 | ||
| 468 | if (options.skip_spirv and case.target.query.cpu_arch != null and case.target.query.cpu_arch.?.isSpirV()) continue; | 468 | if (options.skip_spirv and case.target.query.cpu_arch != null and case.target.query.cpu_arch.?.isSpirv()) continue; |
| 469 | if (options.skip_wasm and case.target.query.cpu_arch != null and case.target.query.cpu_arch.?.isWasm()) continue; | 469 | if (options.skip_wasm and case.target.query.cpu_arch != null and case.target.query.cpu_arch.?.isWasm()) continue; |
| 470 | 470 | ||
| 471 | if (options.skip_freebsd and case.target.query.os_tag == .freebsd) continue; | 471 | if (options.skip_freebsd and case.target.query.os_tag == .freebsd) continue; |
test/tests.zig+1-1| ... | @@ -2568,7 +2568,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { | ... | @@ -2568,7 +2568,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { |
| 2568 | if (test_target.link_libc == null and !std.os.targetRequiresLibC(target)) continue; | 2568 | if (test_target.link_libc == null and !std.os.targetRequiresLibC(target)) continue; |
| 2569 | } | 2569 | } |
| 2570 | 2570 | ||
| 2571 | if (options.skip_spirv and target.cpu.arch.isSpirV()) continue; | 2571 | if (options.skip_spirv and target.cpu.arch.isSpirv()) continue; |
| 2572 | if (options.skip_wasm and target.cpu.arch.isWasm()) continue; | 2572 | if (options.skip_wasm and target.cpu.arch.isWasm()) continue; |
| 2573 | 2573 | ||
| 2574 | if (options.skip_freebsd and target.os.tag == .freebsd) continue; | 2574 | if (options.skip_freebsd and target.os.tag == .freebsd) continue; |
tools/gen_spirv_spec.zig+1| ... | @@ -15,6 +15,7 @@ const allowed_vendors = [_][]const u8{ "KHR", "EXT" }; | ... | @@ -15,6 +15,7 @@ const allowed_vendors = [_][]const u8{ "KHR", "EXT" }; |
| 15 | const set_names = std.StaticStringMap(struct { []const u8, []const u8 }).initComptime(.{ | 15 | const set_names = std.StaticStringMap(struct { []const u8, []const u8 }).initComptime(.{ |
| 16 | .{ "opencl.std.100", .{ "OpenCL.std", "OpenClOpcode" } }, | 16 | .{ "opencl.std.100", .{ "OpenCL.std", "OpenClOpcode" } }, |
| 17 | .{ "glsl.std.450", .{ "GLSL.std.450", "GlslOpcode" } }, | 17 | .{ "glsl.std.450", .{ "GLSL.std.450", "GlslOpcode" } }, |
| 18 | .{ "nonsemantic.shader.debuginfo.100", .{ "NonSemantic.Shader.DebugInfo.100", "ShaderDebugInfoOpCode" } }, | ||
| 18 | }); | 19 | }); |
| 19 | 20 | ||
| 20 | const Extension = struct { | 21 | const Extension = struct { |