| author | |
| committer | |
| log | b60a4af44cca7d3e935acd0b861e3b650714ebc1 |
| tree | 4367ad45c5d4a99d413aa1f33c5a43e4cb076fcb |
| parent | f51d2cf02ab5593f8e0e7923b34d8a68048bc0d8 |
130 files changed, 1951 insertions(+), 1187 deletions(-)
lib/compiler/aro/aro/Attribute/Wip.zig+1-1| ... | ... | @@ -1303,7 +1303,7 @@ fn applyCallingConvention(wip: *Wip) !void { |
| 1303 | 1303 | .default => unreachable, |
| 1304 | 1304 | .cdecl => !(comp.target.cpu.arch.isArm() and comp.target.os.tag != .windows) and |
| 1305 | 1305 | !comp.target.cpu.arch.isPowerPC64() and |
| 1306 | !comp.target.cpu.arch.isSpirV(), | |
| 1306 | !comp.target.cpu.arch.isSpirv(), | |
| 1307 | 1307 | .aarch64_sve_pcs, .aarch64_vector_pcs => comp.target.cpu.arch.isAARCH64(), |
| 1308 | 1308 | .arm_aapcs_vfp, .arm_aapcs => comp.target.cpu.arch.isArm(), |
| 1309 | 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 | 113 | return @backingInt(std.Target.mips.Feature.mips32r6); |
| 114 | 114 | } else if (arch.isMIPS64()) { |
| 115 | 115 | return @backingInt(std.Target.mips.Feature.mips64r6); |
| 116 | } else if (arch.isSpirV()) { | |
| 116 | } else if (arch.isSpirv()) { | |
| 117 | 117 | const spirv = std.Target.spirv.Feature; |
| 118 | 118 | return @backingInt(switch (sub) { |
| 119 | 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 | 36 | pub fn main(init: std.process.Init.Minimal) void { |
| 37 | 37 | @disableInstrumentation(); |
| 38 | 38 | |
| 39 | if (builtin.cpu.arch.isSpirV()) { | |
| 39 | if (builtin.cpu.arch.isSpirv()) { | |
| 40 | 40 | // SPIR-V needs an special test-runner |
| 41 | 41 | return; |
| 42 | 42 | } |
lib/std/Target.zig+1-1| ... | ... | @@ -2381,7 +2381,7 @@ pub fn supportsAddressSpace( |
| 2381 | 2381 | const arch = target.cpu.arch; |
| 2382 | 2382 | |
| 2383 | 2383 | const is_nvptx = arch.isNvptx(); |
| 2384 | const is_spirv = arch.isSpirV(); | |
| 2384 | const is_spirv = arch.isSpirv(); | |
| 2385 | 2385 | const is_gpu = is_nvptx or is_spirv or arch == .amdgcn; |
| 2386 | 2386 | |
| 2387 | 2387 | return switch (address_space) { |
lib/std/debug.zig+1| ... | ... | @@ -500,6 +500,7 @@ const use_trap_panic = switch (builtin.zig_backend) { |
| 500 | 500 | .stage2_spirv, |
| 501 | 501 | .stage2_x86, |
| 502 | 502 | => true, |
| 503 | .stage2_llvm => builtin.cpu.arch.isSpirv(), | |
| 503 | 504 | else => false, |
| 504 | 505 | }; |
| 505 | 506 |
lib/std/lang.zig+5| ... | ... | @@ -1363,6 +1363,11 @@ pub const panic: type = p: { |
| 1363 | 1363 | .stage2_powerpc, |
| 1364 | 1364 | .stage2_riscv64, |
| 1365 | 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 | 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 | 4889 | // tied to IDs that can be passed to valid instructions. Some |
| 4890 | 4890 | // SPIR-V targets do not define c_long, so we just allow any sized |
| 4891 | 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 | 4893 | const max_gp_register_bits = @bitSizeOf(c_long); |
| 4894 | 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 | 36 | .stage2_riscv64, |
| 37 | 37 | .stage2_spirv, |
| 38 | 38 | => false, |
| 39 | .stage2_llvm => !builtin.cpu.arch.isSpirv(), | |
| 39 | 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 | 212 | .powerpc => subArchName(target, .powerpc, .{ |
| 213 | 213 | .{ .spe, "spe" }, |
| 214 | 214 | }), |
| 215 | .spirv32, .spirv64 => subArchName(target, .spirv, .{ | |
| 216 | .{ .v1_6, "1.6" }, | |
| 217 | .{ .v1_5, "1.5" }, | |
| 218 | .{ .v1_4, "1.4" }, | |
| 219 | .{ .v1_3, "1.3" }, | |
| 220 | .{ .v1_2, "1.2" }, | |
| 221 | .{ .v1_1, "1.1" }, | |
| 215 | .spirv32 => switch (target.os.tag) { | |
| 216 | .vulkan, .opengl => subArchName(target, .spirv, .{ | |
| 217 | .{ .v1_6, "1.6" }, | |
| 218 | .{ .v1_5, "1.5" }, | |
| 219 | }), | |
| 220 | else => subArchName(target, .spirv, .{ | |
| 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 | 237 | else => null, |
| 224 | 238 | }; |
| ... | ... | @@ -10234,6 +10248,55 @@ pub fn opaqueType(self: *Builder, name: String) Allocator.Error!Type { |
| 10234 | 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 | 10300 | pub fn namedTypeSetBody( |
| 10238 | 10301 | self: *Builder, |
| 10239 | 10302 | named_type: Type, |
src/Sema.zig+6-6| ... | ... | @@ -6977,7 +6977,7 @@ fn analyzeCall( |
| 6977 | 6977 | const is_inline_call = block.isComptime() or inline_requested; |
| 6978 | 6978 | |
| 6979 | 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 | 6981 | return sema.fail(block, func_src, "SPIR-V does not support calling function pointers", .{}); |
| 6982 | 6982 | } |
| 6983 | 6983 | if (sema.func_is_naked) return sema.failWithOwnedErrorMsg(block, msg: { |
| ... | ... | @@ -15531,7 +15531,7 @@ fn zirAsm( |
| 15531 | 15531 | } |
| 15532 | 15532 | |
| 15533 | 15533 | const constraint = sema.code.nullTerminatedString(input.data.constraint); |
| 15534 | 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")) { | |
| 15535 | 15535 | const val = sema.resolveValue(arg.*) orelse { |
| 15536 | 15536 | return sema.fail(block, input_src, "assembly input with 'c' constraint must be compile-time known", .{}); |
| 15537 | 15537 | }; |
| ... | ... | @@ -20921,7 +20921,7 @@ fn zirReifySpirvType( |
| 20921 | 20921 | } }, |
| 20922 | 20922 | }; |
| 20923 | 20923 | |
| 20924 | if (!target.cpu.arch.isSpirV()) { | |
| 20924 | if (!target.cpu.arch.isSpirv()) { | |
| 20925 | 20925 | return sema.fail( |
| 20926 | 20926 | block, |
| 20927 | 20927 | src, |
| ... | ... | @@ -30286,7 +30286,7 @@ fn checkSpirvSliceAllowed( |
| 30286 | 30286 | const zcu = sema.pt.zcu; |
| 30287 | 30287 | const target = zcu.getTarget(); |
| 30288 | 30288 | |
| 30289 | if (!target.cpu.arch.isSpirV()) return; | |
| 30289 | if (!target.cpu.arch.isSpirv()) return; | |
| 30290 | 30290 | if (block.isComptime()) return; |
| 30291 | 30291 | |
| 30292 | 30292 | if (!target_util.addrSpaceIsLogical(target, address_space)) return; |
| ... | ... | @@ -35069,7 +35069,7 @@ pub fn resolveNavPtrModifiers( |
| 35069 | 35069 | }; |
| 35070 | 35070 | const addrspace_body = zir_decl.addrspace_body orelse { |
| 35071 | 35071 | if (zir_decl.linkage == .@"extern" and |
| 35072 | target.cpu.arch.isSpirV() and | |
| 35072 | target.cpu.arch.isSpirv() and | |
| 35073 | 35073 | nav_ty.zigTypeTag(zcu) != .@"fn") |
| 35074 | 35074 | { |
| 35075 | 35075 | return sema.fail( |
| ... | ... | @@ -35090,7 +35090,7 @@ pub fn resolveNavPtrModifiers( |
| 35090 | 35090 | break :as try sema.analyzeAsAddressSpace(block, addrspace_src, addrspace_ref, addrspace_ctx); |
| 35091 | 35091 | }; |
| 35092 | 35092 | |
| 35093 | if (target.cpu.arch.isSpirV()) { | |
| 35093 | if (target.cpu.arch.isSpirv()) { | |
| 35094 | 35094 | if (zir_decl.kind == .@"var" and zir_decl.linkage != .@"extern" and !zir_decl.is_threadlocal) { |
| 35095 | 35095 | return sema.failWithOwnedErrorMsg(block, msg: { |
| 35096 | 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 | 3135 | => false, |
| 3136 | 3136 | |
| 3137 | 3137 | .vector => { |
| 3138 | if (zcu.getTarget().cpu.arch.isSpirV()) return true; | |
| 3138 | if (zcu.getTarget().cpu.arch.isSpirv()) return true; | |
| 3139 | 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 | 4101 | const target = zcu.getTarget(); |
| 4102 | 4102 | |
| 4103 | 4103 | if (zcu.error_limit == 0) return 0; |
| 4104 | if (target.cpu.arch.isSpirV()) { | |
| 4104 | if (target.cpu.arch.isSpirv()) { | |
| 4105 | 4105 | // As expected by https://github.com/Snektron/zig-spirv-test-executor |
| 4106 | 4106 | if (zcu.comp.config.is_test) return 32; |
| 4107 | 4107 | } |
src/codegen/llvm.zig+132-6| ... | ... | @@ -995,6 +995,13 @@ pub const Object = struct { |
| 995 | 995 | } |
| 996 | 996 | |
| 997 | 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 | ||
| 998 | 1005 | try o.flushTypePool(pt); |
| 999 | 1006 | } |
| 1000 | 1007 | |
| ... | ... | @@ -1003,6 +1010,7 @@ pub const Object = struct { |
| 1003 | 1010 | const ip = &zcu.intern_pool; |
| 1004 | 1011 | const comp = zcu.comp; |
| 1005 | 1012 | const gpa = comp.gpa; |
| 1013 | const arch = comp.root_mod.resolved_target.result.cpu.arch; | |
| 1006 | 1014 | |
| 1007 | 1015 | const nav = ip.getNav(nav_id); |
| 1008 | 1016 | const resolved = nav.resolved.?; |
| ... | ... | @@ -1012,6 +1020,19 @@ pub const Object = struct { |
| 1012 | 1020 | else => null, |
| 1013 | 1021 | }; |
| 1014 | 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 | ||
| 1015 | 1036 | const llvm_ty: Builder.Type = if (opt_extern != null) ty: { |
| 1016 | 1037 | // We *must* lower this declaration no matter what. If it has a type we can't actually |
| 1017 | 1038 | // represent (because it doesn't have runtime bits), we instead lower as the zero-size |
| ... | ... | @@ -1462,6 +1483,7 @@ pub const Object = struct { |
| 1462 | 1483 | .undefined, |
| 1463 | 1484 | .null, |
| 1464 | 1485 | .enum_literal, |
| 1486 | .spirv, | |
| 1465 | 1487 | => return o.builder.debugSignedType(name, 0), |
| 1466 | 1488 | |
| 1467 | 1489 | .float => return o.builder.debugFloatType(name, ty.floatBits(target)), |
| ... | ... | @@ -1823,7 +1845,13 @@ pub const Object = struct { |
| 1823 | 1845 | while (it.next()) |field_index| { |
| 1824 | 1846 | const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]); |
| 1825 | 1847 | if (!field_ty.hasRuntimeBits(zcu)) continue; |
| 1826 | 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 | }; | |
| 1827 | 1855 | const field_align = switch (ty.explicitFieldAlignment(field_index, zcu)) { |
| 1828 | 1856 | .none => field_ty.abiAlignment(zcu), |
| 1829 | 1857 | else => |a| a, |
| ... | ... | @@ -2098,7 +2126,6 @@ pub const Object = struct { |
| 2098 | 2126 | }, |
| 2099 | 2127 | .frame => @panic("TODO implement lowerDebugType for Frame types"), |
| 2100 | 2128 | .@"anyframe" => @panic("TODO implement lowerDebugType for AnyFrame types"), |
| 2101 | .spirv => unreachable, | |
| 2102 | 2129 | } |
| 2103 | 2130 | } |
| 2104 | 2131 | |
| ... | ... | @@ -2856,7 +2883,8 @@ pub const Object = struct { |
| 2856 | 2883 | |
| 2857 | 2884 | if (o.type_map.get(t.toIntern())) |value| return value; |
| 2858 | 2885 | |
| 2859 | 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()); | |
| 2860 | 2888 | |
| 2861 | 2889 | var llvm_field_types: std.ArrayList(Builder.Type) = .empty; |
| 2862 | 2890 | defer llvm_field_types.deinit(o.gpa); |
| ... | ... | @@ -2891,7 +2919,11 @@ pub const Object = struct { |
| 2891 | 2919 | |
| 2892 | 2920 | try llvm_field_types.append(o.gpa, try o.lowerType(field_ty, repr)); |
| 2893 | 2921 | |
| 2894 | 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 | } | |
| 2895 | 2927 | } |
| 2896 | 2928 | { |
| 2897 | 2929 | const prev_offset = offset; |
| ... | ... | @@ -3033,7 +3065,8 @@ pub const Object = struct { |
| 3033 | 3065 | ); |
| 3034 | 3066 | return ty; |
| 3035 | 3067 | }, |
| 3036 | .opaque_type, .spirv_type => unreachable, // no runtime bits | |
| 3068 | .opaque_type => unreachable, | |
| 3069 | .spirv_type => try o.lowerSpirvType(t), | |
| 3037 | 3070 | .enum_type => try o.intType(t.backingIntType(zcu).intInfo(zcu).bits, repr), |
| 3038 | 3071 | .func_type => |func_type| { |
| 3039 | 3072 | assert(t.fnHasRuntimeBits(zcu)); |
| ... | ... | @@ -3064,6 +3097,74 @@ pub const Object = struct { |
| 3064 | 3097 | }; |
| 3065 | 3098 | } |
| 3066 | 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 | ||
| 3067 | 3168 | pub const FuncInfo = struct { |
| 3068 | 3169 | cc: std.lang.CallingConvention, |
| 3069 | 3170 | noalias_bits: u32 = 0, |
| ... | ... | @@ -3891,6 +3992,7 @@ pub const Object = struct { |
| 3891 | 3992 | const zcu = o.zcu; |
| 3892 | 3993 | const ip = &zcu.intern_pool; |
| 3893 | 3994 | const gpa = zcu.comp.gpa; |
| 3995 | const target = &zcu.comp.root_mod.resolved_target.result; | |
| 3894 | 3996 | |
| 3895 | 3997 | const nav = ip.getNav(nav_id); |
| 3896 | 3998 | const nav_ty: Type = .fromInterned(nav.resolved.?.type); |
| ... | ... | @@ -3902,6 +4004,17 @@ pub const Object = struct { |
| 3902 | 4004 | return o.lowerPtrToVoid(nav_align.toLlvm(), nav.resolved.?.@"addrspace"); |
| 3903 | 4005 | } |
| 3904 | 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 | ||
| 3905 | 4018 | const gop = try o.nav_map.getOrPut(gpa, nav_id); |
| 3906 | 4019 | if (!gop.found_existing) { |
| 3907 | 4020 | errdefer assert(o.nav_map.remove(nav_id)); |
| ... | ... | @@ -3918,7 +4031,7 @@ pub const Object = struct { |
| 3918 | 4031 | // We need to make sure the global's address space is up to date, because that affects the |
| 3919 | 4032 | // type of a pointer to this global. But everything else about the global will be populated |
| 3920 | 4033 | // by `updateNav` or `updateFunc`. |
| 3921 | 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); | |
| 3922 | 4035 | return llvm_global.toConst(); |
| 3923 | 4036 | } |
| 3924 | 4037 | |
| ... | ... | @@ -4446,6 +4559,19 @@ pub fn toLlvmAddressSpace(address_space: std.lang.AddressSpace, target: *const s |
| 4446 | 4559 | .local => Builder.AddrSpace.nvptx.local, |
| 4447 | 4560 | else => unreachable, |
| 4448 | 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 | }, | |
| 4449 | 4575 | .x86, .x86_64 => switch (address_space) { |
| 4450 | 4576 | .generic => .default, |
| 4451 | 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 | 1780 | // * https://github.com/llvm/llvm-project/blob/56905dab7da50bccfcceaeb496b206ff476127e1/llvm/test/MC/WebAssembly/blockaddress.ll |
| 1781 | 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 | 1787 | // On a 64-bit target, 1024 pointers in our jump table is about 8K of pointers. This seems just |
| 1784 | 1788 | // about acceptable - it won't fill L1d cache on most CPUs. |
| 1785 | 1789 | const max_table_len = 1024; |
src/codegen/spirv/Assembler.zig+9-13| ... | ... | @@ -784,21 +784,17 @@ fn parseNumber(ass: *Assembler) !void { |
| 784 | 784 | const result = try ass.resolveRef(ass.inst.operands.items[0].ref_id); |
| 785 | 785 | const result_id = result.resultId(); |
| 786 | 786 | |
| 787 | const words = cg.module.instructions.items; | |
| 788 | var offset: usize = 0; | |
| 789 | while (offset < words.len) { | |
| 790 | const header: spec.InstructionHeader = @bitCast(words[offset]); | |
| 791 | const word_count = header.word_count; | |
| 792 | defer offset += word_count; | |
| 793 | if (word_count == 0) break; | |
| 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; | |
| 787 | var it = cg.module.iterate(); | |
| 788 | while (it.next()) |instruction| { | |
| 789 | const words = instruction.words; | |
| 790 | switch (instruction.opcode) { | |
| 791 | .OpTypeInt => if (words.len >= 4 and @as(Id, @fromBackingInt(@intCast(words[1]))) == result_id) { | |
| 792 | const width: u16 = @intCast(words[2]); | |
| 793 | const signedness: std.lang.Signedness = if (words[3] == 0) .unsigned else .signed; | |
| 798 | 794 | return ass.parseContextDependentInt(signedness, width); |
| 799 | 795 | }, |
| 800 | .OpTypeFloat => if (word_count >= 3 and @as(Id, @fromBackingInt(@intCast(words[offset + 1]))) == result_id) { | |
| 801 | const bits = words[offset + 2]; | |
| 796 | .OpTypeFloat => if (words.len >= 3 and @as(Id, @fromBackingInt(@intCast(words[1]))) == result_id) { | |
| 797 | const bits = words[2]; | |
| 802 | 798 | return switch (bits) { |
| 803 | 799 | 16 => ass.parseContextDependentFloat(16), |
| 804 | 800 | 32 => ass.parseContextDependentFloat(32), |
src/codegen/spirv/CodeGen.zig+2-149| ... | ... | @@ -13,7 +13,6 @@ next_result_id: Word = 1, |
| 13 | 13 | navs: std.array_hash_map.Auto(InternPool.Nav.Index, Id) = .empty, |
| 14 | 14 | externs: std.array_hash_map.Auto(InternPool.Nav.Index, Mir.Extern) = .empty, |
| 15 | 15 | entry_points: std.ArrayList(Mir.EntryPoint) = .empty, |
| 16 | error_buffer: ?Id = null, | |
| 17 | 16 | struct_types: std.array_hash_map.Custom(StructType, Id, StructType.HashContext, true) = .empty, |
| 18 | 17 | /// SPIR-V ids of OpVariables whose pointee is a Block struct |
| 19 | 18 | block_var_ids: std.AutoHashMapUnmanaged(Id, void) = .empty, |
| ... | ... | @@ -202,9 +201,7 @@ pub fn generate( |
| 202 | 201 | defer cg.deinit(); |
| 203 | 202 | |
| 204 | 203 | const return_ty_id = try cg.resolveFnReturnType(.fromInterned(fn_info.return_type)); |
| 205 | const is_test = zcu.test_functions.contains(nav_index); | |
| 206 | 204 | const nav_id = try cg.resolveNav(nav_index); |
| 207 | const function_id = if (is_test) cg.allocId() else nav_id; | |
| 208 | 205 | |
| 209 | 206 | try cg.args.ensureUnusedCapacity(gpa, fn_info.param_types.len); |
| 210 | 207 | for (fn_info.param_types.get(ip)) |param_ty_index| { |
| ... | ... | @@ -224,7 +221,7 @@ pub fn generate( |
| 224 | 221 | const fn_ty_id = try cg.functionType(return_ty_id, cg.args.items(.ty)); |
| 225 | 222 | try cg.module.emit(gpa, .OpFunction, .{ |
| 226 | 223 | .id_result_type = return_ty_id, |
| 227 | .id_result = function_id, | |
| 224 | .id_result = nav_id, | |
| 228 | 225 | .function_control = .{}, |
| 229 | 226 | .function_type = fn_ty_id, |
| 230 | 227 | }); |
| ... | ... | @@ -236,8 +233,7 @@ pub fn generate( |
| 236 | 233 | } |
| 237 | 234 | try cg.module.append(gpa, cg.prologue); |
| 238 | 235 | try cg.module.append(gpa, cg.body); |
| 239 | if (is_test) try cg.generateTestEntryPoint(nav.fqn.toSlice(ip), nav_id, function_id); | |
| 240 | try cg.debugName(function_id, nav.fqn.toSlice(ip)); | |
| 236 | try cg.debugName(nav_id, nav.fqn.toSlice(ip)); | |
| 241 | 237 | |
| 242 | 238 | return cg.toOwnedMir(); |
| 243 | 239 | } |
| ... | ... | @@ -3781,149 +3777,6 @@ fn buildWideMul( |
| 3781 | 3777 | } |
| 3782 | 3778 | |
| 3783 | 3779 | /// The SPIR-V backend is not yet advanced enough to support the std testing infrastructure. |
| 3784 | /// In order to be able to run tests, we "temporarily" lower test kernels into separate entry- | |
| 3785 | /// points. The test executor will then be able to invoke these to run the tests. | |
| 3786 | /// Note that tests are lowered according to std.lang.TestFn, which is `fn () anyerror!void`. | |
| 3787 | /// (anyerror!void has the same layout as anyerror). | |
| 3788 | /// Each test declaration generates a function like. | |
| 3789 | /// %anyerror = OpTypeInt 0 16 | |
| 3790 | /// %p_invocation_globals_struct_ty = ... | |
| 3791 | /// %p_anyerror = OpTypePointer CrossWorkgroup %anyerror | |
| 3792 | /// %K = OpTypeFunction %void %p_invocation_globals_struct_ty %p_anyerror | |
| 3793 | /// | |
| 3794 | /// %test = OpFunction %void %K | |
| 3795 | /// %p_invocation_globals = OpFunctionParameter p_invocation_globals_struct_ty | |
| 3796 | /// %p_err = OpFunctionParameter %p_anyerror | |
| 3797 | /// %lbl = OpLabel | |
| 3798 | /// %result = OpFunctionCall %anyerror %func %p_invocation_globals | |
| 3799 | /// OpStore %p_err %result | |
| 3800 | /// OpFunctionEnd | |
| 3801 | /// TODO is to also write out the error as a function call parameter, and to somehow fetch | |
| 3802 | /// the name of an error in the text executor. | |
| 3803 | fn generateTestEntryPoint( | |
| 3804 | cg: *CodeGen, | |
| 3805 | name: []const u8, | |
| 3806 | kernel_id: Id, | |
| 3807 | test_id: Id, | |
| 3808 | ) !void { | |
| 3809 | const gpa = cg.gpa; | |
| 3810 | const zcu = cg.zcu; | |
| 3811 | const target = cg.zcu.getTarget(); | |
| 3812 | ||
| 3813 | const anyerror_ty_id = try cg.resolveType(.anyerror, .direct); | |
| 3814 | const ptr_anyerror_ty = try cg.pt.ptrType(.{ | |
| 3815 | .child = .anyerror_type, | |
| 3816 | .flags = .{ .address_space = .storage_buffer }, | |
| 3817 | }); | |
| 3818 | const ptr_anyerror_ty_id = try cg.resolveType(ptr_anyerror_ty, .direct); | |
| 3819 | ||
| 3820 | var section: Section = .empty; | |
| 3821 | defer section.deinit(gpa); | |
| 3822 | ||
| 3823 | const p_error_id = cg.allocId(); | |
| 3824 | switch (target.os.tag) { | |
| 3825 | .opencl, .amdhsa => { | |
| 3826 | const void_ty_id = try cg.resolveType(.void, .direct); | |
| 3827 | const kernel_proto_ty_id = try cg.functionType(void_ty_id, &.{ptr_anyerror_ty_id}); | |
| 3828 | ||
| 3829 | try section.emit(gpa, .OpFunction, .{ | |
| 3830 | .id_result_type = try cg.resolveType(.void, .direct), | |
| 3831 | .id_result = kernel_id, | |
| 3832 | .function_control = .{}, | |
| 3833 | .function_type = kernel_proto_ty_id, | |
| 3834 | }); | |
| 3835 | ||
| 3836 | try section.emit(gpa, .OpFunctionParameter, .{ | |
| 3837 | .id_result_type = ptr_anyerror_ty_id, | |
| 3838 | .id_result = p_error_id, | |
| 3839 | }); | |
| 3840 | ||
| 3841 | try section.emit(gpa, .OpLabel, .{ | |
| 3842 | .id_result = cg.allocId(), | |
| 3843 | }); | |
| 3844 | }, | |
| 3845 | .vulkan, .opengl => { | |
| 3846 | if (cg.error_buffer == null) { | |
| 3847 | const buffer_struct_ty_id = cg.allocId(); | |
| 3848 | try cg.module.emit(gpa, .OpTypeStruct, .{ | |
| 3849 | .id_result = buffer_struct_ty_id, | |
| 3850 | .id_ref = &.{anyerror_ty_id}, | |
| 3851 | }); | |
| 3852 | try cg.memberDebugName(buffer_struct_ty_id, 0, "error_out"); | |
| 3853 | try cg.decorate(buffer_struct_ty_id, .block); | |
| 3854 | try cg.decorateMember(buffer_struct_ty_id, 0, .{ .offset = .{ .byte_offset = 0 } }); | |
| 3855 | ||
| 3856 | const ptr_buffer_struct_ty_id = cg.allocId(); | |
| 3857 | try cg.module.emit(gpa, .OpTypePointer, .{ | |
| 3858 | .id_result = ptr_buffer_struct_ty_id, | |
| 3859 | .storage_class = cg.storageClass(.storage_buffer), | |
| 3860 | .type = buffer_struct_ty_id, | |
| 3861 | }); | |
| 3862 | ||
| 3863 | const error_buffer_id = cg.allocId(); | |
| 3864 | cg.error_buffer = error_buffer_id; | |
| 3865 | try cg.module.emit(gpa, .OpVariable, .{ | |
| 3866 | .id_result_type = ptr_buffer_struct_ty_id, | |
| 3867 | .id_result = error_buffer_id, | |
| 3868 | .storage_class = cg.storageClass(.storage_buffer), | |
| 3869 | }); | |
| 3870 | try cg.decorate(error_buffer_id, .{ .descriptor_set = .{ .descriptor_set = 0 } }); | |
| 3871 | try cg.decorate(error_buffer_id, .{ .binding = .{ .binding_point = 0 } }); | |
| 3872 | } | |
| 3873 | ||
| 3874 | const void_ty_id = try cg.resolveType(.void, .direct); | |
| 3875 | const kernel_proto_ty_id = try cg.functionType(void_ty_id, &.{}); | |
| 3876 | try section.emit(gpa, .OpFunction, .{ | |
| 3877 | .id_result_type = try cg.resolveType(.void, .direct), | |
| 3878 | .id_result = kernel_id, | |
| 3879 | .function_control = .{}, | |
| 3880 | .function_type = kernel_proto_ty_id, | |
| 3881 | }); | |
| 3882 | try section.emit(gpa, .OpLabel, .{ | |
| 3883 | .id_result = cg.allocId(), | |
| 3884 | }); | |
| 3885 | ||
| 3886 | const buffer_id = cg.error_buffer.?; | |
| 3887 | const zero_id = try cg.constInt(.u32, 0); | |
| 3888 | try section.emit(gpa, .OpInBoundsAccessChain, .{ | |
| 3889 | .id_result_type = ptr_anyerror_ty_id, | |
| 3890 | .id_result = p_error_id, | |
| 3891 | .base = buffer_id, | |
| 3892 | .indexes = &.{zero_id}, | |
| 3893 | }); | |
| 3894 | }, | |
| 3895 | else => unreachable, | |
| 3896 | } | |
| 3897 | ||
| 3898 | const error_id = cg.allocId(); | |
| 3899 | try section.emit(gpa, .OpFunctionCall, .{ | |
| 3900 | .id_result_type = anyerror_ty_id, | |
| 3901 | .id_result = error_id, | |
| 3902 | .function = test_id, | |
| 3903 | }); | |
| 3904 | // Note: Convert to direct not required. | |
| 3905 | try section.emit(gpa, .OpStore, .{ | |
| 3906 | .pointer = p_error_id, | |
| 3907 | .object = error_id, | |
| 3908 | .memory_access = .{ | |
| 3909 | .aligned = .{ .literal_integer = @intCast(Type.abiAlignment(.anyerror, zcu).toByteUnits().?) }, | |
| 3910 | }, | |
| 3911 | }); | |
| 3912 | try section.emit(gpa, .OpReturn, {}); | |
| 3913 | try section.emit(gpa, .OpFunctionEnd, {}); | |
| 3914 | try cg.module.append(gpa, section); | |
| 3915 | ||
| 3916 | // Just generate a quick other name because the intel runtime crashes when the entry- | |
| 3917 | // point name is the same as a different OpName. | |
| 3918 | const test_name = try std.fmt.allocPrint(gpa, "test {s}", .{name}); | |
| 3919 | errdefer gpa.free(test_name); | |
| 3920 | try cg.entry_points.append(gpa, .{ | |
| 3921 | .id = kernel_id, | |
| 3922 | .name = test_name, | |
| 3923 | .cc = .{ .spirv_kernel = .{ .x = 1, .y = 1, .z = 1 } }, | |
| 3924 | }); | |
| 3925 | } | |
| 3926 | ||
| 3927 | 3780 | fn intFromBool(cg: *CodeGen, value: Temporary, result_ty: Type) !Temporary { |
| 3928 | 3781 | const zero_id = try cg.constInt(result_ty, 0); |
| 3929 | 3782 | const one_id = try cg.constInt(result_ty, 1); |
src/codegen/spirv/Section.zig+32| ... | ... | @@ -14,6 +14,38 @@ ids: std.bit_set.Dynamic, |
| 14 | 14 | |
| 15 | 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 | 49 | pub const Error = error{ |
| 18 | 50 | OutOfMemory, |
| 19 | 51 | UnknownOpcode, |
src/link/Spirv.zig+2-1| ... | ... | @@ -218,11 +218,12 @@ pub fn flush( |
| 218 | 218 | .linker = linker, |
| 219 | 219 | .arena = arena, |
| 220 | 220 | .id_bound = 1, |
| 221 | .nonsemantic_info = false, | |
| 221 | 222 | .navs = .empty, |
| 222 | 223 | .symbols = .empty, |
| 223 | 224 | .interned = .empty, |
| 224 | 225 | .variables = .empty, |
| 225 | .function_references = .empty, | |
| 226 | .fn_refs = .empty, | |
| 226 | 227 | .entry_points = .empty, |
| 227 | 228 | .deps = .empty, |
| 228 | 229 | .scratch = .empty, |
src/link/Spirv/Flush.zig+47-53| ... | ... | @@ -18,11 +18,12 @@ const Flush = @This(); |
| 18 | 18 | linker: *Linker, |
| 19 | 19 | arena: Allocator, |
| 20 | 20 | id_bound: Word, |
| 21 | nonsemantic_info: bool, | |
| 21 | 22 | navs: std.array_hash_map.Auto(InternPool.Nav.Index, Id), |
| 22 | 23 | symbols: std.array_hash_map.String(Symbol), |
| 23 | 24 | interned: std.array_hash_map.String(Id), |
| 24 | 25 | variables: std.array_hash_map.Auto(Id, spec.StorageClass), |
| 25 | function_references: std.array_hash_map.Auto(Id, []const Id), | |
| 26 | fn_refs: std.array_hash_map.Auto(Id, []const Id), | |
| 26 | 27 | entry_points: std.ArrayList(Mir.EntryPoint), |
| 27 | 28 | deps: std.ArrayList(Id), |
| 28 | 29 | scratch: Section, |
| ... | ... | @@ -35,7 +36,6 @@ decorations: Section, |
| 35 | 36 | globals: Section, |
| 36 | 37 | declarations: Section, |
| 37 | 38 | functions: Section, |
| 38 | nonsemantic_info: bool = false, | |
| 39 | 39 | |
| 40 | 40 | const Symbol = struct { |
| 41 | 41 | id: Id, |
| ... | ... | @@ -195,7 +195,6 @@ pub fn emitModule(flush: *Flush, out: *Section) link.Error!void { |
| 195 | 195 | }) |feature| { |
| 196 | 196 | if (target.cpu.has(.spirv, feature)) version.minor += 1; |
| 197 | 197 | } |
| 198 | ||
| 199 | 198 | const zig_packed_version = (zig_version.major << 12) | (zig_version.minor << 7) | zig_version.patch; |
| 200 | 199 | const header: spec.Header = .{ |
| 201 | 200 | .magic = spec.magic_number, |
| ... | ... | @@ -204,6 +203,7 @@ pub fn emitModule(flush: *Flush, out: *Section) link.Error!void { |
| 204 | 203 | .id_bound = flush.id_bound, |
| 205 | 204 | .schema = 0, |
| 206 | 205 | }; |
| 206 | ||
| 207 | 207 | try out.writeWords(gpa, @ptrCast(@alignCast(&header))); |
| 208 | 208 | try flush.emitCapabilities(out); |
| 209 | 209 | try out.writeWords(gpa, flush.extended_instruction_sets.instructions.items); |
| ... | ... | @@ -227,7 +227,6 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { |
| 227 | 227 | const arena = flush.arena; |
| 228 | 228 | const diags = &comp.link_diags; |
| 229 | 229 | const target = &comp.root_mod.resolved_target.result; |
| 230 | ||
| 231 | 230 | const ids = try gpa.alloc(Id, mir.id_bound); |
| 232 | 231 | defer gpa.free(ids); |
| 233 | 232 | ids[0] = .none; |
| ... | ... | @@ -258,19 +257,16 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { |
| 258 | 257 | try imports.put(gpa, @backingInt(ext.id), @intCast(gop.index)); |
| 259 | 258 | } |
| 260 | 259 | |
| 261 | const words = mir.module.instructions.items; | |
| 262 | var offset: usize = 0; | |
| 263 | while (offset < words.len) { | |
| 264 | const start = offset; | |
| 265 | const header: spec.InstructionHeader = @bitCast(words[start]); | |
| 266 | const inst = words[start..][0..header.word_count]; | |
| 267 | offset += inst.len; | |
| 268 | ||
| 269 | if (header.opcode == .OpDecorate) { | |
| 270 | const target_id = inst[1]; | |
| 271 | const decoration: spec.Decoration = @fromBackingInt(inst[2]); | |
| 260 | var it = mir.module.iterate(); | |
| 261 | while (it.next()) |inst| { | |
| 262 | const opcode = inst.opcode; | |
| 263 | const words = inst.words; | |
| 264 | ||
| 265 | if (opcode == .OpDecorate) { | |
| 266 | const target_id = words[1]; | |
| 267 | const decoration: spec.Decoration = @fromBackingInt(words[2]); | |
| 272 | 268 | if (decoration == .linkage_attributes) { |
| 273 | const parameters = inst[3..]; | |
| 269 | const parameters = words[3..]; | |
| 274 | 270 | const name_words = parameters[0 .. parameters.len - 1]; |
| 275 | 271 | const name = std.mem.sliceTo(std.mem.sliceAsBytes(name_words), 0); |
| 276 | 272 | const linkage: spec.LinkageType = @fromBackingInt(parameters[parameters.len - 1]); |
| ... | ... | @@ -299,19 +295,19 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { |
| 299 | 295 | } |
| 300 | 296 | } |
| 301 | 297 | |
| 302 | const class = header.opcode.class(); | |
| 303 | const target_id: Word = switch (header.opcode) { | |
| 304 | .OpName, .OpMemberName => inst[1], | |
| 298 | const class = opcode.class(); | |
| 299 | const target_id: Word = switch (opcode) { | |
| 300 | .OpName, .OpMemberName => words[1], | |
| 305 | 301 | .OpDecorationGroup, .OpGroupDecorate, .OpGroupMemberDecorate => { |
| 306 | 302 | return diags.failParse(path.?, "decoration groups are not supported", .{}); |
| 307 | 303 | }, |
| 308 | else => if (class == .annotation) inst[1] else continue, | |
| 304 | else => if (class == .annotation) words[1] else continue, | |
| 309 | 305 | }; |
| 310 | 306 | try annotations.append(gpa, .{ |
| 311 | 307 | .target_id = target_id, |
| 312 | 308 | .class = class, |
| 313 | .start = start, | |
| 314 | .end = offset, | |
| 309 | .start = inst.start, | |
| 310 | .end = inst.end, | |
| 315 | 311 | }); |
| 316 | 312 | } |
| 317 | 313 | |
| ... | ... | @@ -336,19 +332,19 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { |
| 336 | 332 | } |
| 337 | 333 | } |
| 338 | 334 | |
| 339 | offset = 0; | |
| 340 | while (offset < words.len) { | |
| 341 | const start = offset; | |
| 342 | const header: spec.InstructionHeader = @bitCast(words[start]); | |
| 343 | const inst = words[start..][0..header.word_count]; | |
| 344 | offset += inst.len; | |
| 335 | it = mir.module.iterate(); | |
| 336 | while (it.next()) |inst| { | |
| 337 | const start = inst.start; | |
| 338 | var end = inst.end; | |
| 339 | const opcode = inst.opcode; | |
| 340 | const words = inst.words; | |
| 345 | 341 | input.mark += 1; |
| 346 | 342 | flush.deps.clearRetainingCapacity(); |
| 347 | 343 | |
| 348 | const result_index = header.opcode.resultIndex() orelse switch (header.opcode) { | |
| 344 | const result_index = opcode.resultIndex() orelse switch (opcode) { | |
| 349 | 345 | .OpCapability => { |
| 350 | const capability = std.enums.fromInt(spec.Capability, inst[1]) orelse { | |
| 351 | return diags.failParse(path.?, "unknown capability '{d}'", .{inst[1]}); | |
| 346 | const capability = std.enums.fromInt(spec.Capability, words[1]) orelse { | |
| 347 | return diags.failParse(path.?, "unknown capability '{d}'", .{words[1]}); | |
| 352 | 348 | }; |
| 353 | 349 | |
| 354 | 350 | // TODO: this isn't a full validation. we probably have to automate this |
| ... | ... | @@ -368,7 +364,7 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { |
| 368 | 364 | continue; |
| 369 | 365 | }, |
| 370 | 366 | .OpExtension => { |
| 371 | const name = std.mem.sliceTo(std.mem.sliceAsBytes(inst[1..]), 0); | |
| 367 | const name = std.mem.sliceTo(std.mem.sliceAsBytes(words[1..]), 0); | |
| 372 | 368 | if (std.mem.eql(u8, name, "SPV_KHR_non_semantic_info")) { |
| 373 | 369 | flush.nonsemantic_info = true; |
| 374 | 370 | continue; |
| ... | ... | @@ -388,34 +384,31 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { |
| 388 | 384 | continue; |
| 389 | 385 | }, |
| 390 | 386 | .OpEntryPoint => { |
| 391 | try input.copy(flush, &flush.object_entry_points, start, offset, null); | |
| 387 | try input.copy(flush, &flush.object_entry_points, start, end, null); | |
| 392 | 388 | continue; |
| 393 | 389 | }, |
| 394 | 390 | .OpExecutionMode, .OpExecutionModeId => { |
| 395 | try input.copy(flush, &flush.object_execution_modes, start, offset, null); | |
| 391 | try input.copy(flush, &flush.object_execution_modes, start, end, null); | |
| 396 | 392 | continue; |
| 397 | 393 | }, |
| 398 | 394 | .OpTypeForwardPointer => { |
| 399 | forward_pointers.set(inst[1]); | |
| 400 | try input.copy(flush, &flush.globals, start, offset, null); | |
| 395 | forward_pointers.set(words[1]); | |
| 396 | try input.copy(flush, &flush.globals, start, end, null); | |
| 401 | 397 | continue; |
| 402 | 398 | }, |
| 403 | 399 | else => continue, |
| 404 | 400 | }; |
| 405 | 401 | |
| 406 | const result_id = inst[result_index]; | |
| 402 | const result_id = words[result_index]; | |
| 407 | 403 | result_ids.clearRetainingCapacity(); |
| 408 | 404 | try result_ids.append(gpa, result_id); |
| 409 | 405 | |
| 410 | 406 | var has_body = false; |
| 411 | if (header.opcode == .OpFunction) { | |
| 412 | while (true) { | |
| 413 | const body: spec.InstructionHeader = @bitCast(words[offset]); | |
| 407 | if (opcode == .OpFunction) { | |
| 408 | while (it.next()) |body| { | |
| 409 | end = body.end; | |
| 414 | 410 | if (body.opcode == .OpLabel) has_body = true; |
| 415 | if (body.opcode.resultIndex()) |index| { | |
| 416 | try result_ids.append(gpa, words[offset + index]); | |
| 417 | } | |
| 418 | offset += body.word_count; | |
| 411 | if (body.result_id != .none) try result_ids.append(gpa, @backingInt(body.result_id)); | |
| 419 | 412 | if (body.opcode == .OpFunctionEnd) break; |
| 420 | 413 | } |
| 421 | 414 | } |
| ... | ... | @@ -424,18 +417,18 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { |
| 424 | 417 | |
| 425 | 418 | if (imports.get(result_id)) |symbol_index| { |
| 426 | 419 | flush.scratch.reset(); |
| 427 | try input.copy(flush, &flush.scratch, start, offset, null); | |
| 420 | try input.copy(flush, &flush.scratch, start, end, null); | |
| 428 | 421 | const declaration = try arena.dupe(Word, flush.scratch.instructions.items); |
| 429 | 422 | flush.symbols.values()[symbol_index].declaration = declaration; |
| 430 | 423 | continue; |
| 431 | 424 | } |
| 432 | 425 | |
| 433 | switch (header.opcode) { | |
| 426 | switch (opcode) { | |
| 434 | 427 | .OpFunction => if (!has_body) return diags.failParse(path.?, "function declaration without linkage", .{}), |
| 435 | .OpVariable => try flush.variables.put(arena, ids[result_id], @fromBackingInt(inst[3])), | |
| 428 | .OpVariable => try flush.variables.put(arena, ids[result_id], @fromBackingInt(words[3])), | |
| 436 | 429 | else => if (!forward_pointers.isSet(result_id)) { |
| 437 | 430 | flush.scratch.reset(); |
| 438 | try input.copy(flush, &flush.scratch, start, offset, start + result_index); | |
| 431 | try input.copy(flush, &flush.scratch, start, end, start + result_index); | |
| 439 | 432 | for (grouped_indices[starts[result_id]..starts[result_id + 1]]) |index| { |
| 440 | 433 | const annotation = annotations.items[index]; |
| 441 | 434 | if (annotation.class != .annotation) continue; |
| ... | ... | @@ -466,16 +459,16 @@ fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void { |
| 466 | 459 | } |
| 467 | 460 | } |
| 468 | 461 | |
| 469 | const section = switch (header.opcode) { | |
| 462 | const section = switch (opcode) { | |
| 470 | 463 | .OpFunction => &flush.functions, |
| 471 | 464 | .OpExtInstImport => &flush.extended_instruction_sets, |
| 472 | 465 | .OpString => &flush.debug_strings, |
| 473 | 466 | else => &flush.globals, |
| 474 | 467 | }; |
| 475 | try input.copy(flush, section, start, offset, null); | |
| 476 | if (header.opcode == .OpFunction) { | |
| 468 | try input.copy(flush, section, start, end, null); | |
| 469 | if (opcode == .OpFunction) { | |
| 477 | 470 | const references = try arena.dupe(Id, flush.deps.items); |
| 478 | try flush.function_references.put(arena, ids[result_id], references); | |
| 471 | try flush.fn_refs.put(arena, ids[result_id], references); | |
| 479 | 472 | } |
| 480 | 473 | } |
| 481 | 474 | |
| ... | ... | @@ -532,6 +525,7 @@ fn emitCapabilities(flush: *Flush, out: *Section) link.Error!void { |
| 532 | 525 | if (!target.cpu.has(.spirv, feature)) continue; |
| 533 | 526 | try out.emit(gpa, .OpExtension, .{ .name = name }); |
| 534 | 527 | } |
| 528 | ||
| 535 | 529 | if (flush.nonsemantic_info) { |
| 536 | 530 | try out.emit(gpa, .OpExtension, .{ .name = "SPV_KHR_non_semantic_info" }); |
| 537 | 531 | } |
| ... | ... | @@ -594,7 +588,7 @@ fn emitEntryPoints(flush: *Flush, out: *Section) link.Error!void { |
| 594 | 588 | if (storage_class == .function) continue; |
| 595 | 589 | if (!v1_4 and storage_class != .input and storage_class != .output) continue; |
| 596 | 590 | try interface.append(arena, id); |
| 597 | } else if (flush.function_references.get(id)) |references| { | |
| 591 | } else if (flush.fn_refs.get(id)) |references| { | |
| 598 | 592 | try pending.appendSlice(arena, references); |
| 599 | 593 | } |
| 600 | 594 | } |
src/main.zig+1-1| ... | ... | @@ -3582,7 +3582,7 @@ fn buildOutputType( |
| 3582 | 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()) { | |
| 3585 | if (build_options.have_llvm and create_module.resolved_options.use_llvm and target.cpu.arch.isSpirv()) { | |
| 3586 | 3586 | // LLVM has no way to set this non-globally other |
| 3587 | 3587 | // than SPIRVTranslate() but it cannot emits assembly. |
| 3588 | 3588 | var extensions: std.ArrayList(u8) = .empty; |
src/target.zig+1-1| ... | ... | @@ -310,7 +310,7 @@ pub fn hasNewLinker(ofmt: std.Target.ObjectFormat) bool { |
| 310 | 310 | /// than or equal to the number of behavior tests as the respective LLVM backend. |
| 311 | 311 | pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool { |
| 312 | 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 | 314 | if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) { |
| 315 | 315 | if (target.os.tag == .illumos) { |
| 316 | 316 | // https://github.com/ziglang/zig/issues/25699 |
test/behavior.zig+5-5| ... | ... | @@ -115,21 +115,21 @@ test { |
| 115 | 115 | _ = @import("behavior/wasm.zig"); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | if (builtin.zig_backend == .stage2_spirv) { | |
| 118 | if (builtin.cpu.arch.isSpirv()) { | |
| 119 | 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 | 123 | _ = @import("behavior/asm.zig"); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (builtin.zig_backend != .stage2_arm and |
| 127 | builtin.zig_backend != .stage2_spirv) | |
| 127 | !builtin.cpu.arch.isSpirv()) | |
| 128 | 128 | { |
| 129 | 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 | 133 | // Due to lack of import/export of global support |
| 134 | 134 | // (https://github.com/ziglang/zig/issues/4866), these tests correctly |
| 135 | 135 | // cause linker errors, since a data symbol cannot be exported when |
| ... | ... | @@ -143,7 +143,7 @@ test { |
| 143 | 143 | // This bug only repros in the root file |
| 144 | 144 | test "dereference @embedFile() of a file full of zero bytes" { |
| 145 | 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 | 148 | const contents = @embedFile("behavior/zero.bin").*; |
| 149 | 149 | try @import("std").testing.expect(contents.len == 456); |
test/behavior/abs.zig+13-8| ... | ... | @@ -4,6 +4,7 @@ const assert = std.debug.assert; |
| 4 | 4 | const expect = std.testing.expect; |
| 5 | 5 | |
| 6 | 6 | test "@abs integers" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 7 | 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 8 | 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 9 | 10 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -49,6 +50,7 @@ fn testAbsIntegers() !void { |
| 49 | 50 | } |
| 50 | 51 | |
| 51 | 52 | test "@abs signed C ABI integers" { |
| 53 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 52 | 54 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 53 | 55 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 54 | 56 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -60,7 +62,7 @@ test "@abs signed C ABI integers" { |
| 60 | 62 | try testOne(c_short, c_ushort); |
| 61 | 63 | try testOne(c_int, c_uint); |
| 62 | 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 | 67 | fn testOne(comptime Signed: type, comptime Unsigned: type) !void { |
| 66 | 68 | var negative_one: Signed = undefined; |
| ... | ... | @@ -76,6 +78,7 @@ test "@abs signed C ABI integers" { |
| 76 | 78 | } |
| 77 | 79 | |
| 78 | 80 | test "@abs unsigned integers" { |
| 81 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 79 | 82 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 80 | 83 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 81 | 84 | |
| ... | ... | @@ -115,6 +118,7 @@ fn testAbsUnsignedIntegers() !void { |
| 115 | 118 | } |
| 116 | 119 | |
| 117 | 120 | test "@abs unsigned C ABI integers" { |
| 121 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 118 | 122 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 119 | 123 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 120 | 124 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -125,7 +129,7 @@ test "@abs unsigned C ABI integers" { |
| 125 | 129 | try testOne(c_ushort); |
| 126 | 130 | try testOne(c_uint); |
| 127 | 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 | 134 | fn testOne(comptime Unsigned: type) !void { |
| 131 | 135 | var one: Unsigned = undefined; |
| ... | ... | @@ -141,6 +145,7 @@ test "@abs unsigned C ABI integers" { |
| 141 | 145 | } |
| 142 | 146 | |
| 143 | 147 | test "@abs big int <= 128 bits" { |
| 148 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 144 | 149 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 145 | 150 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 146 | 151 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -203,7 +208,7 @@ fn testAbsUnsignedBigInt() !void { |
| 203 | 208 | test "@abs floats" { |
| 204 | 209 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 205 | 210 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 206 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // Fails on lavapipe | |
| 211 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Fails on lavapipe | |
| 207 | 212 | |
| 208 | 213 | try comptime testAbsFloats(f16); |
| 209 | 214 | if (builtin.zig_backend != .stage2_riscv64) try testAbsFloats(f16); |
| ... | ... | @@ -212,9 +217,9 @@ test "@abs floats" { |
| 212 | 217 | try comptime testAbsFloats(f64); |
| 213 | 218 | try testAbsFloats(f64); |
| 214 | 219 | try comptime testAbsFloats(f80); |
| 215 | 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); | |
| 216 | 221 | try comptime testAbsFloats(f128); |
| 217 | 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); | |
| 218 | 223 | } |
| 219 | 224 | |
| 220 | 225 | fn testAbsFloats(comptime T: type) !void { |
| ... | ... | @@ -259,7 +264,7 @@ test "@abs int vectors" { |
| 259 | 264 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 260 | 265 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 261 | 266 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 262 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 267 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 263 | 268 | |
| 264 | 269 | try comptime testAbsIntVectors(1); |
| 265 | 270 | try testAbsIntVectors(1); |
| ... | ... | @@ -325,7 +330,7 @@ test "@abs unsigned int vectors" { |
| 325 | 330 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 326 | 331 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 327 | 332 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 328 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 333 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 329 | 334 | |
| 330 | 335 | try comptime testAbsUnsignedIntVectors(1); |
| 331 | 336 | try testAbsUnsignedIntVectors(1); |
| ... | ... | @@ -382,7 +387,7 @@ test "@abs float vectors" { |
| 382 | 387 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 383 | 388 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 384 | 389 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 385 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 390 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 386 | 391 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 387 | 392 | |
| 388 | 393 | @setEvalBranchQuota(2000); |
test/behavior/addrspace_and_linksection.zig+3-3| ... | ... | @@ -12,7 +12,7 @@ const var_linksection = linksections.?[1]; |
| 12 | 12 | const fn_linksection = linksections.?[2]; |
| 13 | 13 | |
| 14 | 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 | 17 | const S = struct { |
| 18 | 18 | const a: u32 addrspace(.generic) = 123; |
| ... | ... | @@ -49,7 +49,7 @@ test "addrspace and linksection on container-level const" { |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 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 | 54 | const S = struct { |
| 55 | 55 | var a: u32 addrspace(.generic) = 123; |
| ... | ... | @@ -83,7 +83,7 @@ test "addrspace and linksection on container-level var" { |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 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 | 88 | const S = struct { |
| 89 | 89 | fn f() addrspace(.generic) u32 { |
test/behavior/align.zig+27-23| ... | ... | @@ -7,7 +7,7 @@ const assert = std.debug.assert; |
| 7 | 7 | var foo: u8 align(4) = 100; |
| 8 | 8 | |
| 9 | 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 | 12 | comptime assert(@typeInfo(@TypeOf(&foo)).pointer.attrs.@"align" == 4); |
| 13 | 13 | comptime assert(@TypeOf(&foo) == *align(4) u8); |
| ... | ... | @@ -18,7 +18,7 @@ test "global variable alignment" { |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 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 | 23 | const S = struct { |
| 24 | 24 | var global: @This() = undefined; |
| ... | ... | @@ -30,7 +30,7 @@ test "large abi alignment of global" { |
| 30 | 30 | |
| 31 | 31 | test "large alignment of local constant" { |
| 32 | 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 | 34 | if (builtin.zig_backend == .stage2_c and builtin.target.abi == .msvc) return error.SkipZigTest; |
| 35 | 35 | |
| 36 | 36 | if (builtin.zig_backend == .stage2_x86_64 and builtin.os.tag == .windows) { |
| ... | ... | @@ -44,7 +44,7 @@ test "large alignment of local constant" { |
| 44 | 44 | |
| 45 | 45 | test "slicing array of length 1 can not assume runtime index is always zero" { |
| 46 | 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 | 49 | var runtime_index: usize = 1; |
| 50 | 50 | _ = &runtime_index; |
| ... | ... | @@ -55,7 +55,7 @@ test "slicing array of length 1 can not assume runtime index is always zero" { |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 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 | 60 | const A = *u32; |
| 61 | 61 | const B = *align(@alignOf(u32)) u32; |
| ... | ... | @@ -89,6 +89,8 @@ test "implicitly-aligned pointer is coercible to equivalent explicitly-aligned p |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | test "implicitly decreasing pointer alignment" { |
| 92 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 93 | ||
| 92 | 94 | const a: u32 align(4) = 3; |
| 93 | 95 | const b: u32 align(8) = 4; |
| 94 | 96 | try expect(addUnaligned(&a, &b) == 7); |
| ... | ... | @@ -240,7 +242,7 @@ test "alignment and size of structs with 128-bit fields" { |
| 240 | 242 | |
| 241 | 243 | test "implicitly decreasing slice alignment" { |
| 242 | 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 | 246 | const a: u32 align(4) = 3; |
| 245 | 247 | const b: u32 align(8) = 4; |
| 246 | 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 | 253 | |
| 252 | 254 | test "specifying alignment allows pointer cast" { |
| 253 | 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 | 258 | try testBytesAlign(0x33); |
| 257 | 259 | } |
| ... | ... | @@ -264,7 +266,7 @@ fn testBytesAlign(b: u8) !void { |
| 264 | 266 | test "@alignCast slices" { |
| 265 | 267 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 266 | 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 | 271 | var array align(4) = [_]u32{ 1, 1 }; |
| 270 | 272 | const slice = array[0..]; |
| ... | ... | @@ -279,6 +281,7 @@ fn sliceExpects4(slice: []align(4) u32) void { |
| 279 | 281 | } |
| 280 | 282 | |
| 281 | 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 | 285 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 283 | 286 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 284 | 287 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -292,7 +295,7 @@ test "page aligned array on stack" { |
| 292 | 295 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 293 | 296 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 294 | 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 | 299 | // Large alignment value to make it hard to accidentally pass. |
| 297 | 300 | var array align(0x1000) = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 }; |
| 298 | 301 | var number1: u8 align(16) = 42; |
| ... | ... | @@ -310,7 +313,7 @@ test "page aligned array on stack" { |
| 310 | 313 | test "function alignment" { |
| 311 | 314 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 312 | 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 | 318 | // function alignment is a compile error on wasm |
| 316 | 319 | if (native_arch.isWasm()) return error.SkipZigTest; |
| ... | ... | @@ -339,7 +342,7 @@ test "function alignment" { |
| 339 | 342 | test "implicitly decreasing fn alignment" { |
| 340 | 343 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 341 | 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 | 347 | // function alignment is a compile error on wasm |
| 345 | 348 | if (native_arch.isWasm()) return error.SkipZigTest; |
| ... | ... | @@ -362,7 +365,7 @@ fn alignedBig() align(16) i32 { |
| 362 | 365 | test "@alignCast functions" { |
| 363 | 366 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 364 | 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 | 370 | // function alignment is a compile error on wasm |
| 368 | 371 | if (native_arch.isWasm()) return error.SkipZigTest; |
| ... | ... | @@ -381,7 +384,7 @@ fn simple4() align(4) i32 { |
| 381 | 384 | |
| 382 | 385 | test "runtime-known array index has best alignment possible" { |
| 383 | 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 | 389 | // take full advantage of over-alignment |
| 387 | 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 | 433 | } |
| 431 | 434 | |
| 432 | 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 | 438 | const a = @alignOf(@TypeOf(nothing)); |
| 436 | 439 | |
| ... | ... | @@ -449,6 +452,7 @@ const DefaultAligned = struct { |
| 449 | 452 | }; |
| 450 | 453 | |
| 451 | 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 | 456 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 453 | 457 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 454 | 458 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -467,7 +471,7 @@ var default_aligned_global = DefaultAligned{ |
| 467 | 471 | }; |
| 468 | 472 | |
| 469 | 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 | 475 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 472 | 476 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 473 | 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 | 482 | test "struct field explicit alignment" { |
| 479 | 483 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 480 | 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 | 486 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 483 | 487 | |
| 484 | 488 | const S = struct { |
| ... | ... | @@ -498,7 +502,7 @@ test "struct field explicit alignment" { |
| 498 | 502 | test "align(N) on functions" { |
| 499 | 503 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 500 | 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 | 507 | if (builtin.zig_backend == .stage2_c) { |
| 504 | 508 | // https://github.com/ziglang/zig/issues/16845 |
| ... | ... | @@ -536,7 +540,7 @@ test "comptime alloc alignment" { |
| 536 | 540 | |
| 537 | 541 | test "@alignCast null" { |
| 538 | 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 | 545 | var ptr: ?*anyopaque = null; |
| 542 | 546 | _ = &ptr; |
| ... | ... | @@ -552,7 +556,7 @@ test "alignment of slice element" { |
| 552 | 556 | test "sub-aligned pointer field access" { |
| 553 | 557 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 554 | 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 | 561 | // Originally reported at https://github.com/ziglang/zig/issues/14904 |
| 558 | 562 | |
| ... | ... | @@ -570,7 +574,7 @@ test "sub-aligned pointer field access" { |
| 570 | 574 | } |
| 571 | 575 | |
| 572 | 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 | 578 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 575 | 579 | |
| 576 | 580 | const S = struct { arr: [0]usize = .{} }; |
| ... | ... | @@ -602,7 +606,7 @@ test "zero-bit fields in extern struct pad fields appropriately" { |
| 602 | 606 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 603 | 607 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 604 | 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 | 611 | const S = extern struct { |
| 608 | 612 | x: u8, |
| ... | ... | @@ -626,7 +630,7 @@ test "zero-bit fields in extern struct pad fields appropriately" { |
| 626 | 630 | } |
| 627 | 631 | |
| 628 | 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 | 635 | // This only succeeds on Thumb if we handle the Thumb bit correctly; if not, the `@ptrFromInt` |
| 632 | 636 | // will incorrectly trip an alignment safety check. |
| ... | ... | @@ -646,7 +650,7 @@ test "function pointer align mask" { |
| 646 | 650 | } |
| 647 | 651 | |
| 648 | 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 | 655 | const S = struct { |
| 652 | 656 | fn alignment() usize { |
test/behavior/alignof.zig+2-1| ... | ... | @@ -19,6 +19,7 @@ test "@alignOf(T) before referencing T" { |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | test "comparison of @alignOf(T) against zero" { |
| 22 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 22 | 23 | const T = struct { x: u32 }; |
| 23 | 24 | try expect(!(@alignOf(T) == 0)); |
| 24 | 25 | try expect(@alignOf(T) != 0); |
| ... | ... | @@ -29,7 +30,7 @@ test "comparison of @alignOf(T) against zero" { |
| 29 | 30 | } |
| 30 | 31 | |
| 31 | 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 | 35 | var buf: [1024]u8 align(64) = undefined; |
| 35 | 36 | var start: usize = 1; |
test/behavior/array.zig+52-36| ... | ... | @@ -7,7 +7,7 @@ const expect = testing.expect; |
| 7 | 7 | const expectEqual = testing.expectEqual; |
| 8 | 8 | |
| 9 | 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 | 12 | const a: u32 align(4) = 3; |
| 13 | 13 | const b: u32 align(8) = 4; |
| ... | ... | @@ -21,7 +21,7 @@ test "array to slice" { |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | test "arrays" { |
| 24 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 24 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 25 | 25 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 26 | 26 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 27 | 27 | |
| ... | ... | @@ -51,7 +51,7 @@ fn getArrayLen(a: []const u32) usize { |
| 51 | 51 | test "runtime array concat with comptime slice" { |
| 52 | 52 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 53 | 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 | 55 | var a: [1]u8 = .{1}; |
| 56 | 56 | const b = (comptime @as([]const u8, &.{0})) ++ &a; |
| 57 | 57 | const c = &a ++ (comptime @as([]const u8, &.{0})); |
| ... | ... | @@ -61,7 +61,7 @@ test "runtime array concat with comptime slice" { |
| 61 | 61 | |
| 62 | 62 | test "array concat with undefined" { |
| 63 | 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 | 66 | const S = struct { |
| 67 | 67 | fn doTheTest() !void { |
| ... | ... | @@ -83,7 +83,7 @@ test "array concat with undefined" { |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 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 | 87 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 88 | 88 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 89 | 89 | |
| ... | ... | @@ -99,7 +99,7 @@ test "array concat with tuple" { |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 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 | 105 | const array: [2]u64 = .{ 1, 2 }; |
| ... | ... | @@ -117,7 +117,7 @@ test "array concat with undefined tuple" { |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 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 | 122 | const a = 'a'; |
| 123 | 123 | var i: [4]u8 = [2]u8{ a, 'b' } ++ [2]u8{ 'c', 'd' }; |
| ... | ... | @@ -152,6 +152,7 @@ const ArrayDotLenConstExpr = struct { |
| 152 | 152 | const some_array = [_]u8{ 0, 1, 2, 3 }; |
| 153 | 153 | |
| 154 | 154 | test "array literal with specified size" { |
| 155 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 155 | 156 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 156 | 157 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 157 | 158 | |
| ... | ... | @@ -162,6 +163,7 @@ test "array literal with specified size" { |
| 162 | 163 | } |
| 163 | 164 | |
| 164 | 165 | test "array len field" { |
| 166 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 165 | 167 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 166 | 168 | |
| 167 | 169 | var arr = [4]u8{ 0, 0, 0, 0 }; |
| ... | ... | @@ -174,7 +176,7 @@ test "array len field" { |
| 174 | 176 | } |
| 175 | 177 | |
| 176 | 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 | 180 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 179 | 181 | |
| 180 | 182 | const S = struct { |
| ... | ... | @@ -211,7 +213,7 @@ test "void arrays" { |
| 211 | 213 | } |
| 212 | 214 | |
| 213 | 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 | 217 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 216 | 218 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 217 | 219 | |
| ... | ... | @@ -226,6 +228,7 @@ test "nested arrays of strings" { |
| 226 | 228 | } |
| 227 | 229 | |
| 228 | 230 | test "nested arrays of integers" { |
| 231 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 229 | 232 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 230 | 233 | |
| 231 | 234 | const array_of_numbers = [_][2]u8{ |
| ... | ... | @@ -240,6 +243,7 @@ test "nested arrays of integers" { |
| 240 | 243 | } |
| 241 | 244 | |
| 242 | 245 | test "implicit comptime in array type size" { |
| 246 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 243 | 247 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 244 | 248 | |
| 245 | 249 | var arr: [plusOne(10)]bool = undefined; |
| ... | ... | @@ -253,7 +257,7 @@ fn plusOne(x: u32) u32 { |
| 253 | 257 | |
| 254 | 258 | test "single-item pointer to array indexing and slicing" { |
| 255 | 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 | 262 | try testSingleItemPtrArrayIndexSlice(); |
| 259 | 263 | try comptime testSingleItemPtrArrayIndexSlice(); |
| ... | ... | @@ -279,7 +283,7 @@ fn doSomeMangling(array: *[4]u8) void { |
| 279 | 283 | |
| 280 | 284 | test "implicit cast zero sized array ptr to slice" { |
| 281 | 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 | 289 | var b = "".*; |
| ... | ... | @@ -294,6 +298,7 @@ test "implicit cast zero sized array ptr to slice" { |
| 294 | 298 | } |
| 295 | 299 | |
| 296 | 300 | test "anonymous list literal syntax" { |
| 301 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 297 | 302 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 298 | 303 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 299 | 304 | |
| ... | ... | @@ -315,7 +320,7 @@ var s_array: [8]Sub = undefined; |
| 315 | 320 | const Sub = struct { b: u8 }; |
| 316 | 321 | const Str = struct { a: []Sub }; |
| 317 | 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 | 324 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 320 | 325 | |
| 321 | 326 | var s = Str{ .a = s_array[0..] }; |
| ... | ... | @@ -330,7 +335,7 @@ test "set global var array via slice embedded in struct" { |
| 330 | 335 | } |
| 331 | 336 | |
| 332 | 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 | 339 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 335 | 340 | |
| 336 | 341 | try testImplicitCastSingleItemPtr(); |
| ... | ... | @@ -359,7 +364,7 @@ test "comptime evaluating function that takes array by value" { |
| 359 | 364 | } |
| 360 | 365 | |
| 361 | 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 | 368 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 364 | 369 | |
| 365 | 370 | var two: i32 = 2; |
| ... | ... | @@ -369,7 +374,7 @@ test "runtime initialize array elem and then implicit cast to slice" { |
| 369 | 374 | } |
| 370 | 375 | |
| 371 | 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 | 378 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 374 | 379 | |
| 375 | 380 | const S = struct { |
| ... | ... | @@ -396,7 +401,7 @@ test "array literal as argument to function" { |
| 396 | 401 | } |
| 397 | 402 | |
| 398 | 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 | 405 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 401 | 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 | 462 | } |
| 458 | 463 | |
| 459 | 464 | test "anonymous literal in array" { |
| 465 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 460 | 466 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 461 | 467 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 462 | 468 | |
| ... | ... | @@ -482,6 +488,7 @@ test "anonymous literal in array" { |
| 482 | 488 | } |
| 483 | 489 | |
| 484 | 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 | 492 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 486 | 493 | |
| 487 | 494 | const S = struct { |
| ... | ... | @@ -499,6 +506,7 @@ test "access the null element of a null terminated array" { |
| 499 | 506 | } |
| 500 | 507 | |
| 501 | 508 | test "type deduction for array subscript expression" { |
| 509 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 502 | 510 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 503 | 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 | 525 | } |
| 518 | 526 | |
| 519 | 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 | 529 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 522 | 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 | 550 | |
| 543 | 551 | test "type coercion of anon struct literal to array" { |
| 544 | 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 | 554 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 547 | 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 | 590 | } |
| 583 | 591 | |
| 584 | 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 | 594 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 587 | 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 | 620 | } |
| 613 | 621 | |
| 614 | 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 | 624 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 617 | 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 | 643 | } |
| 636 | 644 | |
| 637 | 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 | 648 | var c: u16 = 300; |
| 641 | 649 | _ = &c; |
| ... | ... | @@ -646,6 +654,7 @@ test "runtime initialized sentinel-terminated array literal" { |
| 646 | 654 | } |
| 647 | 655 | |
| 648 | 656 | test "array of array agregate init" { |
| 657 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 649 | 658 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 650 | 659 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 651 | 660 | |
| ... | ... | @@ -656,7 +665,7 @@ test "array of array agregate init" { |
| 656 | 665 | } |
| 657 | 666 | |
| 658 | 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 | 670 | const S = struct { |
| 662 | 671 | fn doTheTest(p: *const [5]u32) !void { |
| ... | ... | @@ -692,6 +701,7 @@ test "discarded array init preserves result location" { |
| 692 | 701 | } |
| 693 | 702 | |
| 694 | 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 | 705 | const x = .{ .foo = [2]u16{ |
| 696 | 706 | @intCast(10), |
| 697 | 707 | @intCast(20), |
| ... | ... | @@ -705,7 +715,7 @@ test "array init with no result location has result type" { |
| 705 | 715 | test "slicing array of zero-sized values" { |
| 706 | 716 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 707 | 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 | 720 | var arr: [32]u0 = undefined; |
| 711 | 721 | for (arr[0..]) |*zero| |
| ... | ... | @@ -715,6 +725,7 @@ test "slicing array of zero-sized values" { |
| 715 | 725 | } |
| 716 | 726 | |
| 717 | 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 | 729 | const S = struct { |
| 719 | 730 | // A function parameter has a result type, but no result pointer. |
| 720 | 731 | fn f(arr: [1]u32) u32 { |
| ... | ... | @@ -729,7 +740,7 @@ test "array init with no result pointer sets field result types" { |
| 729 | 740 | } |
| 730 | 741 | |
| 731 | 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 | 745 | var side_effects: u4 = 0; |
| 735 | 746 | const init = [4]u4{ |
| ... | ... | @@ -755,7 +766,7 @@ test "runtime side-effects in comptime-known array init" { |
| 755 | 766 | } |
| 756 | 767 | |
| 757 | 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 | 771 | var my_u32: u32 = 123; |
| 761 | 772 | var my_u64: u64 = 456; |
| ... | ... | @@ -770,7 +781,7 @@ test "slice initialized through reference to anonymous array init provides resul |
| 770 | 781 | } |
| 771 | 782 | |
| 772 | 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 | 786 | var my_u32: u32 = 123; |
| 776 | 787 | var my_u64: u64 = 456; |
| ... | ... | @@ -785,7 +796,7 @@ test "sentinel-terminated slice initialized through reference to anonymous array |
| 785 | 796 | } |
| 786 | 797 | |
| 787 | 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 | 800 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 790 | 801 | |
| 791 | 802 | var my_u32: u32 = 123; |
| ... | ... | @@ -804,7 +815,7 @@ test "many-item pointer initialized through reference to anonymous array init pr |
| 804 | 815 | } |
| 805 | 816 | |
| 806 | 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 | 819 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 809 | 820 | |
| 810 | 821 | var my_u32: u32 = 123; |
| ... | ... | @@ -824,7 +835,7 @@ test "many-item sentinel-terminated pointer initialized through reference to ano |
| 824 | 835 | } |
| 825 | 836 | |
| 826 | 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 | 840 | var my_u32: u32 = 123; |
| 830 | 841 | var my_u64: u64 = 456; |
| ... | ... | @@ -839,7 +850,7 @@ test "pointer to array initialized through reference to anonymous array init pro |
| 839 | 850 | } |
| 840 | 851 | |
| 841 | 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 | 855 | var my_u32: u32 = 123; |
| 845 | 856 | var my_u64: u64 = 456; |
| ... | ... | @@ -854,6 +865,7 @@ test "pointer to sentinel-terminated array initialized through reference to anon |
| 854 | 865 | } |
| 855 | 866 | |
| 856 | 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 | 869 | const Tuple = struct { u64, *const u32 }; |
| 858 | 870 | const foo: *const Tuple = &.{ |
| 859 | 871 | @intCast(12345), |
| ... | ... | @@ -864,6 +876,7 @@ test "tuple initialized through reference to anonymous array init provides resul |
| 864 | 876 | } |
| 865 | 877 | |
| 866 | 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 | 880 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 868 | 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 | 891 | |
| 879 | 892 | test "array initialized with string literal" { |
| 880 | 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 | 896 | const S = struct { |
| 884 | 897 | a: u32, |
| ... | ... | @@ -898,7 +911,7 @@ test "array initialized with string literal" { |
| 898 | 911 | } |
| 899 | 912 | |
| 900 | 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 | 915 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 903 | 916 | |
| 904 | 917 | const S = struct { |
| ... | ... | @@ -919,6 +932,7 @@ test "array initialized with array with sentinel" { |
| 919 | 932 | } |
| 920 | 933 | |
| 921 | 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 | 936 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 923 | 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 | 958 | |
| 945 | 959 | test "accessing multidimensional global array at comptime" { |
| 946 | 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 | 963 | const S = struct { |
| 950 | 964 | const array = [_][]const []const u8{ |
| ... | ... | @@ -958,6 +972,7 @@ test "accessing multidimensional global array at comptime" { |
| 958 | 972 | } |
| 959 | 973 | |
| 960 | 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 | 976 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 962 | 977 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 963 | 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 | 996 | } |
| 982 | 997 | |
| 983 | 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 | 1001 | var runtime: struct { array: [1]void, index: usize } = undefined; |
| 987 | 1002 | runtime = .{ .array = .{{}}, .index = 0 }; |
| ... | ... | @@ -1035,7 +1050,7 @@ test "initialize pointer to anyopaque with reference to empty array initializer" |
| 1035 | 1050 | } |
| 1036 | 1051 | |
| 1037 | 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 | 1055 | var rt: u32 = undefined; |
| 1041 | 1056 | rt = 42; |
| ... | ... | @@ -1048,6 +1063,7 @@ test "sentinel of runtime-known array initialization is populated" { |
| 1048 | 1063 | } |
| 1049 | 1064 | |
| 1050 | 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 | 1067 | const S = struct { |
| 1052 | 1068 | const Thing = [1]u32; |
| 1053 | 1069 | |
| ... | ... | @@ -1069,7 +1085,7 @@ test "resist alias of explicit copy of array passed as arg" { |
| 1069 | 1085 | } |
| 1070 | 1086 | |
| 1071 | 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 | 1090 | const S = struct { |
| 1075 | 1091 | fn doTheTest(x: u8) !void { |
test/behavior/asm.zig+3-3| ... | ... | @@ -18,7 +18,7 @@ comptime { |
| 18 | 18 | \\.type this_is_my_alias, @function; |
| 19 | 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 | 22 | asm ( |
| 23 | 23 | \\%a = OpString "hello there" |
| 24 | 24 | ); |
| ... | ... | @@ -43,7 +43,7 @@ test "output constraint modifiers" { |
| 43 | 43 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 44 | 44 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 45 | 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 | 47 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 48 | 48 | |
| 49 | 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 | 65 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 66 | 66 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 67 | 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 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 70 | 70 | |
| 71 | 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 | 14 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 15 | 15 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 16 | 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 | 19 | try testCmpxchg(); |
| 20 | 20 | try comptime testCmpxchg(); |
| ... | ... | @@ -41,7 +41,7 @@ test "atomicrmw and atomicload" { |
| 41 | 41 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 42 | 42 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 43 | 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 | 45 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 46 | 46 | |
| 47 | 47 | var data: u8 = 200; |
| ... | ... | @@ -70,7 +70,7 @@ test "cmpxchg with ptr" { |
| 70 | 70 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 71 | 71 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 72 | 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 | 74 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 75 | 75 | |
| 76 | 76 | var data1: i32 = 1234; |
| ... | ... | @@ -96,7 +96,7 @@ test "cmpxchg with ignored result" { |
| 96 | 96 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 97 | 97 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 98 | 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 | 101 | var x: i32 = 1234; |
| 102 | 102 | |
| ... | ... | @@ -141,7 +141,7 @@ test "cmpxchg on a global variable" { |
| 141 | 141 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 142 | 142 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 143 | 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 | 146 | _ = @cmpxchgStrong(u32, &a_global_variable, 1234, 42, .acquire, .monotonic); |
| 147 | 147 | try expect(a_global_variable == 42); |
| ... | ... | @@ -151,7 +151,7 @@ test "atomic load and rmw with enum" { |
| 151 | 151 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 152 | 152 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 153 | 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 | 155 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 156 | 156 | |
| 157 | 157 | const Value = enum(u8) { a, b, c }; |
| ... | ... | @@ -169,7 +169,7 @@ test "atomic store" { |
| 169 | 169 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 170 | 170 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 171 | 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 | 174 | try comptime testAtomicStore(); |
| 175 | 175 | try testAtomicStore(); |
| ... | ... | @@ -188,7 +188,7 @@ test "atomicrmw with floats" { |
| 188 | 188 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 189 | 189 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 190 | 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 | 192 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 193 | 193 | |
| 194 | 194 | try testAtomicRmwFloat(); |
| ... | ... | @@ -214,7 +214,7 @@ test "atomicrmw with ints" { |
| 214 | 214 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 215 | 215 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 216 | 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 | 218 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 219 | 219 | |
| 220 | 220 | try testAtomicRmwInts(); |
| ... | ... | @@ -357,7 +357,7 @@ test "atomics with different types" { |
| 357 | 357 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 358 | 358 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 359 | 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 | 361 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 362 | 362 | |
| 363 | 363 | try testAtomicsWithType(bool, true, false); |
| ... | ... | @@ -411,7 +411,7 @@ fn testAtomicsWithPackedStruct(comptime T: type, a: T, b: T) !void { |
| 411 | 411 | test "return @atomicStore, using it as a void value" { |
| 412 | 412 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 413 | 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 | 416 | const S = struct { |
| 417 | 417 | const A = struct { |
test/behavior/backing_int.zig+11-3| ... | ... | @@ -46,6 +46,8 @@ const E5 = enum(u0) { |
| 46 | 46 | }; |
| 47 | 47 | |
| 48 | 48 | test "@backingInt with enums" { |
| 49 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 50 | ||
| 49 | 51 | const static = struct { |
| 50 | 52 | fn doTheTest(v1: E1, v2: E2, v3: E3, v4: E4, v5: E5) !void { |
| 51 | 53 | const b1 = @backingInt(v1); |
| ... | ... | @@ -74,6 +76,8 @@ test "@backingInt with enums" { |
| 74 | 76 | } |
| 75 | 77 | |
| 76 | 78 | test "@fromBackingInt with enums" { |
| 79 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 80 | ||
| 77 | 81 | const static = struct { |
| 78 | 82 | fn doTheTest( |
| 79 | 83 | b1: @typeInfo(E1).@"enum".tag_type, |
| ... | ... | @@ -137,7 +141,7 @@ const T5 = union(E5) { |
| 137 | 141 | }; |
| 138 | 142 | |
| 139 | 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 | 146 | const static = struct { |
| 143 | 147 | fn doTheTest(v1: T1, v2: T2, v4: T4, v5: T5) !void { |
| ... | ... | @@ -208,6 +212,8 @@ const S5 = packed struct(u0) { |
| 208 | 212 | }; |
| 209 | 213 | |
| 210 | 214 | test "@backingInt with packed structs" { |
| 215 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 216 | ||
| 211 | 217 | const static = struct { |
| 212 | 218 | fn doTheTest(v1: S1, v2: S2, v3: S3, v4: S4, v5: S5) !void { |
| 213 | 219 | const b1 = @backingInt(v1); |
| ... | ... | @@ -236,6 +242,8 @@ test "@backingInt with packed structs" { |
| 236 | 242 | } |
| 237 | 243 | |
| 238 | 244 | test "@fromBackingInt with packed structs" { |
| 245 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 246 | ||
| 239 | 247 | const static = struct { |
| 240 | 248 | fn doTheTest( |
| 241 | 249 | b1: @typeInfo(S1).@"struct".backing_integer.?, |
| ... | ... | @@ -313,7 +321,7 @@ const U5 = packed union(u0) { |
| 313 | 321 | }; |
| 314 | 322 | |
| 315 | 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 | 326 | const static = struct { |
| 319 | 327 | fn doTheTest(v1: U1, v2: U2, v3: U3, v4: U4, v5: U5) !void { |
| ... | ... | @@ -343,7 +351,7 @@ test "@backingInt with packed unions" { |
| 343 | 351 | } |
| 344 | 352 | |
| 345 | 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 | 356 | const static = struct { |
| 349 | 357 | fn doTheTest( |
test/behavior/basic.zig+70-32| ... | ... | @@ -24,6 +24,7 @@ fn testTruncate(x: u32) u8 { |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 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 | 28 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 28 | 29 | |
| 29 | 30 | try testTrunc(u32, u1, 0b10101, 0b1); |
| ... | ... | @@ -38,6 +39,7 @@ test "truncate to non-power-of-two integers" { |
| 38 | 39 | } |
| 39 | 40 | |
| 40 | 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 | 43 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 42 | 44 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 43 | 45 | |
| ... | ... | @@ -60,7 +62,7 @@ const g1: i32 = 1233 + 1; |
| 60 | 62 | var g2: i32 = 0; |
| 61 | 63 | |
| 62 | 64 | test "global variables" { |
| 63 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 65 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 64 | 66 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 65 | 67 | |
| 66 | 68 | try expect(g2 == 0); |
| ... | ... | @@ -80,6 +82,8 @@ test "type equality" { |
| 80 | 82 | } |
| 81 | 83 | |
| 82 | 84 | test "pointer dereferencing" { |
| 85 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 86 | ||
| 83 | 87 | var x = @as(i32, 3); |
| 84 | 88 | const y = &x; |
| 85 | 89 | |
| ... | ... | @@ -137,6 +141,8 @@ test "function branch hints" { |
| 137 | 141 | } |
| 138 | 142 | |
| 139 | 143 | test "if branch hints" { |
| 144 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 145 | ||
| 140 | 146 | var t: bool = undefined; |
| 141 | 147 | t = true; |
| 142 | 148 | if (t) { |
| ... | ... | @@ -147,6 +153,8 @@ test "if branch hints" { |
| 147 | 153 | } |
| 148 | 154 | |
| 149 | 155 | test "switch branch hints" { |
| 156 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 157 | ||
| 150 | 158 | var t: bool = undefined; |
| 151 | 159 | t = true; |
| 152 | 160 | switch (t) { |
| ... | ... | @@ -160,6 +168,8 @@ test "switch branch hints" { |
| 160 | 168 | } |
| 161 | 169 | |
| 162 | 170 | test "orelse branch hints" { |
| 171 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 172 | ||
| 163 | 173 | var x: ?u32 = undefined; |
| 164 | 174 | x = 123; |
| 165 | 175 | const val = x orelse val: { |
| ... | ... | @@ -170,6 +180,8 @@ test "orelse branch hints" { |
| 170 | 180 | } |
| 171 | 181 | |
| 172 | 182 | test "catch branch hints" { |
| 183 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 184 | ||
| 173 | 185 | var x: error{Bad}!u32 = undefined; |
| 174 | 186 | x = 123; |
| 175 | 187 | const val = x catch val: { |
| ... | ... | @@ -180,6 +192,8 @@ test "catch branch hints" { |
| 180 | 192 | } |
| 181 | 193 | |
| 182 | 194 | test "and/or branch hints" { |
| 195 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 196 | ||
| 183 | 197 | var t: bool = undefined; |
| 184 | 198 | t = true; |
| 185 | 199 | try expect(t or b: { |
| ... | ... | @@ -207,14 +221,14 @@ fn first4KeysOfHomeRow() []const u8 { |
| 207 | 221 | } |
| 208 | 222 | |
| 209 | 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 | 225 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 212 | 226 | |
| 213 | 227 | try expect(mem.eql(u8, first4KeysOfHomeRow(), "aoeu")); |
| 214 | 228 | } |
| 215 | 229 | |
| 216 | 230 | test "hex escape" { |
| 217 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 231 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 218 | 232 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 219 | 233 | |
| 220 | 234 | try expect(mem.eql(u8, "\x68\x65\x6c\x6c\x6f", "hello")); |
| ... | ... | @@ -222,7 +236,7 @@ test "hex escape" { |
| 222 | 236 | |
| 223 | 237 | test "multiline string" { |
| 224 | 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 | 241 | const s1 = |
| 228 | 242 | \\one |
| ... | ... | @@ -235,7 +249,7 @@ test "multiline string" { |
| 235 | 249 | |
| 236 | 250 | test "multiline string comments at start" { |
| 237 | 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 | 254 | const s1 = |
| 241 | 255 | //\\one |
| ... | ... | @@ -248,7 +262,7 @@ test "multiline string comments at start" { |
| 248 | 262 | |
| 249 | 263 | test "multiline string comments at end" { |
| 250 | 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 | 267 | const s1 = |
| 254 | 268 | \\one |
| ... | ... | @@ -261,7 +275,7 @@ test "multiline string comments at end" { |
| 261 | 275 | |
| 262 | 276 | test "multiline string comments in middle" { |
| 263 | 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 | 280 | const s1 = |
| 267 | 281 | \\one |
| ... | ... | @@ -274,7 +288,7 @@ test "multiline string comments in middle" { |
| 274 | 288 | |
| 275 | 289 | test "multiline string comments at multiple places" { |
| 276 | 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 | 293 | const s1 = |
| 280 | 294 | \\one |
| ... | ... | @@ -288,7 +302,7 @@ test "multiline string comments at multiple places" { |
| 288 | 302 | } |
| 289 | 303 | |
| 290 | 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 | 307 | try expect(mem.eql(u8, "OK" ++ " IT " ++ "WORKED", "OK IT WORKED")); |
| 294 | 308 | } |
| ... | ... | @@ -302,6 +316,7 @@ test "compile time global reinterpret" { |
| 302 | 316 | } |
| 303 | 317 | |
| 304 | 318 | test "cast undefined" { |
| 319 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 305 | 320 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 306 | 321 | |
| 307 | 322 | const array: [100]u8 = undefined; |
| ... | ... | @@ -372,7 +387,8 @@ fn fB() []const u8 { |
| 372 | 387 | |
| 373 | 388 | test "call function pointer in struct" { |
| 374 | 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 | 392 | try expect(mem.eql(u8, f3(true), "a")); |
| 377 | 393 | try expect(mem.eql(u8, f3(false), "b")); |
| 378 | 394 | } |
| ... | ... | @@ -394,6 +410,7 @@ const FnPtrWrapper = struct { |
| 394 | 410 | }; |
| 395 | 411 | |
| 396 | 412 | test "const ptr from var variable" { |
| 413 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 397 | 414 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 398 | 415 | |
| 399 | 416 | var x: u64 = undefined; |
| ... | ... | @@ -412,7 +429,7 @@ fn copy(src: *const u64, dst: *u64) void { |
| 412 | 429 | test "call result of if else expression" { |
| 413 | 430 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 414 | 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 | 434 | try expect(mem.eql(u8, f2(true), "a")); |
| 418 | 435 | try expect(mem.eql(u8, f2(false), "b")); |
| ... | ... | @@ -423,7 +440,7 @@ fn f2(x: bool) []const u8 { |
| 423 | 440 | |
| 424 | 441 | const OpaqueA = opaque {}; |
| 425 | 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 | 445 | var x: i32 = 1234; |
| 429 | 446 | _ = hereIsAnOpaqueType(@as(*OpaqueA, @ptrCast(&x))); |
| ... | ... | @@ -446,7 +463,7 @@ fn testTakeAddressOfParameter(f: f32) !void { |
| 446 | 463 | } |
| 447 | 464 | |
| 448 | 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 | 468 | try testPointerToVoidReturnType(); |
| 452 | 469 | } |
| ... | ... | @@ -462,7 +479,7 @@ fn testPointerToVoidReturnType2() *const void { |
| 462 | 479 | test "array 2D const double ptr" { |
| 463 | 480 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 464 | 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 | 484 | const rect_2d_vertexes = [_][1]f32{ |
| 468 | 485 | [_]f32{1.0}, |
| ... | ... | @@ -474,7 +491,7 @@ test "array 2D const double ptr" { |
| 474 | 491 | test "array 2D const double ptr with offset" { |
| 475 | 492 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 476 | 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 | 496 | const rect_2d_vertexes = [_][2]f32{ |
| 480 | 497 | [_]f32{ 3.0, 4.239 }, |
| ... | ... | @@ -486,7 +503,7 @@ test "array 2D const double ptr with offset" { |
| 486 | 503 | test "array 3D const double ptr with offset" { |
| 487 | 504 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 488 | 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 | 508 | const rect_3d_vertexes = [_][2][2]f32{ |
| 492 | 509 | [_][2]f32{ |
| ... | ... | @@ -519,6 +536,7 @@ fn nine() u8 { |
| 519 | 536 | } |
| 520 | 537 | |
| 521 | 538 | test "struct inside function" { |
| 539 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 522 | 540 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 523 | 541 | |
| 524 | 542 | try testStructInFn(); |
| ... | ... | @@ -541,7 +559,7 @@ fn testStructInFn() !void { |
| 541 | 559 | |
| 542 | 560 | test "fn call returning scalar optional in equality expression" { |
| 543 | 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 | 564 | try expect(getNull() == null); |
| 547 | 565 | } |
| ... | ... | @@ -553,7 +571,7 @@ fn getNull() ?*i32 { |
| 553 | 571 | test "global variable assignment with optional unwrapping with var initialized to undefined" { |
| 554 | 572 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 555 | 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 | 576 | const S = struct { |
| 559 | 577 | var data: i32 = 1234; |
| ... | ... | @@ -570,6 +588,7 @@ test "global variable assignment with optional unwrapping with var initialized t |
| 570 | 588 | var global_foo: *i32 = undefined; |
| 571 | 589 | |
| 572 | 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 | 592 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 574 | 593 | |
| 575 | 594 | const S = struct { |
| ... | ... | @@ -610,6 +629,8 @@ fn ZA() type { |
| 610 | 629 | } |
| 611 | 630 | |
| 612 | 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 | 634 | const S = struct { |
| 614 | 635 | const @"u8" = u16; |
| 615 | 636 | const alias = @"u8"; |
| ... | ... | @@ -636,12 +657,14 @@ fn emptyFn() void {} |
| 636 | 657 | |
| 637 | 658 | const addr1 = @as(*const u8, @ptrCast(&emptyFn)); |
| 638 | 659 | test "comptime cast fn to ptr" { |
| 660 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 661 | ||
| 639 | 662 | const addr2 = @as(*const u8, @ptrCast(&emptyFn)); |
| 640 | 663 | comptime assert(addr1 == addr2); |
| 641 | 664 | } |
| 642 | 665 | |
| 643 | 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 | 669 | var a = &emptyFn; |
| 647 | 670 | _ = &a; |
| ... | ... | @@ -649,7 +672,7 @@ test "equality compare fn ptrs" { |
| 649 | 672 | } |
| 650 | 673 | |
| 651 | 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 | 677 | const S = struct { |
| 655 | 678 | const A = struct { |
| ... | ... | @@ -668,7 +691,7 @@ test "self reference through fn ptr field" { |
| 668 | 691 | |
| 669 | 692 | test "global variable initialized to global variable array element" { |
| 670 | 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 | 696 | try expect(global_ptr == &gdt[0]); |
| 674 | 697 | } |
| ... | ... | @@ -682,7 +705,7 @@ var gdt = [_]GDTEntry{ |
| 682 | 705 | var global_ptr = &gdt[0]; |
| 683 | 706 | |
| 684 | 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 | 709 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 687 | 710 | |
| 688 | 711 | const S = struct { |
| ... | ... | @@ -701,7 +724,7 @@ test "global constant is loaded with a runtime-known index" { |
| 701 | 724 | } |
| 702 | 725 | |
| 703 | 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 | 729 | const s1 = |
| 707 | 730 | \\one |
| ... | ... | @@ -715,7 +738,7 @@ test "multiline string literal is null terminated" { |
| 715 | 738 | test "string escapes" { |
| 716 | 739 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 717 | 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 | 743 | try expectEqualStrings("\"", "\x22"); |
| 721 | 744 | try expectEqualStrings("\'", "\x27"); |
| ... | ... | @@ -733,7 +756,7 @@ test "explicit cast optional pointers" { |
| 733 | 756 | } |
| 734 | 757 | |
| 735 | 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 | 761 | const a = @as([]const u8, "a"); |
| 739 | 762 | const b = &a; |
| ... | ... | @@ -744,6 +767,7 @@ fn ptrEql(a: *const []const u8, b: *const []const u8) bool { |
| 744 | 767 | } |
| 745 | 768 | |
| 746 | 769 | test "string concatenation" { |
| 770 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 747 | 771 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 748 | 772 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 749 | 773 | |
| ... | ... | @@ -766,6 +790,7 @@ test "string concatenation" { |
| 766 | 790 | } |
| 767 | 791 | |
| 768 | 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 | 794 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 770 | 795 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 771 | 796 | |
| ... | ... | @@ -782,7 +807,7 @@ fn maybe(x: bool) anyerror!?u32 { |
| 782 | 807 | |
| 783 | 808 | test "auto created variables have correct alignment" { |
| 784 | 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 | 812 | const S = struct { |
| 788 | 813 | fn foo(str: [*]const u8) u32 { |
| ... | ... | @@ -799,7 +824,7 @@ test "auto created variables have correct alignment" { |
| 799 | 824 | test "extern variable with non-pointer opaque type" { |
| 800 | 825 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 801 | 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 | 829 | @export(&var_to_export, .{ .name = "opaque_extern_var" }); |
| 805 | 830 | try expect(@as(*align(1) u32, @ptrCast(&opaque_extern_var)).* == 42); |
| ... | ... | @@ -840,6 +865,7 @@ test "if expression type coercion" { |
| 840 | 865 | } |
| 841 | 866 | |
| 842 | 867 | test "discarding the result of various expressions" { |
| 868 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 843 | 869 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 844 | 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 | 938 | } |
| 913 | 939 | |
| 914 | 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 | 942 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 916 | 943 | |
| 917 | 944 | const S = struct { |
| ... | ... | @@ -936,6 +963,7 @@ test "vector initialized with array init syntax has proper type" { |
| 936 | 963 | } |
| 937 | 964 | |
| 938 | 965 | test "weird array and tuple initializations" { |
| 966 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 939 | 967 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 940 | 968 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 941 | 969 | |
| ... | ... | @@ -1054,6 +1082,7 @@ comptime { |
| 1054 | 1082 | } |
| 1055 | 1083 | |
| 1056 | 1084 | test "switch inside @as gets correct type" { |
| 1085 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1057 | 1086 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1058 | 1087 | |
| 1059 | 1088 | var a: u32 = 0; |
| ... | ... | @@ -1078,7 +1107,7 @@ test "inline call of function with a switch inside the return statement" { |
| 1078 | 1107 | } |
| 1079 | 1108 | |
| 1080 | 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 | 1112 | const S = struct { |
| 1084 | 1113 | const Thing = struct {}; |
| ... | ... | @@ -1100,6 +1129,7 @@ test "returning an opaque type from a function" { |
| 1100 | 1129 | } |
| 1101 | 1130 | |
| 1102 | 1131 | test "orelse coercion as function argument" { |
| 1132 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1103 | 1133 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1104 | 1134 | |
| 1105 | 1135 | const Loc = struct { start: i32 = -1 }; |
| ... | ... | @@ -1118,7 +1148,7 @@ test "orelse coercion as function argument" { |
| 1118 | 1148 | } |
| 1119 | 1149 | |
| 1120 | 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 | 1153 | const S = struct { |
| 1124 | 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 | 1167 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1138 | 1168 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 1139 | 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 | 1171 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1142 | 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 | 1241 | } |
| 1212 | 1242 | |
| 1213 | 1243 | test "integer compare <= 64 bits" { |
| 1244 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1245 | ||
| 1214 | 1246 | inline for (.{ u8, u16, u32, u64, usize, u10, u20, u30, u60 }) |T| { |
| 1215 | 1247 | try testUnsignedCmp(T); |
| 1216 | 1248 | try comptime testUnsignedCmp(T); |
| ... | ... | @@ -1222,6 +1254,7 @@ test "integer compare <= 64 bits" { |
| 1222 | 1254 | } |
| 1223 | 1255 | |
| 1224 | 1256 | test "integer compare <= 128 bits" { |
| 1257 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1225 | 1258 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1226 | 1259 | |
| 1227 | 1260 | inline for (.{ u65, u96, u127, u128 }) |T| { |
| ... | ... | @@ -1235,6 +1268,7 @@ test "integer compare <= 128 bits" { |
| 1235 | 1268 | } |
| 1236 | 1269 | |
| 1237 | 1270 | test "integer compare > 128 bits" { |
| 1271 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1238 | 1272 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1239 | 1273 | |
| 1240 | 1274 | inline for (.{ u129, u255, u512, u800 }) |T| { |
| ... | ... | @@ -1248,6 +1282,7 @@ test "integer compare > 128 bits" { |
| 1248 | 1282 | } |
| 1249 | 1283 | |
| 1250 | 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 | 1286 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1252 | 1287 | |
| 1253 | 1288 | const Crasher = struct { |
| ... | ... | @@ -1332,7 +1367,7 @@ test "const inferred array of slices" { |
| 1332 | 1367 | |
| 1333 | 1368 | test "var inferred array of slices" { |
| 1334 | 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 | 1372 | const T = struct { v: bool }; |
| 1338 | 1373 | |
| ... | ... | @@ -1355,6 +1390,7 @@ test "copy array of self-referential struct" { |
| 1355 | 1390 | } |
| 1356 | 1391 | |
| 1357 | 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 | 1394 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1359 | 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 | 1428 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1393 | 1429 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1394 | 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 | 1432 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1397 | 1433 | |
| 1398 | 1434 | try expect(@sizeOf(u24) == 4); |
| ... | ... | @@ -1419,6 +1455,8 @@ test "allocation and looping over 3-byte integer" { |
| 1419 | 1455 | } |
| 1420 | 1456 | |
| 1421 | 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 | 1460 | const S = struct { |
| 1423 | 1461 | arr: [1]u32 = .{0}, |
| 1424 | 1462 | fn doTheTest(self: *@This()) !void { |
test/behavior/bit_shifting.zig+3-3| ... | ... | @@ -65,7 +65,7 @@ test "sharded table" { |
| 65 | 65 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 66 | 66 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 67 | 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 | 70 | // realistic 16-way sharding |
| 71 | 71 | try testShardedTable(u32, 4, 8); |
| ... | ... | @@ -115,7 +115,7 @@ test "Saturating Shift Left where lhs is of a computed type" { |
| 115 | 115 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 116 | 116 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 117 | 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 | 119 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 120 | 120 | |
| 121 | 121 | const S = struct { |
| ... | ... | @@ -148,7 +148,7 @@ test "Saturating Shift Left where lhs is of a computed type" { |
| 148 | 148 | test "Saturating Shift Left" { |
| 149 | 149 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 150 | 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 | 152 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 153 | 153 | |
| 154 | 154 | const S = struct { |
test/behavior/bitcast.zig+19-14| ... | ... | @@ -9,6 +9,7 @@ const minInt = std.math.minInt; |
| 9 | 9 | const native_endian = builtin.target.cpu.arch.endian(); |
| 10 | 10 | |
| 11 | 11 | test "@bitCast iX -> uX (32, 64)" { |
| 12 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 12 | 13 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 13 | 14 | |
| 14 | 15 | const bit_values = [_]usize{ 32, 64 }; |
| ... | ... | @@ -20,6 +21,7 @@ test "@bitCast iX -> uX (32, 64)" { |
| 20 | 21 | } |
| 21 | 22 | |
| 22 | 23 | test "@bitCast iX -> uX (8, 16, 128)" { |
| 24 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 23 | 25 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 24 | 26 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 25 | 27 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -32,6 +34,7 @@ test "@bitCast iX -> uX (8, 16, 128)" { |
| 32 | 34 | } |
| 33 | 35 | |
| 34 | 36 | test "@bitCast iX -> uX exotic integers" { |
| 37 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 35 | 38 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 36 | 39 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 37 | 40 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -98,7 +101,7 @@ test "bitcast literal [4]u8 param to u32" { |
| 98 | 101 | } |
| 99 | 102 | |
| 100 | 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 | 106 | var y: u16 = 0x55AA; |
| 104 | 107 | _ = &y; |
| ... | ... | @@ -107,7 +110,7 @@ test "bitcast generates a temporary value" { |
| 107 | 110 | } |
| 108 | 111 | |
| 109 | 112 | test "@bitCast packed structs at runtime and comptime" { |
| 110 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 113 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 111 | 114 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 112 | 115 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 113 | 116 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -135,7 +138,7 @@ test "@bitCast packed structs at runtime and comptime" { |
| 135 | 138 | } |
| 136 | 139 | |
| 137 | 140 | test "bitcast packed struct to integer and back" { |
| 138 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 141 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 139 | 142 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 140 | 143 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 141 | 144 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -159,6 +162,7 @@ test "bitcast packed struct to integer and back" { |
| 159 | 162 | } |
| 160 | 163 | |
| 161 | 164 | test "implicit cast to error union by returning" { |
| 165 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 162 | 166 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 163 | 167 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 164 | 168 | |
| ... | ... | @@ -213,7 +217,7 @@ test "@bitCast packed struct of floats" { |
| 213 | 217 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 214 | 218 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 215 | 219 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 216 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 220 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 217 | 221 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 218 | 222 | |
| 219 | 223 | const Foo = packed struct { |
| ... | ... | @@ -249,7 +253,7 @@ test "comptime @bitCast packed struct to int and back" { |
| 249 | 253 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 250 | 254 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 251 | 255 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 252 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 256 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 253 | 257 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 254 | 258 | |
| 255 | 259 | const S = packed struct { |
| ... | ... | @@ -282,7 +286,7 @@ test "comptime @bitCast packed struct to int and back" { |
| 282 | 286 | test "bitcast vector to integer and back" { |
| 283 | 287 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 284 | 288 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 285 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 289 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 286 | 290 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 287 | 291 | |
| 288 | 292 | var vec: @Vector(16, bool) = @splat(true); |
| ... | ... | @@ -314,6 +318,7 @@ test "bitcast vector to integer and back" { |
| 314 | 318 | } |
| 315 | 319 | |
| 316 | 320 | test "bitcast vector elementwise" { |
| 321 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 317 | 322 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 318 | 323 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 319 | 324 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -357,7 +362,7 @@ fn bitCastWrapper128(x: f128) u128 { |
| 357 | 362 | } |
| 358 | 363 | test "bitcast nan float does not modify signaling bit" { |
| 359 | 364 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 360 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 365 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 361 | 366 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 362 | 367 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isPowerPC()) return error.SkipZigTest; |
| 363 | 368 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| ... | ... | @@ -411,7 +416,7 @@ test "bitcast nan float does not modify signaling bit" { |
| 411 | 416 | test "@bitCast of packed struct of bools all true" { |
| 412 | 417 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 413 | 418 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 414 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | |
| 419 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO | |
| 415 | 420 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 416 | 421 | |
| 417 | 422 | const P = packed struct { |
| ... | ... | @@ -431,7 +436,7 @@ test "@bitCast of packed struct of bools all true" { |
| 431 | 436 | test "@bitCast of packed struct of bools all false" { |
| 432 | 437 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 433 | 438 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 434 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | |
| 439 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO | |
| 435 | 440 | |
| 436 | 441 | const P = packed struct { |
| 437 | 442 | b0: bool, |
| ... | ... | @@ -480,7 +485,7 @@ test "@bitCast of packed struct with void field and multiple integers" { |
| 480 | 485 | } |
| 481 | 486 | |
| 482 | 487 | test "@bitCast vector to array with different element size" { |
| 483 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 488 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 484 | 489 | |
| 485 | 490 | const static = struct { |
| 486 | 491 | fn doTheTest(v: @Vector(4, u5)) !void { |
| ... | ... | @@ -505,7 +510,7 @@ test "@bitCast vector to array with different element size" { |
| 505 | 510 | } |
| 506 | 511 | |
| 507 | 512 | test "@bitCast packed struct to array of bits" { |
| 508 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 513 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 509 | 514 | |
| 510 | 515 | const S = packed struct(u16) { |
| 511 | 516 | foo: u5, |
| ... | ... | @@ -553,7 +558,7 @@ test "@bitCast packed struct to array of bits" { |
| 553 | 558 | } |
| 554 | 559 | |
| 555 | 560 | test "@bitCast nested arrays of vectors" { |
| 556 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 561 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 557 | 562 | |
| 558 | 563 | const Src = [2][2]@Vector(4, u5); |
| 559 | 564 | const Dest = [5]@Vector(2, u8); |
| ... | ... | @@ -590,7 +595,7 @@ test "@bitCast nested arrays of vectors" { |
| 590 | 595 | } |
| 591 | 596 | |
| 592 | 597 | test "@bitCast nested arrays of bool to scalar" { |
| 593 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 598 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 594 | 599 | |
| 595 | 600 | const static = struct { |
| 596 | 601 | fn doTheTest(src: [4][4]bool) !void { |
| ... | ... | @@ -609,7 +614,7 @@ test "@bitCast nested arrays of bool to scalar" { |
| 609 | 614 | } |
| 610 | 615 | |
| 611 | 616 | test "@bitCast deeply nested arrays to scalar" { |
| 612 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 617 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 613 | 618 | |
| 614 | 619 | const static = struct { |
| 615 | 620 | fn doTheTest(src: [2][1][3][5]u4) !void { |
test/behavior/bitreverse.zig+4-4| ... | ... | @@ -11,7 +11,7 @@ test "@bitReverse" { |
| 11 | 11 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 12 | 12 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 13 | 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 | 15 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 16 | 16 | |
| 17 | 17 | try comptime testBitReverse(); |
| ... | ... | @@ -124,7 +124,7 @@ test "bitReverse vectors u8" { |
| 124 | 124 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 125 | 125 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 126 | 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 | 128 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 129 | 129 | |
| 130 | 130 | try comptime vector8(); |
| ... | ... | @@ -143,7 +143,7 @@ test "bitReverse vectors u16" { |
| 143 | 143 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 144 | 144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 145 | 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 | 147 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 148 | 148 | |
| 149 | 149 | try comptime vector16(); |
| ... | ... | @@ -162,7 +162,7 @@ test "bitReverse vectors u24" { |
| 162 | 162 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 163 | 163 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 164 | 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 | 166 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 167 | 167 | |
| 168 | 168 | try comptime vector24(); |
test/behavior/bool.zig+5| ... | ... | @@ -9,6 +9,7 @@ test "bool literals" { |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | test "cast bool to int" { |
| 12 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 12 | 13 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 13 | 14 | |
| 14 | 15 | const t = true; |
| ... | ... | @@ -48,6 +49,8 @@ test "compile time bool not" { |
| 48 | 49 | } |
| 49 | 50 | |
| 50 | 51 | test "short circuit" { |
| 52 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 53 | ||
| 51 | 54 | try testShortCircuit(false, true); |
| 52 | 55 | try comptime testShortCircuit(false, true); |
| 53 | 56 | } |
| ... | ... | @@ -92,6 +95,8 @@ fn testShortCircuit(f: bool, t: bool) !void { |
| 92 | 95 | } |
| 93 | 96 | |
| 94 | 97 | test "or with noreturn operand" { |
| 98 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 99 | ||
| 95 | 100 | const S = struct { |
| 96 | 101 | fn foo(a: u32, b: u32) bool { |
| 97 | 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 | 8 | test { |
| 9 | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 10 | 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 | 13 | var val: u8 = undefined; |
| 14 | 14 | try testing.expectEqual({}, @atomicStore(u8, &val, 0, .unordered)); |
test/behavior/byteswap.zig+5-5| ... | ... | @@ -6,7 +6,7 @@ test "@byteSwap integers" { |
| 6 | 6 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 7 | 7 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 8 | 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 | 11 | const ByteSwapIntTest = struct { |
| 12 | 12 | fn run() !void { |
| ... | ... | @@ -41,7 +41,7 @@ test "@byteSwap exotic integers" { |
| 41 | 41 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 42 | 42 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 43 | 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 | 46 | const ByteSwapIntTest = struct { |
| 47 | 47 | fn run() !void { |
| ... | ... | @@ -84,7 +84,7 @@ test "@byteSwap vectors u8" { |
| 84 | 84 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 85 | 85 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 86 | 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 | 88 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 89 | 89 | |
| 90 | 90 | try comptime vector8(); |
| ... | ... | @@ -103,7 +103,7 @@ test "@byteSwap vectors u16" { |
| 103 | 103 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 104 | 104 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 105 | 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 | 107 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 108 | 108 | |
| 109 | 109 | try comptime vector16(); |
| ... | ... | @@ -122,7 +122,7 @@ test "@byteSwap vectors u24" { |
| 122 | 122 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 123 | 123 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 124 | 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 | 126 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 127 | 127 | |
| 128 | 128 | try comptime vector24(); |
test/behavior/byval_arg_var.zig+1-1| ... | ... | @@ -5,7 +5,7 @@ var result: []const u8 = "wrong"; |
| 5 | 5 | |
| 6 | 6 | test "pass string literal byvalue to a generic var param" { |
| 7 | 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 | 10 | start(); |
| 11 | 11 | blowUpStack(10); |
test/behavior/call.zig+21-13| ... | ... | @@ -23,7 +23,7 @@ test "basic invocations" { |
| 23 | 23 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 24 | 24 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 25 | 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 | 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 | 61 | test "tuple parameters" { |
| 62 | 62 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 63 | 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 | 66 | const add = struct { |
| 67 | 67 | fn add(a: i32, b: i32) i32 { |
| ... | ... | @@ -92,6 +92,7 @@ test "tuple parameters" { |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 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 | 96 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 96 | 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 | 113 | } |
| 113 | 114 | |
| 114 | 115 | test "function call with 40 arguments" { |
| 116 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 115 | 117 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 116 | 118 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 117 | 119 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -273,7 +275,7 @@ test "forced tail call" { |
| 273 | 275 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 274 | 276 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 275 | 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 | 279 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 278 | 280 | |
| 279 | 281 | if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) { |
| ... | ... | @@ -308,7 +310,7 @@ test "inline call preserves tail call" { |
| 308 | 310 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 309 | 311 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 310 | 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 | 314 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 313 | 315 | |
| 314 | 316 | if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) { |
| ... | ... | @@ -341,7 +343,7 @@ test "inline call preserves tail call" { |
| 341 | 343 | |
| 342 | 344 | test "inline call doesn't re-evaluate non generic struct" { |
| 343 | 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 | 348 | const S = struct { |
| 347 | 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 | 357 | } |
| 356 | 358 | |
| 357 | 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 | 362 | const S = struct { |
| 359 | 363 | const E = std.meta.FieldEnum(struct { |
| 360 | 364 | prev_pos: bool, |
| ... | ... | @@ -407,7 +411,7 @@ test "recursive inline call with comptime known argument" { |
| 407 | 411 | |
| 408 | 412 | test "inline while with @call" { |
| 409 | 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 | 416 | const S = struct { |
| 413 | 417 | fn inc(a: *u32) void { |
| ... | ... | @@ -423,6 +427,8 @@ test "inline while with @call" { |
| 423 | 427 | } |
| 424 | 428 | |
| 425 | 429 | test "method call as parameter type" { |
| 430 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 431 | ||
| 426 | 432 | const S = struct { |
| 427 | 433 | fn foo(x: anytype, y: @TypeOf(x).Inner()) @TypeOf(y) { |
| 428 | 434 | return y; |
| ... | ... | @@ -436,6 +442,7 @@ test "method call as parameter type" { |
| 436 | 442 | } |
| 437 | 443 | |
| 438 | 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 | 446 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 440 | 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 | 471 | } |
| 465 | 472 | |
| 466 | 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 | 475 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 468 | 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 | 499 | } |
| 492 | 500 | |
| 493 | 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 | 504 | const S = struct { |
| 497 | 505 | inline fn foo(x: u8) !void { |
| ... | ... | @@ -517,7 +525,7 @@ test "call function in comptime field" { |
| 517 | 525 | test "call function pointer in comptime field" { |
| 518 | 526 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 519 | 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 | 530 | const Auto = struct { |
| 523 | 531 | auto: [max_len]u8 = undefined, |
| ... | ... | @@ -538,7 +546,7 @@ test "call function pointer in comptime field" { |
| 538 | 546 | } |
| 539 | 547 | |
| 540 | 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 | 551 | const S = struct { |
| 544 | 552 | var ok = false; |
| ... | ... | @@ -615,7 +623,7 @@ test "call with union with zero sized field is not memorized incorrectly" { |
| 615 | 623 | test "function call with cast to anyopaque pointer" { |
| 616 | 624 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 617 | 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 | 628 | const Foo = struct { |
| 621 | 629 | y: u8, |
| ... | ... | @@ -633,7 +641,7 @@ test "arguments pointed to on stack into tailcall" { |
| 633 | 641 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 634 | 642 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 635 | 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 | 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 | 647 | switch (builtin.cpu.arch) { |
| ... | ... | @@ -707,7 +715,7 @@ test "tail call function pointer" { |
| 707 | 715 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 708 | 716 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 709 | 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 | 719 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 712 | 720 | |
| 713 | 721 | if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) { |
| ... | ... | @@ -737,7 +745,7 @@ test "tail call function pointer" { |
| 737 | 745 | test "tail call with potentially extended types" { |
| 738 | 746 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 739 | 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 | 750 | if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) { |
| 743 | 751 | if (builtin.cpu.arch.isMIPS() or builtin.cpu.arch.isPowerPC() or builtin.cpu.arch.isWasm()) { |
test/behavior/cast.zig+129-99| ... | ... | @@ -21,6 +21,7 @@ test "integer literal to pointer cast" { |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | test "peer type resolution: ?T and T" { |
| 24 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 24 | 25 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 25 | 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 | 68 | } |
| 68 | 69 | |
| 69 | 70 | test "comptime_int @floatFromInt" { |
| 71 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 70 | 72 | { |
| 71 | 73 | const result = @as(f16, @floatFromInt(1234)); |
| 72 | 74 | try expect(@TypeOf(result) == f16); |
| ... | ... | @@ -97,6 +99,7 @@ test "comptime_int @floatFromInt" { |
| 97 | 99 | } |
| 98 | 100 | |
| 99 | 101 | test "@floatFromInt" { |
| 102 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 100 | 103 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 101 | 104 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 102 | 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 | 129 | } |
| 127 | 130 | |
| 128 | 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 | 133 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 131 | 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 | 154 | } |
| 152 | 155 | |
| 153 | 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 | 158 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 156 | 159 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 157 | 160 | |
| ... | ... | @@ -174,7 +177,7 @@ test "@floatFromInt > 128 bits" { |
| 174 | 177 | test "@floatFromInt(f80)" { |
| 175 | 178 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 176 | 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 | 181 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 179 | 182 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; |
| 180 | 183 | |
| ... | ... | @@ -212,7 +215,7 @@ test "@floatFromInt(f80)" { |
| 212 | 215 | } |
| 213 | 216 | |
| 214 | 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 | 220 | const check = struct { |
| 218 | 221 | // Check that an integer value can be coerced to a float type and |
| ... | ... | @@ -273,7 +276,7 @@ test "type coercion from int to float" { |
| 273 | 276 | } |
| 274 | 277 | |
| 275 | 278 | test "@intFromFloat" { |
| 276 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 279 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 277 | 280 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 278 | 281 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 279 | 282 | |
| ... | ... | @@ -303,6 +306,8 @@ fn testIntFromFloats() !void { |
| 303 | 306 | } |
| 304 | 307 | |
| 305 | 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 | 311 | const S = struct { |
| 307 | 312 | const x: i32 = 10; |
| 308 | 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 | 343 | |
| 339 | 344 | test "implicitly cast indirect pointer to maybe-indirect pointer" { |
| 340 | 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 | 348 | const S = struct { |
| 343 | 349 | const Self = @This(); |
| 344 | 350 | x: u8, |
| ... | ... | @@ -372,6 +378,8 @@ test "@intCast comptime_int" { |
| 372 | 378 | } |
| 373 | 379 | |
| 374 | 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 | 384 | const result = @as(f16, @floatCast(1234)); |
| 377 | 385 | try expect(@TypeOf(result) == f16); |
| ... | ... | @@ -416,7 +424,7 @@ fn MakeType(comptime T: type) type { |
| 416 | 424 | |
| 417 | 425 | test "implicit cast from *[N]T to [*c]T" { |
| 418 | 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 | 429 | var x: [4]u16 = [4]u16{ 0, 1, 2, 3 }; |
| 422 | 430 | var y: [*c]u16 = &x; |
| ... | ... | @@ -451,6 +459,7 @@ test "@intCast to u0 and use the result" { |
| 451 | 459 | } |
| 452 | 460 | |
| 453 | 461 | test "peer result null and comptime_int" { |
| 462 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 454 | 463 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 455 | 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 | 486 | test "*const ?[*]const T to [*c]const [*c]const T" { |
| 478 | 487 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 479 | 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 | 491 | var array = [_]u8{ 'o', 'k' }; |
| 483 | 492 | const opt_array_ptr: ?[*]const u8 = &array; |
| ... | ... | @@ -489,7 +498,7 @@ test "*const ?[*]const T to [*c]const [*c]const T" { |
| 489 | 498 | |
| 490 | 499 | test "array coercion to undefined at runtime" { |
| 491 | 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 | 503 | @setRuntimeSafety(true); |
| 495 | 504 | |
| ... | ... | @@ -516,6 +525,7 @@ fn implicitIntLitToOptional() void { |
| 516 | 525 | } |
| 517 | 526 | |
| 518 | 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 | 529 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 520 | 530 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 521 | 531 | |
| ... | ... | @@ -537,6 +547,7 @@ test "cast from ?[*]T to ??[*]T" { |
| 537 | 547 | } |
| 538 | 548 | |
| 539 | 549 | test "peer type unsigned int to signed" { |
| 550 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 540 | 551 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 541 | 552 | |
| 542 | 553 | var w: u31 = 5; |
| ... | ... | @@ -550,7 +561,7 @@ test "peer type unsigned int to signed" { |
| 550 | 561 | |
| 551 | 562 | test "expected [*c]const u8, found [*:0]const u8" { |
| 552 | 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 | 566 | var a: [*:0]const u8 = "hello"; |
| 556 | 567 | _ = &a; |
| ... | ... | @@ -562,7 +573,7 @@ test "expected [*c]const u8, found [*:0]const u8" { |
| 562 | 573 | test "explicit cast from integer to error type" { |
| 563 | 574 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 564 | 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 | 577 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 567 | 578 | |
| 568 | 579 | try testCastIntToErr(error.ItBroke); |
| ... | ... | @@ -577,7 +588,7 @@ fn testCastIntToErr(err: anyerror) !void { |
| 577 | 588 | test "peer resolve array and const slice" { |
| 578 | 589 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 579 | 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 | 593 | try testPeerResolveArrayConstSlice(true); |
| 583 | 594 | try comptime testPeerResolveArrayConstSlice(true); |
| ... | ... | @@ -590,7 +601,7 @@ fn testPeerResolveArrayConstSlice(b: bool) !void { |
| 590 | 601 | } |
| 591 | 602 | |
| 592 | 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 | 605 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 595 | 606 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 596 | 607 | |
| ... | ... | @@ -616,7 +627,7 @@ fn castToOptionalTypeError(z: i32) !void { |
| 616 | 627 | } |
| 617 | 628 | |
| 618 | 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 | 631 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 621 | 632 | |
| 622 | 633 | try testCastZeroArrayToErrSliceMut(); |
| ... | ... | @@ -634,7 +645,7 @@ fn gimmeErrOrSlice() anyerror![]u8 { |
| 634 | 645 | test "peer type resolution: [0]u8, []const u8, and anyerror![]u8" { |
| 635 | 646 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 636 | 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 | 650 | const S = struct { |
| 640 | 651 | fn doTheTest() anyerror!void { |
| ... | ... | @@ -665,7 +676,7 @@ fn peerTypeEmptyArrayAndSliceAndError(a: bool, slice: []u8) anyerror![]u8 { |
| 665 | 676 | |
| 666 | 677 | test "implicit cast from *const [N]T to []const T" { |
| 667 | 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 | 681 | try testCastConstArrayRefToConstSlice(); |
| 671 | 682 | try comptime testCastConstArrayRefToConstSlice(); |
| ... | ... | @@ -690,7 +701,7 @@ fn testCastConstArrayRefToConstSlice() !void { |
| 690 | 701 | |
| 691 | 702 | test "peer type resolution: error and [N]T" { |
| 692 | 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 | 706 | try expect(mem.eql(u8, try testPeerErrorAndArray(0), "OK")); |
| 696 | 707 | comptime assert(mem.eql(u8, try testPeerErrorAndArray(0), "OK")); |
| ... | ... | @@ -714,7 +725,7 @@ fn testPeerErrorAndArray2(x: u8) anyerror![]const u8 { |
| 714 | 725 | |
| 715 | 726 | test "single-item pointer of array to slice to unknown length pointer" { |
| 716 | 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 | 730 | try testCastPtrOfArrayToSliceAndPtr(); |
| 720 | 731 | try comptime testCastPtrOfArrayToSliceAndPtr(); |
| ... | ... | @@ -743,7 +754,7 @@ fn testCastPtrOfArrayToSliceAndPtr() !void { |
| 743 | 754 | |
| 744 | 755 | test "cast *[1][*]const u8 to [*]const ?[*]const u8" { |
| 745 | 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 | 759 | const window_name = [1][*]const u8{"window name"}; |
| 749 | 760 | const x: [*]const ?[*]const u8 = &window_name; |
| ... | ... | @@ -755,7 +766,7 @@ test "@intCast on vector" { |
| 755 | 766 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 756 | 767 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 757 | 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 | 770 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| 760 | 771 | |
| 761 | 772 | const S = struct { |
| ... | ... | @@ -1027,7 +1038,7 @@ test "peer cast: error set any anyerror" { |
| 1027 | 1038 | test "peer type resolution: error set supersets" { |
| 1028 | 1039 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1029 | 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 | 1043 | const a: error{ One, Two } = undefined; |
| 1033 | 1044 | const b: error{One} = undefined; |
| ... | ... | @@ -1056,7 +1067,7 @@ test "peer type resolution: error set supersets" { |
| 1056 | 1067 | test "peer type resolution: disjoint error sets" { |
| 1057 | 1068 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1058 | 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 | 1072 | const a: error{ One, Two } = undefined; |
| 1062 | 1073 | const b: error{Three} = undefined; |
| ... | ... | @@ -1085,7 +1096,7 @@ test "peer type resolution: disjoint error sets" { |
| 1085 | 1096 | test "peer type resolution: error union and error set" { |
| 1086 | 1097 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1087 | 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 | 1101 | const a: error{Three} = undefined; |
| 1091 | 1102 | const b: error{ One, Two }!u32 = undefined; |
| ... | ... | @@ -1118,7 +1129,7 @@ test "peer type resolution: error union and error set" { |
| 1118 | 1129 | test "peer type resolution: error union after non-error" { |
| 1119 | 1130 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1120 | 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 | 1134 | const a: u32 = undefined; |
| 1124 | 1135 | const b: error{ One, Two }!u32 = undefined; |
| ... | ... | @@ -1151,7 +1162,7 @@ test "peer type resolution: error union after non-error" { |
| 1151 | 1162 | test "peer cast *[0]T to E![]const T" { |
| 1152 | 1163 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1153 | 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 | 1167 | var buffer: [5]u8 = "abcde".*; |
| 1157 | 1168 | const buf: anyerror![]const u8 = buffer[0..]; |
| ... | ... | @@ -1166,7 +1177,7 @@ test "peer cast *[0]T to E![]const T" { |
| 1166 | 1177 | test "peer cast *[0]T to []const T" { |
| 1167 | 1178 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1168 | 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 | 1182 | var buffer: [5]u8 = "abcde".*; |
| 1172 | 1183 | const buf: []const u8 = buffer[0..]; |
| ... | ... | @@ -1177,6 +1188,7 @@ test "peer cast *[0]T to []const T" { |
| 1177 | 1188 | } |
| 1178 | 1189 | |
| 1179 | 1190 | test "peer cast *[N]T to [*]T" { |
| 1191 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1180 | 1192 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1181 | 1193 | |
| 1182 | 1194 | var array = [4:99]i32{ 1, 2, 3, 4 }; |
| ... | ... | @@ -1189,7 +1201,7 @@ test "peer cast *[N]T to [*]T" { |
| 1189 | 1201 | test "peer resolution of string literals" { |
| 1190 | 1202 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1191 | 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 | 1206 | const S = struct { |
| 1195 | 1207 | const E = enum { a, b, c, d }; |
| ... | ... | @@ -1210,7 +1222,7 @@ test "peer resolution of string literals" { |
| 1210 | 1222 | |
| 1211 | 1223 | test "peer cast [:x]T to []T" { |
| 1212 | 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 | 1227 | const S = struct { |
| 1216 | 1228 | fn doTheTest() !void { |
| ... | ... | @@ -1226,7 +1238,7 @@ test "peer cast [:x]T to []T" { |
| 1226 | 1238 | |
| 1227 | 1239 | test "peer cast [N:x]T to [N]T" { |
| 1228 | 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 | 1243 | const S = struct { |
| 1232 | 1244 | fn doTheTest() !void { |
| ... | ... | @@ -1242,7 +1254,7 @@ test "peer cast [N:x]T to [N]T" { |
| 1242 | 1254 | |
| 1243 | 1255 | test "peer cast *[N:x]T to *[N]T" { |
| 1244 | 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 | 1259 | const S = struct { |
| 1248 | 1260 | fn doTheTest() !void { |
| ... | ... | @@ -1258,7 +1270,7 @@ test "peer cast *[N:x]T to *[N]T" { |
| 1258 | 1270 | test "peer cast [*:x]T to [*]T" { |
| 1259 | 1271 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1260 | 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 | 1275 | const S = struct { |
| 1264 | 1276 | fn doTheTest() !void { |
| ... | ... | @@ -1278,7 +1290,7 @@ test "peer cast [*:x]T to [*]T" { |
| 1278 | 1290 | test "peer cast [:x]T to [*:x]T" { |
| 1279 | 1291 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1280 | 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 | 1295 | const S = struct { |
| 1284 | 1296 | fn doTheTest() !void { |
| ... | ... | @@ -1298,7 +1310,7 @@ test "peer cast [:x]T to [*:x]T" { |
| 1298 | 1310 | |
| 1299 | 1311 | test "peer type resolution implicit cast to return type" { |
| 1300 | 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 | 1315 | const S = struct { |
| 1304 | 1316 | fn doTheTest() !void { |
| ... | ... | @@ -1318,7 +1330,7 @@ test "peer type resolution implicit cast to return type" { |
| 1318 | 1330 | |
| 1319 | 1331 | test "peer type resolution implicit cast to variable type" { |
| 1320 | 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 | 1335 | const S = struct { |
| 1324 | 1336 | fn doTheTest() !void { |
| ... | ... | @@ -1343,7 +1355,7 @@ test "variable initialization uses result locations properly with regards to the |
| 1343 | 1355 | |
| 1344 | 1356 | test "cast between C pointer with different but compatible types" { |
| 1345 | 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 | 1360 | const S = struct { |
| 1349 | 1361 | fn foo(arg: [*]c_ushort) u16 { |
| ... | ... | @@ -1360,7 +1372,7 @@ test "cast between C pointer with different but compatible types" { |
| 1360 | 1372 | |
| 1361 | 1373 | test "peer type resolve string lit with sentinel-terminated mutable slice" { |
| 1362 | 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 | 1377 | var array: [4:0]u8 = undefined; |
| 1366 | 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 | 1382 | } |
| 1371 | 1383 | |
| 1372 | 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 | 1387 | var array1: [4]u8 = undefined; |
| 1374 | 1388 | const array2: [5]u8 = undefined; |
| 1375 | 1389 | comptime assert(@TypeOf(&array1, &array2) == []const u8); |
| ... | ... | @@ -1377,6 +1391,8 @@ test "peer type resolve array pointers, one of them const" { |
| 1377 | 1391 | } |
| 1378 | 1392 | |
| 1379 | 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 | 1396 | const const_array: [4]u8 = undefined; |
| 1381 | 1397 | var array: [4]u8 = undefined; |
| 1382 | 1398 | var const_ptr: [*]const u8 = undefined; |
| ... | ... | @@ -1397,6 +1413,8 @@ test "peer type resolve array pointer and unknown pointer" { |
| 1397 | 1413 | } |
| 1398 | 1414 | |
| 1399 | 1415 | test "comptime float casts" { |
| 1416 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1417 | ||
| 1400 | 1418 | const a = @as(comptime_float, @floatFromInt(1)); |
| 1401 | 1419 | try expect(a == 1); |
| 1402 | 1420 | try expect(@TypeOf(a) == comptime_float); |
| ... | ... | @@ -1431,7 +1449,7 @@ test "pointer reinterpret const float to int" { |
| 1431 | 1449 | test "implicit cast from [*]T to ?*anyopaque" { |
| 1432 | 1450 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1433 | 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 | 1454 | var a = [_]u8{ 3, 2, 1 }; |
| 1437 | 1455 | var runtime_zero: usize = 0; |
| ... | ... | @@ -1448,7 +1466,7 @@ fn incrementVoidPtrArray(array: ?*anyopaque, len: usize) void { |
| 1448 | 1466 | } |
| 1449 | 1467 | |
| 1450 | 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 | 1471 | try foobar(FUNCTION_CONSTANT); |
| 1454 | 1472 | } |
| ... | ... | @@ -1463,7 +1481,7 @@ fn foobar(func: PFN_void) !void { |
| 1463 | 1481 | } |
| 1464 | 1482 | |
| 1465 | 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 | 1486 | const Container = struct { |
| 1469 | 1487 | const Ctx = opaque {}; |
| ... | ... | @@ -1490,7 +1508,7 @@ test "cast function with an opaque parameter" { |
| 1490 | 1508 | test "implicit ptr to *anyopaque" { |
| 1491 | 1509 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1492 | 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 | 1513 | var a: u32 = 1; |
| 1496 | 1514 | const ptr: *align(@alignOf(u32)) anyopaque = &a; |
| ... | ... | @@ -1503,7 +1521,7 @@ test "implicit ptr to *anyopaque" { |
| 1503 | 1521 | |
| 1504 | 1522 | test "return null from fn () anyerror!?&T" { |
| 1505 | 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 | 1526 | const a = returnNullFromOptionalTypeErrorRef(); |
| 1509 | 1527 | const b = returnNullLitFromOptionalTypeErrorRef(); |
| ... | ... | @@ -1520,7 +1538,7 @@ fn returnNullLitFromOptionalTypeErrorRef() anyerror!?*A { |
| 1520 | 1538 | test "peer type resolution: [0]u8 and []const u8" { |
| 1521 | 1539 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1522 | 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 | 1543 | try expect(peerTypeEmptyArrayAndSlice(true, "hi").len == 0); |
| 1526 | 1544 | try expect(peerTypeEmptyArrayAndSlice(false, "hi").len == 1); |
| ... | ... | @@ -1540,7 +1558,7 @@ fn peerTypeEmptyArrayAndSlice(a: bool, slice: []const u8) []const u8 { |
| 1540 | 1558 | test "implicitly cast from [N]T to ?[]const T" { |
| 1541 | 1559 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1542 | 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 | 1563 | try expect(mem.eql(u8, castToOptionalSlice().?, "hi")); |
| 1546 | 1564 | comptime assert(mem.eql(u8, castToOptionalSlice().?, "hi")); |
| ... | ... | @@ -1553,7 +1571,7 @@ fn castToOptionalSlice() ?[]const u8 { |
| 1553 | 1571 | test "cast u128 to f128 and back" { |
| 1554 | 1572 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1555 | 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 | 1575 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1558 | 1576 | |
| 1559 | 1577 | try comptime testCast128(); |
| ... | ... | @@ -1576,7 +1594,7 @@ test "implicit cast from *[N]T to ?[*]T" { |
| 1576 | 1594 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1577 | 1595 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1578 | 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 | 1599 | var x: ?[*]u16 = null; |
| 1582 | 1600 | var y: [4]u16 = [4]u16{ 0, 1, 2, 3 }; |
| ... | ... | @@ -1591,7 +1609,7 @@ test "implicit cast from *[N]T to ?[*]T" { |
| 1591 | 1609 | test "implicit cast from *T to ?*anyopaque" { |
| 1592 | 1610 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1593 | 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 | 1614 | var a: u8 = 1; |
| 1597 | 1615 | incrementVoidPtrValue(&a); |
| ... | ... | @@ -1603,7 +1621,7 @@ fn incrementVoidPtrValue(value: ?*anyopaque) void { |
| 1603 | 1621 | } |
| 1604 | 1622 | |
| 1605 | 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 | 1625 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1608 | 1626 | |
| 1609 | 1627 | var x = @as(anyerror![]const u8, &[0]u8{}); |
| ... | ... | @@ -1613,13 +1631,13 @@ test "implicit cast *[0]T to E![]const u8" { |
| 1613 | 1631 | |
| 1614 | 1632 | var global_array: [4]u8 = undefined; |
| 1615 | 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 | 1636 | const f = @as(*align(1) const fn () callconv(.c) void, @ptrCast(&global_array)); |
| 1619 | 1637 | try expect(@intFromPtr(f) == @intFromPtr(&global_array)); |
| 1620 | 1638 | } |
| 1621 | 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 | 1642 | var f = @as(*align(1) const fn () callconv(.c) void, @ptrCast(&global_array)); |
| 1625 | 1643 | _ = &f; |
| ... | ... | @@ -1629,7 +1647,7 @@ test "cast from array reference to fn: runtime fn ptr" { |
| 1629 | 1647 | test "*const [N]null u8 to ?[]const u8" { |
| 1630 | 1648 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1631 | 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 | 1652 | const S = struct { |
| 1635 | 1653 | fn doTheTest() !void { |
| ... | ... | @@ -1646,7 +1664,7 @@ test "*const [N]null u8 to ?[]const u8" { |
| 1646 | 1664 | test "comptime @ptrCast to optional slice" { |
| 1647 | 1665 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1648 | 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 | 1669 | const result: ?[]const u8 = comptime blk: { |
| 1652 | 1670 | const slice: []const u8 = "123"; |
| ... | ... | @@ -1679,7 +1697,7 @@ var global_struct: struct { f0: usize } = undefined; |
| 1679 | 1697 | test "assignment to optional pointer result loc" { |
| 1680 | 1698 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1681 | 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 | 1702 | var foo: struct { ptr: ?*anyopaque } = .{ .ptr = &global_struct }; |
| 1685 | 1703 | _ = &foo; |
| ... | ... | @@ -1687,7 +1705,7 @@ test "assignment to optional pointer result loc" { |
| 1687 | 1705 | } |
| 1688 | 1706 | |
| 1689 | 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 | 1710 | var a: [4]void = undefined; |
| 1693 | 1711 | const b: []void = &a; |
| ... | ... | @@ -1696,7 +1714,7 @@ test "cast between *[N]void and []void" { |
| 1696 | 1714 | |
| 1697 | 1715 | test "peer resolve arrays of different size to const slice" { |
| 1698 | 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 | 1719 | try expect(mem.eql(u8, boolToStr(true), "true")); |
| 1702 | 1720 | try expect(mem.eql(u8, boolToStr(false), "false")); |
| ... | ... | @@ -1710,7 +1728,7 @@ fn boolToStr(b: bool) []const u8 { |
| 1710 | 1728 | test "cast f16 to wider types" { |
| 1711 | 1729 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1712 | 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 | 1732 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1715 | 1733 | |
| 1716 | 1734 | const S = struct { |
| ... | ... | @@ -1729,7 +1747,7 @@ test "cast f16 to wider types" { |
| 1729 | 1747 | test "cast f128 to narrower types" { |
| 1730 | 1748 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1731 | 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 | 1751 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1734 | 1752 | |
| 1735 | 1753 | const S = struct { |
| ... | ... | @@ -1748,7 +1766,7 @@ test "cast f128 to narrower types" { |
| 1748 | 1766 | test "peer type resolution: unreachable, null, slice" { |
| 1749 | 1767 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1750 | 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 | 1771 | const S = struct { |
| 1754 | 1772 | fn doTheTest(num: usize, word: []const u8) !void { |
| ... | ... | @@ -1787,7 +1805,7 @@ test "cast i8 fn call peers to i32 result" { |
| 1787 | 1805 | test "cast compatible optional types" { |
| 1788 | 1806 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1789 | 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 | 1810 | var a: ?[:0]const u8 = null; |
| 1793 | 1811 | _ = &a; |
| ... | ... | @@ -1797,7 +1815,7 @@ test "cast compatible optional types" { |
| 1797 | 1815 | |
| 1798 | 1816 | test "coerce undefined single-item pointer of array to error union of slice" { |
| 1799 | 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 | 1820 | const a = @as([*]u8, undefined)[0..0]; |
| 1803 | 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 | 1825 | } |
| 1808 | 1826 | |
| 1809 | 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 | 1829 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1812 | 1830 | |
| 1813 | 1831 | var x: []i32 = &.{}; |
| ... | ... | @@ -1818,7 +1836,7 @@ test "pointer to empty struct literal to mutable slice" { |
| 1818 | 1836 | test "coerce between pointers of compatible differently-named floats" { |
| 1819 | 1837 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1820 | 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 | 1840 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1823 | 1841 | |
| 1824 | 1842 | const F = switch (@typeInfo(c_longdouble).float.bits) { |
| ... | ... | @@ -1878,6 +1896,8 @@ test "cast typed undefined to int" { |
| 1878 | 1896 | // } |
| 1879 | 1897 | |
| 1880 | 1898 | test "bitcast packed struct with u0" { |
| 1899 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1900 | ||
| 1881 | 1901 | const S = packed struct(u2) { a: u0, b: u2 }; |
| 1882 | 1902 | const s = @as(S, @bitCast(@as(u2, 2))); |
| 1883 | 1903 | try expect(s.a == 0); |
| ... | ... | @@ -1888,7 +1908,7 @@ test "bitcast packed struct with u0" { |
| 1888 | 1908 | |
| 1889 | 1909 | test "optional pointer coerced to optional allowzero pointer" { |
| 1890 | 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 | 1913 | var p: ?*u32 = undefined; |
| 1894 | 1914 | var q: ?*allowzero u32 = undefined; |
| ... | ... | @@ -1905,7 +1925,7 @@ test "optional slice coerced to allowzero many pointer" { |
| 1905 | 1925 | } |
| 1906 | 1926 | |
| 1907 | 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 | 1930 | const ns = struct { |
| 1911 | 1931 | const Color = struct { |
| ... | ... | @@ -1926,7 +1946,7 @@ test "optional slice passed as parameter coerced to allowzero many pointer" { |
| 1926 | 1946 | } |
| 1927 | 1947 | |
| 1928 | 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 | 1951 | var x: i32 = 1234; |
| 1932 | 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 | 1956 | |
| 1937 | 1957 | test "peer type resolution forms error union" { |
| 1938 | 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 | 1961 | var foo: i32 = 123; |
| 1942 | 1962 | _ = &foo; |
| ... | ... | @@ -1971,7 +1991,7 @@ test "@volatileCast without a result location" { |
| 1971 | 1991 | } |
| 1972 | 1992 | |
| 1973 | 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 | 1996 | var x: u32 = 1; |
| 1977 | 1997 | |
| ... | ... | @@ -1984,7 +2004,7 @@ test "coercion from single-item pointer to @as to slice" { |
| 1984 | 2004 | test "peer type resolution: const sentinel slice and mutable non-sentinel slice" { |
| 1985 | 2005 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1986 | 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 | 2009 | const S = struct { |
| 1990 | 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 | 2031 | } |
| 2012 | 2032 | |
| 2013 | 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 | 2035 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2015 | 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 | 2053 | } |
| 2033 | 2054 | |
| 2034 | 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 | 2057 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2037 | 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 | 2098 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2078 | 2099 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2079 | 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 | 2103 | var a: [2:0]u32 = .{ 0, 1 }; |
| 2083 | 2104 | var b: [2:0]u32 = .{ 2, 3 }; |
| ... | ... | @@ -2099,7 +2120,7 @@ test "peer type resolution: same array type with sentinel" { |
| 2099 | 2120 | test "peer type resolution: array with sentinel and array without sentinel" { |
| 2100 | 2121 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2101 | 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 | 2125 | var a: [2:0]u32 = .{ 0, 1 }; |
| 2105 | 2126 | var b: [2]u32 = .{ 2, 3 }; |
| ... | ... | @@ -2122,7 +2143,7 @@ test "peer type resolution: array and vector with same child type" { |
| 2122 | 2143 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2123 | 2144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2124 | 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 | 2147 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 2127 | 2148 | |
| 2128 | 2149 | var arr: [2]u32 = .{ 0, 1 }; |
| ... | ... | @@ -2143,7 +2164,7 @@ test "peer type resolution: array and vector with same child type" { |
| 2143 | 2164 | } |
| 2144 | 2165 | |
| 2145 | 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 | 2168 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2148 | 2169 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2149 | 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 | 2191 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2171 | 2192 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2172 | 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 | 2196 | const E = error{Foo}; |
| 2176 | 2197 | var a: E!*u8 = error.Foo; |
| ... | ... | @@ -2193,7 +2214,7 @@ test "peer type resolution: error union and optional of same type" { |
| 2193 | 2214 | test "peer type resolution: C pointer and @TypeOf(null)" { |
| 2194 | 2215 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2195 | 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 | 2219 | var a: [*c]c_int = 0x1000; |
| 2199 | 2220 | _ = &a; |
| ... | ... | @@ -2215,7 +2236,7 @@ test "peer type resolution: C pointer and @TypeOf(null)" { |
| 2215 | 2236 | test "peer type resolution: three-way resolution combines error set and optional" { |
| 2216 | 2237 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2217 | 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 | 2241 | const E = error{Foo}; |
| 2221 | 2242 | var a: E = error.Foo; |
| ... | ... | @@ -2258,7 +2279,7 @@ test "peer type resolution: vector and optional vector" { |
| 2258 | 2279 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2259 | 2280 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2260 | 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 | 2283 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 2263 | 2284 | |
| 2264 | 2285 | var a: ?@Vector(3, u32) = .{ 0, 1, 2 }; |
| ... | ... | @@ -2279,6 +2300,7 @@ test "peer type resolution: vector and optional vector" { |
| 2279 | 2300 | } |
| 2280 | 2301 | |
| 2281 | 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 | 2304 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2283 | 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 | 2325 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2304 | 2326 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2305 | 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 | 2330 | var arr: [3]i32 = .{ 1, 2, 3 }; |
| 2309 | 2331 | _ = &arr; |
| ... | ... | @@ -2324,7 +2346,7 @@ test "peer type resolution: array and tuple" { |
| 2324 | 2346 | } |
| 2325 | 2347 | |
| 2326 | 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 | 2350 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2329 | 2351 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2330 | 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 | 2373 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2352 | 2374 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2353 | 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 | 2378 | var vec: @Vector(2, i8) = .{ 10, 20 }; |
| 2357 | 2379 | var arr: [2]i8 = .{ 30, 40 }; |
| ... | ... | @@ -2393,7 +2415,7 @@ test "peer type resolution: vector and array and tuple" { |
| 2393 | 2415 | test "peer type resolution: empty tuple pointer and slice" { |
| 2394 | 2416 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2395 | 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 | 2420 | var a: [:0]const u8 = "Hello"; |
| 2399 | 2421 | var b = &.{}; |
| ... | ... | @@ -2414,7 +2436,7 @@ test "peer type resolution: empty tuple pointer and slice" { |
| 2414 | 2436 | test "peer type resolution: tuple pointer and slice" { |
| 2415 | 2437 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2416 | 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 | 2441 | var a: [:0]const u8 = "Hello"; |
| 2420 | 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 | 2458 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2437 | 2459 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2438 | 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 | 2463 | var a: ?[:0]const u8 = null; |
| 2442 | 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 | 2479 | test "peer type resolution: many compatible pointers" { |
| 2458 | 2480 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2459 | 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 | 2484 | var buf = "foo-3".*; |
| 2463 | 2485 | |
| ... | ... | @@ -2521,6 +2543,7 @@ test "peer type resolution: many compatible pointers" { |
| 2521 | 2543 | } |
| 2522 | 2544 | |
| 2523 | 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 | 2547 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2525 | 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 | 2576 | test "peer type resolution: C pointer and many pointer" { |
| 2554 | 2577 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2555 | 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 | 2581 | var buf = "hello".*; |
| 2559 | 2582 | |
| ... | ... | @@ -2576,7 +2599,7 @@ test "peer type resolution: C pointer and many pointer" { |
| 2576 | 2599 | test "peer type resolution: pointer attributes are combined correctly" { |
| 2577 | 2600 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2578 | 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 | 2604 | var buf_a align(4) = "foo".*; |
| 2582 | 2605 | var buf_b align(4) = "bar".*; |
| ... | ... | @@ -2663,7 +2686,7 @@ test "peer type resolution: arrays of compatible types" { |
| 2663 | 2686 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2664 | 2687 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2665 | 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 | 2691 | var e0: u8 = 3; |
| 2669 | 2692 | var e1: u8 = 2; |
| ... | ... | @@ -2680,7 +2703,7 @@ test "peer type resolution: arrays of compatible types" { |
| 2680 | 2703 | test "cast builtins can wrap result in optional" { |
| 2681 | 2704 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2682 | 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 | 2708 | const S = struct { |
| 2686 | 2709 | const MyEnum = enum(u32) { _ }; |
| ... | ... | @@ -2715,7 +2738,7 @@ test "cast builtins can wrap result in optional" { |
| 2715 | 2738 | } |
| 2716 | 2739 | |
| 2717 | 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 | 2742 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2720 | 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 | 2778 | test "cast builtins can wrap result in error union and optional" { |
| 2756 | 2779 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2757 | 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 | 2783 | const S = struct { |
| 2761 | 2784 | const MyEnum = enum(u32) { _ }; |
| ... | ... | @@ -2791,7 +2814,7 @@ test "cast builtins can wrap result in error union and optional" { |
| 2791 | 2814 | } |
| 2792 | 2815 | |
| 2793 | 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 | 2818 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2796 | 2819 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2797 | 2820 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -2836,7 +2859,7 @@ test "@ptrFromInt on vector" { |
| 2836 | 2859 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2837 | 2860 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2838 | 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 | 2864 | const S = struct { |
| 2842 | 2865 | fn doTheTest() !void { |
| ... | ... | @@ -2860,7 +2883,7 @@ test "@intFromPtr on vector" { |
| 2860 | 2883 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2861 | 2884 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2862 | 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 | 2888 | const S = struct { |
| 2866 | 2889 | fn doTheTest() !void { |
| ... | ... | @@ -2880,7 +2903,7 @@ test "@intFromPtr on vector" { |
| 2880 | 2903 | } |
| 2881 | 2904 | |
| 2882 | 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 | 2907 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2885 | 2908 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2886 | 2909 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -2900,7 +2923,7 @@ test "@floatFromInt on vector" { |
| 2900 | 2923 | } |
| 2901 | 2924 | |
| 2902 | 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 | 2927 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2905 | 2928 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2906 | 2929 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -2920,6 +2943,7 @@ test "@intFromFloat on vector" { |
| 2920 | 2943 | } |
| 2921 | 2944 | |
| 2922 | 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 | 2947 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2924 | 2948 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2925 | 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 | 2974 | } |
| 2951 | 2975 | |
| 2952 | 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 | 2978 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2955 | 2979 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2956 | 2980 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -2970,6 +2994,8 @@ test "@intFromBool on vector" { |
| 2970 | 2994 | } |
| 2971 | 2995 | |
| 2972 | 2996 | test "numeric coercions with undefined" { |
| 2997 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 2998 | ||
| 2973 | 2999 | const from: i32 = undefined; |
| 2974 | 3000 | var to: f32 = from; |
| 2975 | 3001 | to = @floatFromInt(from); |
| ... | ... | @@ -2987,6 +3013,7 @@ test "15-bit int to float" { |
| 2987 | 3013 | } |
| 2988 | 3014 | |
| 2989 | 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 | 3017 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2991 | 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 | 3030 | test "result information is preserved through many nested structures" { |
| 3004 | 3031 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 3005 | 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 | 3035 | const S = struct { |
| 3009 | 3036 | fn doTheTest() !void { |
| ... | ... | @@ -3025,6 +3052,7 @@ test "result information is preserved through many nested structures" { |
| 3025 | 3052 | } |
| 3026 | 3053 | |
| 3027 | 3054 | test "@intCast vector of signed integer" { |
| 3055 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 3028 | 3056 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 3029 | 3057 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 3030 | 3058 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -3047,6 +3075,7 @@ test "result type is preserved into comptime block" { |
| 3047 | 3075 | } |
| 3048 | 3076 | |
| 3049 | 3077 | test "bitcast vector" { |
| 3078 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 3050 | 3079 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 3051 | 3080 | |
| 3052 | 3081 | const u8x32 = @Vector(32, u8); |
| ... | ... | @@ -3058,7 +3087,7 @@ test "bitcast vector" { |
| 3058 | 3087 | } |
| 3059 | 3088 | |
| 3060 | 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 | 3092 | var f: bool = undefined; |
| 3064 | 3093 | f = false; |
| ... | ... | @@ -3077,7 +3106,7 @@ test "peer type resolution: slice of sentinel-terminated array" { |
| 3077 | 3106 | |
| 3078 | 3107 | test "@intFromFloat boundary cases" { |
| 3079 | 3108 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 3080 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 3109 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 3081 | 3110 | |
| 3082 | 3111 | const S = struct { |
| 3083 | 3112 | fn case(comptime I: type, x: f32, bump: enum { up, down }, expected: I) !void { |
| ... | ... | @@ -3108,7 +3137,7 @@ test "@intFromFloat boundary cases" { |
| 3108 | 3137 | } |
| 3109 | 3138 | |
| 3110 | 3139 | test "@intFromFloat vector boundary cases" { |
| 3111 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 3140 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 3112 | 3141 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 3113 | 3142 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 3114 | 3143 | |
| ... | ... | @@ -3137,6 +3166,7 @@ test "@intFromFloat vector boundary cases" { |
| 3137 | 3166 | } |
| 3138 | 3167 | |
| 3139 | 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; | |
| 3140 | 3170 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 3141 | 3171 | |
| 3142 | 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 | const minInt = std.math.minInt; |
| 7 | 7 | |
| 8 | 8 | test "@intCast i32 to u7" { |
| 9 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 9 | 10 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 10 | 11 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 11 | 12 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -33,6 +34,7 @@ test "coerce i8 to i32 and @intCast back" { |
| 33 | 34 | } |
| 34 | 35 | |
| 35 | 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 | 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 | 145 | |
| 144 | 146 | test "@intCast <= 64 bits" { |
| 145 | 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 | 150 | try testIntCast(i32, minInt(i32), i64, minInt(i32)); |
| 148 | 151 | try testIntCast(i32, maxInt(i32), i64, maxInt(i32)); |
| 149 | 152 | try testIntCast(u32, maxInt(u32), u64, maxInt(u32)); |
| ... | ... | @@ -168,7 +171,7 @@ test "@intCast <= 64 bits" { |
| 168 | 171 | |
| 169 | 172 | test "@intCast > 128 bits" { |
| 170 | 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 | 176 | try testIntCast(u8, 123, u140, 123); |
| 174 | 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 | 415 | } |
| 416 | 416 | |
| 417 | 417 | test "type pun extern struct" { |
| 418 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 419 | ||
| 418 | 420 | const S = extern struct { f: u8 }; |
| 419 | 421 | comptime var s = S{ .f = 123 }; |
| 420 | 422 | @as(*u8, @ptrCast(&s)).* = 72; |
| ... | ... | @@ -434,7 +436,7 @@ test "type pun null pointer-like optional" { |
| 434 | 436 | } |
| 435 | 437 | |
| 436 | 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 | 441 | comptime var array: [5]u8 = "hello".*; |
| 440 | 442 | array[5..5].* = .{}; |
| ... | ... | @@ -514,7 +516,8 @@ fn fieldPtrTest() u32 { |
| 514 | 516 | return a.value; |
| 515 | 517 | } |
| 516 | 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 | 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 | 601 | } |
| 599 | 602 | |
| 600 | 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 | 606 | const p0: *const *anyopaque = &@ptrFromInt(0x1000); |
| 602 | 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 | 10 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 11 | 11 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 12 | 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 | 15 | const strs = [_][*]const u8{ "one", "two", "three" }; |
| 16 | 16 | argv = &strs; |
test/behavior/decl_literals.zig+4-2| ... | ... | @@ -33,6 +33,7 @@ test "decl literal with pointer" { |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | test "call decl literal with optional" { |
| 36 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 36 | 37 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 37 | 38 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 38 | 39 | |
| ... | ... | @@ -48,7 +49,7 @@ test "call decl literal with optional" { |
| 48 | 49 | } |
| 49 | 50 | |
| 50 | 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 | 54 | const S = struct { |
| 54 | 55 | x: u32, |
| ... | ... | @@ -62,6 +63,7 @@ test "call decl literal with pointer" { |
| 62 | 63 | } |
| 63 | 64 | |
| 64 | 65 | test "call decl literal" { |
| 66 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 65 | 67 | const S = struct { |
| 66 | 68 | x: u32, |
| 67 | 69 | fn init() @This() { |
| ... | ... | @@ -74,7 +76,7 @@ test "call decl literal" { |
| 74 | 76 | } |
| 75 | 77 | |
| 76 | 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 | 81 | const S = struct { |
| 80 | 82 | x: u32, |
test/behavior/defer.zig+7-2| ... | ... | @@ -5,6 +5,8 @@ const expectEqual = std.testing.expectEqual; |
| 5 | 5 | const expectError = std.testing.expectError; |
| 6 | 6 | |
| 7 | 7 | test "break and continue inside loop inside defer expression" { |
| 8 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 9 | ||
| 8 | 10 | testBreakContInDefer(10); |
| 9 | 11 | comptime testBreakContInDefer(10); |
| 10 | 12 | } |
| ... | ... | @@ -32,6 +34,7 @@ test "defer and labeled break" { |
| 32 | 34 | } |
| 33 | 35 | |
| 34 | 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 | 38 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 36 | 39 | |
| 37 | 40 | if (testNestedFnErrDefer()) |_| @panic("expected error") else |e| try expect(e == error.Bad); |
| ... | ... | @@ -49,6 +52,7 @@ fn testNestedFnErrDefer() anyerror!void { |
| 49 | 52 | } |
| 50 | 53 | |
| 51 | 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 | 56 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 53 | 57 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 54 | 58 | |
| ... | ... | @@ -89,7 +93,7 @@ fn runSomeErrorDefers(x: bool) !bool { |
| 89 | 93 | } |
| 90 | 94 | |
| 91 | 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 | 97 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 94 | 98 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 95 | 99 | |
| ... | ... | @@ -109,7 +113,8 @@ test "mixing normal and error defers" { |
| 109 | 113 | |
| 110 | 114 | test "simple else prong doesn't emit an error for unreachable else prong" { |
| 111 | 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 | 118 | const S = struct { |
| 114 | 119 | fn foo() error{Foo}!void { |
| 115 | 120 | return error.Foo; |
test/behavior/destructure.zig+14| ... | ... | @@ -4,6 +4,8 @@ const assert = std.debug.assert; |
| 4 | 4 | const expect = std.testing.expect; |
| 5 | 5 | |
| 6 | 6 | test "simple destructure" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 8 | ||
| 7 | 9 | const S = struct { |
| 8 | 10 | fn doTheTest() !void { |
| 9 | 11 | var x: u32 = undefined; |
| ... | ... | @@ -23,6 +25,8 @@ test "simple destructure" { |
| 23 | 25 | } |
| 24 | 26 | |
| 25 | 27 | test "destructure with comptime syntax" { |
| 28 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 29 | ||
| 26 | 30 | const S = struct { |
| 27 | 31 | fn doTheTest() !void { |
| 28 | 32 | { |
| ... | ... | @@ -78,6 +82,8 @@ test "destructure with comptime syntax" { |
| 78 | 82 | } |
| 79 | 83 | |
| 80 | 84 | test "destructure from labeled block" { |
| 85 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 86 | ||
| 81 | 87 | const S = struct { |
| 82 | 88 | fn doTheTest(rt_true: bool) !void { |
| 83 | 89 | const x: u32, const y: u8, const z: i64 = blk: { |
| ... | ... | @@ -96,6 +102,8 @@ test "destructure from labeled block" { |
| 96 | 102 | } |
| 97 | 103 | |
| 98 | 104 | test "destructure tuple value" { |
| 105 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 106 | ||
| 99 | 107 | const tup: struct { f32, u32, i64 } = .{ 10.0, 20, 30 }; |
| 100 | 108 | const x, const y, const z = tup; |
| 101 | 109 | |
| ... | ... | @@ -109,6 +117,8 @@ test "destructure tuple value" { |
| 109 | 117 | } |
| 110 | 118 | |
| 111 | 119 | test "destructure array value" { |
| 120 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 121 | ||
| 112 | 122 | const arr: [3]u32 = .{ 10, 20, 30 }; |
| 113 | 123 | const x, const y, const z = arr; |
| 114 | 124 | |
| ... | ... | @@ -122,6 +132,8 @@ test "destructure array value" { |
| 122 | 132 | } |
| 123 | 133 | |
| 124 | 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 | 137 | const Tuple = struct { u8, u16, u32 }; |
| 126 | 138 | const x, const y, const z = Tuple{ |
| 127 | 139 | .@"0" = 100, |
| ... | ... | @@ -149,6 +161,8 @@ test "destructure of comptime-known tuple is comptime-known" { |
| 149 | 161 | } |
| 150 | 162 | |
| 151 | 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 | 166 | var z: u32 = undefined; |
| 153 | 167 | var x: u8, const y, z = .{ 1, 2, 3 }; |
| 154 | 168 | _ = &x; |
test/behavior/enum.zig+32-14| ... | ... | @@ -12,6 +12,8 @@ fn shouldEqual(n: Number, expected: u3) !void { |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | test "enum to int" { |
| 15 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 16 | ||
| 15 | 17 | try shouldEqual(Number.Zero, 0); |
| 16 | 18 | try shouldEqual(Number.One, 1); |
| 17 | 19 | try shouldEqual(Number.Two, 2); |
| ... | ... | @@ -614,6 +616,7 @@ test "enum with specified tag values" { |
| 614 | 616 | } |
| 615 | 617 | |
| 616 | 618 | test "non-exhaustive enum" { |
| 619 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 617 | 620 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 618 | 621 | |
| 619 | 622 | const S = struct { |
| ... | ... | @@ -657,6 +660,8 @@ test "non-exhaustive enum" { |
| 657 | 660 | } |
| 658 | 661 | |
| 659 | 662 | test "empty non-exhaustive enum" { |
| 663 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 664 | ||
| 660 | 665 | const S = struct { |
| 661 | 666 | const E = enum(u8) { _ }; |
| 662 | 667 | |
| ... | ... | @@ -678,6 +683,7 @@ test "empty non-exhaustive enum" { |
| 678 | 683 | } |
| 679 | 684 | |
| 680 | 685 | test "single field non-exhaustive enum" { |
| 686 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 681 | 687 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 682 | 688 | |
| 683 | 689 | const S = struct { |
| ... | ... | @@ -796,6 +802,8 @@ test "enum with 1 field but explicit tag type should still have the tag type" { |
| 796 | 802 | } |
| 797 | 803 | |
| 798 | 804 | test "signed integer as enum tag" { |
| 805 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 806 | ||
| 799 | 807 | const SignedEnum = enum(i2) { |
| 800 | 808 | A0 = -1, |
| 801 | 809 | A1 = 0, |
| ... | ... | @@ -880,6 +888,8 @@ test "method call on an enum" { |
| 880 | 888 | } |
| 881 | 889 | |
| 882 | 890 | test "enum value allocation" { |
| 891 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 892 | ||
| 883 | 893 | const LargeEnum = enum(u32) { |
| 884 | 894 | A0 = 0x80000000, |
| 885 | 895 | A1, |
| ... | ... | @@ -892,6 +902,7 @@ test "enum value allocation" { |
| 892 | 902 | } |
| 893 | 903 | |
| 894 | 904 | test "enum literal casting to tagged union" { |
| 905 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 895 | 906 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 896 | 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 | 929 | const Bar = enum { A, B, C, D }; |
| 919 | 930 | |
| 920 | 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 | 933 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 922 | 934 | |
| 923 | 935 | var bar: error{B}!Bar = undefined; |
| ... | ... | @@ -927,6 +939,7 @@ test "enum literal casting to error union with payload enum" { |
| 927 | 939 | } |
| 928 | 940 | |
| 929 | 941 | test "constant enum initialization with differing sizes" { |
| 942 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 930 | 943 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 931 | 944 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 932 | 945 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -972,7 +985,7 @@ test "@tagName" { |
| 972 | 985 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 973 | 986 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 974 | 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 | 990 | try expect(mem.eql(u8, testEnumTagNameBare(BareNumber.Three), "Three")); |
| 978 | 991 | comptime assert(mem.eql(u8, testEnumTagNameBare(BareNumber.Three), "Three")); |
| ... | ... | @@ -988,7 +1001,7 @@ test "@tagName non-exhaustive enum" { |
| 988 | 1001 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 989 | 1002 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 990 | 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 | 1005 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 993 | 1006 | |
| 994 | 1007 | try expect(mem.eql(u8, testEnumTagNameBare(NonExhaustive.B), "B")); |
| ... | ... | @@ -1000,7 +1013,7 @@ test "@tagName is null-terminated" { |
| 1000 | 1013 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1001 | 1014 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1002 | 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 | 1017 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1005 | 1018 | |
| 1006 | 1019 | const S = struct { |
| ... | ... | @@ -1016,7 +1029,7 @@ test "tag name with assigned enum values" { |
| 1016 | 1029 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1017 | 1030 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1018 | 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 | 1033 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1021 | 1034 | |
| 1022 | 1035 | const LocalFoo = enum(u8) { |
| ... | ... | @@ -1030,7 +1043,7 @@ test "tag name with assigned enum values" { |
| 1030 | 1043 | |
| 1031 | 1044 | test "@tagName on enum literals" { |
| 1032 | 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 | 1048 | try expect(mem.eql(u8, @tagName(.FooBar), "FooBar")); |
| 1036 | 1049 | comptime assert(mem.eql(u8, @tagName(.FooBar), "FooBar")); |
| ... | ... | @@ -1040,7 +1053,7 @@ test "tag name with signed enum values" { |
| 1040 | 1053 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1041 | 1054 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1042 | 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 | 1057 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1045 | 1058 | |
| 1046 | 1059 | const LocalFoo = enum(isize) { |
| ... | ... | @@ -1057,7 +1070,7 @@ test "tag name with signed enum values" { |
| 1057 | 1070 | test "tag name with large enum values" { |
| 1058 | 1071 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1059 | 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 | 1075 | const Kdf = enum(u128) { |
| 1063 | 1076 | aes_kdf = 0xea4f8ac1080d74bf60448a629af3d9c9, |
| ... | ... | @@ -1077,7 +1090,7 @@ test "tag name with large enum values" { |
| 1077 | 1090 | test "@tagName with exotic integer enum types" { |
| 1078 | 1091 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1079 | 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 | 1095 | const S = struct { |
| 1083 | 1096 | fn testEnumSigned(comptime T: type) !void { |
| ... | ... | @@ -1177,7 +1190,7 @@ test "@tagName in callconv(.c) function" { |
| 1177 | 1190 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1178 | 1191 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1179 | 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 | 1194 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1182 | 1195 | |
| 1183 | 1196 | try expect(mem.orderZ(u8, testEnumTagNameCallconvC(), "Two") == .eq); |
| ... | ... | @@ -1191,6 +1204,7 @@ fn testEnumTagNameCallconvC() callconv(.c) [*:0]const u8 { |
| 1191 | 1204 | } |
| 1192 | 1205 | |
| 1193 | 1206 | test "enum literal casting to optional" { |
| 1207 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1194 | 1208 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1195 | 1209 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1196 | 1210 | |
| ... | ... | @@ -1217,7 +1231,7 @@ const bit_field_1 = BitFieldOfEnums{ |
| 1217 | 1231 | }; |
| 1218 | 1232 | |
| 1219 | 1233 | test "bit field access with enum fields" { |
| 1220 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1234 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1221 | 1235 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1222 | 1236 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1223 | 1237 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1261,7 +1275,7 @@ test "tag name functions are unique" { |
| 1261 | 1275 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1262 | 1276 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1263 | 1277 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1264 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1278 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1265 | 1279 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1266 | 1280 | |
| 1267 | 1281 | { |
| ... | ... | @@ -1280,7 +1294,7 @@ test "tag name functions are unique" { |
| 1280 | 1294 | |
| 1281 | 1295 | test "size of enum with only one tag which has explicit integer tag type" { |
| 1282 | 1296 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1283 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1297 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1284 | 1298 | |
| 1285 | 1299 | const E = enum(u8) { nope = 10 }; |
| 1286 | 1300 | const S0 = struct { e: E }; |
| ... | ... | @@ -1315,7 +1329,7 @@ test "switch on an extern enum with negative value" { |
| 1315 | 1329 | } |
| 1316 | 1330 | |
| 1317 | 1331 | test "switch on an enum with small signed tag type" { |
| 1318 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1332 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1319 | 1333 | |
| 1320 | 1334 | const E = enum(i3) { |
| 1321 | 1335 | y = -2, |
| ... | ... | @@ -1359,7 +1373,7 @@ test "enum tag from a local variable" { |
| 1359 | 1373 | } |
| 1360 | 1374 | |
| 1361 | 1375 | test "auto-numbered enum with signed tag type" { |
| 1362 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1376 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1363 | 1377 | |
| 1364 | 1378 | const E = enum(i32) { a, b }; |
| 1365 | 1379 | |
| ... | ... | @@ -1376,6 +1390,7 @@ test "auto-numbered enum with signed tag type" { |
| 1376 | 1390 | } |
| 1377 | 1391 | |
| 1378 | 1392 | test "lazy initialized field" { |
| 1393 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1379 | 1394 | try std.testing.expectEqual(@as(u8, @alignOf(struct {})), getLazyInitialized(.a)); |
| 1380 | 1395 | } |
| 1381 | 1396 | |
| ... | ... | @@ -1404,6 +1419,7 @@ test "matching captures causes enum equivalence" { |
| 1404 | 1419 | } |
| 1405 | 1420 | |
| 1406 | 1421 | test "large enum field values" { |
| 1422 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1407 | 1423 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1408 | 1424 | |
| 1409 | 1425 | { |
| ... | ... | @@ -1452,6 +1468,8 @@ test "comptime @enumFromInt with signed arithmetic" { |
| 1452 | 1468 | } |
| 1453 | 1469 | |
| 1454 | 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 | ||
| 1455 | 1473 | const static = struct { |
| 1456 | 1474 | const E = enum(E.IntTag) { |
| 1457 | 1475 | const IntTag = u8; |
test/behavior/error.zig+54-15| ... | ... | @@ -30,6 +30,7 @@ fn shouldBeNotEqual(a: anyerror, b: anyerror) void { |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | test "error binary operator" { |
| 33 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 33 | 34 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 34 | 35 | |
| 35 | 36 | const a = errBinaryOperatorG(true) catch 3; |
| ... | ... | @@ -61,12 +62,14 @@ pub fn baz() anyerror!i32 { |
| 61 | 62 | } |
| 62 | 63 | |
| 63 | 64 | test "error wrapping" { |
| 65 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 64 | 66 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 65 | 67 | |
| 66 | 68 | try expect((baz() catch unreachable) == 15); |
| 67 | 69 | } |
| 68 | 70 | |
| 69 | 71 | test "unwrap simple value from error" { |
| 72 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 70 | 73 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 71 | 74 | |
| 72 | 75 | const i = unwrapSimpleValueFromErrorDo() catch unreachable; |
| ... | ... | @@ -77,6 +80,7 @@ fn unwrapSimpleValueFromErrorDo() anyerror!isize { |
| 77 | 80 | } |
| 78 | 81 | |
| 79 | 82 | test "error return in assignment" { |
| 83 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 80 | 84 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 81 | 85 | |
| 82 | 86 | doErrReturnInAssignment() catch unreachable; |
| ... | ... | @@ -98,6 +102,7 @@ test "syntax: optional operator in front of error union operator" { |
| 98 | 102 | } |
| 99 | 103 | |
| 100 | 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 | 106 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 102 | 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 | 129 | |
| 125 | 130 | test "implicit cast to optional to error union to return result loc" { |
| 126 | 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 | 134 | const S = struct { |
| 130 | 135 | fn entry() !void { |
| ... | ... | @@ -145,12 +150,14 @@ test "implicit cast to optional to error union to return result loc" { |
| 145 | 150 | } |
| 146 | 151 | |
| 147 | 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 | 155 | entry(); |
| 149 | 156 | comptime entry(); |
| 150 | 157 | } |
| 151 | 158 | |
| 152 | 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 | 162 | entryPtr(); |
| 156 | 163 | comptime entryPtr(); |
| ... | ... | @@ -182,6 +189,8 @@ fn fooPtr(f: *const fn () anyerror!void) void { |
| 182 | 189 | fn bar2() (error{}!void) {} |
| 183 | 190 | |
| 184 | 191 | test "error union type " { |
| 192 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 193 | ||
| 185 | 194 | try testErrorUnionType(); |
| 186 | 195 | try comptime testErrorUnionType(); |
| 187 | 196 | } |
| ... | ... | @@ -195,6 +204,8 @@ fn testErrorUnionType() !void { |
| 195 | 204 | } |
| 196 | 205 | |
| 197 | 206 | test "error set type" { |
| 207 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 208 | ||
| 198 | 209 | try testErrorSetType(); |
| 199 | 210 | try comptime testErrorSetType(); |
| 200 | 211 | } |
| ... | ... | @@ -218,6 +229,7 @@ fn testErrorSetType() !void { |
| 218 | 229 | } |
| 219 | 230 | |
| 220 | 231 | test "explicit error set cast" { |
| 232 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 221 | 233 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 222 | 234 | |
| 223 | 235 | try testExplicitErrorSetCast(Set1.A); |
| ... | ... | @@ -236,6 +248,7 @@ fn testExplicitErrorSetCast(set1: Set1) !void { |
| 236 | 248 | } |
| 237 | 249 | |
| 238 | 250 | test "@errorCast on error unions" { |
| 251 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 239 | 252 | const S = struct { |
| 240 | 253 | fn doTheTest() !void { |
| 241 | 254 | { |
| ... | ... | @@ -262,6 +275,7 @@ test "@errorCast on error unions" { |
| 262 | 275 | } |
| 263 | 276 | |
| 264 | 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 | 279 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 266 | 280 | |
| 267 | 281 | try testComptimeTestErrorEmptySet(1234); |
| ... | ... | @@ -298,6 +312,8 @@ test "inferred empty error set comptime catch" { |
| 298 | 312 | } |
| 299 | 313 | |
| 300 | 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 | 317 | const S = struct { |
| 302 | 318 | const Struct = struct { |
| 303 | 319 | pub fn func() (error{})!usize { |
| ... | ... | @@ -319,6 +335,7 @@ test "error inference with an empty set" { |
| 319 | 335 | } |
| 320 | 336 | |
| 321 | 337 | test "error union peer type resolution" { |
| 338 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 322 | 339 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 323 | 340 | |
| 324 | 341 | try testErrorUnionPeerTypeResolution(1); |
| ... | ... | @@ -350,6 +367,7 @@ fn quux_1() !i32 { |
| 350 | 367 | } |
| 351 | 368 | |
| 352 | 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 | 371 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 354 | 372 | |
| 355 | 373 | _ = try foo3(0); |
| ... | ... | @@ -363,7 +381,7 @@ fn foo3(b: usize) Error!usize { |
| 363 | 381 | |
| 364 | 382 | test "error: Infer error set from literals" { |
| 365 | 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 | 386 | _ = nullLiteral("n") catch |err| handleErrors(err); |
| 369 | 387 | _ = floatLiteral("n") catch |err| handleErrors(err); |
| ... | ... | @@ -400,6 +418,7 @@ fn intLiteral(str: []const u8) !?i64 { |
| 400 | 418 | } |
| 401 | 419 | |
| 402 | 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 | 422 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 404 | 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 | 465 | } |
| 447 | 466 | |
| 448 | 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 | 469 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 450 | 470 | |
| 451 | 471 | const S = struct { |
| ... | ... | @@ -477,6 +497,7 @@ test "optional error set is the same size as error set" { |
| 477 | 497 | } |
| 478 | 498 | |
| 479 | 499 | test "nested catch" { |
| 500 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 480 | 501 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 481 | 502 | |
| 482 | 503 | const S = struct { |
| ... | ... | @@ -502,7 +523,7 @@ test "nested catch" { |
| 502 | 523 | |
| 503 | 524 | test "function pointer with return type that is error union with payload which is pointer of parent struct" { |
| 504 | 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 | 528 | const S = struct { |
| 508 | 529 | const Foo = struct { |
| ... | ... | @@ -524,6 +545,7 @@ test "function pointer with return type that is error union with payload which i |
| 524 | 545 | } |
| 525 | 546 | |
| 526 | 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 | 549 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 528 | 550 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 529 | 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 | 577 | } |
| 556 | 578 | |
| 557 | 579 | test "error payload type is correctly resolved" { |
| 580 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 558 | 581 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 559 | 582 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 560 | 583 | |
| ... | ... | @@ -585,7 +608,7 @@ test "error union comptime caching" { |
| 585 | 608 | test "@errorName" { |
| 586 | 609 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 587 | 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 | 612 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 590 | 613 | |
| 591 | 614 | try expect(mem.eql(u8, @errorName(error.AnError), "AnError")); |
| ... | ... | @@ -599,7 +622,7 @@ fn gimmeItBroke() anyerror { |
| 599 | 622 | test "@errorName sentinel length matches slice length" { |
| 600 | 623 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 601 | 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 | 626 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 604 | 627 | |
| 605 | 628 | const name = testBuiltinErrorName(error.FooBar); |
| ... | ... | @@ -613,6 +636,8 @@ pub fn testBuiltinErrorName(err: anyerror) [:0]const u8 { |
| 613 | 636 | } |
| 614 | 637 | |
| 615 | 638 | test "error set equality" { |
| 639 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 640 | ||
| 616 | 641 | const a = error{One}; |
| 617 | 642 | const b = error{One}; |
| 618 | 643 | |
| ... | ... | @@ -628,6 +653,7 @@ test "error set equality" { |
| 628 | 653 | } |
| 629 | 654 | |
| 630 | 655 | test "inferred error set equality" { |
| 656 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 631 | 657 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 632 | 658 | |
| 633 | 659 | const S = struct { |
| ... | ... | @@ -691,6 +717,7 @@ test "coerce error set to the current inferred error set" { |
| 691 | 717 | } |
| 692 | 718 | |
| 693 | 719 | test "error union payload is properly aligned" { |
| 720 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 694 | 721 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 695 | 722 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 696 | 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 | 750 | } |
| 724 | 751 | |
| 725 | 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 | 754 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 727 | 755 | |
| 728 | 756 | const S = struct { |
| ... | ... | @@ -750,7 +778,7 @@ test "simple else prong allowed even when all errors handled" { |
| 750 | 778 | test "pointer to error union payload" { |
| 751 | 779 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 752 | 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 | 782 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 755 | 783 | |
| 756 | 784 | var err_union: anyerror!u8 = 15; |
| ... | ... | @@ -781,7 +809,7 @@ const NoReturn = struct { |
| 781 | 809 | }; |
| 782 | 810 | |
| 783 | 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 | 813 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 786 | 814 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 787 | 815 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -795,7 +823,7 @@ test "error union of noreturn used with if" { |
| 795 | 823 | } |
| 796 | 824 | |
| 797 | 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 | 827 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 800 | 828 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 801 | 829 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -806,7 +834,7 @@ test "error union of noreturn used with try" { |
| 806 | 834 | } |
| 807 | 835 | |
| 808 | 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 | 838 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 811 | 839 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 812 | 840 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -819,7 +847,7 @@ test "error union of noreturn used with catch" { |
| 819 | 847 | test "alignment of wrapping an error union payload" { |
| 820 | 848 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 821 | 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 | 851 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 824 | 852 | |
| 825 | 853 | const S = struct { |
| ... | ... | @@ -835,6 +863,7 @@ test "alignment of wrapping an error union payload" { |
| 835 | 863 | } |
| 836 | 864 | |
| 837 | 865 | test "compare error union and error set" { |
| 866 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 838 | 867 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 839 | 868 | |
| 840 | 869 | var a: anyerror = error.Foo; |
| ... | ... | @@ -872,7 +901,7 @@ test "catch within a function that calls no errorable functions" { |
| 872 | 901 | test "error from comptime string" { |
| 873 | 902 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 874 | 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 | 905 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 877 | 906 | |
| 878 | 907 | const name = "Weird error name!"; |
| ... | ... | @@ -887,6 +916,8 @@ test "error from comptime string" { |
| 887 | 916 | } |
| 888 | 917 | |
| 889 | 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 | 921 | const E1 = @TypeOf(error.Foo); |
| 891 | 922 | try expect(@TypeOf(E1.Foo) == E1); |
| 892 | 923 | const E2 = error{ A, B, C }; |
| ... | ... | @@ -895,6 +926,7 @@ test "field access of anyerror results in smaller error set" { |
| 895 | 926 | } |
| 896 | 927 | |
| 897 | 928 | test "optional error union return type" { |
| 929 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 898 | 930 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 899 | 931 | |
| 900 | 932 | const S = struct { |
| ... | ... | @@ -933,7 +965,7 @@ test "optional error set function parameter" { |
| 933 | 965 | |
| 934 | 966 | test "returning an error union containing a type with no runtime bits" { |
| 935 | 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 | 970 | const ZeroByteType = struct { |
| 939 | 971 | foo: void, |
| ... | ... | @@ -949,7 +981,7 @@ test "returning an error union containing a type with no runtime bits" { |
| 949 | 981 | |
| 950 | 982 | test "try used in recursive function with inferred error set" { |
| 951 | 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 | 986 | const Value = union(enum) { |
| 955 | 987 | values: []const @This(), |
| ... | ... | @@ -1010,6 +1042,7 @@ test "function called at runtime is properly analyzed for inferred error set" { |
| 1010 | 1042 | } |
| 1011 | 1043 | |
| 1012 | 1044 | test "errorCast to adhoc inferred error set" { |
| 1045 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1013 | 1046 | const S = struct { |
| 1014 | 1047 | inline fn baz() !i32 { |
| 1015 | 1048 | return @errorCast(err()); |
| ... | ... | @@ -1022,6 +1055,7 @@ test "errorCast to adhoc inferred error set" { |
| 1022 | 1055 | } |
| 1023 | 1056 | |
| 1024 | 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 | 1059 | const S = struct { |
| 1026 | 1060 | fn doTheTest(set: error{ A, B }) error{A}!i32 { |
| 1027 | 1061 | return @errorCast(set); |
| ... | ... | @@ -1032,6 +1066,7 @@ test "@errorCast from error set to error union" { |
| 1032 | 1066 | } |
| 1033 | 1067 | |
| 1034 | 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 | 1070 | const S = struct { |
| 1036 | 1071 | fn doTheTest(set: error{ A, B }!i32) error{A}!i32 { |
| 1037 | 1072 | return @errorCast(set); |
| ... | ... | @@ -1045,7 +1080,7 @@ test "result location initialization of error union with OPV payload" { |
| 1045 | 1080 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1046 | 1081 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1047 | 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 | 1084 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 1050 | 1085 | |
| 1051 | 1086 | const S = struct { |
| ... | ... | @@ -1067,6 +1102,7 @@ test "result location initialization of error union with OPV payload" { |
| 1067 | 1102 | } |
| 1068 | 1103 | |
| 1069 | 1104 | test "return error union with i65" { |
| 1105 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1070 | 1106 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1071 | 1107 | |
| 1072 | 1108 | try expect(try add(1000, 234) == 1234); |
| ... | ... | @@ -1077,6 +1113,7 @@ fn add(x: i65, y: i65) anyerror!i65 { |
| 1077 | 1113 | } |
| 1078 | 1114 | |
| 1079 | 1115 | test "compare error union to error set" { |
| 1116 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1080 | 1117 | const S = struct { |
| 1081 | 1118 | fn doTheTest(val: error{Foo}!i32) !void { |
| 1082 | 1119 | if (error.Foo == val) return error.Unexpected; |
| ... | ... | @@ -1107,6 +1144,7 @@ test "'if' ignores error via local while 'else' ignores error directly" { |
| 1107 | 1144 | } |
| 1108 | 1145 | |
| 1109 | 1146 | test "@errorCast into own inferred error set" { |
| 1147 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1110 | 1148 | const static = struct { |
| 1111 | 1149 | fn foo(b: bool) !void { |
| 1112 | 1150 | if (b) { |
| ... | ... | @@ -1140,6 +1178,7 @@ test "@errorCast into other inferred error set" { |
| 1140 | 1178 | } |
| 1141 | 1179 | |
| 1142 | 1180 | test "error union with vector type" { |
| 1181 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1143 | 1182 | var x: anyerror!@Vector(5, f64) = undefined; |
| 1144 | 1183 | x = error.Expected; |
| 1145 | 1184 | try expect(x == error.Expected); |
test/behavior/eval.zig+49-21| ... | ... | @@ -5,7 +5,7 @@ const expect = std.testing.expect; |
| 5 | 5 | const expectEqual = std.testing.expectEqual; |
| 6 | 6 | |
| 7 | 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 | 10 | try expect(some_data.len == 21); |
| 11 | 11 | } |
| ... | ... | @@ -72,6 +72,7 @@ fn constExprEvalOnSingleExprBlocksFn(x: i32, b: bool) i32 { |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | test "constant expressions" { |
| 75 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 75 | 76 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 76 | 77 | |
| 77 | 78 | var array: [array_size]u8 = undefined; |
| ... | ... | @@ -93,6 +94,7 @@ fn letsTryToCompareBools(a: bool, b: bool) bool { |
| 93 | 94 | return max(bool, a, b); |
| 94 | 95 | } |
| 95 | 96 | test "inlined block and runtime block phi" { |
| 97 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 96 | 98 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 97 | 99 | |
| 98 | 100 | try expect(letsTryToCompareBools(true, true)); |
| ... | ... | @@ -141,7 +143,7 @@ test "pointer to type" { |
| 141 | 143 | test "a type constructed in a global expression" { |
| 142 | 144 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 143 | 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 | 148 | var l: List = undefined; |
| 147 | 149 | l.array[0] = 10; |
| ... | ... | @@ -234,6 +236,7 @@ const vertices = [_]Vertex{ |
| 234 | 236 | }; |
| 235 | 237 | |
| 236 | 238 | test "statically initialized list" { |
| 239 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 237 | 240 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 238 | 241 | |
| 239 | 242 | try expect(static_point_list[0].x == 1); |
| ... | ... | @@ -303,6 +306,7 @@ fn performFn(comptime prefix_char: u8, start_value: i32) i32 { |
| 303 | 306 | } |
| 304 | 307 | |
| 305 | 308 | test "comptime iterate over fn ptr list" { |
| 309 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 306 | 310 | try expect(performFn('t', 1) == 6); |
| 307 | 311 | try expect(performFn('o', 0) == 1); |
| 308 | 312 | try expect(performFn('w', 99) == 99); |
| ... | ... | @@ -339,6 +343,7 @@ fn doesAlotT(comptime T: type, value: usize) T { |
| 339 | 343 | } |
| 340 | 344 | |
| 341 | 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 | 347 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 343 | 348 | |
| 344 | 349 | try expect(doesAlotT(u32, 2) == 2); |
| ... | ... | @@ -390,7 +395,7 @@ test "return 0 from function that has u0 return type" { |
| 390 | 395 | } |
| 391 | 396 | |
| 392 | 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 | 399 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 395 | 400 | |
| 396 | 401 | st_init_str_foo.x += 1; |
| ... | ... | @@ -406,6 +411,7 @@ var st_init_str_foo = StInitStrFoo{ |
| 406 | 411 | }; |
| 407 | 412 | |
| 408 | 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 | 415 | var res: usize = 0; |
| 410 | 416 | inline for ([_]type{ [2]u8, [1]u8, [2]u8 }) |T| { |
| 411 | 417 | var a: T = undefined; |
| ... | ... | @@ -441,7 +447,7 @@ fn copyWithPartialInline(s: []u32, b: []u8) void { |
| 441 | 447 | test "binary math operator in partially inlined function" { |
| 442 | 448 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 443 | 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 | 452 | var s: [4]u32 = undefined; |
| 447 | 453 | var b: [16]u8 = undefined; |
| ... | ... | @@ -484,6 +490,7 @@ test "comptime bitwise operators" { |
| 484 | 490 | } |
| 485 | 491 | |
| 486 | 492 | test "comptime shlWithOverflow" { |
| 493 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 487 | 494 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 488 | 495 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 489 | 496 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -498,7 +505,7 @@ test "comptime shlWithOverflow" { |
| 498 | 505 | |
| 499 | 506 | test "const ptr to variable data changes at runtime" { |
| 500 | 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 | 510 | try expect(foo_ref.name[0] == 'a'); |
| 504 | 511 | foo_ref.name = "b"; |
| ... | ... | @@ -515,7 +522,7 @@ const foo_ref = &foo_contents; |
| 515 | 522 | test "runtime 128 bit integer division" { |
| 516 | 523 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 517 | 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 | 526 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 520 | 527 | |
| 521 | 528 | var a: u128 = 152313999999999991610955792383; |
| ... | ... | @@ -527,13 +534,14 @@ test "runtime 128 bit integer division" { |
| 527 | 534 | |
| 528 | 535 | test "@tagName of @typeInfo" { |
| 529 | 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 | 539 | const str = @tagName(@typeInfo(u8)); |
| 533 | 540 | try expect(std.mem.eql(u8, str, "int")); |
| 534 | 541 | } |
| 535 | 542 | |
| 536 | 543 | test "static eval list init" { |
| 544 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 537 | 545 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 538 | 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 | 559 | } |
| 552 | 560 | |
| 553 | 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 | 563 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 555 | 564 | |
| 556 | 565 | var runtime = [1]i32{3}; |
| ... | ... | @@ -603,7 +612,7 @@ const hi1 = "hi"; |
| 603 | 612 | const hi2 = hi1; |
| 604 | 613 | test "const global shares pointer with other same one" { |
| 605 | 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 | 617 | try assertEqualPtrs(&hi1[0], &hi2[0]); |
| 609 | 618 | comptime assert(&hi1[0] == &hi2[0]); |
| ... | ... | @@ -722,7 +731,7 @@ fn testVarInsideInlineLoop(args: anytype) !void { |
| 722 | 731 | test "array concatenation of function calls" { |
| 723 | 732 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 724 | 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 | 736 | var a = oneItem(3) ++ oneItem(4); |
| 728 | 737 | try expect(std.mem.eql(i32, &a, &[_]i32{ 3, 4 })); |
| ... | ... | @@ -737,6 +746,7 @@ fn scalar(x: u32) u32 { |
| 737 | 746 | } |
| 738 | 747 | |
| 739 | 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 | 750 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 741 | 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 | 765 | test "array concatenation peer resolves element types - pointer" { |
| 756 | 766 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 757 | 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 | 770 | var a = [2]u3{ 1, 7 }; |
| 761 | 771 | var b = [3]u8{ 200, 225, 255 }; |
| ... | ... | @@ -772,7 +782,7 @@ test "array concatenation sets the sentinel - value" { |
| 772 | 782 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 773 | 783 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 774 | 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 | 787 | var a = [2]u3{ 1, 7 }; |
| 778 | 788 | var b = [3:69]u8{ 200, 225, 255 }; |
| ... | ... | @@ -791,7 +801,7 @@ test "array concatenation sets the sentinel - value" { |
| 791 | 801 | test "array concatenation sets the sentinel - pointer" { |
| 792 | 802 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 793 | 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 | 806 | var a = [2]u3{ 1, 7 }; |
| 797 | 807 | var b = [3:69]u8{ 200, 225, 255 }; |
| ... | ... | @@ -926,7 +936,7 @@ test "closure capture type of runtime-known var" { |
| 926 | 936 | } |
| 927 | 937 | |
| 928 | 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 | 940 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 931 | 941 | |
| 932 | 942 | const S = struct { |
| ... | ... | @@ -959,7 +969,7 @@ test "comptime break passing through runtime condition converted to runtime brea |
| 959 | 969 | } |
| 960 | 970 | |
| 961 | 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 | 973 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 964 | 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 | 1006 | } |
| 997 | 1007 | |
| 998 | 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 | 1011 | const S = struct { |
| 1000 | 1012 | fn doTheTest(runtime: u8) !void { |
| 1001 | 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 | 1024 | } |
| 1013 | 1025 | |
| 1014 | 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 | 1028 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1016 | 1029 | |
| 1017 | 1030 | const S = struct { |
| ... | ... | @@ -1038,7 +1051,7 @@ test "equality of pointers to comptime const" { |
| 1038 | 1051 | test "storing an array of type in a field" { |
| 1039 | 1052 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1040 | 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 | 1056 | const S = struct { |
| 1044 | 1057 | fn doTheTest() void { |
| ... | ... | @@ -1066,7 +1079,7 @@ test "storing an array of type in a field" { |
| 1066 | 1079 | |
| 1067 | 1080 | test "pass pointer to field of comptime-only type as a runtime parameter" { |
| 1068 | 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 | 1084 | const S = struct { |
| 1072 | 1085 | const Mixed = struct { |
| ... | ... | @@ -1192,7 +1205,8 @@ test "lazy value is resolved as slice operand" { |
| 1192 | 1205 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1193 | 1206 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1194 | 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 | 1210 | const A = struct { a: u32 }; |
| 1197 | 1211 | var a: [512]u64 = undefined; |
| 1198 | 1212 | |
| ... | ... | @@ -1203,6 +1217,8 @@ test "lazy value is resolved as slice operand" { |
| 1203 | 1217 | } |
| 1204 | 1218 | |
| 1205 | 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 | 1222 | const S = struct { |
| 1207 | 1223 | fn foo(a: u8) bool { |
| 1208 | 1224 | return a == 4; |
| ... | ... | @@ -1249,6 +1265,7 @@ test "inline for inside a runtime condition" { |
| 1249 | 1265 | } |
| 1250 | 1266 | |
| 1251 | 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 | 1269 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1253 | 1270 | |
| 1254 | 1271 | const arr = .{ 1, 2, 3 }; |
| ... | ... | @@ -1267,7 +1284,7 @@ test "continue in inline for inside a comptime switch" { |
| 1267 | 1284 | } |
| 1268 | 1285 | |
| 1269 | 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 | 1289 | const S = struct { |
| 1273 | 1290 | var bytes: [1024]u8 = undefined; |
| ... | ... | @@ -1316,7 +1333,7 @@ test "continue nested inline for loop in named block expr" { |
| 1316 | 1333 | } |
| 1317 | 1334 | |
| 1318 | 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 | 1337 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1321 | 1338 | |
| 1322 | 1339 | const T = struct { |
| ... | ... | @@ -1344,7 +1361,7 @@ test "x and false is comptime-known false" { |
| 1344 | 1361 | } |
| 1345 | 1362 | |
| 1346 | 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 | 1365 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1349 | 1366 | |
| 1350 | 1367 | const T = struct { |
| ... | ... | @@ -1372,6 +1389,7 @@ test "x or true is comptime-known true" { |
| 1372 | 1389 | } |
| 1373 | 1390 | |
| 1374 | 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 | 1393 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1376 | 1394 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1377 | 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 | 1409 | } |
| 1392 | 1410 | |
| 1393 | 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 | 1414 | const S = struct { |
| 1395 | 1415 | fn fnPtr(function: anytype) *const @TypeOf(function) { |
| 1396 | 1416 | return &function; |
| ... | ... | @@ -1406,7 +1426,7 @@ test "comptime function turns function value to function pointer" { |
| 1406 | 1426 | } |
| 1407 | 1427 | |
| 1408 | 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 | 1431 | const S = struct { |
| 1412 | 1432 | x: i32, |
| ... | ... | @@ -1451,6 +1471,8 @@ test "struct in comptime false branch is not evaluated" { |
| 1451 | 1471 | } |
| 1452 | 1472 | |
| 1453 | 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 | 1476 | var zds: u32 = 0; |
| 1455 | 1477 | zds = switch (zds) { |
| 1456 | 1478 | 0 => switch (zds) { |
| ... | ... | @@ -1465,6 +1487,8 @@ test "result of nested switch assigned to variable" { |
| 1465 | 1487 | } |
| 1466 | 1488 | |
| 1467 | 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 | 1492 | const T1 = struct { |
| 1469 | 1493 | fn v() error{}!usize { |
| 1470 | 1494 | return 1; |
| ... | ... | @@ -1519,6 +1543,8 @@ test "early exit in container level const" { |
| 1519 | 1543 | } |
| 1520 | 1544 | |
| 1521 | 1545 | test "@inComptime" { |
| 1546 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1547 | ||
| 1522 | 1548 | const S = struct { |
| 1523 | 1549 | fn inComptime() bool { |
| 1524 | 1550 | return @inComptime(); |
| ... | ... | @@ -1584,6 +1610,8 @@ test "comptime labeled block implicit exit" { |
| 1584 | 1610 | } |
| 1585 | 1611 | |
| 1586 | 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 | 1615 | const arr: [2]u8 = .{ 1, 2 }; |
| 1588 | 1616 | |
| 1589 | 1617 | var idx: usize = undefined; |
test/behavior/export_builtin.zig+3-3| ... | ... | @@ -4,7 +4,7 @@ const expect = std.testing.expect; |
| 4 | 4 | |
| 5 | 5 | test "exporting enum value" { |
| 6 | 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 | 9 | const S = struct { |
| 10 | 10 | const E = enum(c_int) { one, two }; |
| ... | ... | @@ -18,7 +18,7 @@ test "exporting enum value" { |
| 18 | 18 | |
| 19 | 19 | test "exporting using namespace access" { |
| 20 | 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 | 23 | const S = struct { |
| 24 | 24 | const Inner = struct { |
| ... | ... | @@ -35,7 +35,7 @@ test "exporting using namespace access" { |
| 35 | 35 | test "exporting comptime-known value" { |
| 36 | 36 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 37 | 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 | 40 | const x: u32 = 10; |
| 41 | 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 | 43 | } |
| 44 | 44 | |
| 45 | 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 | 48 | _ = struct { |
| 49 | 49 | fn foo_internal() callconv(.c) u32 { |
test/behavior/extern.zig+3-3| ... | ... | @@ -4,7 +4,7 @@ const expect = std.testing.expect; |
| 4 | 4 | |
| 5 | 5 | test "anyopaque extern symbol" { |
| 6 | 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 | 9 | const a = @extern(*anyopaque, .{ .name = "a_mystery_symbol" }); |
| 10 | 10 | const b: *i32 = @ptrCast(@alignCast(a)); |
| ... | ... | @@ -15,7 +15,7 @@ export var a_mystery_symbol: i32 = 1234; |
| 15 | 15 | |
| 16 | 16 | test "function extern symbol" { |
| 17 | 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 | 20 | const a = @extern(*const fn () callconv(.c) i32, .{ .name = "a_mystery_function" }); |
| 21 | 21 | try expect(a() == 4567); |
| ... | ... | @@ -27,7 +27,7 @@ export fn a_mystery_function() i32 { |
| 27 | 27 | |
| 28 | 28 | test "function extern symbol matches extern decl" { |
| 29 | 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 | 32 | const S = struct { |
| 33 | 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 | 2 | const builtin = @import("builtin"); |
| 3 | 3 | |
| 4 | 4 | test "@fieldParentPtr struct" { |
| 5 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 5 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 6 | 6 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 7 | 7 | |
| 8 | 8 | const C = struct { |
| ... | ... | @@ -139,7 +139,7 @@ test "@fieldParentPtr struct" { |
| 139 | 139 | |
| 140 | 140 | test "@fieldParentPtr extern struct" { |
| 141 | 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 | 144 | const C = extern struct { |
| 145 | 145 | a: bool = true, |
| ... | ... | @@ -274,7 +274,7 @@ test "@fieldParentPtr extern struct" { |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 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 | 278 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 279 | 279 | |
| 280 | 280 | const C = extern struct { |
| ... | ... | @@ -378,7 +378,7 @@ test "@fieldParentPtr extern struct first zero-bit field" { |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 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 | 382 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 383 | 383 | |
| 384 | 384 | const C = extern struct { |
| ... | ... | @@ -482,7 +482,7 @@ test "@fieldParentPtr extern struct middle zero-bit field" { |
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 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 | 486 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 487 | 487 | |
| 488 | 488 | const C = extern struct { |
| ... | ... | @@ -587,7 +587,7 @@ test "@fieldParentPtr extern struct last zero-bit field" { |
| 587 | 587 | |
| 588 | 588 | test "@fieldParentPtr unaligned packed struct" { |
| 589 | 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 | 591 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 592 | 592 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 593 | 593 | |
| ... | ... | @@ -725,7 +725,7 @@ test "@fieldParentPtr unaligned packed struct" { |
| 725 | 725 | |
| 726 | 726 | test "@fieldParentPtr aligned packed struct" { |
| 727 | 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 | 729 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 730 | 730 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 731 | 731 | |
| ... | ... | @@ -863,7 +863,7 @@ test "@fieldParentPtr aligned packed struct" { |
| 863 | 863 | |
| 864 | 864 | test "@fieldParentPtr nested packed struct" { |
| 865 | 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 | 867 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 868 | 868 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 869 | 869 | |
| ... | ... | @@ -1026,7 +1026,7 @@ test "@fieldParentPtr nested packed struct" { |
| 1026 | 1026 | |
| 1027 | 1027 | test "@fieldParentPtr packed struct first zero-bit field" { |
| 1028 | 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 | 1030 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1031 | 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 | 1132 | |
| 1133 | 1133 | test "@fieldParentPtr packed struct middle zero-bit field" { |
| 1134 | 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 | 1136 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1137 | 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 | 1238 | |
| 1239 | 1239 | test "@fieldParentPtr packed struct last zero-bit field" { |
| 1240 | 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 | 1242 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1243 | 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 | 1344 | |
| 1345 | 1345 | test "@fieldParentPtr tagged union" { |
| 1346 | 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 | 1349 | const C = union(enum) { |
| 1350 | 1350 | a: bool, |
| ... | ... | @@ -1479,7 +1479,7 @@ test "@fieldParentPtr tagged union" { |
| 1479 | 1479 | } |
| 1480 | 1480 | |
| 1481 | 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 | 1483 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1484 | 1484 | |
| 1485 | 1485 | const C = union { |
| ... | ... | @@ -1617,7 +1617,7 @@ test "@fieldParentPtr untagged union" { |
| 1617 | 1617 | test "@fieldParentPtr extern union" { |
| 1618 | 1618 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1619 | 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 | 1622 | const C = extern union { |
| 1623 | 1623 | a: bool, |
| ... | ... | @@ -1752,7 +1752,7 @@ test "@fieldParentPtr extern union" { |
| 1752 | 1752 | } |
| 1753 | 1753 | |
| 1754 | 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 | 1756 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1757 | 1757 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1758 | 1758 | |
| ... | ... | @@ -1896,7 +1896,7 @@ test "@fieldParentPtr packed union" { |
| 1896 | 1896 | |
| 1897 | 1897 | test "@fieldParentPtr tagged union all zero-bit fields" { |
| 1898 | 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 | 1901 | const C = union(enum) { |
| 1902 | 1902 | a: u0, |
test/behavior/floatop.zig+73-51| ... | ... | @@ -28,7 +28,7 @@ test "add f32/f64" { |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 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 | 32 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 33 | 33 | |
| 34 | 34 | try testAdd(f80); |
| ... | ... | @@ -62,7 +62,7 @@ test "sub f32/f64" { |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 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 | 66 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 67 | 67 | |
| 68 | 68 | try testSub(f80); |
| ... | ... | @@ -96,7 +96,7 @@ test "mul f32/f64" { |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 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 | 100 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 101 | 101 | |
| 102 | 102 | try testMul(f80); |
| ... | ... | @@ -116,6 +116,7 @@ fn testMul(comptime T: type) !void { |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | test "cmp f16" { |
| 119 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 119 | 120 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 120 | 121 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 121 | 122 | |
| ... | ... | @@ -124,7 +125,7 @@ test "cmp f16" { |
| 124 | 125 | } |
| 125 | 126 | |
| 126 | 127 | test "cmp f32" { |
| 127 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 128 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 128 | 129 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 129 | 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 | 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,7 +138,7 @@ test "cmp f64" { |
| 137 | 138 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 138 | 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 | 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 |
| 140 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // Fails on lavapipe | |
| 141 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Fails on lavapipe | |
| 141 | 142 | |
| 142 | 143 | try testCmp(f64); |
| 143 | 144 | try comptime testCmp(f64); |
| ... | ... | @@ -146,7 +147,7 @@ test "cmp f64" { |
| 146 | 147 | test "cmp f128" { |
| 147 | 148 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 148 | 149 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 149 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 150 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 150 | 151 | |
| 151 | 152 | try testCmp(f128); |
| 152 | 153 | try comptime testCmp(f128); |
| ... | ... | @@ -154,7 +155,7 @@ test "cmp f128" { |
| 154 | 155 | |
| 155 | 156 | test "cmp f80/c_longdouble" { |
| 156 | 157 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 157 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 158 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 158 | 159 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 159 | 160 | |
| 160 | 161 | try testCmp(f80); |
| ... | ... | @@ -218,6 +219,7 @@ fn testCmp(comptime T: type) !void { |
| 218 | 219 | } |
| 219 | 220 | |
| 220 | 221 | test "vector cmp f16" { |
| 222 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 221 | 223 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 222 | 224 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 223 | 225 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -229,7 +231,7 @@ test "vector cmp f16" { |
| 229 | 231 | |
| 230 | 232 | test "vector cmp f32" { |
| 231 | 233 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 232 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 234 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 233 | 235 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 234 | 236 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 235 | 237 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isArm()) return error.SkipZigTest; |
| ... | ... | @@ -248,7 +250,7 @@ test "vector cmp f64" { |
| 248 | 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 |
| 249 | 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 |
| 250 | 252 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| 251 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // Fails on lavapipe | |
| 253 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Fails on lavapipe | |
| 252 | 254 | |
| 253 | 255 | try testCmpVector(f64); |
| 254 | 256 | try comptime testCmpVector(f64); |
| ... | ... | @@ -257,7 +259,7 @@ test "vector cmp f64" { |
| 257 | 259 | test "vector cmp f128" { |
| 258 | 260 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 259 | 261 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 260 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 262 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 261 | 263 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 262 | 264 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| 263 | 265 | |
| ... | ... | @@ -269,7 +271,7 @@ test "vector cmp f80/c_longdouble" { |
| 269 | 271 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 270 | 272 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| 271 | 273 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 272 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 274 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 273 | 275 | |
| 274 | 276 | try testCmpVector(f80); |
| 275 | 277 | try comptime testCmpVector(f80); |
| ... | ... | @@ -359,7 +361,7 @@ test "@sqrt f16" { |
| 359 | 361 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 360 | 362 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 361 | 363 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 362 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 364 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 363 | 365 | |
| 364 | 366 | try testSqrt(f16); |
| 365 | 367 | try comptime testSqrt(f16); |
| ... | ... | @@ -368,7 +370,7 @@ test "@sqrt f16" { |
| 368 | 370 | test "@sqrt f32/f64" { |
| 369 | 371 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 370 | 372 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 371 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 373 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 372 | 374 | |
| 373 | 375 | try testSqrt(f32); |
| 374 | 376 | try comptime testSqrt(f32); |
| ... | ... | @@ -380,7 +382,7 @@ test "@sqrt f80/f128/c_longdouble" { |
| 380 | 382 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 381 | 383 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 382 | 384 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 383 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 385 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 384 | 386 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| 385 | 387 | |
| 386 | 388 | try testSqrt(f80); |
| ... | ... | @@ -459,6 +461,7 @@ fn testSqrt(comptime T: type) !void { |
| 459 | 461 | } |
| 460 | 462 | |
| 461 | 463 | test "@sqrt with vectors" { |
| 464 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 462 | 465 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 463 | 466 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 464 | 467 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -481,7 +484,7 @@ test "@sin f16" { |
| 481 | 484 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 482 | 485 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 483 | 486 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 484 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 487 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 485 | 488 | |
| 486 | 489 | try testSin(f16); |
| 487 | 490 | try comptime testSin(f16); |
| ... | ... | @@ -491,7 +494,7 @@ test "@sin f32/f64" { |
| 491 | 494 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 492 | 495 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 493 | 496 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 494 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 497 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 495 | 498 | |
| 496 | 499 | try testSin(f32); |
| 497 | 500 | comptime try testSin(f32); |
| ... | ... | @@ -503,7 +506,7 @@ test "@sin f80/f128/c_longdouble" { |
| 503 | 506 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 504 | 507 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 505 | 508 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 506 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 509 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 507 | 510 | |
| 508 | 511 | try testSin(f80); |
| 509 | 512 | comptime try testSin(f80); |
| ... | ... | @@ -526,6 +529,7 @@ fn testSin(comptime T: type) !void { |
| 526 | 529 | } |
| 527 | 530 | |
| 528 | 531 | test "@sin with vectors" { |
| 532 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 529 | 533 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 530 | 534 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 531 | 535 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -548,7 +552,7 @@ test "@cos f16" { |
| 548 | 552 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 549 | 553 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 550 | 554 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 551 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 555 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 552 | 556 | |
| 553 | 557 | try testCos(f16); |
| 554 | 558 | try comptime testCos(f16); |
| ... | ... | @@ -558,7 +562,7 @@ test "@cos f32/f64" { |
| 558 | 562 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 559 | 563 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 560 | 564 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 561 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 565 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 562 | 566 | |
| 563 | 567 | try testCos(f32); |
| 564 | 568 | try comptime testCos(f32); |
| ... | ... | @@ -570,7 +574,7 @@ test "@cos f80/f128/c_longdouble" { |
| 570 | 574 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 571 | 575 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 572 | 576 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 573 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 577 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 574 | 578 | |
| 575 | 579 | try testCos(f80); |
| 576 | 580 | try comptime testCos(f80); |
| ... | ... | @@ -593,6 +597,7 @@ fn testCos(comptime T: type) !void { |
| 593 | 597 | } |
| 594 | 598 | |
| 595 | 599 | test "@cos with vectors" { |
| 600 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 596 | 601 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 597 | 602 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 598 | 603 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -615,7 +620,7 @@ test "@tan f16" { |
| 615 | 620 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 616 | 621 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 617 | 622 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 618 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 623 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 619 | 624 | |
| 620 | 625 | try testTan(f16); |
| 621 | 626 | try comptime testTan(f16); |
| ... | ... | @@ -625,7 +630,7 @@ test "@tan f32/f64" { |
| 625 | 630 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 626 | 631 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 627 | 632 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 628 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 633 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 629 | 634 | |
| 630 | 635 | try testTan(f32); |
| 631 | 636 | try comptime testTan(f32); |
| ... | ... | @@ -637,7 +642,7 @@ test "@tan f80/f128/c_longdouble" { |
| 637 | 642 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 638 | 643 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 639 | 644 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 640 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 645 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 641 | 646 | |
| 642 | 647 | try testTan(f80); |
| 643 | 648 | try comptime testTan(f80); |
| ... | ... | @@ -660,6 +665,7 @@ fn testTan(comptime T: type) !void { |
| 660 | 665 | } |
| 661 | 666 | |
| 662 | 667 | test "@tan with vectors" { |
| 668 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 663 | 669 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 664 | 670 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 665 | 671 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -682,7 +688,7 @@ test "@exp f16" { |
| 682 | 688 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 683 | 689 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 684 | 690 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 685 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 691 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 686 | 692 | |
| 687 | 693 | try testExp(f16); |
| 688 | 694 | try comptime testExp(f16); |
| ... | ... | @@ -692,7 +698,7 @@ test "@exp f32/f64" { |
| 692 | 698 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 693 | 699 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 694 | 700 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 695 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 701 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 696 | 702 | |
| 697 | 703 | try testExp(f32); |
| 698 | 704 | try comptime testExp(f32); |
| ... | ... | @@ -704,7 +710,7 @@ test "@exp f80/f128/c_longdouble" { |
| 704 | 710 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 705 | 711 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 706 | 712 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 707 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 713 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 708 | 714 | |
| 709 | 715 | try testExp(f80); |
| 710 | 716 | try comptime testExp(f80); |
| ... | ... | @@ -731,6 +737,7 @@ fn testExp(comptime T: type) !void { |
| 731 | 737 | } |
| 732 | 738 | |
| 733 | 739 | test "@exp with vectors" { |
| 740 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 734 | 741 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 735 | 742 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 736 | 743 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -753,7 +760,7 @@ test "@exp2 f16" { |
| 753 | 760 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 754 | 761 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 755 | 762 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 756 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 763 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 757 | 764 | |
| 758 | 765 | try testExp2(f16); |
| 759 | 766 | try comptime testExp2(f16); |
| ... | ... | @@ -763,7 +770,7 @@ test "@exp2 f32/f64" { |
| 763 | 770 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 764 | 771 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 765 | 772 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 766 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 773 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 767 | 774 | |
| 768 | 775 | try testExp2(f32); |
| 769 | 776 | try comptime testExp2(f32); |
| ... | ... | @@ -775,7 +782,7 @@ test "@exp2 f80/f128/c_longdouble" { |
| 775 | 782 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 776 | 783 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 777 | 784 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 778 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 785 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 779 | 786 | |
| 780 | 787 | try testExp2(f80); |
| 781 | 788 | try comptime testExp2(f80); |
| ... | ... | @@ -797,6 +804,7 @@ fn testExp2(comptime T: type) !void { |
| 797 | 804 | } |
| 798 | 805 | |
| 799 | 806 | test "@exp2 with @vectors" { |
| 807 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 800 | 808 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 801 | 809 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 802 | 810 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -819,7 +827,7 @@ test "@log f16" { |
| 819 | 827 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 820 | 828 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 821 | 829 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 822 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 830 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 823 | 831 | |
| 824 | 832 | try testLog(f16); |
| 825 | 833 | try comptime testLog(f16); |
| ... | ... | @@ -829,7 +837,7 @@ test "@log f32/f64" { |
| 829 | 837 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 830 | 838 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 831 | 839 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 832 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 840 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 833 | 841 | |
| 834 | 842 | try testLog(f32); |
| 835 | 843 | try comptime testLog(f32); |
| ... | ... | @@ -841,7 +849,7 @@ test "@log f80/f128/c_longdouble" { |
| 841 | 849 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 842 | 850 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 843 | 851 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 844 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 852 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 845 | 853 | |
| 846 | 854 | try testLog(f80); |
| 847 | 855 | try comptime testLog(f80); |
| ... | ... | @@ -867,7 +875,7 @@ test "@log with @vectors" { |
| 867 | 875 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 868 | 876 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 869 | 877 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 870 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 878 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 871 | 879 | |
| 872 | 880 | { |
| 873 | 881 | var v: @Vector(4, f32) = [_]f32{ 1.1, 2.2, 0.3, 0.4 }; |
| ... | ... | @@ -884,7 +892,7 @@ test "@log2 f16" { |
| 884 | 892 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 885 | 893 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 886 | 894 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 887 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 895 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 888 | 896 | |
| 889 | 897 | try testLog2(f16); |
| 890 | 898 | try comptime testLog2(f16); |
| ... | ... | @@ -894,7 +902,7 @@ test "@log2 f32/f64" { |
| 894 | 902 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 895 | 903 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 896 | 904 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 897 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 905 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 898 | 906 | |
| 899 | 907 | try testLog2(f32); |
| 900 | 908 | try comptime testLog2(f32); |
| ... | ... | @@ -906,7 +914,7 @@ test "@log2 f80/f128/c_longdouble" { |
| 906 | 914 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 907 | 915 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 908 | 916 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 909 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 917 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 910 | 918 | |
| 911 | 919 | try testLog2(f80); |
| 912 | 920 | try comptime testLog2(f80); |
| ... | ... | @@ -928,6 +936,7 @@ fn testLog2(comptime T: type) !void { |
| 928 | 936 | } |
| 929 | 937 | |
| 930 | 938 | test "@log2 with vectors" { |
| 939 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 931 | 940 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 932 | 941 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 933 | 942 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -959,7 +968,7 @@ test "@log10 f16" { |
| 959 | 968 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 960 | 969 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 961 | 970 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 962 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 971 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 963 | 972 | |
| 964 | 973 | try testLog10(f16); |
| 965 | 974 | try comptime testLog10(f16); |
| ... | ... | @@ -969,7 +978,7 @@ test "@log10 f32/f64" { |
| 969 | 978 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 970 | 979 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 971 | 980 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 972 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 981 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 973 | 982 | |
| 974 | 983 | try testLog10(f32); |
| 975 | 984 | try comptime testLog10(f32); |
| ... | ... | @@ -981,7 +990,7 @@ test "@log10 f80/f128/c_longdouble" { |
| 981 | 990 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 982 | 991 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 983 | 992 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 984 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 993 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 985 | 994 | |
| 986 | 995 | try testLog10(f80); |
| 987 | 996 | try comptime testLog10(f80); |
| ... | ... | @@ -1006,7 +1015,7 @@ test "@log10 with vectors" { |
| 1006 | 1015 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1007 | 1016 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1008 | 1017 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1009 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1018 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1010 | 1019 | |
| 1011 | 1020 | try testLog10WithVectors(); |
| 1012 | 1021 | try comptime testLog10WithVectors(); |
| ... | ... | @@ -1026,7 +1035,7 @@ test "@abs f16" { |
| 1026 | 1035 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1027 | 1036 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1028 | 1037 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1029 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // Fails on lavapipe | |
| 1038 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Fails on lavapipe | |
| 1030 | 1039 | |
| 1031 | 1040 | try testFabs(f16); |
| 1032 | 1041 | try comptime testFabs(f16); |
| ... | ... | @@ -1035,7 +1044,7 @@ test "@abs f16" { |
| 1035 | 1044 | test "@abs f32/f64" { |
| 1036 | 1045 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1037 | 1046 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1038 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // Fails on lavapipe | |
| 1047 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Fails on lavapipe | |
| 1039 | 1048 | |
| 1040 | 1049 | try testFabs(f32); |
| 1041 | 1050 | try comptime testFabs(f32); |
| ... | ... | @@ -1046,7 +1055,7 @@ test "@abs f32/f64" { |
| 1046 | 1055 | test "@abs f80/f128/c_longdouble" { |
| 1047 | 1056 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1048 | 1057 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1049 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1058 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1050 | 1059 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1051 | 1060 | |
| 1052 | 1061 | try testFabs(f80); |
| ... | ... | @@ -1122,6 +1131,7 @@ fn testFabs(comptime T: type) !void { |
| 1122 | 1131 | } |
| 1123 | 1132 | |
| 1124 | 1133 | test "@abs with vectors" { |
| 1134 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1125 | 1135 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1126 | 1136 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1127 | 1137 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1141,6 +1151,7 @@ fn testFabsWithVectors() !void { |
| 1141 | 1151 | } |
| 1142 | 1152 | |
| 1143 | 1153 | test "@floor f16" { |
| 1154 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1144 | 1155 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1145 | 1156 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1146 | 1157 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1150,6 +1161,7 @@ test "@floor f16" { |
| 1150 | 1161 | } |
| 1151 | 1162 | |
| 1152 | 1163 | test "@floor f32/f64" { |
| 1164 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1153 | 1165 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1154 | 1166 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1155 | 1167 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1163,7 +1175,7 @@ test "@floor f32/f64" { |
| 1163 | 1175 | test "@floor f80/f128/c_longdouble" { |
| 1164 | 1176 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1165 | 1177 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1166 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1178 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1167 | 1179 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1168 | 1180 | |
| 1169 | 1181 | try testFloor(f80); |
| ... | ... | @@ -1205,6 +1217,7 @@ fn testFloor(comptime T: type) !void { |
| 1205 | 1217 | } |
| 1206 | 1218 | |
| 1207 | 1219 | test "@floor with vectors" { |
| 1220 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1208 | 1221 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1209 | 1222 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1210 | 1223 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1224,6 +1237,7 @@ fn testFloorWithVectors() !void { |
| 1224 | 1237 | } |
| 1225 | 1238 | |
| 1226 | 1239 | test "@ceil f16" { |
| 1240 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1227 | 1241 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1228 | 1242 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1229 | 1243 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1233,6 +1247,7 @@ test "@ceil f16" { |
| 1233 | 1247 | } |
| 1234 | 1248 | |
| 1235 | 1249 | test "@ceil f32/f64" { |
| 1250 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1236 | 1251 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1237 | 1252 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1238 | 1253 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1246,7 +1261,7 @@ test "@ceil f32/f64" { |
| 1246 | 1261 | test "@ceil f80/f128/c_longdouble" { |
| 1247 | 1262 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1248 | 1263 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1249 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1264 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1250 | 1265 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1251 | 1266 | |
| 1252 | 1267 | try testCeil(f80); |
| ... | ... | @@ -1260,7 +1275,7 @@ test "@ceil f80/f128/c_longdouble" { |
| 1260 | 1275 | test "@ceil f80 maxInt(u64)" { |
| 1261 | 1276 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1262 | 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 | 1279 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1265 | 1280 | |
| 1266 | 1281 | var x: u64 = std.math.maxInt(u64); |
| ... | ... | @@ -1300,6 +1315,7 @@ fn testCeil(comptime T: type) !void { |
| 1300 | 1315 | } |
| 1301 | 1316 | |
| 1302 | 1317 | test "@ceil with vectors" { |
| 1318 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1303 | 1319 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1304 | 1320 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1305 | 1321 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1319,6 +1335,7 @@ fn testCeilWithVectors() !void { |
| 1319 | 1335 | } |
| 1320 | 1336 | |
| 1321 | 1337 | test "@trunc f16" { |
| 1338 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1322 | 1339 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1323 | 1340 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1324 | 1341 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1328,6 +1345,7 @@ test "@trunc f16" { |
| 1328 | 1345 | } |
| 1329 | 1346 | |
| 1330 | 1347 | test "@trunc f32/f64" { |
| 1348 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1331 | 1349 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1332 | 1350 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1333 | 1351 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1341,7 +1359,7 @@ test "@trunc f32/f64" { |
| 1341 | 1359 | test "@trunc f80/f128/c_longdouble" { |
| 1342 | 1360 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1343 | 1361 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1344 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1362 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1345 | 1363 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1346 | 1364 | |
| 1347 | 1365 | try testTrunc(f80); |
| ... | ... | @@ -1383,6 +1401,7 @@ fn testTrunc(comptime T: type) !void { |
| 1383 | 1401 | } |
| 1384 | 1402 | |
| 1385 | 1403 | test "@trunc with vectors" { |
| 1404 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1386 | 1405 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1387 | 1406 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1388 | 1407 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1402,6 +1421,7 @@ fn testTruncWithVectors() !void { |
| 1402 | 1421 | } |
| 1403 | 1422 | |
| 1404 | 1423 | test "neg f16" { |
| 1424 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1405 | 1425 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1406 | 1426 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1407 | 1427 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1411,6 +1431,7 @@ test "neg f16" { |
| 1411 | 1431 | } |
| 1412 | 1432 | |
| 1413 | 1433 | test "neg f32/f64" { |
| 1434 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1414 | 1435 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1415 | 1436 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1416 | 1437 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1424,7 +1445,7 @@ test "neg f32/f64" { |
| 1424 | 1445 | test "neg f80/f128/c_longdouble" { |
| 1425 | 1446 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1426 | 1447 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1427 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1448 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1428 | 1449 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1429 | 1450 | |
| 1430 | 1451 | try testNeg(f80); |
| ... | ... | @@ -1505,7 +1526,7 @@ fn testNeg(comptime T: type) !void { |
| 1505 | 1526 | } |
| 1506 | 1527 | |
| 1507 | 1528 | test "negate f80" { |
| 1508 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1529 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1509 | 1530 | |
| 1510 | 1531 | var f: f80 = 0.0; |
| 1511 | 1532 | const a: u80 = @bitCast(f); |
| ... | ... | @@ -1539,7 +1560,7 @@ test "f128 at compile time is lossy" { |
| 1539 | 1560 | test "comptime fixed-width float zero divided by zero produces NaN" { |
| 1540 | 1561 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1541 | 1562 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1542 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1563 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1543 | 1564 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1544 | 1565 | |
| 1545 | 1566 | inline for (.{ f16, f32, f64, f80, f128 }) |F| { |
| ... | ... | @@ -1548,6 +1569,7 @@ test "comptime fixed-width float zero divided by zero produces NaN" { |
| 1548 | 1569 | } |
| 1549 | 1570 | |
| 1550 | 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; | |
| 1551 | 1573 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1552 | 1574 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1553 | 1575 | |
| ... | ... | @@ -1691,7 +1713,7 @@ test "comptime calls are only memoized when float arguments are bit-for-bit equa |
| 1691 | 1713 | test "result location forwarded through unary float builtins" { |
| 1692 | 1714 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1693 | 1715 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1694 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1716 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1695 | 1717 | |
| 1696 | 1718 | const S = struct { |
| 1697 | 1719 | var x: u32 = 10; |
test/behavior/fn.zig+35-13| ... | ... | @@ -21,6 +21,8 @@ fn testLocVars(b: i32) void { |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | test "mutable local variables" { |
| 24 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 25 | ||
| 24 | 26 | var zero: i32 = 0; |
| 25 | 27 | _ = &zero; |
| 26 | 28 | try expect(zero == 0); |
| ... | ... | @@ -70,13 +72,14 @@ fn outer(y: u32) *const fn (u32) u32 { |
| 70 | 72 | } |
| 71 | 73 | |
| 72 | 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 | 77 | const func = outer(10); |
| 76 | 78 | try expect(func(3) == 7); |
| 77 | 79 | } |
| 78 | 80 | |
| 79 | 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 | 83 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 81 | 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 | 104 | test "inline function call that calls optional function pointer, return pointer at callsite interacts correctly with callsite return type" { |
| 102 | 105 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 103 | 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 | 109 | const S = struct { |
| 107 | 110 | field: u32, |
| ... | ... | @@ -147,7 +150,7 @@ fn fnWithUnreachable() noreturn { |
| 147 | 150 | |
| 148 | 151 | test "extern struct with stdcallcc fn pointer" { |
| 149 | 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 | 155 | const S = extern struct { |
| 153 | 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 | 178 | } |
| 176 | 179 | |
| 177 | 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 | 182 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 179 | 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 | 186 | } |
| 183 | 187 | |
| 184 | 188 | test "pass by non-copying value" { |
| 189 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 185 | 190 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 186 | 191 | |
| 187 | 192 | try expect(addPointCoords(Point{ .x = 1, .y = 2 }) == 3); |
| ... | ... | @@ -197,6 +202,7 @@ fn addPointCoords(pt: Point) i32 { |
| 197 | 202 | } |
| 198 | 203 | |
| 199 | 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 | 206 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 201 | 207 | |
| 202 | 208 | try expect((try addPointCoordsVar(Point{ .x = 1, .y = 2 })) == 3); |
| ... | ... | @@ -208,6 +214,7 @@ fn addPointCoordsVar(pt: anytype) !i32 { |
| 208 | 214 | } |
| 209 | 215 | |
| 210 | 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 | 218 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 212 | 219 | |
| 213 | 220 | var pt = Point2{ .x = 1, .y = 2 }; |
| ... | ... | @@ -224,6 +231,7 @@ const Point2 = struct { |
| 224 | 231 | }; |
| 225 | 232 | |
| 226 | 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 | 235 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 228 | 236 | |
| 229 | 237 | var pt = Point3{ .x = 1, .y = 2 }; |
| ... | ... | @@ -252,7 +260,7 @@ test "pass by non-copying value as method, at comptime" { |
| 252 | 260 | test "implicit cast fn call result to optional in field result" { |
| 253 | 261 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 254 | 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 | 265 | const S = struct { |
| 258 | 266 | fn entry() !void { |
| ... | ... | @@ -290,6 +298,7 @@ fn voidFun(a: i32, b: void, c: i32, d: void) !void { |
| 290 | 298 | } |
| 291 | 299 | |
| 292 | 300 | test "call function with empty string" { |
| 301 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 293 | 302 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 294 | 303 | |
| 295 | 304 | acceptsString(""); |
| ... | ... | @@ -302,7 +311,7 @@ fn acceptsString(foo: []u8) void { |
| 302 | 311 | test "function pointers" { |
| 303 | 312 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 304 | 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 | 316 | const fns = [_]*const @TypeOf(fn1){ |
| 308 | 317 | &fn1, |
| ... | ... | @@ -337,6 +346,7 @@ fn numberLiteralArg(a: anytype) !void { |
| 337 | 346 | } |
| 338 | 347 | |
| 339 | 348 | test "function call with anon list literal" { |
| 349 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 340 | 350 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 341 | 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 | 366 | } |
| 357 | 367 | |
| 358 | 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 | 370 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 360 | 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 | 405 | } |
| 395 | 406 | |
| 396 | 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 | 410 | const S = struct { |
| 398 | 411 | fn foo() !void {} |
| 399 | 412 | }; |
| ... | ... | @@ -404,7 +417,7 @@ test "function with inferred error set but returning no error" { |
| 404 | 417 | |
| 405 | 418 | test "import passed byref to function in return type" { |
| 406 | 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 | 422 | const S = struct { |
| 410 | 423 | fn get() @import("std").ArrayList(i32) { |
| ... | ... | @@ -418,7 +431,7 @@ test "import passed byref to function in return type" { |
| 418 | 431 | |
| 419 | 432 | test "implicit cast function to function ptr" { |
| 420 | 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 | 436 | const S1 = struct { |
| 424 | 437 | export fn someFunctionThatReturnsAValue() c_int { |
| ... | ... | @@ -439,7 +452,7 @@ test "implicit cast function to function ptr" { |
| 439 | 452 | test "method call with optional and error union first param" { |
| 440 | 453 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 441 | 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 | 457 | const S = struct { |
| 445 | 458 | x: i32 = 1234, |
| ... | ... | @@ -459,7 +472,7 @@ test "method call with optional and error union first param" { |
| 459 | 472 | test "method call with optional pointer first param" { |
| 460 | 473 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 461 | 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 | 477 | const S = struct { |
| 465 | 478 | x: i32 = 1234, |
| ... | ... | @@ -477,7 +490,7 @@ test "method call with optional pointer first param" { |
| 477 | 490 | test "using @ptrCast on function pointers" { |
| 478 | 491 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 479 | 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 | 495 | const S = struct { |
| 483 | 496 | const A = struct { data: [4]u8 }; |
| ... | ... | @@ -514,6 +527,8 @@ test "function returns function returning type" { |
| 514 | 527 | } |
| 515 | 528 | |
| 516 | 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 | 532 | const S = struct { |
| 518 | 533 | fn openDataFile(mode: enum { read, write }) !u32 { |
| 519 | 534 | return switch (mode) { |
| ... | ... | @@ -532,6 +547,8 @@ test "peer type resolution of inferred error set with non-void payload" { |
| 532 | 547 | } |
| 533 | 548 | |
| 534 | 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 | 552 | const A = struct { |
| 536 | 553 | a: u32, |
| 537 | 554 | fn foo(comptime a: anytype) !void { |
| ... | ... | @@ -570,7 +587,7 @@ test "pass and return comptime-only types" { |
| 570 | 587 | |
| 571 | 588 | test "pointer to alias behaves same as pointer to function" { |
| 572 | 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 | 592 | const S = struct { |
| 576 | 593 | fn foo() u32 { |
| ... | ... | @@ -593,6 +610,7 @@ test "comptime parameters don't have to be marked comptime if only called at com |
| 593 | 610 | } |
| 594 | 611 | |
| 595 | 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 | 614 | const S = struct { |
| 597 | 615 | inline fn foo(x: *i32, y: *const i32) type { |
| 598 | 616 | x.* = y.*; |
| ... | ... | @@ -607,7 +625,7 @@ test "inline function with comptime-known comptime-only return type called at ru |
| 607 | 625 | } |
| 608 | 626 | |
| 609 | 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 | 630 | const S = struct { |
| 613 | 631 | fn paramAddrMatch(x: u8) bool { |
| ... | ... | @@ -635,6 +653,8 @@ test "address of function parameter is consistent in function return type" { |
| 635 | 653 | } |
| 636 | 654 | |
| 637 | 655 | test "function parameter self equality" { |
| 656 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 657 | ||
| 638 | 658 | const S = struct { |
| 639 | 659 | fn equal(x: u32) bool { |
| 640 | 660 | return x == x; |
| ... | ... | @@ -664,6 +684,8 @@ test "function parameter self equality" { |
| 664 | 684 | } |
| 665 | 685 | |
| 666 | 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 | 689 | const S = struct { |
| 668 | 690 | inline fn f(x: bool, y: if (x) u8 else u16) if (x) bool else u32 { |
| 669 | 691 | if (x) { |
| ... | ... | @@ -744,7 +766,7 @@ test "coerce generic function making generic parameter concrete" { |
| 744 | 766 | } |
| 745 | 767 | |
| 746 | 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 | 771 | const S = struct { |
| 750 | 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 | 32 | } |
| 33 | 33 | |
| 34 | 34 | test "fn delegation" { |
| 35 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 35 | 36 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 36 | 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 | 12 | } |
| 13 | 13 | |
| 14 | 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 | 17 | const foo = get_foo(); |
| 18 | 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 | 5 | const mem = std.mem; |
| 6 | 6 | |
| 7 | 7 | test "continue in for loop" { |
| 8 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 8 | 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 9 | 10 | |
| 10 | 11 | const array = [_]i32{ 1, 2, 3, 4, 5 }; |
| ... | ... | @@ -67,7 +68,7 @@ test "ignore lval with underscore (for loop)" { |
| 67 | 68 | test "basic for loop" { |
| 68 | 69 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 69 | 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 | 73 | const expected_result: [24]u8 = .{ |
| 73 | 74 | 9, 8, 7, 6, 0, 1, 2, 3, |
| ... | ... | @@ -114,7 +115,7 @@ test "basic for loop" { |
| 114 | 115 | test "for with null and T peer types and inferred result location type" { |
| 115 | 116 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 116 | 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 | 120 | const S = struct { |
| 120 | 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 | 134 | } |
| 134 | 135 | |
| 135 | 136 | test "2 break statements and an else" { |
| 137 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 136 | 138 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 137 | 139 | |
| 138 | 140 | const S = struct { |
| ... | ... | @@ -154,7 +156,7 @@ test "2 break statements and an else" { |
| 154 | 156 | test "for loop with pointer elem var" { |
| 155 | 157 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 156 | 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 | 161 | const source = "abcdefg"; |
| 160 | 162 | var target: [source.len]u8 = undefined; |
| ... | ... | @@ -179,6 +181,7 @@ fn mangleString(s: []u8) void { |
| 179 | 181 | } |
| 180 | 182 | |
| 181 | 183 | test "for copies its payload" { |
| 184 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 182 | 185 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 183 | 186 | |
| 184 | 187 | const S = struct { |
| ... | ... | @@ -198,7 +201,7 @@ test "for copies its payload" { |
| 198 | 201 | test "for on slice with allowzero ptr" { |
| 199 | 202 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 200 | 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 | 206 | const S = struct { |
| 204 | 207 | fn doTheTest(slice: []const u8) !void { |
| ... | ... | @@ -213,7 +216,7 @@ test "for on slice with allowzero ptr" { |
| 213 | 216 | |
| 214 | 217 | test "else continue outer for" { |
| 215 | 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 | 221 | var i: usize = 6; |
| 219 | 222 | var buf: [5]u8 = undefined; |
| ... | ... | @@ -226,6 +229,7 @@ test "else continue outer for" { |
| 226 | 229 | } |
| 227 | 230 | |
| 228 | 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 | 234 | var x = [_]u32{ 1, 2 }; |
| 231 | 235 | _ = &x; |
| ... | ... | @@ -272,6 +276,7 @@ test "two counters" { |
| 272 | 276 | } |
| 273 | 277 | |
| 274 | 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 | 280 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 276 | 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 | 311 | test "slice and two counters, one is offset and one is runtime" { |
| 307 | 312 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 308 | 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 | 316 | const slice: []const u8 = "blah"; |
| 312 | 317 | var start: usize = 0; |
| ... | ... | @@ -335,7 +340,7 @@ test "slice and two counters, one is offset and one is runtime" { |
| 335 | 340 | test "two slices, one captured by-ref" { |
| 336 | 341 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 337 | 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 | 345 | var buf: [10]u8 = undefined; |
| 341 | 346 | const slice1: []const u8 = "blah"; |
| ... | ... | @@ -354,7 +359,7 @@ test "two slices, one captured by-ref" { |
| 354 | 359 | test "raw pointer and slice" { |
| 355 | 360 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 356 | 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 | 364 | var buf: [10]u8 = undefined; |
| 360 | 365 | const slice: []const u8 = "blah"; |
| ... | ... | @@ -373,7 +378,7 @@ test "raw pointer and slice" { |
| 373 | 378 | test "raw pointer and counter" { |
| 374 | 379 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 375 | 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 | 383 | var buf: [10]u8 = undefined; |
| 379 | 384 | const ptr: [*]u8 = &buf; |
| ... | ... | @@ -391,7 +396,7 @@ test "raw pointer and counter" { |
| 391 | 396 | test "inline for with slice as the comptime-known" { |
| 392 | 397 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 393 | 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 | 401 | const comptime_slice = "hello"; |
| 397 | 402 | var runtime_i: usize = 3; |
| ... | ... | @@ -422,7 +427,7 @@ test "inline for with slice as the comptime-known" { |
| 422 | 427 | test "inline for with counter as the comptime-known" { |
| 423 | 428 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 424 | 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 | 432 | var runtime_slice = "hello"; |
| 428 | 433 | var runtime_i: usize = 3; |
| ... | ... | @@ -451,6 +456,7 @@ test "inline for with counter as the comptime-known" { |
| 451 | 456 | } |
| 452 | 457 | |
| 453 | 458 | test "inline for on tuple pointer" { |
| 459 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 454 | 460 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 455 | 461 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 456 | 462 | |
| ... | ... | @@ -465,6 +471,7 @@ test "inline for on tuple pointer" { |
| 465 | 471 | } |
| 466 | 472 | |
| 467 | 473 | test "ref counter that starts at zero" { |
| 474 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 468 | 475 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 469 | 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 | 486 | } |
| 480 | 487 | |
| 481 | 488 | test "inferred alloc ptr of for loop" { |
| 489 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 482 | 490 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 483 | 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 | 509 | } |
| 502 | 510 | |
| 503 | 511 | test "for loop results in a bool" { |
| 512 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 504 | 513 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 505 | 514 | |
| 506 | 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 | 5 | const expectEqual = testing.expectEqual; |
| 6 | 6 | |
| 7 | 7 | test "one param, explicit comptime" { |
| 8 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 9 | ||
| 8 | 10 | var x: usize = 0; |
| 9 | 11 | x += checkSize(i32); |
| 10 | 12 | x += checkSize(bool); |
| ... | ... | @@ -17,6 +19,7 @@ fn checkSize(comptime T: type) usize { |
| 17 | 19 | } |
| 18 | 20 | |
| 19 | 21 | test "simple generic fn" { |
| 22 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 20 | 23 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 21 | 24 | |
| 22 | 25 | try expect(max(i32, 3, -1) == 3); |
| ... | ... | @@ -51,6 +54,7 @@ fn sameButWithFloats(a: f64, b: f64) f64 { |
| 51 | 54 | } |
| 52 | 55 | |
| 53 | 56 | test "fn with comptime args" { |
| 57 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 54 | 58 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 55 | 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 | 90 | test "type constructed by comptime function call" { |
| 87 | 91 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 88 | 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 | 95 | var l: SimpleList(10) = undefined; |
| 92 | 96 | l.array[0] = 10; |
| ... | ... | @@ -108,6 +112,7 @@ fn SimpleList(comptime L: usize) type { |
| 108 | 112 | } |
| 109 | 113 | |
| 110 | 114 | test "function with return type type" { |
| 115 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 111 | 116 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 112 | 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 | 155 | test "generic fn with implicit cast" { |
| 151 | 156 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 152 | 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 | 160 | try expect(getFirstByte(u8, &[_]u8{13}) == 13); |
| 156 | 161 | try expect(getFirstByte(u16, &[_]u16{ |
| ... | ... | @@ -169,7 +174,7 @@ test "generic fn keeps non-generic parameter types" { |
| 169 | 174 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 170 | 175 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 171 | 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 | 179 | const A = 128; |
| 175 | 180 | |
| ... | ... | @@ -204,7 +209,7 @@ fn foo2(arg: anytype) bool { |
| 204 | 209 | |
| 205 | 210 | test "generic struct" { |
| 206 | 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 | 214 | var a1 = GenNode(i32){ |
| 210 | 215 | .value = 13, |
| ... | ... | @@ -245,7 +250,7 @@ test "function parameter is generic" { |
| 245 | 250 | test "generic function instantiation turns into comptime call" { |
| 246 | 251 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 247 | 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 | 255 | const S = struct { |
| 251 | 256 | fn doTheTest() !void { |
| ... | ... | @@ -273,6 +278,7 @@ test "generic function instantiation turns into comptime call" { |
| 273 | 278 | } |
| 274 | 279 | |
| 275 | 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 | 282 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 277 | 283 | |
| 278 | 284 | const S = struct { x: i32 }; |
| ... | ... | @@ -288,6 +294,7 @@ test "generic function with void and comptime parameter" { |
| 288 | 294 | } |
| 289 | 295 | |
| 290 | 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 | 298 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 292 | 299 | |
| 293 | 300 | const S = struct { |
| ... | ... | @@ -306,7 +313,7 @@ test "anonymous struct return type referencing comptime parameter" { |
| 306 | 313 | test "generic function instantiation non-duplicates" { |
| 307 | 314 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 308 | 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 | 318 | const S = struct { |
| 312 | 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 | 346 | } |
| 340 | 347 | |
| 341 | 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 | 351 | const S = struct { |
| 345 | 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 | 381 | } |
| 375 | 382 | |
| 376 | 383 | test "generic struct as parameter type" { |
| 384 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 377 | 385 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 378 | 386 | |
| 379 | 387 | const S = struct { |
| ... | ... | @@ -389,7 +397,7 @@ test "generic struct as parameter type" { |
| 389 | 397 | } |
| 390 | 398 | |
| 391 | 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 | 401 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 394 | 402 | |
| 395 | 403 | const S = struct { |
| ... | ... | @@ -406,7 +414,7 @@ test "slice as parameter type" { |
| 406 | 414 | } |
| 407 | 415 | |
| 408 | 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 | 419 | const S = struct { |
| 412 | 420 | fn doTheTest(a: anytype) !void { |
| ... | ... | @@ -417,6 +425,8 @@ test "null sentinel pointer passed as generic argument" { |
| 417 | 425 | } |
| 418 | 426 | |
| 419 | 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 | 430 | const S = struct { |
| 421 | 431 | fn doMath(comptime f: fn (comptime type, i32, i32) error{Overflow}!i32, a: i32, b: i32) !void { |
| 422 | 432 | const result = try f(i32, a, b); |
| ... | ... | @@ -427,7 +437,7 @@ test "generic function passed as comptime argument" { |
| 427 | 437 | } |
| 428 | 438 | |
| 429 | 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 | 442 | const S = struct { |
| 433 | 443 | fn b(comptime T: type) ?*const fn () error{}!T { |
| ... | ... | @@ -439,6 +449,8 @@ test "return type of generic function is function pointer" { |
| 439 | 449 | } |
| 440 | 450 | |
| 441 | 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 | 454 | const S = struct { |
| 443 | 455 | const A = B(i32, c); |
| 444 | 456 | fn c() !i32 { |
| ... | ... | @@ -485,7 +497,9 @@ test "union in struct captures argument" { |
| 485 | 497 | } |
| 486 | 498 | |
| 487 | 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 | 501 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 502 | ||
| 489 | 503 | const S = struct { |
| 490 | 504 | fn DeleagateWithContext(comptime Function: type) type { |
| 491 | 505 | const ArgArgs = std.meta.ArgsTuple(Function); |
| ... | ... | @@ -516,7 +530,7 @@ test "comptime callconv(.c) function ptr uses comptime type argument" { |
| 516 | 530 | } |
| 517 | 531 | |
| 518 | 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 | 534 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 521 | 535 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 522 | 536 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -559,6 +573,7 @@ fn StructCapture(comptime T: type) type { |
| 559 | 573 | } |
| 560 | 574 | |
| 561 | 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 | 577 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 563 | 578 | |
| 564 | 579 | const S = StructCapture(f64); |
| ... | ... | @@ -573,7 +588,7 @@ comptime { |
| 573 | 588 | } |
| 574 | 589 | |
| 575 | 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 | 593 | const S = struct { |
| 579 | 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 | 4 | |
| 5 | 5 | var pos = [2]f32{ 0.0, 0.0 }; |
| 6 | 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 | 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 9 | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 10 | 10 | |
| ... | ... | @@ -15,7 +15,7 @@ test "store to global array" { |
| 15 | 15 | |
| 16 | 16 | var vpos = @Vector(2, f32){ 0.0, 0.0 }; |
| 17 | 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 | 19 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 20 | 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 21 | 21 | |
| ... | ... | @@ -27,7 +27,7 @@ test "store to global vector" { |
| 27 | 27 | test "slices pointing at the same address as global array." { |
| 28 | 28 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 29 | 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 | 32 | const S = struct { |
| 33 | 33 | const a = [_]u8{ 1, 2, 3 }; |
| ... | ... | @@ -44,7 +44,7 @@ test "slices pointing at the same address as global array." { |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 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 | 48 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 49 | 49 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 50 | 50 | |
| ... | ... | @@ -68,6 +68,8 @@ test "global loads can affect liveness" { |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 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 | 73 | const S = struct { |
| 72 | 74 | self: *const @This(), |
| 73 | 75 | x: u32, |
| ... | ... | @@ -83,7 +85,7 @@ test "global const can be self-referential" { |
| 83 | 85 | } |
| 84 | 86 | |
| 85 | 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 | 90 | const S = struct { |
| 89 | 91 | self: *@This(), |
| ... | ... | @@ -112,6 +114,8 @@ test "global var can be self-referential" { |
| 112 | 114 | } |
| 113 | 115 | |
| 114 | 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 | 119 | const S = struct { |
| 116 | 120 | other: *const @This(), |
| 117 | 121 | x: u32, |
| ... | ... | @@ -136,7 +140,7 @@ test "global const can be indirectly self-referential" { |
| 136 | 140 | } |
| 137 | 141 | |
| 138 | 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 | 145 | const S = struct { |
| 142 | 146 | other: *@This(), |
| ... | ... | @@ -175,7 +179,7 @@ var callbacks: Callbacks = undefined; |
| 175 | 179 | var callbacks_loaded: bool = false; |
| 176 | 180 | |
| 177 | 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 | 184 | if (callbacks_loaded) { |
| 181 | 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 | 188 | |
| 185 | 189 | test "function pointer field call on global extern struct" { |
| 186 | 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 | 193 | const S = struct { |
| 190 | 194 | fn keyCallback(key: i32) callconv(.c) i32 { |
test/behavior/hasdecl.zig+2| ... | ... | @@ -12,6 +12,7 @@ pub const Bar = struct { |
| 12 | 12 | }; |
| 13 | 13 | |
| 14 | 14 | test "@hasDecl" { |
| 15 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 15 | 16 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 16 | 17 | |
| 17 | 18 | try expect(@hasDecl(Foo, "public_thing")); |
| ... | ... | @@ -24,6 +25,7 @@ test "@hasDecl" { |
| 24 | 25 | } |
| 25 | 26 | |
| 26 | 27 | test "@hasDecl using a sliced string literal" { |
| 28 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 27 | 29 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 28 | 30 | |
| 29 | 31 | try expect(@hasDecl(@This(), "Bar") == true); |
test/behavior/hasfield.zig+2| ... | ... | @@ -2,6 +2,8 @@ const expect = @import("std").testing.expect; |
| 2 | 2 | const builtin = @import("builtin"); |
| 3 | 3 | |
| 4 | 4 | test "@hasField" { |
| 5 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 6 | ||
| 5 | 7 | const struc = struct { |
| 6 | 8 | a: i32, |
| 7 | 9 | b: []u8, |
test/behavior/if.zig+10-2| ... | ... | @@ -4,6 +4,8 @@ const expect = std.testing.expect; |
| 4 | 4 | const expectEqual = std.testing.expectEqual; |
| 5 | 5 | |
| 6 | 6 | test "if statements" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 8 | ||
| 7 | 9 | shouldBeEqual(1, 1); |
| 8 | 10 | firstEqlThird(2, 1, 2); |
| 9 | 11 | } |
| ... | ... | @@ -44,7 +46,7 @@ var global_with_val: anyerror!u32 = 0; |
| 44 | 46 | var global_with_err: anyerror!u32 = error.SomeError; |
| 45 | 47 | |
| 46 | 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 | 50 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 49 | 51 | |
| 50 | 52 | if (global_with_val) |v| { |
| ... | ... | @@ -94,6 +96,7 @@ test "const result loc, runtime if cond, else unreachable" { |
| 94 | 96 | } |
| 95 | 97 | |
| 96 | 98 | test "if copies its payload" { |
| 99 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 97 | 100 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 98 | 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 | 134 | test "if peer expressions inferred optional type" { |
| 132 | 135 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 133 | 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 | 139 | var self: []const u8 = "abcdef"; |
| 137 | 140 | var index: usize = 0; |
| ... | ... | @@ -147,6 +150,7 @@ test "if peer expressions inferred optional type" { |
| 147 | 150 | } |
| 148 | 151 | |
| 149 | 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 | 154 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 151 | 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 | 162 | } |
| 159 | 163 | |
| 160 | 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 | 167 | var a: ?u32 = 1234; |
| 162 | 168 | var b: u32 = 2000; |
| 163 | 169 | _ = .{ &a, &b }; |
| ... | ... | @@ -186,6 +192,7 @@ fn returnTrue() bool { |
| 186 | 192 | } |
| 187 | 193 | |
| 188 | 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 | 196 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 190 | 197 | |
| 191 | 198 | const Foo = struct { x: i32 }; |
| ... | ... | @@ -205,6 +212,7 @@ test "if value shouldn't be load-elided if used later (structs)" { |
| 205 | 212 | } |
| 206 | 213 | |
| 207 | 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 | 216 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 209 | 217 | |
| 210 | 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 | 29 | test "import c keywords" { |
| 30 | 30 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 31 | 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 | 33 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| 34 | 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 | 23 | |
| 24 | 24 | test "incomplete struct param top level declaration" { |
| 25 | 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 | 28 | const a = A{ |
| 29 | 29 | .b = B{ |
test/behavior/inline_switch.zig+6| ... | ... | @@ -3,6 +3,7 @@ const expect = std.testing.expect; |
| 3 | 3 | const builtin = @import("builtin"); |
| 4 | 4 | |
| 5 | 5 | test "inline scalar prongs" { |
| 6 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 6 | 7 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 7 | 8 | |
| 8 | 9 | var x: usize = 0; |
| ... | ... | @@ -42,6 +43,7 @@ test "inline switch enums" { |
| 42 | 43 | |
| 43 | 44 | const U = union(E) { a: void, b: u2, c: u3, d: u4 }; |
| 44 | 45 | test "inline switch unions" { |
| 46 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 45 | 47 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 46 | 48 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 47 | 49 | var x: U = .a; |
| ... | ... | @@ -67,6 +69,7 @@ test "inline switch unions" { |
| 67 | 69 | } |
| 68 | 70 | |
| 69 | 71 | test "inline else bool" { |
| 72 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 70 | 73 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 71 | 74 | var a = true; |
| 72 | 75 | _ = &a; |
| ... | ... | @@ -89,6 +92,7 @@ test "inline else error" { |
| 89 | 92 | } |
| 90 | 93 | |
| 91 | 94 | test "inline else enum" { |
| 95 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 92 | 96 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 93 | 97 | |
| 94 | 98 | const E2 = enum(u8) { a = 2, b = 3, c = 4, d = 5 }; |
| ... | ... | @@ -134,6 +138,8 @@ test "inline else int all values" { |
| 134 | 138 | } |
| 135 | 139 | |
| 136 | 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 | 143 | const U2 = union(enum) { |
| 138 | 144 | a: u32, |
| 139 | 145 | }; |
test/behavior/int128.zig+5-2| ... | ... | @@ -5,6 +5,7 @@ const minInt = std.math.minInt; |
| 5 | 5 | const builtin = @import("builtin"); |
| 6 | 6 | |
| 7 | 7 | test "uint128" { |
| 8 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 8 | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 9 | 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 10 | 11 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -25,7 +26,7 @@ test "uint128" { |
| 25 | 26 | test "undefined 128 bit int" { |
| 26 | 27 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 27 | 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 | 30 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 30 | 31 | |
| 31 | 32 | @setRuntimeSafety(true); |
| ... | ... | @@ -42,6 +43,7 @@ test "undefined 128 bit int" { |
| 42 | 43 | } |
| 43 | 44 | |
| 44 | 45 | test "int128" { |
| 46 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 45 | 47 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 46 | 48 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 47 | 49 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -66,7 +68,7 @@ test "int128" { |
| 66 | 68 | test "truncate int128" { |
| 67 | 69 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 68 | 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 | 72 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 71 | 73 | |
| 72 | 74 | { |
| ... | ... | @@ -87,6 +89,7 @@ test "truncate int128" { |
| 87 | 89 | } |
| 88 | 90 | |
| 89 | 91 | test "shift int128" { |
| 92 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 90 | 93 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 91 | 94 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 92 | 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 | 4 | const builtin = @import("builtin"); |
| 5 | 5 | |
| 6 | 6 | test "int comparison elision" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 7 | 8 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 8 | 9 | |
| 9 | 10 | testIntEdges(u0); |
| ... | ... | @@ -14,7 +15,7 @@ test "int comparison elision" { |
| 14 | 15 | |
| 15 | 16 | // TODO: support int types > 128 bits wide in other backends |
| 16 | 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 | 20 | // TODO: panic: integer overflow with int types > 65528 bits wide |
| 20 | 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 | 18 | } |
| 19 | 19 | |
| 20 | 20 | test "ir block deps" { |
| 21 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 21 | 22 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 22 | 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 | 4 | test "strlit to vector" { |
| 5 | 5 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 6 | 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 | 9 | const strlit = "0123456789abcdef0123456789ABCDEF"; |
| 10 | 10 | const vec_from_strlit: @Vector(32, u8) = strlit.*; |
test/behavior/math.zig+82-47| ... | ... | @@ -10,6 +10,7 @@ const mem = std.mem; |
| 10 | 10 | const math = std.math; |
| 11 | 11 | |
| 12 | 12 | test "assignment operators" { |
| 13 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 13 | 14 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 14 | 15 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 15 | 16 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -40,6 +41,8 @@ test "assignment operators" { |
| 40 | 41 | } |
| 41 | 42 | |
| 42 | 43 | test "three expr in a row" { |
| 44 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 45 | ||
| 43 | 46 | try testThreeExprInARow(false, true); |
| 44 | 47 | try comptime testThreeExprInARow(false, true); |
| 45 | 48 | } |
| ... | ... | @@ -64,7 +67,7 @@ fn assertFalse(b: bool) !void { |
| 64 | 67 | test "@clz small" { |
| 65 | 68 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 66 | 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 | 71 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 69 | 72 | |
| 70 | 73 | try testClzSmall(); |
| ... | ... | @@ -82,7 +85,7 @@ fn testClzSmall() !void { |
| 82 | 85 | test "@clz big ints" { |
| 83 | 86 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 84 | 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 | 89 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 87 | 90 | |
| 88 | 91 | try testClzBigInts(); |
| ... | ... | @@ -102,7 +105,7 @@ test "@clz vectors" { |
| 102 | 105 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 103 | 106 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 104 | 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 | 109 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 107 | 110 | |
| 108 | 111 | try testClzVectors(); |
| ... | ... | @@ -143,7 +146,7 @@ test "@ctz small" { |
| 143 | 146 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 144 | 147 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 145 | 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 | 151 | try testCtzSmall(); |
| 149 | 152 | try comptime testCtzSmall(); |
| ... | ... | @@ -165,7 +168,7 @@ fn testOneCtz(comptime T: type, x: T) u32 { |
| 165 | 168 | test "@ctz 128-bit integers" { |
| 166 | 169 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 167 | 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 | 172 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 170 | 173 | |
| 171 | 174 | try testCtz128(); |
| ... | ... | @@ -184,7 +187,7 @@ test "@ctz vectors" { |
| 184 | 187 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 185 | 188 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 186 | 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 | 192 | try testCtzVectors(); |
| 190 | 193 | try comptime testCtzVectors(); |
| ... | ... | @@ -258,6 +261,8 @@ test "quad hex float literal parsing in range" { |
| 258 | 261 | } |
| 259 | 262 | |
| 260 | 263 | test "underscore separator parsing" { |
| 264 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 265 | ||
| 261 | 266 | try expect(1_234_567 == 1234567); |
| 262 | 267 | try expect(1_234_567 == 1234567); |
| 263 | 268 | try expect(1_2_3_4_5_6_7 == 1234567); |
| ... | ... | @@ -334,6 +339,7 @@ test "comptime_int multi-limb partial shift right" { |
| 334 | 339 | } |
| 335 | 340 | |
| 336 | 341 | test "xor" { |
| 342 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 337 | 343 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 338 | 344 | |
| 339 | 345 | try test_xor(); |
| ... | ... | @@ -382,6 +388,7 @@ fn not(comptime T: type, a: T) T { |
| 382 | 388 | } |
| 383 | 389 | |
| 384 | 390 | test "binary not" { |
| 391 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 385 | 392 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 386 | 393 | |
| 387 | 394 | try expect(not(u0, 0) == 0); |
| ... | ... | @@ -421,6 +428,7 @@ test "binary not" { |
| 421 | 428 | } |
| 422 | 429 | |
| 423 | 430 | test "binary not big int <= 128 bits" { |
| 431 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 424 | 432 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 425 | 433 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 426 | 434 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -456,7 +464,8 @@ test "division" { |
| 456 | 464 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 457 | 465 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 458 | 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 | 469 | try testIntDivision(); |
| 461 | 470 | try comptime testIntDivision(); |
| 462 | 471 | |
| ... | ... | @@ -629,7 +638,7 @@ test "large integer division" { |
| 629 | 638 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 630 | 639 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 631 | 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 | 642 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 634 | 643 | |
| 635 | 644 | { |
| ... | ... | @@ -650,7 +659,7 @@ test "division half-precision floats" { |
| 650 | 659 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 651 | 660 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 652 | 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 | 664 | try testDivisionFP16(); |
| 656 | 665 | try comptime testDivisionFP16(); |
| ... | ... | @@ -737,6 +746,7 @@ fn testUnsignedNegationWrappingEval(x: u16) !void { |
| 737 | 746 | } |
| 738 | 747 | |
| 739 | 748 | test "negation wrapping" { |
| 749 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 740 | 750 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 741 | 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 | 760 | } |
| 751 | 761 | |
| 752 | 762 | test "unsigned 64-bit division" { |
| 763 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 753 | 764 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 754 | 765 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 755 | 766 | |
| ... | ... | @@ -791,7 +802,7 @@ fn testShrTrunc(x: u16) !void { |
| 791 | 802 | test "f128" { |
| 792 | 803 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 793 | 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 | 806 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 796 | 807 | |
| 797 | 808 | try test_f128(); |
| ... | ... | @@ -817,6 +828,7 @@ fn should_not_be_zero(x: f128) !void { |
| 817 | 828 | } |
| 818 | 829 | |
| 819 | 830 | test "umax wrapped squaring" { |
| 831 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 820 | 832 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 821 | 833 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 822 | 834 | |
| ... | ... | @@ -873,6 +885,7 @@ test "umax wrapped squaring" { |
| 873 | 885 | } |
| 874 | 886 | |
| 875 | 887 | test "128-bit multiplication" { |
| 888 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 876 | 889 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 877 | 890 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 878 | 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 | 918 | } |
| 906 | 919 | |
| 907 | 920 | test "@addWithOverflow" { |
| 921 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 908 | 922 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 909 | 923 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 910 | 924 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -923,6 +937,7 @@ test "@addWithOverflow" { |
| 923 | 937 | } |
| 924 | 938 | |
| 925 | 939 | test "@addWithOverflow <= 128 bits" { |
| 940 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 926 | 941 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 927 | 942 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 928 | 943 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -968,7 +983,7 @@ test "@addWithOverflow > 128 bits" { |
| 968 | 983 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 969 | 984 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 970 | 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 | 988 | try testAddWithOverflow(u129, 4, 105, 109, 0); |
| 974 | 989 | try testAddWithOverflow(u129, 1000, 100, 1100, 0); |
| ... | ... | @@ -1008,6 +1023,7 @@ test "@addWithOverflow > 128 bits" { |
| 1008 | 1023 | } |
| 1009 | 1024 | |
| 1010 | 1025 | test "small int addition" { |
| 1026 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1011 | 1027 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1012 | 1028 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1013 | 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 | 1052 | } |
| 1037 | 1053 | |
| 1038 | 1054 | test "basic @mulWithOverflow" { |
| 1055 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1039 | 1056 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1040 | 1057 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1041 | 1058 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1048,6 +1065,7 @@ test "basic @mulWithOverflow" { |
| 1048 | 1065 | } |
| 1049 | 1066 | |
| 1050 | 1067 | test "extensive @mulWithOverflow" { |
| 1068 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1051 | 1069 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1052 | 1070 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1053 | 1071 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1087,6 +1105,7 @@ test "extensive @mulWithOverflow" { |
| 1087 | 1105 | } |
| 1088 | 1106 | |
| 1089 | 1107 | test "@mulWithOverflow bitsize > 32" { |
| 1108 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1090 | 1109 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1091 | 1110 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1092 | 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 | 1142 | } |
| 1124 | 1143 | |
| 1125 | 1144 | test "Multiply unwrap error * immediate" { |
| 1145 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1126 | 1146 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1127 | 1147 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1128 | 1148 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1139,7 +1159,7 @@ test "@mulWithOverflow bitsize 128 bits" { |
| 1139 | 1159 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1140 | 1160 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1141 | 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 | 1164 | try testMulWithOverflow(u128, 3, 0x5555555555555555_5555555555555555, 0xffffffffffffffff_ffffffffffffffff, 0); |
| 1145 | 1165 | try testMulWithOverflow(u128, 3, 0x5555555555555555_5555555555555556, 2, 1); |
| ... | ... | @@ -1162,7 +1182,7 @@ test "@mulWithOverflow bitsize 128 bits" { |
| 1162 | 1182 | |
| 1163 | 1183 | test "@mulWithOverflow > 128 bits" { |
| 1164 | 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 | 1187 | try testMulWithOverflow(u140, 0, maxInt(u140), 0, 0); |
| 1168 | 1188 | try testMulWithOverflow(u140, 1, maxInt(u140), maxInt(u140), 0); |
| ... | ... | @@ -1191,7 +1211,7 @@ test "@mulWithOverflow > 128 bits" { |
| 1191 | 1211 | |
| 1192 | 1212 | test "@mulWithOverflow bitsize 256 bits" { |
| 1193 | 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 | 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 | 1255 | } |
| 1236 | 1256 | |
| 1237 | 1257 | test "@subWithOverflow" { |
| 1258 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1238 | 1259 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1239 | 1260 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1240 | 1261 | |
| ... | ... | @@ -1251,6 +1272,7 @@ test "@subWithOverflow" { |
| 1251 | 1272 | } |
| 1252 | 1273 | |
| 1253 | 1274 | test "@subWithOverflow <= 128 bits" { |
| 1275 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1254 | 1276 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1255 | 1277 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1256 | 1278 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1294,7 +1316,7 @@ test "@subWithOverflow > 128 bits" { |
| 1294 | 1316 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1295 | 1317 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1296 | 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 | 1321 | try testSubWithOverflow(u129, 4, 105, maxInt(u129) - 100, 1); |
| 1300 | 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 | 1362 | test "@shlWithOverflow" { |
| 1341 | 1363 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1342 | 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 | 1366 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1345 | 1367 | |
| 1346 | 1368 | try testShlWithOverflow(u4, 2, 1, 4, 0); |
| ... | ... | @@ -1359,7 +1381,7 @@ test "@shlWithOverflow" { |
| 1359 | 1381 | test "@shlWithOverflow > 64 bits" { |
| 1360 | 1382 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1361 | 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 | 1385 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1364 | 1386 | |
| 1365 | 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 | 1407 | |
| 1386 | 1408 | test "@shlWithOverflow > 128 bits" { |
| 1387 | 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 | 1412 | try testShlWithOverflow(u140, 1 << 100, 20, 1 << 120, 0); |
| 1391 | 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 | 1435 | } |
| 1414 | 1436 | |
| 1415 | 1437 | test "and > 128 bits" { |
| 1438 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1416 | 1439 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1417 | 1440 | |
| 1418 | 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 | 1464 | } |
| 1442 | 1465 | |
| 1443 | 1466 | test "or > 128 bits" { |
| 1467 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1444 | 1468 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1445 | 1469 | |
| 1446 | 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 | 1493 | } |
| 1470 | 1494 | |
| 1471 | 1495 | test "xor > 128 bits" { |
| 1496 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1472 | 1497 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1473 | 1498 | |
| 1474 | 1499 | try testXor(u140, 0, maxInt(u140), maxInt(u140)); |
| ... | ... | @@ -1497,6 +1522,7 @@ fn testNot(comptime T: type, a: T, expected: T) !void { |
| 1497 | 1522 | } |
| 1498 | 1523 | |
| 1499 | 1524 | test "not > 128 bits" { |
| 1525 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1500 | 1526 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1501 | 1527 | |
| 1502 | 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 | 1551 | } |
| 1526 | 1552 | |
| 1527 | 1553 | test "shl > 128 bits" { |
| 1554 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1528 | 1555 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1529 | 1556 | |
| 1530 | 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 | 1580 | } |
| 1554 | 1581 | |
| 1555 | 1582 | test "shr > 128 bits" { |
| 1583 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1556 | 1584 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1557 | 1585 | |
| 1558 | 1586 | try testShr(u140, 1 << 139, 39, 1 << 100); |
| ... | ... | @@ -1582,7 +1610,7 @@ fn testClz(comptime T: type, a: T, expected: u16) !void { |
| 1582 | 1610 | |
| 1583 | 1611 | test "@clz > 128 bits" { |
| 1584 | 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 | 1615 | try testClz(u140, 0, 140); |
| 1588 | 1616 | try testClz(u140, 1 << 139, 0); |
| ... | ... | @@ -1611,7 +1639,7 @@ fn testCtz(comptime T: type, a: T, expected: u16) !void { |
| 1611 | 1639 | |
| 1612 | 1640 | test "@ctz > 128 bits" { |
| 1613 | 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 | 1644 | try testCtz(u140, 0, 140); |
| 1617 | 1645 | try testCtz(u140, 1 << 139, 139); |
| ... | ... | @@ -1640,7 +1668,7 @@ fn testPopCount(comptime T: type, a: T, expected: u16) !void { |
| 1640 | 1668 | |
| 1641 | 1669 | test "@popCount > 128 bits" { |
| 1642 | 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 | 1673 | try testPopCount(u140, 0, 0); |
| 1646 | 1674 | try testPopCount(u140, maxInt(u140), 140); |
| ... | ... | @@ -1669,7 +1697,7 @@ fn testBitReverse(comptime T: type, a: T, expected: T) !void { |
| 1669 | 1697 | |
| 1670 | 1698 | test "@bitReverse > 128 bits" { |
| 1671 | 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 | 1702 | try testBitReverse(u140, 1 << 139, 1); |
| 1675 | 1703 | try testBitReverse(u140, 1 << 70, 1 << 69); |
| ... | ... | @@ -1698,7 +1726,7 @@ fn testByteSwap(comptime T: type, a: T, expected: T) !void { |
| 1698 | 1726 | |
| 1699 | 1727 | test "@byteSwap > 128 bits" { |
| 1700 | 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 | 1731 | try testByteSwap(u144, 1 << 136, 1); |
| 1704 | 1732 | try testByteSwap(u144, 1, 1 << 136); |
| ... | ... | @@ -1727,7 +1755,7 @@ fn testMax(comptime T: type, a: T, b: T, expected: T) !void { |
| 1727 | 1755 | |
| 1728 | 1756 | test "@max > 128 bits" { |
| 1729 | 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 | 1760 | try testMax(u140, 0, maxInt(u140), maxInt(u140)); |
| 1733 | 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 | 1784 | |
| 1757 | 1785 | test "@min > 128 bits" { |
| 1758 | 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 | 1789 | try testMin(u140, 0, maxInt(u140), 0); |
| 1762 | 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 | 1812 | } |
| 1785 | 1813 | |
| 1786 | 1814 | test "@abs > 128 bits" { |
| 1815 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1787 | 1816 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1788 | 1817 | |
| 1789 | 1818 | try testAbs(u140, 0, 0); |
| ... | ... | @@ -1808,7 +1837,7 @@ fn testRem(comptime T: type, numerator: T, denominator: T, expected: T) !void { |
| 1808 | 1837 | |
| 1809 | 1838 | test "@rem > 128 bits" { |
| 1810 | 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 | 1842 | try testRem(u140, 0, maxInt(u140), 0); |
| 1814 | 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 | 1864 | |
| 1836 | 1865 | test "@mod > 128 bits" { |
| 1837 | 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 | 1869 | try testMod(u140, 0, maxInt(u140), 0); |
| 1841 | 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 | 1891 | |
| 1863 | 1892 | test "@divFloor > 128 bits" { |
| 1864 | 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 | 1896 | try testDivFloor(u140, 0, maxInt(u140), 0); |
| 1868 | 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 | 1919 | |
| 1891 | 1920 | test "@divCeil > 128 bits" { |
| 1892 | 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 | 1924 | try testDivCeil(u140, 0, maxInt(u140), 0); |
| 1896 | 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 | 1947 | |
| 1919 | 1948 | test "@divTrunc > 128 bits" { |
| 1920 | 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 | 1952 | try testDivTrunc(u140, 0, maxInt(u140), 0); |
| 1924 | 1953 | try testDivTrunc(u140, maxInt(u140), maxInt(u140), 1); |
| ... | ... | @@ -1941,6 +1970,8 @@ test "@divTrunc > 128 bits" { |
| 1941 | 1970 | } |
| 1942 | 1971 | |
| 1943 | 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 | 1976 | var a: u0 = 0; |
| 1946 | 1977 | _ = &a; |
| ... | ... | @@ -1972,6 +2003,8 @@ test "overflow arithmetic with u0 values" { |
| 1972 | 2003 | } |
| 1973 | 2004 | |
| 1974 | 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 | 2008 | try expect(5 / 3 == 1); |
| 1976 | 2009 | try expect(-5 / -3 == 1); |
| 1977 | 2010 | try expect(-6 / 3 == -2); |
| ... | ... | @@ -1983,7 +2016,7 @@ test "allow signed integer division/remainder when values are comptime-known and |
| 1983 | 2016 | test "quad hex float literal parsing accurate" { |
| 1984 | 2017 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1985 | 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 | 2020 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1988 | 2021 | |
| 1989 | 2022 | const a: f128 = 0x1.1111222233334444555566667777p+0; |
| ... | ... | @@ -2089,6 +2122,7 @@ fn testShlTrunc(x: u16) !void { |
| 2089 | 2122 | } |
| 2090 | 2123 | |
| 2091 | 2124 | test "exact shift left" { |
| 2125 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 2092 | 2126 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2093 | 2127 | |
| 2094 | 2128 | try testShlExact(0b00110101); |
| ... | ... | @@ -2141,7 +2175,7 @@ test "remainder division" { |
| 2141 | 2175 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2142 | 2176 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2143 | 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 | 2179 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2146 | 2180 | |
| 2147 | 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 | 2208 | test "float remainder division using @rem" { |
| 2175 | 2209 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2176 | 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 | 2212 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2179 | 2213 | |
| 2180 | 2214 | try comptime frem(f16); |
| ... | ... | @@ -2216,7 +2250,7 @@ test "float modulo division using @mod" { |
| 2216 | 2250 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2217 | 2251 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2218 | 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 | 2254 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2221 | 2255 | |
| 2222 | 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 | 2318 | test "@round f80" { |
| 2285 | 2319 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2286 | 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 | 2322 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2289 | 2323 | |
| 2290 | 2324 | try testRound(f80, 12.0); |
| ... | ... | @@ -2294,7 +2328,7 @@ test "@round f80" { |
| 2294 | 2328 | test "@round f128" { |
| 2295 | 2329 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2296 | 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 | 2332 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2299 | 2333 | |
| 2300 | 2334 | try testRound(f128, 12.0); |
| ... | ... | @@ -2312,7 +2346,7 @@ test "vector integer addition" { |
| 2312 | 2346 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2313 | 2347 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2314 | 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 | 2351 | const S = struct { |
| 2318 | 2352 | fn doTheTest() !void { |
| ... | ... | @@ -2332,7 +2366,7 @@ test "vector integer addition" { |
| 2332 | 2366 | test "NaN comparison" { |
| 2333 | 2367 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2334 | 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 | 2370 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2337 | 2371 | |
| 2338 | 2372 | try testNanEqNan(f16); |
| ... | ... | @@ -2348,7 +2382,7 @@ test "NaN comparison" { |
| 2348 | 2382 | test "NaN comparison f80" { |
| 2349 | 2383 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2350 | 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 | 2386 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2353 | 2387 | |
| 2354 | 2388 | try testNanEqNan(f80); |
| ... | ... | @@ -2372,7 +2406,7 @@ test "vector comparison" { |
| 2372 | 2406 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2373 | 2407 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2374 | 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 | 2411 | const S = struct { |
| 2378 | 2412 | fn doTheTest() !void { |
| ... | ... | @@ -2401,7 +2435,7 @@ test "compare undefined literal with comptime_int" { |
| 2401 | 2435 | test "signed zeros are represented properly" { |
| 2402 | 2436 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2403 | 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 | 2439 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2406 | 2440 | |
| 2407 | 2441 | const S = struct { |
| ... | ... | @@ -2463,7 +2497,7 @@ test "@clz works on both vector and scalar inputs" { |
| 2463 | 2497 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2464 | 2498 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2465 | 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 | 2502 | var x: u32 = 0x1; |
| 2469 | 2503 | _ = &x; |
| ... | ... | @@ -2478,7 +2512,7 @@ test "@clz works on both vector and scalar inputs" { |
| 2478 | 2512 | test "runtime comparison to NaN is comptime-known" { |
| 2479 | 2513 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2480 | 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 | 2516 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2483 | 2517 | |
| 2484 | 2518 | const S = struct { |
| ... | ... | @@ -2534,7 +2568,7 @@ test "float divide by zero" { |
| 2534 | 2568 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2535 | 2569 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2536 | 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 | 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 | 2603 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2570 | 2604 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2571 | 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 | 2607 | if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| 2574 | 2608 | |
| 2575 | 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 | 2627 | } |
| 2594 | 2628 | |
| 2595 | 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 | 2631 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2597 | 2632 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2598 | 2633 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -2613,7 +2648,7 @@ test "float vector multiplication of comptime zero by runtime nan is nan" { |
| 2613 | 2648 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2614 | 2649 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2615 | 2650 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2616 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // Fails on lavapipe | |
| 2651 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Fails on lavapipe | |
| 2617 | 2652 | |
| 2618 | 2653 | const ct_zero: @Vector(1, f32) = .{0}; |
| 2619 | 2654 | var rt_nan: @Vector(1, f32) = .{math.nan(f32)}; |
| ... | ... | @@ -2650,7 +2685,7 @@ test "comptime float vector multiplication of zero by nan is nan" { |
| 2650 | 2685 | } |
| 2651 | 2686 | |
| 2652 | 2687 | test "i96 operations" { |
| 2653 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 2688 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 2654 | 2689 | |
| 2655 | 2690 | // This is coverage for some stuff used by std.Io timestamps, to catch |
| 2656 | 2691 | // issues earlier than bootstrapping. |
test/behavior/maximum_minimum.zig+16-8| ... | ... | @@ -6,6 +6,7 @@ const expect = std.testing.expect; |
| 6 | 6 | const expectEqual = std.testing.expectEqual; |
| 7 | 7 | |
| 8 | 8 | test "@max" { |
| 9 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 9 | 10 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 10 | 11 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 11 | 12 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -31,7 +32,7 @@ test "@max on vectors" { |
| 31 | 32 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 32 | 33 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 33 | 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 | 37 | const S = struct { |
| 37 | 38 | fn doTheTest() !void { |
| ... | ... | @@ -62,7 +63,7 @@ test "@min" { |
| 62 | 63 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 63 | 64 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 64 | 65 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 65 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // Fails on lavapipe | |
| 66 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // Fails on lavapipe | |
| 66 | 67 | |
| 67 | 68 | const S = struct { |
| 68 | 69 | fn doTheTest() !void { |
| ... | ... | @@ -85,7 +86,7 @@ test "@min for vectors" { |
| 85 | 86 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 86 | 87 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 87 | 88 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 88 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 89 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 89 | 90 | |
| 90 | 91 | const S = struct { |
| 91 | 92 | fn doTheTest() !void { |
| ... | ... | @@ -115,7 +116,7 @@ test "@min for vectors" { |
| 115 | 116 | test "@min/max for floats" { |
| 116 | 117 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 117 | 118 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 118 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 119 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 119 | 120 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 120 | 121 | |
| 121 | 122 | const S = struct { |
| ... | ... | @@ -152,6 +153,8 @@ test "@min/@max on lazy values" { |
| 152 | 153 | } |
| 153 | 154 | |
| 154 | 155 | test "@min/@max more than two arguments" { |
| 156 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 157 | ||
| 155 | 158 | const x: u32 = 30; |
| 156 | 159 | const y: u32 = 10; |
| 157 | 160 | const z: u32 = 20; |
| ... | ... | @@ -160,7 +163,7 @@ test "@min/@max more than two arguments" { |
| 160 | 163 | } |
| 161 | 164 | |
| 162 | 165 | test "@min/@max more than two vector arguments" { |
| 163 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 166 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 164 | 167 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 165 | 168 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 166 | 169 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -174,6 +177,7 @@ test "@min/@max more than two vector arguments" { |
| 174 | 177 | } |
| 175 | 178 | |
| 176 | 179 | test "@min/@max notices bounds" { |
| 180 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 177 | 181 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 178 | 182 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 179 | 183 | |
| ... | ... | @@ -190,7 +194,7 @@ test "@min/@max notices bounds" { |
| 190 | 194 | } |
| 191 | 195 | |
| 192 | 196 | test "@min/@max notices vector bounds" { |
| 193 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 197 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 194 | 198 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 195 | 199 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 196 | 200 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -222,6 +226,7 @@ test "@min/@max on comptime_int" { |
| 222 | 226 | } |
| 223 | 227 | |
| 224 | 228 | test "@min/@max notices bounds from types" { |
| 229 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 225 | 230 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 226 | 231 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 227 | 232 | |
| ... | ... | @@ -241,7 +246,7 @@ test "@min/@max notices bounds from types" { |
| 241 | 246 | } |
| 242 | 247 | |
| 243 | 248 | test "@min/@max notices bounds from vector types" { |
| 244 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 249 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 245 | 250 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 246 | 251 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 247 | 252 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -282,6 +287,7 @@ test "@min/@max notices bounds from types when comptime-known value is undef" { |
| 282 | 287 | } |
| 283 | 288 | |
| 284 | 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; | |
| 285 | 291 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 286 | 292 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 287 | 293 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -304,6 +310,8 @@ test "@min/@max notices bounds from vector types when element of comptime-known |
| 304 | 310 | } |
| 305 | 311 | |
| 306 | 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 | ||
| 307 | 315 | var x: i32 = -1; |
| 308 | 316 | var y: u31 = 1; |
| 309 | 317 | _ = .{ &x, &y }; |
| ... | ... | @@ -349,7 +357,7 @@ test "@min/@max with runtime signed and unsigned integers of same size" { |
| 349 | 357 | } |
| 350 | 358 | |
| 351 | 359 | test "@min/@max with runtime vectors of signed and unsigned integers of same size" { |
| 352 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 360 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 353 | 361 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 354 | 362 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 355 | 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 | 29 | test "standard field calls" { |
| 30 | 30 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 31 | 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 | 34 | try expect(HasFuncs.one(0) == 1); |
| 35 | 35 | try expect(HasFuncs.two(0) == 2); |
| ... | ... | @@ -72,7 +72,7 @@ test "standard field calls" { |
| 72 | 72 | test "@field field calls" { |
| 73 | 73 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 74 | 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 | 77 | try expect(@field(HasFuncs, "one")(0) == 1); |
| 78 | 78 | try expect(@field(HasFuncs, "two")(0) == 2); |
test/behavior/memcpy.zig+8-8| ... | ... | @@ -6,7 +6,7 @@ const assert = std.debug.assert; |
| 6 | 6 | test "memcpy and memset intrinsics" { |
| 7 | 7 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 8 | 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 | 11 | try testMemcpyMemset(); |
| 12 | 12 | try comptime testMemcpyMemset(); |
| ... | ... | @@ -27,7 +27,7 @@ fn testMemcpyMemset() !void { |
| 27 | 27 | test "@memcpy with both operands single-ptr-to-array, one is null-terminated" { |
| 28 | 28 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 29 | 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 | 32 | try testMemcpyBothSinglePtrArrayOneIsNullTerminated(); |
| 33 | 33 | try comptime testMemcpyBothSinglePtrArrayOneIsNullTerminated(); |
| ... | ... | @@ -47,7 +47,7 @@ fn testMemcpyBothSinglePtrArrayOneIsNullTerminated() !void { |
| 47 | 47 | test "@memcpy dest many pointer" { |
| 48 | 48 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 49 | 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 | 52 | try testMemcpyDestManyPtr(); |
| 53 | 53 | try comptime testMemcpyDestManyPtr(); |
| ... | ... | @@ -69,7 +69,7 @@ fn testMemcpyDestManyPtr() !void { |
| 69 | 69 | test "@memcpy C pointer" { |
| 70 | 70 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 71 | 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 | 74 | try testMemcpyCPointer(); |
| 75 | 75 | try comptime testMemcpyCPointer(); |
| ... | ... | @@ -90,7 +90,7 @@ test "@memcpy slice" { |
| 90 | 90 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 91 | 91 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 92 | 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 | 95 | try testMemcpySlice(); |
| 96 | 96 | try comptime testMemcpySlice(); |
| ... | ... | @@ -133,7 +133,7 @@ test "@memcpy comptime-only type" { |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 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 | 138 | const S = struct { |
| 139 | 139 | fn doTheTest() void { |
| ... | ... | @@ -153,7 +153,7 @@ test "@memcpy zero-bit type with aliasing" { |
| 153 | 153 | |
| 154 | 154 | test "@memcpy with sentinel" { |
| 155 | 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 | 158 | const S = struct { |
| 159 | 159 | fn doTheTest() void { |
| ... | ... | @@ -182,7 +182,7 @@ test "@memcpy no sentinel source into sentinel destination" { |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | test "@memcpy a global array" { |
| 185 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 185 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 186 | 186 | |
| 187 | 187 | const S = struct { |
| 188 | 188 | var array_u8: [1]u8 = .{1}; |
test/behavior/memmove.zig+5-5| ... | ... | @@ -5,7 +5,7 @@ const expect = std.testing.expect; |
| 5 | 5 | test "memmove and memset intrinsics" { |
| 6 | 6 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 7 | 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 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 10 | 10 | |
| 11 | 11 | try testMemmoveMemset(); |
| ... | ... | @@ -32,7 +32,7 @@ fn testMemmoveMemset() !void { |
| 32 | 32 | test "@memmove with both operands single-ptr-to-array, one is null-terminated" { |
| 33 | 33 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 34 | 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 | 36 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 37 | 37 | |
| 38 | 38 | try testMemmoveBothSinglePtrArrayOneIsNullTerminated(); |
| ... | ... | @@ -75,7 +75,7 @@ fn testMemmoveBothSinglePtrArrayOneIsNullTerminated() !void { |
| 75 | 75 | test "@memmove dest many pointer" { |
| 76 | 76 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 77 | 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 | 79 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 80 | 80 | |
| 81 | 81 | try testMemmoveDestManyPtr(); |
| ... | ... | @@ -117,7 +117,7 @@ test "@memmove slice" { |
| 117 | 117 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 118 | 118 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 119 | 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 | 121 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 122 | 122 | |
| 123 | 123 | try testMemmoveSlice(); |
| ... | ... | @@ -172,7 +172,7 @@ comptime { |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | test "@memmove a global array" { |
| 175 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 175 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 176 | 176 | |
| 177 | 177 | const S = struct { |
| 178 | 178 | var array_u8: [1]u8 = .{1}; |
test/behavior/memset.zig+12-12| ... | ... | @@ -5,7 +5,7 @@ const expect = std.testing.expect; |
| 5 | 5 | test "@memset on array pointers" { |
| 6 | 6 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 7 | 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 | 10 | try testMemsetArray(); |
| 11 | 11 | try comptime testMemsetArray(); |
| ... | ... | @@ -33,7 +33,7 @@ fn testMemsetArray() !void { |
| 33 | 33 | test "@memset preserves array sentinel" { |
| 34 | 34 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 35 | 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 | 38 | try testMemsetArraySentinel(); |
| 39 | 39 | try comptime testMemsetArraySentinel(); |
| ... | ... | @@ -55,7 +55,7 @@ fn testMemsetArraySentinel() !void { |
| 55 | 55 | test "@memset on slices" { |
| 56 | 56 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 57 | 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 | 59 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 60 | 60 | |
| 61 | 61 | try testMemsetSlice(); |
| ... | ... | @@ -90,7 +90,7 @@ fn testMemsetSlice() !void { |
| 90 | 90 | test "memset with bool element" { |
| 91 | 91 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 92 | 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 | 95 | var buf: [5]bool = undefined; |
| 96 | 96 | @memset(&buf, true); |
| ... | ... | @@ -101,7 +101,7 @@ test "memset with bool element" { |
| 101 | 101 | test "memset with 1-byte struct element" { |
| 102 | 102 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 103 | 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 | 106 | const S = struct { x: bool }; |
| 107 | 107 | var buf: [5]S = undefined; |
| ... | ... | @@ -113,7 +113,7 @@ test "memset with 1-byte struct element" { |
| 113 | 113 | test "memset with 1-byte array element" { |
| 114 | 114 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 115 | 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 | 118 | const A = [1]bool; |
| 119 | 119 | var buf: [5]A = undefined; |
| ... | ... | @@ -126,7 +126,7 @@ test "memset with large array element, runtime known" { |
| 126 | 126 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 127 | 127 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 128 | 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 | 130 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 131 | 131 | |
| 132 | 132 | const A = [128]u64; |
| ... | ... | @@ -144,7 +144,7 @@ test "memset with large array element, runtime known" { |
| 144 | 144 | test "memset with large array element, comptime known" { |
| 145 | 145 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 146 | 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 | 148 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 149 | 149 | |
| 150 | 150 | const A = [128]u64; |
| ... | ... | @@ -161,7 +161,7 @@ test "memset with large array element, comptime known" { |
| 161 | 161 | test "@memset provides result type" { |
| 162 | 162 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 163 | 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 | 165 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 166 | 166 | |
| 167 | 167 | const S = struct { x: u32 }; |
| ... | ... | @@ -179,7 +179,7 @@ test "@memset provides result type" { |
| 179 | 179 | test "zero keys with @memset" { |
| 180 | 180 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 181 | 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 | 184 | const Keys = struct { |
| 185 | 185 | up: bool, |
| ... | ... | @@ -201,7 +201,7 @@ test "@memset with zero-length array" { |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 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 | 206 | const S = struct { |
| 207 | 207 | var array_u8: [1]u8 = .{1}; |
| ... | ... | @@ -232,7 +232,7 @@ test "@memset a global array" { |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 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 | 237 | const S = struct { |
| 238 | 238 | var x: bool = false; |
test/behavior/merge_error_sets.zig+1| ... | ... | @@ -12,6 +12,7 @@ fn foo() C!void { |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | test "merge error sets" { |
| 15 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 15 | 16 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 16 | 17 | |
| 17 | 18 | if (foo()) { |
test/behavior/muladd.zig+7-4| ... | ... | @@ -48,7 +48,7 @@ fn testMulAdd16() !void { |
| 48 | 48 | test "@mulAdd f80" { |
| 49 | 49 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 50 | 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 | 52 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 53 | 53 | |
| 54 | 54 | try comptime testMulAdd80(); |
| ... | ... | @@ -66,7 +66,7 @@ fn testMulAdd80() !void { |
| 66 | 66 | test "@mulAdd f128" { |
| 67 | 67 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 68 | 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 | 70 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 71 | 71 | |
| 72 | 72 | try comptime testMulAdd128(); |
| ... | ... | @@ -95,6 +95,7 @@ fn vector16() !void { |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | test "vector f16" { |
| 98 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 98 | 99 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 99 | 100 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 100 | 101 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -118,6 +119,7 @@ fn vector32() !void { |
| 118 | 119 | } |
| 119 | 120 | |
| 120 | 121 | test "vector f32" { |
| 122 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 121 | 123 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 122 | 124 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 123 | 125 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -141,6 +143,7 @@ fn vector64() !void { |
| 141 | 143 | } |
| 142 | 144 | |
| 143 | 145 | test "vector f64" { |
| 146 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 144 | 147 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 145 | 148 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 146 | 149 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -166,7 +169,7 @@ test "vector f80" { |
| 166 | 169 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 167 | 170 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 168 | 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 | 173 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 171 | 174 | |
| 172 | 175 | try comptime vector80(); |
| ... | ... | @@ -190,7 +193,7 @@ test "vector f128" { |
| 190 | 193 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 191 | 194 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 192 | 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 | 197 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 195 | 198 | |
| 196 | 199 | try comptime vector128(); |
test/behavior/multiple_externs_with_conflicting_types.zig+2-2| ... | ... | @@ -5,7 +5,7 @@ const A = extern struct { |
| 5 | 5 | extern fn issue529(?*A) void; |
| 6 | 6 | |
| 7 | 7 | comptime { |
| 8 | if (builtin.zig_backend != .stage2_spirv) { | |
| 8 | if (!builtin.cpu.arch.isSpirv()) { | |
| 9 | 9 | _ = @import("conflicting_externs/b.zig"); |
| 10 | 10 | } |
| 11 | 11 | } |
| ... | ... | @@ -15,7 +15,7 @@ const builtin = @import("builtin"); |
| 15 | 15 | test "call extern function defined with conflicting type" { |
| 16 | 16 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 17 | 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 | 19 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 20 | 20 | |
| 21 | 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 | 24 | test "nan memory equality" { |
| 25 | 25 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 26 | 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 | 29 | // signaled |
| 30 | 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 | 29 | } |
| 30 | 30 | |
| 31 | 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 | 33 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 33 | 34 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 34 | 35 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -50,6 +51,7 @@ test "rhs maybe unwrap return" { |
| 50 | 51 | } |
| 51 | 52 | |
| 52 | 53 | test "maybe return" { |
| 54 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 53 | 55 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 54 | 56 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 55 | 57 | |
| ... | ... | @@ -69,6 +71,7 @@ fn foo(x: ?i32) ?bool { |
| 69 | 71 | } |
| 70 | 72 | |
| 71 | 73 | test "test null runtime" { |
| 74 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 72 | 75 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 73 | 76 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 74 | 77 | |
| ... | ... | @@ -130,7 +133,7 @@ test "null with default unwrap" { |
| 130 | 133 | |
| 131 | 134 | test "optional pointer to 0 bit type null value at runtime" { |
| 132 | 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 | 138 | const EmptyStruct = struct {}; |
| 136 | 139 | var x: ?*EmptyStruct = null; |
| ... | ... | @@ -139,6 +142,7 @@ test "optional pointer to 0 bit type null value at runtime" { |
| 139 | 142 | } |
| 140 | 143 | |
| 141 | 144 | test "if var maybe pointer" { |
| 145 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 142 | 146 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 143 | 147 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 144 | 148 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -183,7 +187,7 @@ const SillyStruct = struct { |
| 183 | 187 | const here_is_a_null_literal = SillyStruct{ .context = null }; |
| 184 | 188 | |
| 185 | 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 | 191 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 188 | 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 | 7 | const expectEqualStrings = std.testing.expectEqualStrings; |
| 8 | 8 | |
| 9 | 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 | 11 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 11 | 12 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 12 | 13 | |
| ... | ... | @@ -28,7 +29,7 @@ pub const EmptyStruct = struct {}; |
| 28 | 29 | |
| 29 | 30 | test "optional pointer to size zero struct" { |
| 30 | 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 | 34 | var e = EmptyStruct{}; |
| 34 | 35 | const o: ?*EmptyStruct = &e; |
| ... | ... | @@ -36,7 +37,7 @@ test "optional pointer to size zero struct" { |
| 36 | 37 | } |
| 37 | 38 | |
| 38 | 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 | 42 | try testNullPtrsEql(); |
| 42 | 43 | try comptime testNullPtrsEql(); |
| ... | ... | @@ -94,7 +95,7 @@ test "optional error equality" { |
| 94 | 95 | |
| 95 | 96 | test "optional with zero-bit type" { |
| 96 | 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 | 100 | const S = struct { |
| 100 | 101 | fn doTheTest(comptime ZeroBit: type, comptime zero_bit: ZeroBit) !void { |
| ... | ... | @@ -147,7 +148,7 @@ test "address of unwrap optional" { |
| 147 | 148 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 148 | 149 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 149 | 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 | 153 | const S = struct { |
| 153 | 154 | const Foo = struct { |
| ... | ... | @@ -166,6 +167,7 @@ test "address of unwrap optional" { |
| 166 | 167 | } |
| 167 | 168 | |
| 168 | 169 | test "nested optional field in struct" { |
| 170 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 169 | 171 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 170 | 172 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 171 | 173 | |
| ... | ... | @@ -183,6 +185,7 @@ test "nested optional field in struct" { |
| 183 | 185 | } |
| 184 | 186 | |
| 185 | 187 | test "equality compare optionals and non-optionals" { |
| 188 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 186 | 189 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 187 | 190 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 188 | 191 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -242,6 +245,7 @@ test "equality compare optionals and non-optionals" { |
| 242 | 245 | } |
| 243 | 246 | |
| 244 | 247 | test "compare optionals with modified payloads" { |
| 248 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 245 | 249 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 246 | 250 | |
| 247 | 251 | var lhs: ?bool = false; |
| ... | ... | @@ -269,7 +273,7 @@ test "compare optionals with modified payloads" { |
| 269 | 273 | |
| 270 | 274 | test "unwrap function call with optional pointer return value" { |
| 271 | 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 | 277 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 274 | 278 | |
| 275 | 279 | const S = struct { |
| ... | ... | @@ -290,6 +294,7 @@ test "unwrap function call with optional pointer return value" { |
| 290 | 294 | } |
| 291 | 295 | |
| 292 | 296 | test "nested orelse" { |
| 297 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 293 | 298 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 294 | 299 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 295 | 300 | |
| ... | ... | @@ -318,7 +323,7 @@ test "nested orelse" { |
| 318 | 323 | test "self-referential struct through a slice of optional" { |
| 319 | 324 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 320 | 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 | 328 | const S = struct { |
| 324 | 329 | const Node = struct { |
| ... | ... | @@ -351,6 +356,7 @@ test "assigning to an unwrapped optional field in an inline loop" { |
| 351 | 356 | } |
| 352 | 357 | |
| 353 | 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 | 360 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 355 | 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 | 375 | } |
| 370 | 376 | |
| 371 | 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 | 379 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 373 | 380 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 374 | 381 | const S = struct { |
| ... | ... | @@ -395,7 +402,7 @@ test "0-bit child type coerced to optional return ptr result location" { |
| 395 | 402 | test "0-bit child type coerced to optional" { |
| 396 | 403 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 397 | 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 | 406 | const S = struct { |
| 400 | 407 | fn doTheTest() !void { |
| 401 | 408 | var it: Foo = .{ |
| ... | ... | @@ -419,6 +426,7 @@ test "0-bit child type coerced to optional" { |
| 419 | 426 | } |
| 420 | 427 | |
| 421 | 428 | test "array of optional unaligned types" { |
| 429 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 422 | 430 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 423 | 431 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 424 | 432 | |
| ... | ... | @@ -454,6 +462,7 @@ test "array of optional unaligned types" { |
| 454 | 462 | } |
| 455 | 463 | |
| 456 | 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 | 466 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 458 | 467 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 459 | 468 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -475,7 +484,7 @@ test "optional pointer to zero bit optional payload" { |
| 475 | 484 | test "optional pointer to zero bit error union payload" { |
| 476 | 485 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 477 | 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 | 488 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 480 | 489 | |
| 481 | 490 | const B = struct { |
| ... | ... | @@ -509,7 +518,7 @@ const NoReturn = struct { |
| 509 | 518 | }; |
| 510 | 519 | |
| 511 | 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 | 522 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 514 | 523 | |
| 515 | 524 | NoReturn.a = 64; |
| ... | ... | @@ -521,7 +530,7 @@ test "optional of noreturn used with if" { |
| 521 | 530 | } |
| 522 | 531 | |
| 523 | 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 | 534 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 526 | 535 | |
| 527 | 536 | NoReturn.a = 64; |
| ... | ... | @@ -551,6 +560,7 @@ test "orelse on C pointer" { |
| 551 | 560 | } |
| 552 | 561 | |
| 553 | 562 | test "alignment of wrapping an optional payload" { |
| 563 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 554 | 564 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 555 | 565 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 556 | 566 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -571,7 +581,7 @@ test "alignment of wrapping an optional payload" { |
| 571 | 581 | test "Optional slice size is optimized" { |
| 572 | 582 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 573 | 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 | 586 | try expect(@sizeOf(?[]u8) == @sizeOf([]u8)); |
| 577 | 587 | var a: ?[]const u8 = null; |
| ... | ... | @@ -584,7 +594,7 @@ test "Optional slice passed to function" { |
| 584 | 594 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 585 | 595 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 586 | 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 | 599 | const S = struct { |
| 590 | 600 | fn foo(a: ?[]const u8) !void { |
| ... | ... | @@ -599,6 +609,7 @@ test "Optional slice passed to function" { |
| 599 | 609 | } |
| 600 | 610 | |
| 601 | 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 | 613 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 603 | 614 | |
| 604 | 615 | const Thing = struct { n: i32 }; |
| ... | ... | @@ -626,7 +637,7 @@ test "peer type resolution in nested if expressions" { |
| 626 | 637 | test "cast slice to const slice nested in error union and optional" { |
| 627 | 638 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 628 | 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 | 641 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 631 | 642 | |
| 632 | 643 | const S = struct { |
| ... | ... | @@ -647,6 +658,7 @@ test "variable of optional of noreturn" { |
| 647 | 658 | } |
| 648 | 659 | |
| 649 | 660 | test "copied optional doesn't alias source" { |
| 661 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 650 | 662 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 651 | 663 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 652 | 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 | 676 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 665 | 677 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 666 | 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 | 680 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 669 | 681 | |
| 670 | 682 | const S = struct { |
| ... | ... | @@ -697,6 +709,8 @@ test "global comptime only optional" { |
| 697 | 709 | } |
| 698 | 710 | |
| 699 | 711 | test "optional ptr payload alignment" { |
| 712 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 713 | ||
| 700 | 714 | const S = struct { |
| 701 | 715 | fn doTheTest(p: *align(1) ?u32) !void { |
| 702 | 716 | comptime assert(@TypeOf(&p.*.?) == *align(1) u32); |
test/behavior/overlapping_assign.zig+1-1| ... | ... | @@ -3,7 +3,7 @@ const std = @import("std"); |
| 3 | 3 | const expect = std.testing.expect; |
| 4 | 4 | |
| 5 | 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 | 8 | try theTest(); |
| 9 | 9 | try comptime theTest(); |
test/behavior/packed-struct.zig+30-26| ... | ... | @@ -119,6 +119,7 @@ test "consistent size of packed structs" { |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 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 | 123 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 123 | 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 | 184 | } |
| 184 | 185 | |
| 185 | 186 | test "nested packed structs" { |
| 187 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 186 | 188 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 187 | 189 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 188 | 190 | |
| ... | ... | @@ -225,7 +227,7 @@ test "nested packed structs" { |
| 225 | 227 | } |
| 226 | 228 | |
| 227 | 229 | test "regular in irregular packed struct" { |
| 228 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 230 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 229 | 231 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 230 | 232 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 231 | 233 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| ... | ... | @@ -248,7 +250,8 @@ test "nested packed struct unaligned" { |
| 248 | 250 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 249 | 251 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 250 | 252 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 251 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 253 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 254 | ||
| 252 | 255 | const S1 = packed struct { |
| 253 | 256 | a: u4, |
| 254 | 257 | b: u4, |
| ... | ... | @@ -317,7 +320,7 @@ test "nested packed struct unaligned" { |
| 317 | 320 | test "byte-aligned field pointer offsets" { |
| 318 | 321 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 319 | 322 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 320 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 323 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 321 | 324 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 322 | 325 | |
| 323 | 326 | const S = struct { |
| ... | ... | @@ -404,7 +407,7 @@ test "nested packed struct field pointers" { |
| 404 | 407 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 405 | 408 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 406 | 409 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 407 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 410 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 408 | 411 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 409 | 412 | const S2 = packed struct { |
| 410 | 413 | base: u8, |
| ... | ... | @@ -439,7 +442,7 @@ test "nested packed struct field pointers" { |
| 439 | 442 | test "@intFromPtr on a packed struct field" { |
| 440 | 443 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 441 | 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 | 447 | const S = struct { |
| 445 | 448 | const P = packed struct { |
| ... | ... | @@ -460,7 +463,7 @@ test "@intFromPtr on a packed struct field" { |
| 460 | 463 | test "@intFromPtr on a packed struct field unaligned and nested" { |
| 461 | 464 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 462 | 465 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 463 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 466 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 464 | 467 | |
| 465 | 468 | const S1 = packed struct { |
| 466 | 469 | a: u4, |
| ... | ... | @@ -556,7 +559,7 @@ test "packed struct fields modification" { |
| 556 | 559 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 557 | 560 | |
| 558 | 561 | // Originally reported at https://github.com/ziglang/zig/issues/16615 |
| 559 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 562 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 560 | 563 | |
| 561 | 564 | const Small = packed struct(u16) { |
| 562 | 565 | val: u8 = 0, |
| ... | ... | @@ -581,7 +584,7 @@ test "packed struct fields modification" { |
| 581 | 584 | test "nested packed struct field access test" { |
| 582 | 585 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 583 | 586 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 584 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 587 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 585 | 588 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 586 | 589 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 587 | 590 | |
| ... | ... | @@ -699,7 +702,7 @@ test "nested packed struct field access test" { |
| 699 | 702 | |
| 700 | 703 | test "nested packed struct at non-zero offset" { |
| 701 | 704 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 702 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 705 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 703 | 706 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 704 | 707 | |
| 705 | 708 | const Pair = packed struct(u24) { |
| ... | ... | @@ -731,7 +734,7 @@ test "nested packed struct at non-zero offset 2" { |
| 731 | 734 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 732 | 735 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 733 | 736 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 734 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 737 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 735 | 738 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 736 | 739 | |
| 737 | 740 | const S = struct { |
| ... | ... | @@ -793,7 +796,7 @@ test "nested packed struct at non-zero offset 2" { |
| 793 | 796 | } |
| 794 | 797 | |
| 795 | 798 | test "runtime init of unnamed packed struct type" { |
| 796 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 799 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 797 | 800 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 798 | 801 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 799 | 802 | |
| ... | ... | @@ -812,7 +815,7 @@ test "packed struct passed to callconv(.c) function" { |
| 812 | 815 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 813 | 816 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 814 | 817 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 815 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 818 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 816 | 819 | |
| 817 | 820 | const S = struct { |
| 818 | 821 | const Packed = packed struct(u64) { |
| ... | ... | @@ -837,7 +840,7 @@ test "packed struct passed to callconv(.c) function" { |
| 837 | 840 | test "overaligned pointer to packed struct" { |
| 838 | 841 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 839 | 842 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 840 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 843 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 841 | 844 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 842 | 845 | |
| 843 | 846 | const S = packed struct { a: u32, b: u32 }; |
| ... | ... | @@ -864,7 +867,7 @@ test "pointer to container level packed struct field" { |
| 864 | 867 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 865 | 868 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 866 | 869 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 867 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 870 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 868 | 871 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 869 | 872 | |
| 870 | 873 | const S = packed struct(u32) { |
| ... | ... | @@ -887,7 +890,7 @@ test "pointer to container level packed struct field" { |
| 887 | 890 | } |
| 888 | 891 | |
| 889 | 892 | test "store undefined to packed result location" { |
| 890 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 893 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 891 | 894 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 892 | 895 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 893 | 896 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -910,7 +913,7 @@ test "bitcast back and forth" { |
| 910 | 913 | |
| 911 | 914 | // Originally reported at https://github.com/ziglang/zig/issues/14200 |
| 912 | 915 | test "field access of packed struct smaller than its abi size inside struct initialized with rls" { |
| 913 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 916 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 914 | 917 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 915 | 918 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 916 | 919 | |
| ... | ... | @@ -933,7 +936,7 @@ test "modify nested packed struct aligned field" { |
| 933 | 936 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 934 | 937 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 935 | 938 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 936 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 939 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 937 | 940 | |
| 938 | 941 | const Options = packed struct { |
| 939 | 942 | foo: bool = false, |
| ... | ... | @@ -962,7 +965,7 @@ test "modify nested packed struct aligned field" { |
| 962 | 965 | test "assigning packed struct inside another packed struct" { |
| 963 | 966 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 964 | 967 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 965 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 968 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 966 | 969 | |
| 967 | 970 | const S = struct { |
| 968 | 971 | const Inner = packed struct { |
| ... | ... | @@ -1005,7 +1008,7 @@ test "packed struct acts as a namespace" { |
| 1005 | 1008 | } |
| 1006 | 1009 | |
| 1007 | 1010 | test "assignment to non-byte-aligned field in packed struct" { |
| 1008 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1011 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1009 | 1012 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1010 | 1013 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1011 | 1014 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1028,7 +1031,7 @@ test "assignment to non-byte-aligned field in packed struct" { |
| 1028 | 1031 | test "packed struct field pointer aligned properly" { |
| 1029 | 1032 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1030 | 1033 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1031 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO | |
| 1034 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; // TODO | |
| 1032 | 1035 | |
| 1033 | 1036 | const Foo = packed struct { |
| 1034 | 1037 | a: i32, |
| ... | ... | @@ -1044,7 +1047,7 @@ test "packed struct field pointer aligned properly" { |
| 1044 | 1047 | } |
| 1045 | 1048 | |
| 1046 | 1049 | test "load flag from packed struct in union" { |
| 1047 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1050 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1048 | 1051 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1049 | 1052 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1050 | 1053 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1122,7 +1125,7 @@ test "2-byte packed struct argument in C calling convention" { |
| 1122 | 1125 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1123 | 1126 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 1124 | 1127 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1125 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1128 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1126 | 1129 | |
| 1127 | 1130 | const S = packed struct(u16) { |
| 1128 | 1131 | x: u15 = 0, |
| ... | ... | @@ -1168,7 +1171,7 @@ test "packed struct equality" { |
| 1168 | 1171 | } |
| 1169 | 1172 | |
| 1170 | 1173 | test "packed struct equality ignores padding bits" { |
| 1171 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1174 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1172 | 1175 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1173 | 1176 | |
| 1174 | 1177 | const S = packed struct { b: bool }; |
| ... | ... | @@ -1179,7 +1182,7 @@ test "packed struct equality ignores padding bits" { |
| 1179 | 1182 | } |
| 1180 | 1183 | |
| 1181 | 1184 | test "packed struct with signed field" { |
| 1182 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1185 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1183 | 1186 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1184 | 1187 | |
| 1185 | 1188 | var s: packed struct { |
| ... | ... | @@ -1192,7 +1195,7 @@ test "packed struct with signed field" { |
| 1192 | 1195 | } |
| 1193 | 1196 | |
| 1194 | 1197 | test "assign packed struct initialized with RLS to packed struct literal field" { |
| 1195 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1198 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1196 | 1199 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1197 | 1200 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1198 | 1201 | |
| ... | ... | @@ -1209,7 +1212,7 @@ test "assign packed struct initialized with RLS to packed struct literal field" |
| 1209 | 1212 | } |
| 1210 | 1213 | |
| 1211 | 1214 | test "packed struct store of comparison result" { |
| 1212 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1215 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1213 | 1216 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1214 | 1217 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 1215 | 1218 | |
| ... | ... | @@ -1260,6 +1263,7 @@ test "convert from/to backing int" { |
| 1260 | 1263 | } |
| 1261 | 1264 | |
| 1262 | 1265 | test "equality with wide backing integer" { |
| 1266 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1263 | 1267 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/35982 |
| 1264 | 1268 | |
| 1265 | 1269 | const S = packed struct(i200) { |
test/behavior/packed-union.zig+8-8| ... | ... | @@ -8,7 +8,7 @@ test "flags in packed union" { |
| 8 | 8 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 9 | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 10 | 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 | 12 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 13 | 13 | |
| 14 | 14 | try testFlagsInPackedUnion(); |
| ... | ... | @@ -51,7 +51,7 @@ test "flags in packed union at offset" { |
| 51 | 51 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 52 | 52 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 53 | 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 | 55 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 56 | 56 | |
| 57 | 57 | try testFlagsInPackedUnionAtOffset(); |
| ... | ... | @@ -107,7 +107,7 @@ fn testFlagsInPackedUnionAtOffset() !void { |
| 107 | 107 | test "packed union in packed struct" { |
| 108 | 108 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 109 | 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 | 112 | try testPackedUnionInPackedStruct(); |
| 113 | 113 | try comptime testPackedUnionInPackedStruct(); |
| ... | ... | @@ -144,7 +144,7 @@ test "packed union initialized with a runtime value" { |
| 144 | 144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 145 | 145 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 146 | 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 | 149 | const Fields = packed struct { |
| 150 | 150 | timestamp: u50, |
| ... | ... | @@ -182,7 +182,7 @@ test "assigning to non-active field at comptime" { |
| 182 | 182 | test "packed union with explicit backing integer" { |
| 183 | 183 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 184 | 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 | 187 | const U = packed union(i32) { |
| 188 | 188 | raw: i32, |
| ... | ... | @@ -201,7 +201,7 @@ test "packed union with explicit backing integer" { |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 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 | 206 | const Foo = packed union { |
| 207 | 207 | a: u4, |
| ... | ... | @@ -229,7 +229,7 @@ test "initialize packed union field to undefined at comptime" { |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 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 | 234 | const U = packed union(u10) { |
| 235 | 235 | a: i10, |
| ... | ... | @@ -246,7 +246,7 @@ test "convert from/to backing int" { |
| 246 | 246 | |
| 247 | 247 | test "equality with wide backing integer" { |
| 248 | 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 | 251 | const U = packed union(i200) { |
| 252 | 252 | x: u200, |
test/behavior/packed_struct_explicit_backing_int.zig+1| ... | ... | @@ -5,6 +5,7 @@ const expectEqual = std.testing.expectEqual; |
| 5 | 5 | const native_endian = builtin.cpu.arch.endian(); |
| 6 | 6 | |
| 7 | 7 | test "packed struct explicit backing integer" { |
| 8 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 8 | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 9 | 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 | 20 | test "pointer-integer arithmetic" { |
| 21 | 21 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 22 | 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 | 25 | var ptr: [*]const u8 = "abcd"; |
| 26 | 26 | |
| ... | ... | @@ -45,7 +45,7 @@ test "pointer-integer arithmetic" { |
| 45 | 45 | |
| 46 | 46 | test "pointer subtraction" { |
| 47 | 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 | 51 | const a: *u8 = @ptrFromInt(100); |
| ... | ... | @@ -100,7 +100,7 @@ test "pointer subtraction" { |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 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 | 105 | var t: bool = undefined; |
| 106 | 106 | t = true; |
| ... | ... | @@ -126,7 +126,7 @@ fn PtrOf(comptime T: type) type { |
| 126 | 126 | |
| 127 | 127 | test "implicit cast single item pointer to C pointer and back" { |
| 128 | 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 | 131 | var y: u8 = 11; |
| 132 | 132 | const x: [*c]u8 = &y; |
| ... | ... | @@ -143,7 +143,7 @@ test "initialize const optional C pointer to null" { |
| 143 | 143 | |
| 144 | 144 | test "assigning integer to C pointer" { |
| 145 | 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 | 147 | var x: i32 = 0; |
| 148 | 148 | var y: i32 = 1; |
| 149 | 149 | var ptr: [*c]u8 = 0; |
| ... | ... | @@ -160,7 +160,7 @@ test "assigning integer to C pointer" { |
| 160 | 160 | |
| 161 | 161 | test "C pointer comparison and arithmetic" { |
| 162 | 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 | 165 | const S = struct { |
| 166 | 166 | fn doTheTest() !void { |
| ... | ... | @@ -204,7 +204,7 @@ fn testDerefPtrOneVal() !void { |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 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 | 209 | const ptr_one: *u8 = undefined; |
| 210 | 210 | const ptr_many: [*]u8 = undefined; |
| ... | ... | @@ -222,6 +222,7 @@ test "peer type resolution with C pointers" { |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 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 | 226 | var ptr_c: [*c]u8 = undefined; |
| 226 | 227 | var ptr_const: *const u8 = &undefined; |
| 227 | 228 | _ = .{ &ptr_c, &ptr_const }; |
| ... | ... | @@ -232,7 +233,7 @@ test "implicit casting between C pointer and optional non-C pointer" { |
| 232 | 233 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 233 | 234 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 234 | 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 | 238 | var slice: []const u8 = "aoeu"; |
| 238 | 239 | _ = &slice; |
| ... | ... | @@ -247,7 +248,7 @@ test "implicit casting between C pointer and optional non-C pointer" { |
| 247 | 248 | test "implicit cast error unions with non-optional to optional pointer" { |
| 248 | 249 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 249 | 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 | 252 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 252 | 253 | |
| 253 | 254 | const S = struct { |
| ... | ... | @@ -276,7 +277,7 @@ test "allowzero pointer and slice" { |
| 276 | 277 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 277 | 278 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 278 | 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 | 282 | var ptr: [*]allowzero i32 = @ptrFromInt(0); |
| 282 | 283 | const opt_ptr: ?[*]allowzero i32 = ptr; |
| ... | ... | @@ -295,7 +296,7 @@ test "allowzero pointer and slice" { |
| 295 | 296 | test "assign null directly to C pointer and test null equality" { |
| 296 | 297 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 297 | 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 | 301 | var x: [*c]i32 = null; |
| 301 | 302 | _ = &x; |
| ... | ... | @@ -353,6 +354,8 @@ test "assign null directly to C pointer and test null equality" { |
| 353 | 354 | } |
| 354 | 355 | |
| 355 | 356 | test "array initialization types" { |
| 357 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 358 | ||
| 356 | 359 | const E = enum { A, B, C }; |
| 357 | 360 | try expect(@TypeOf([_]u8{}) == [0]u8); |
| 358 | 361 | try expect(@TypeOf([_:0]u8{}) == [0:0]u8); |
| ... | ... | @@ -362,7 +365,7 @@ test "array initialization types" { |
| 362 | 365 | |
| 363 | 366 | test "null terminated pointer" { |
| 364 | 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 | 370 | const S = struct { |
| 368 | 371 | fn doTheTest() !void { |
| ... | ... | @@ -380,7 +383,7 @@ test "null terminated pointer" { |
| 380 | 383 | test "allow any sentinel" { |
| 381 | 384 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 382 | 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 | 388 | const S = struct { |
| 386 | 389 | fn doTheTest() !void { |
| ... | ... | @@ -396,7 +399,7 @@ test "allow any sentinel" { |
| 396 | 399 | test "pointer sentinel with enums" { |
| 397 | 400 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 398 | 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 | 404 | const S = struct { |
| 402 | 405 | const Number = enum { |
| ... | ... | @@ -419,7 +422,7 @@ test "pointer sentinel with optional element" { |
| 419 | 422 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 420 | 423 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 421 | 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 | 427 | const S = struct { |
| 425 | 428 | fn doTheTest() !void { |
| ... | ... | @@ -436,7 +439,7 @@ test "pointer sentinel with +inf" { |
| 436 | 439 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 437 | 440 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 438 | 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 | 444 | const S = struct { |
| 442 | 445 | fn doTheTest() !void { |
| ... | ... | @@ -458,7 +461,7 @@ test "pointer to array at fixed address" { |
| 458 | 461 | } |
| 459 | 462 | |
| 460 | 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 | 467 | var ptr: [*]align(8) u32 = undefined; |
| ... | ... | @@ -507,7 +510,7 @@ test "@intFromPtr on null optional at comptime" { |
| 507 | 510 | test "indexing array with sentinel returns correct type" { |
| 508 | 511 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 509 | 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 | 515 | var s: [:0]const u8 = "abc"; |
| 513 | 516 | try testing.expectEqualSlices(u8, "*const u8", @typeName(@TypeOf(&s[0]))); |
| ... | ... | @@ -515,7 +518,7 @@ test "indexing array with sentinel returns correct type" { |
| 515 | 518 | |
| 516 | 519 | test "element pointer to slice" { |
| 517 | 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 | 523 | const S = struct { |
| 521 | 524 | fn doTheTest() !void { |
| ... | ... | @@ -537,7 +540,7 @@ test "element pointer to slice" { |
| 537 | 540 | |
| 538 | 541 | test "element pointer arithmetic to slice" { |
| 539 | 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 | 545 | const S = struct { |
| 543 | 546 | fn doTheTest() !void { |
| ... | ... | @@ -562,7 +565,7 @@ test "element pointer arithmetic to slice" { |
| 562 | 565 | |
| 563 | 566 | test "array slicing to slice" { |
| 564 | 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 | 570 | const S = struct { |
| 568 | 571 | fn doTheTest() !void { |
| ... | ... | @@ -592,7 +595,7 @@ test "pointer to constant decl preserves alignment" { |
| 592 | 595 | test "ptrCast comptime known slice to C pointer" { |
| 593 | 596 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 594 | 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 | 600 | const s: [:0]const u8 = "foo"; |
| 598 | 601 | var p: [*c]const u8 = @ptrCast(s); |
| ... | ... | @@ -611,7 +614,7 @@ test "pointer alignment and element type include call expression" { |
| 611 | 614 | } |
| 612 | 615 | |
| 613 | 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 | 619 | const S = struct { |
| 617 | 620 | const Base = extern struct { a: u8 }; |
| ... | ... | @@ -636,6 +639,8 @@ test "result type preserved through multiple references" { |
| 636 | 639 | } |
| 637 | 640 | |
| 638 | 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 | 644 | const ptr1: ?*const u32 = &@intCast(123); |
| 640 | 645 | const ptr2: ?[]const u8 = &.{ @intCast(123), @truncate(0xABCD) }; |
| 641 | 646 | try expect(ptr1.?.* == 123); |
| ... | ... | @@ -688,14 +693,15 @@ fn constant() !void { |
| 688 | 693 | |
| 689 | 694 | test "pointer-to-array constness for zero-size elements, var" { |
| 690 | 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 | 698 | try mutable(); |
| 693 | 699 | try comptime mutable(); |
| 694 | 700 | } |
| 695 | 701 | |
| 696 | 702 | test "pointer-to-array constness for zero-size elements, const" { |
| 697 | 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 | 706 | try constant(); |
| 701 | 707 | try comptime constant(); |
| ... | ... | @@ -735,7 +741,7 @@ test "comptime pointer equality through distinct fields with well-defined layout |
| 735 | 741 | } |
| 736 | 742 | |
| 737 | 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 | 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 | 755 | } |
| 750 | 756 | |
| 751 | 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 | 760 | var slice: []const u0 = undefined; |
| 755 | 761 | slice = &.{ 0, 0 }; |
| ... | ... | @@ -761,7 +767,7 @@ test "pointers to elements of slice of zero-bit type" { |
| 761 | 767 | } |
| 762 | 768 | |
| 763 | 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 | 772 | var many_ptr: [*]const u0 = undefined; |
| 767 | 773 | many_ptr = &.{ 0, 0 }; |
| ... | ... | @@ -773,6 +779,8 @@ test "pointers to elements of many-ptr to zero-bit type" { |
| 773 | 779 | } |
| 774 | 780 | |
| 775 | 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 | 784 | const opt: ?*u8 = @ptrFromInt(0x1000); |
| 777 | 785 | const outer_ptr: [*c]const ?*u8 = &opt; |
| 778 | 786 | const inner_ptr = &outer_ptr.*.?; |
test/behavior/popcount.zig+3-3| ... | ... | @@ -6,7 +6,7 @@ const expectEqual = std.testing.expectEqual; |
| 6 | 6 | test "@popCount integers" { |
| 7 | 7 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 8 | 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 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 11 | 11 | |
| 12 | 12 | try comptime testPopCountIntegers(); |
| ... | ... | @@ -17,7 +17,7 @@ test "@popCount 128bit integer" { |
| 17 | 17 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 18 | 18 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 19 | 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 | 21 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 22 | 22 | |
| 23 | 23 | comptime { |
| ... | ... | @@ -79,7 +79,7 @@ test "@popCount vectors" { |
| 79 | 79 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 80 | 80 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 81 | 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 | 83 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 84 | 84 | |
| 85 | 85 | try comptime testPopCountVectors(); |
test/behavior/prefetch.zig+1-1| ... | ... | @@ -2,7 +2,7 @@ const builtin = @import("builtin"); |
| 2 | 2 | const std = @import("std"); |
| 3 | 3 | |
| 4 | 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 | 7 | var a: [2]u32 = .{ 42, 42 }; |
| 8 | 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 | 6 | |
| 7 | 7 | test "reinterpret bytes as integer with nonzero offset" { |
| 8 | 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 | 11 | try testReinterpretBytesAsInteger(); |
| 12 | 12 | try comptime testReinterpretBytesAsInteger(); |
| ... | ... | @@ -22,6 +22,7 @@ fn testReinterpretBytesAsInteger() !void { |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 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 | 26 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 26 | 27 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 27 | 28 | |
| ... | ... | @@ -39,7 +40,7 @@ fn testReinterpretWithOffsetAndNoWellDefinedLayout() !void { |
| 39 | 40 | |
| 40 | 41 | test "reinterpret bytes inside auto-layout struct as integer with nonzero offset" { |
| 41 | 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 | 45 | try testReinterpretStructWrappedBytesAsInteger(); |
| 45 | 46 | try comptime testReinterpretStructWrappedBytesAsInteger(); |
| ... | ... | @@ -57,7 +58,7 @@ fn testReinterpretStructWrappedBytesAsInteger() !void { |
| 57 | 58 | |
| 58 | 59 | test "reinterpret bytes of an array into an extern struct" { |
| 59 | 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 | 63 | try testReinterpretBytesAsExternStruct(); |
| 63 | 64 | try comptime testReinterpretBytesAsExternStruct(); |
| ... | ... | @@ -171,7 +172,7 @@ test "lower reinterpreted comptime field ptr" { |
| 171 | 172 | |
| 172 | 173 | test "reinterpret struct field at comptime" { |
| 173 | 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 | 177 | const numNative = comptime Bytes.init(0x12345678); |
| 177 | 178 | if (native_endian != .little) { |
| ... | ... | @@ -194,7 +195,7 @@ const Bytes = struct { |
| 194 | 195 | |
| 195 | 196 | test "ptrcast of const integer has the correct object size" { |
| 196 | 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 | 200 | const is_value = ~@as(isize, @intCast(std.math.minInt(isize))); |
| 200 | 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 | 230 | test "implicit optional pointer to optional anyopaque pointer" { |
| 230 | 231 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 231 | 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 | 235 | var buf: [4]u8 = "aoeu".*; |
| 235 | 236 | const x: ?[*]u8 = &buf; |
| ... | ... | @@ -241,7 +242,7 @@ test "implicit optional pointer to optional anyopaque pointer" { |
| 241 | 242 | test "@ptrCast slice to slice" { |
| 242 | 243 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 243 | 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 | 247 | const S = struct { |
| 247 | 248 | fn foo(slice: []u32) []i32 { |
| ... | ... | @@ -281,6 +282,8 @@ test "@ptrCast undefined value at comptime" { |
| 281 | 282 | } |
| 282 | 283 | |
| 283 | 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 | 287 | const S = packed struct { three: u3 }; |
| 285 | 288 | const st: S = .{ .three = 6 }; |
| 286 | 289 | try expect(st.three == 6); |
| ... | ... | @@ -332,7 +335,7 @@ test "@ptrCast restructures comptime-only array" { |
| 332 | 335 | } |
| 333 | 336 | |
| 334 | 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 | 340 | const a3a2: [4][2]comptime_int = .{ |
| 338 | 341 | .{ 1, 2 }, |
| ... | ... | @@ -351,7 +354,7 @@ test "@ptrCast restructures sliced comptime-only array" { |
| 351 | 354 | test "@ptrCast slice multiplying length" { |
| 352 | 355 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 353 | 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 | 359 | const S = struct { |
| 357 | 360 | fn doTheTest(zero: u32) !void { |
| ... | ... | @@ -368,7 +371,7 @@ test "@ptrCast slice multiplying length" { |
| 368 | 371 | test "@ptrCast array pointer to slice multiplying length" { |
| 369 | 372 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 370 | 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 | 376 | const S = struct { |
| 374 | 377 | fn doTheTest(zero: u32) !void { |
| ... | ... | @@ -385,7 +388,7 @@ test "@ptrCast array pointer to slice multiplying length" { |
| 385 | 388 | test "@ptrCast slice dividing length" { |
| 386 | 389 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 387 | 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 | 393 | const S = struct { |
| 391 | 394 | fn doTheTest(zero: u8) !void { |
| ... | ... | @@ -402,7 +405,7 @@ test "@ptrCast slice dividing length" { |
| 402 | 405 | test "@ptrCast array pointer to slice dividing length" { |
| 403 | 406 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 404 | 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 | 410 | const S = struct { |
| 408 | 411 | fn doTheTest(zero: u8) !void { |
| ... | ... | @@ -419,7 +422,7 @@ test "@ptrCast array pointer to slice dividing length" { |
| 419 | 422 | test "@ptrCast slice with complex length increase" { |
| 420 | 423 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 421 | 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 | 427 | const TwoBytes = [2]u8; |
| 425 | 428 | const ThreeBytes = [3]u8; |
| ... | ... | @@ -439,7 +442,7 @@ test "@ptrCast slice with complex length increase" { |
| 439 | 442 | test "@ptrCast array pointer to slice with complex length increase" { |
| 440 | 443 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 441 | 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 | 447 | const TwoBytes = [2]u8; |
| 445 | 448 | const ThreeBytes = [3]u8; |
| ... | ... | @@ -459,7 +462,7 @@ test "@ptrCast array pointer to slice with complex length increase" { |
| 459 | 462 | test "@ptrCast slice with complex length decrease" { |
| 460 | 463 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 461 | 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 | 467 | const TwoBytes = [2]u8; |
| 465 | 468 | const ThreeBytes = [3]u8; |
| ... | ... | @@ -479,7 +482,7 @@ test "@ptrCast slice with complex length decrease" { |
| 479 | 482 | test "@ptrCast array pointer to slice with complex length decrease" { |
| 480 | 483 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 481 | 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 | 487 | const TwoBytes = [2]u8; |
| 485 | 488 | const ThreeBytes = [3]u8; |
| ... | ... | @@ -499,7 +502,7 @@ test "@ptrCast array pointer to slice with complex length decrease" { |
| 499 | 502 | test "@ptrCast slice of zero-bit type to different slice" { |
| 500 | 503 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 501 | 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 | 507 | const S = struct { |
| 505 | 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 | 521 | test "@ptrCast single-item pointer to slice with length 1" { |
| 519 | 522 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 520 | 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 | 526 | const S = struct { |
| 524 | 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 | 541 | test "@ptrCast single-item pointer to slice of bytes" { |
| 539 | 542 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 540 | 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 | 546 | const S = struct { |
| 544 | 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 | 3 | const expectEqual = std.testing.expectEqual; |
| 4 | 4 | |
| 5 | 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 | 8 | addressToFunction(); |
| 9 | 9 | comptime addressToFunction(); |
| ... | ... | @@ -18,7 +18,7 @@ fn addressToFunction() void { |
| 18 | 18 | test "mutate through ptr initialized with constant ptrFromInt value" { |
| 19 | 19 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 20 | 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 | 23 | forceCompilerAnalyzeBranchHardCodedPtrDereference(false); |
| 24 | 24 | } |
| ... | ... | @@ -35,13 +35,14 @@ fn forceCompilerAnalyzeBranchHardCodedPtrDereference(x: bool) void { |
| 35 | 35 | test "@ptrFromInt creates null pointer" { |
| 36 | 36 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 37 | 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 | 40 | const ptr = @as(?*u32, @ptrFromInt(0)); |
| 41 | 41 | try expectEqual(@as(?*u32, null), ptr); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | test "@ptrFromInt creates allowzero zero pointer" { |
| 45 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 45 | 46 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 46 | 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 | test "reference a variable in an if after an if in the 2nd switch prong" { |
| 8 | 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 9 | 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 | 12 | try foo(true, Num.Two, false, "aoeu"); |
| 13 | 13 | try expect(!ok); |
test/behavior/reflection.zig+1| ... | ... | @@ -26,6 +26,7 @@ fn dummy(a: bool, b: i32, c: f32) i32 { |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | test "reflection: @field" { |
| 29 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 29 | 30 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 30 | 31 | |
| 31 | 32 | var f = Foo{ |
test/behavior/return_address.zig+1-1| ... | ... | @@ -8,7 +8,7 @@ fn retAddr() usize { |
| 8 | 8 | test "return address" { |
| 9 | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 10 | 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 | 13 | _ = retAddr(); |
| 14 | 14 | // TODO: #14938 |
test/behavior/saturating_arithmetic.zig+14-14| ... | ... | @@ -16,7 +16,7 @@ test "saturating add" { |
| 16 | 16 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 17 | 17 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 18 | 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 | 20 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 21 | 21 | |
| 22 | 22 | const S = struct { |
| ... | ... | @@ -55,7 +55,7 @@ test "saturating add 128bit" { |
| 55 | 55 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 56 | 56 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 57 | 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 | 59 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 60 | 60 | |
| 61 | 61 | const S = struct { |
| ... | ... | @@ -82,7 +82,7 @@ test "saturating subtraction" { |
| 82 | 82 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 83 | 83 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 84 | 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 | 86 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 87 | 87 | |
| 88 | 88 | const S = struct { |
| ... | ... | @@ -120,7 +120,7 @@ test "saturating subtraction 128bit" { |
| 120 | 120 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 121 | 121 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 122 | 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 | 124 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 125 | 125 | |
| 126 | 126 | const S = struct { |
| ... | ... | @@ -143,7 +143,7 @@ fn testSatMul(comptime T: type, a: T, b: T, expected: T) !void { |
| 143 | 143 | test "saturating multiplication <= 32 bits" { |
| 144 | 144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 145 | 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 | 147 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 148 | 148 | |
| 149 | 149 | try testSatMul(u8, 0, maxInt(u8), 0); |
| ... | ... | @@ -207,7 +207,7 @@ test "saturating multiplication <= 32 bits" { |
| 207 | 207 | test "saturating mul i64, i128" { |
| 208 | 208 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 209 | 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 | 212 | try testSatMul(i64, 0, maxInt(i64), 0); |
| 213 | 213 | try testSatMul(i64, 0, minInt(i64), 0); |
| ... | ... | @@ -236,7 +236,7 @@ test "saturating multiplication" { |
| 236 | 236 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 237 | 237 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 238 | 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 | 240 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 241 | 241 | |
| 242 | 242 | const S = struct { |
| ... | ... | @@ -276,7 +276,7 @@ test "saturating shift-left" { |
| 276 | 276 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 277 | 277 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 278 | 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 | 280 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 281 | 281 | |
| 282 | 282 | const S = struct { |
| ... | ... | @@ -312,7 +312,7 @@ test "saturating shift-left" { |
| 312 | 312 | test "saturating shift-left large rhs" { |
| 313 | 313 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 314 | 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 | 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 | 330 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 331 | 331 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 332 | 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 | 334 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 335 | 335 | |
| 336 | 336 | const lhs_const: u8 = 1; |
| ... | ... | @@ -358,7 +358,7 @@ test "saturating shl uses the LHS type" { |
| 358 | 358 | |
| 359 | 359 | test "sat add > 128 bits" { |
| 360 | 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 | 363 | try testSatAdd(u140, 0, 0, 0); |
| 364 | 364 | try testSatAdd(u140, maxInt(u140), 1, maxInt(u140)); |
| ... | ... | @@ -373,7 +373,7 @@ test "sat add > 128 bits" { |
| 373 | 373 | |
| 374 | 374 | test "sat sub > 128 bits" { |
| 375 | 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 | 378 | try testSatSub(u140, 0, 1, 0); |
| 379 | 379 | try testSatSub(u140, maxInt(u140), maxInt(u140), 0); |
| ... | ... | @@ -388,7 +388,7 @@ test "sat sub > 128 bits" { |
| 388 | 388 | |
| 389 | 389 | test "sat mul > 128 bits" { |
| 390 | 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 | 393 | try testSatMul(u140, 0, maxInt(u140), 0); |
| 394 | 394 | try testSatMul(u140, 1 << 70, 1 << 69, 1 << 139); |
| ... | ... | @@ -403,7 +403,7 @@ test "sat mul > 128 bits" { |
| 403 | 403 | |
| 404 | 404 | test "sat shl > 128 bits" { |
| 405 | 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 | 408 | try testSatShl(u140, 0, u8, 17, 0); |
| 409 | 409 | try testSatShl(u140, 1 << 100, u8, 20, 1 << 120); |
test/behavior/select.zig+2-2| ... | ... | @@ -8,7 +8,7 @@ test "@select vectors" { |
| 8 | 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 9 | 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 10 | 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 | 13 | try comptime selectVectors(); |
| 14 | 14 | try selectVectors(); |
| ... | ... | @@ -52,7 +52,7 @@ test "@select arrays" { |
| 52 | 52 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 53 | 53 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 54 | 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 | 57 | try comptime selectArrays(); |
| 58 | 58 | try selectArrays(); |
test/behavior/shuffle.zig+5-3| ... | ... | @@ -9,7 +9,7 @@ test "@shuffle int" { |
| 9 | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 10 | 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 11 | 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 | 14 | const S = struct { |
| 15 | 15 | fn doTheTest() !void { |
| ... | ... | @@ -50,6 +50,7 @@ test "@shuffle int" { |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | test "@shuffle int strange sizes" { |
| 53 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 53 | 54 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 54 | 55 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 55 | 56 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -133,7 +134,8 @@ test "@shuffle bool 1" { |
| 133 | 134 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 134 | 135 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 135 | 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 | 139 | const S = struct { |
| 138 | 140 | fn doTheTest() !void { |
| 139 | 141 | var x: @Vector(4, bool) = [4]bool{ false, true, false, true }; |
| ... | ... | @@ -154,7 +156,7 @@ test "@shuffle bool 2" { |
| 154 | 156 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 155 | 157 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 156 | 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 | 161 | const S = struct { |
| 160 | 162 | fn doTheTest() !void { |
test/behavior/sizeof_and_typeof.zig+16-6| ... | ... | @@ -12,6 +12,8 @@ const x: u16 = 13; |
| 12 | 12 | const z: @TypeOf(x) = 19; |
| 13 | 13 | |
| 14 | 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 | 18 | var var_1: u32 = undefined; |
| 17 | 19 | var var_2: u8 = undefined; |
| ... | ... | @@ -73,7 +75,7 @@ const P = packed struct { |
| 73 | 75 | |
| 74 | 76 | test "@offsetOf" { |
| 75 | 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 | 80 | // Packed structs have fixed memory layout |
| 79 | 81 | try expect(@offsetOf(P, "a") == 0); |
| ... | ... | @@ -100,6 +102,7 @@ test "@offsetOf" { |
| 100 | 102 | } |
| 101 | 103 | |
| 102 | 104 | test "@bitOffsetOf" { |
| 105 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 103 | 106 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 104 | 107 | |
| 105 | 108 | // Packed structs have fixed memory layout |
| ... | ... | @@ -134,7 +137,7 @@ test "@TypeOf() has no runtime side effects" { |
| 134 | 137 | } |
| 135 | 138 | |
| 136 | 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 | 141 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 139 | 142 | |
| 140 | 143 | const S = struct { |
| ... | ... | @@ -150,6 +153,8 @@ test "branching logic inside @TypeOf" { |
| 150 | 153 | } |
| 151 | 154 | |
| 152 | 155 | test "@bitSizeOf" { |
| 156 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 157 | ||
| 153 | 158 | try expect(@bitSizeOf(u2) == 2); |
| 154 | 159 | try expect(@bitSizeOf(u8) == @sizeOf(u8) * 8); |
| 155 | 160 | try expect(@bitSizeOf(packed struct { |
| ... | ... | @@ -158,6 +163,8 @@ test "@bitSizeOf" { |
| 158 | 163 | } |
| 159 | 164 | |
| 160 | 165 | test "@sizeOf comparison against zero" { |
| 166 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 167 | ||
| 161 | 168 | const S0 = struct { |
| 162 | 169 | f: *@This(), |
| 163 | 170 | }; |
| ... | ... | @@ -240,6 +247,7 @@ test "lazy size cast to float" { |
| 240 | 247 | } |
| 241 | 248 | |
| 242 | 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 | 251 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 244 | 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 | 296 | |
| 289 | 297 | test "peer type resolution with @TypeOf doesn't trigger dependency loop check" { |
| 290 | 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 | 301 | const T = struct { |
| 293 | 302 | next: @TypeOf(null, @as(*const @This(), undefined)), |
| 294 | 303 | }; |
| ... | ... | @@ -327,11 +336,11 @@ const exp = struct { |
| 327 | 336 | } |
| 328 | 337 | }; |
| 329 | 338 | comptime { |
| 330 | if (builtin.zig_backend != .stage2_spirv) _ = exp; | |
| 339 | if (!builtin.cpu.arch.isSpirv()) _ = exp; | |
| 331 | 340 | } |
| 332 | 341 | |
| 333 | 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 | 345 | const S = extern struct { |
| 337 | 346 | state: c_short, |
| ... | ... | @@ -382,6 +391,7 @@ test "Peer resolution of extern function calls in @TypeOf" { |
| 382 | 391 | } |
| 383 | 392 | |
| 384 | 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 | 395 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 386 | 396 | |
| 387 | 397 | const Test = struct { |
| ... | ... | @@ -406,7 +416,7 @@ test "Extern function calls, dereferences and field access in @TypeOf" { |
| 406 | 416 | } |
| 407 | 417 | |
| 408 | 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 | 421 | const dummy = struct {}; |
| 412 | 422 | const S = struct { |
test/behavior/slice.zig+55-43| ... | ... | @@ -30,7 +30,7 @@ comptime { |
| 30 | 30 | |
| 31 | 31 | test "slicing" { |
| 32 | 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 | 35 | var array: [20]i32 = undefined; |
| 36 | 36 | |
| ... | ... | @@ -59,7 +59,7 @@ test "const slice" { |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 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 | 64 | const slice1 = @as([*]i32, undefined)[0..0]; |
| 65 | 65 | try expect(slice1.len == 0); |
| ... | ... | @@ -69,7 +69,7 @@ test "comptime slice of undefined pointer of length 0" { |
| 69 | 69 | |
| 70 | 70 | test "implicitly cast array of size 0 to slice" { |
| 71 | 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 | 74 | var msg = [_]u8{}; |
| 75 | 75 | try assertLenIsZero(&msg); |
| ... | ... | @@ -81,7 +81,7 @@ fn assertLenIsZero(msg: []const u8) !void { |
| 81 | 81 | |
| 82 | 82 | test "access len index of sentinel-terminated slice" { |
| 83 | 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 | 86 | const S = struct { |
| 87 | 87 | fn doTheTest() !void { |
| ... | ... | @@ -105,7 +105,7 @@ test "comptime slice of slice preserves comptime var" { |
| 105 | 105 | |
| 106 | 106 | test "open slice of open slice with sentinel" { |
| 107 | 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 | 110 | var slice: [:0]const u8 = "hello"; |
| 111 | 111 | _ = &slice; |
| ... | ... | @@ -123,7 +123,7 @@ test "open slice of open slice with sentinel" { |
| 123 | 123 | |
| 124 | 124 | test "open slice with sentinel of slice with end index" { |
| 125 | 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 | 128 | var slice: [:0]const u8 = "hello"; |
| 129 | 129 | _ = &slice; |
| ... | ... | @@ -162,6 +162,8 @@ test "slice of type" { |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 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 | 167 | const S = struct { |
| 166 | 168 | fn checkTypesSlice(comptime types_slice: []const type) !void { |
| 167 | 169 | try expect(types_slice.len == 2); |
| ... | ... | @@ -175,7 +177,7 @@ test "pass a slice of types to a function" { |
| 175 | 177 | |
| 176 | 178 | test "generic malloc free" { |
| 177 | 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 | 182 | const a = memAlloc(u8, 10) catch unreachable; |
| 181 | 183 | memFree(u8, a); |
| ... | ... | @@ -189,7 +191,8 @@ fn memFree(comptime T: type, memory: []T) void { |
| 189 | 191 | } |
| 190 | 192 | |
| 191 | 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 | 196 | const S = struct { |
| 194 | 197 | fn doTheTest() !void { |
| 195 | 198 | const pointer = @as([*]u8, @ptrFromInt(0x04))[0..2]; |
| ... | ... | @@ -213,7 +216,7 @@ test "comptime slice of pointer preserves comptime var" { |
| 213 | 216 | } |
| 214 | 217 | |
| 215 | 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 | 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 | 232 | |
| 230 | 233 | test "slicing zero length array" { |
| 231 | 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 | 237 | const s1 = ""[0..]; |
| 234 | 238 | const s2 = ([_]u32{})[0..]; |
| 235 | 239 | try expect(s1.len == 0); |
| ... | ... | @@ -239,7 +243,7 @@ test "slicing zero length array" { |
| 239 | 243 | } |
| 240 | 244 | |
| 241 | 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 | 248 | const array = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 }; |
| 245 | 249 | const ptr: [*]const u8 = @as([*]const u8, @ptrCast(&array)); |
| ... | ... | @@ -254,6 +258,8 @@ test "slicing pointer by length" { |
| 254 | 258 | const x = @as([*]i32, @ptrFromInt(0x1000))[0..0x500]; |
| 255 | 259 | const y = x[0x100..]; |
| 256 | 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 | 263 | try expect(@intFromPtr(x) == 0x1000); |
| 258 | 264 | try expect(x.len == 0x500); |
| 259 | 265 | |
| ... | ... | @@ -262,7 +268,7 @@ test "compile time slice of pointer to hard coded address" { |
| 262 | 268 | } |
| 263 | 269 | |
| 264 | 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 | 273 | comptime { |
| 268 | 274 | try expect(@TypeOf("aoeu"[0..]) == *const [4:0]u8); |
| ... | ... | @@ -278,7 +284,7 @@ test "slice string literal has correct type" { |
| 278 | 284 | |
| 279 | 285 | test "result location zero sized array inside struct field implicit cast to slice" { |
| 280 | 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 | 289 | const E = struct { |
| 284 | 290 | entries: []u32, |
| ... | ... | @@ -291,7 +297,7 @@ test "result location zero sized array inside struct field implicit cast to slic |
| 291 | 297 | test "runtime safety lets us slice from len..len" { |
| 292 | 298 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 293 | 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 | 302 | var an_array = [_]u8{ 1, 2, 3 }; |
| 297 | 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 | 309 | |
| 304 | 310 | test "C pointer" { |
| 305 | 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 | 314 | var buf: [*c]const u8 = "kjdhfkjdhfdkjhfkfjhdfkjdhfkdjhfdkjhf"; |
| 309 | 315 | var len: u32 = 10; |
| ... | ... | @@ -315,7 +321,7 @@ test "C pointer" { |
| 315 | 321 | test "C pointer slice access" { |
| 316 | 322 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 317 | 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 | 326 | var buf: [10]u32 = @splat(42); |
| 321 | 327 | const c_ptr = @as([*c]const u32, @ptrCast(&buf)); |
| ... | ... | @@ -345,7 +351,7 @@ fn sliceSum(comptime q: []const u8) i32 { |
| 345 | 351 | |
| 346 | 352 | test "slice type with custom alignment" { |
| 347 | 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 | 356 | const LazilyResolvedType = struct { |
| 351 | 357 | anything: i32, |
| ... | ... | @@ -359,7 +365,7 @@ test "slice type with custom alignment" { |
| 359 | 365 | |
| 360 | 366 | test "obtaining a null terminated slice" { |
| 361 | 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 | 370 | // here we have a normal array |
| 365 | 371 | var buf: [50]u8 = undefined; |
| ... | ... | @@ -385,6 +391,8 @@ test "obtaining a null terminated slice" { |
| 385 | 391 | } |
| 386 | 392 | |
| 387 | 393 | test "empty array to slice" { |
| 394 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 395 | ||
| 388 | 396 | const S = struct { |
| 389 | 397 | fn doTheTest() !void { |
| 390 | 398 | const empty: []align(16) u8 = &[_]u8{}; |
| ... | ... | @@ -422,7 +430,7 @@ test "comptime-known slice of a global constant" { |
| 422 | 430 | |
| 423 | 431 | test "@ptrCast slice to pointer" { |
| 424 | 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 | 435 | const S = struct { |
| 428 | 436 | fn doTheTest() !void { |
| ... | ... | @@ -439,7 +447,7 @@ test "@ptrCast slice to pointer" { |
| 439 | 447 | |
| 440 | 448 | test "slice multi-pointer without end" { |
| 441 | 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 | 452 | const S = struct { |
| 445 | 453 | fn doTheTest() !void { |
| ... | ... | @@ -477,7 +485,7 @@ test "slice multi-pointer without end" { |
| 477 | 485 | test "slice syntax resulting in pointer-to-array" { |
| 478 | 486 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 479 | 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 | 490 | const S = struct { |
| 483 | 491 | fn doTheTest() !void { |
| ... | ... | @@ -692,7 +700,7 @@ test "slice syntax resulting in pointer-to-array" { |
| 692 | 700 | |
| 693 | 701 | test "slice pointer-to-array null terminated" { |
| 694 | 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 | 705 | comptime { |
| 698 | 706 | var array = [5:0]u8{ 1, 2, 3, 4, 5 }; |
| ... | ... | @@ -711,7 +719,7 @@ test "slice pointer-to-array null terminated" { |
| 711 | 719 | |
| 712 | 720 | test "slice pointer-to-array zero length" { |
| 713 | 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 | 724 | comptime { |
| 717 | 725 | { |
| ... | ... | @@ -745,7 +753,7 @@ test "slice pointer-to-array zero length" { |
| 745 | 753 | test "type coercion of pointer to anon struct literal to pointer to slice" { |
| 746 | 754 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 747 | 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 | 758 | const S = struct { |
| 751 | 759 | const U = union { |
| ... | ... | @@ -792,7 +800,7 @@ test "array concat of slices gives ptr to array" { |
| 792 | 800 | |
| 793 | 801 | test "slice bounds in comptime concatenation" { |
| 794 | 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 | 805 | const bs = comptime blk: { |
| 798 | 806 | const b = "........1........"; |
| ... | ... | @@ -808,6 +816,8 @@ test "slice bounds in comptime concatenation" { |
| 808 | 816 | } |
| 809 | 817 | |
| 810 | 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 | 822 | const str0 = &[_:0]u8{ '1', '2', '3' }; |
| 813 | 823 | const slice0: [:0]const u8 = str0; |
| ... | ... | @@ -833,7 +843,8 @@ test "slice sentinel access at comptime" { |
| 833 | 843 | |
| 834 | 844 | test "slicing array with sentinel as end index" { |
| 835 | 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 | 848 | const S = struct { |
| 838 | 849 | fn do() !void { |
| 839 | 850 | var array = [_:0]u8{ 1, 2, 3, 4 }; |
| ... | ... | @@ -850,7 +861,7 @@ test "slicing array with sentinel as end index" { |
| 850 | 861 | |
| 851 | 862 | test "slicing slice with sentinel as end index" { |
| 852 | 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 | 866 | const S = struct { |
| 856 | 867 | fn do() !void { |
| ... | ... | @@ -879,7 +890,8 @@ test "slice len modification at comptime" { |
| 879 | 890 | } |
| 880 | 891 | |
| 881 | 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 | 895 | const const_slice: []const u8 = "string"; |
| 884 | 896 | |
| 885 | 897 | const const_ptr_const_slice = &const_slice; |
| ... | ... | @@ -909,7 +921,7 @@ test "global slice field access" { |
| 909 | 921 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 910 | 922 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 911 | 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 | 926 | const S = struct { |
| 915 | 927 | var slice: []const u8 = undefined; |
| ... | ... | @@ -921,7 +933,7 @@ test "global slice field access" { |
| 921 | 933 | } |
| 922 | 934 | |
| 923 | 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 | 938 | var n: usize = 10; |
| 927 | 939 | _ = &n; |
| ... | ... | @@ -931,7 +943,7 @@ test "slice of void" { |
| 931 | 943 | } |
| 932 | 944 | |
| 933 | 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 | 948 | var a: usize = 0; |
| 937 | 949 | const idx: *usize = &a; |
| ... | ... | @@ -947,7 +959,7 @@ test "slice with dereferenced value" { |
| 947 | 959 | } |
| 948 | 960 | |
| 949 | 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 | 965 | const empty_slice: []u8 = &[_]u8{}; |
| ... | ... | @@ -965,7 +977,7 @@ test "empty slice ptr is non null" { |
| 965 | 977 | |
| 966 | 978 | test "slice decays to many pointer" { |
| 967 | 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 | 982 | var buf: [8]u8 = "abcdefg\x00".*; |
| 971 | 983 | const p: [*:0]const u8 = buf[0..7 :0]; |
| ... | ... | @@ -975,7 +987,7 @@ test "slice decays to many pointer" { |
| 975 | 987 | test "write through pointer to optional slice arg" { |
| 976 | 988 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 977 | 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 | 992 | const S = struct { |
| 981 | 993 | fn bar(foo: *?[]const u8) !void { |
| ... | ... | @@ -994,7 +1006,7 @@ test "write through pointer to optional slice arg" { |
| 994 | 1006 | test "modify slice length at comptime" { |
| 995 | 1007 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 996 | 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 | 1011 | const arr: [2]u8 = .{ 10, 20 }; |
| 1000 | 1012 | comptime var s: []const u8 = arr[0..0]; |
| ... | ... | @@ -1009,7 +1021,7 @@ test "modify slice length at comptime" { |
| 1009 | 1021 | |
| 1010 | 1022 | test "slicing zero length array field of struct" { |
| 1011 | 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 | 1025 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1014 | 1026 | |
| 1015 | 1027 | const S = struct { |
| ... | ... | @@ -1024,7 +1036,7 @@ test "slicing zero length array field of struct" { |
| 1024 | 1036 | |
| 1025 | 1037 | test "slicing slices gives correct result" { |
| 1026 | 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 | 1041 | const foo = "1234"; |
| 1030 | 1042 | const bar = foo[0..4]; |
| ... | ... | @@ -1037,7 +1049,7 @@ test "slicing slices gives correct result" { |
| 1037 | 1049 | |
| 1038 | 1050 | test "get address of element of zero-sized slice" { |
| 1039 | 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 | 1054 | const S = struct { |
| 1043 | 1055 | fn destroy(_: *void) void {} |
| ... | ... | @@ -1049,7 +1061,7 @@ test "get address of element of zero-sized slice" { |
| 1049 | 1061 | |
| 1050 | 1062 | test "sentinel-terminated 0-length slices" { |
| 1051 | 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 | 1066 | const u32s: [4]u32 = [_]u32{ 0, 1, 2, 3 }; |
| 1055 | 1067 | |
| ... | ... | @@ -1068,7 +1080,7 @@ test "sentinel-terminated 0-length slices" { |
| 1068 | 1080 | } |
| 1069 | 1081 | |
| 1070 | 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 | 1085 | var cond: bool = undefined; |
| 1074 | 1086 | cond = false; |
| ... | ... | @@ -1078,7 +1090,7 @@ test "peer slices keep abi alignment with empty struct" { |
| 1078 | 1090 | } |
| 1079 | 1091 | |
| 1080 | 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 | 1095 | const sentinel = std.math.maxInt(u16); |
| 1084 | 1096 | |
| ... | ... | @@ -1101,7 +1113,7 @@ test "sentinel expression in slice operation has result type" { |
| 1101 | 1113 | } |
| 1102 | 1114 | |
| 1103 | 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 | 1118 | const S = struct { |
| 1107 | 1119 | fn foo(cond: bool, slice: []const u8) []const u8 { |
| ... | ... | @@ -1115,7 +1127,7 @@ test "conditionally return second argument slice" { |
| 1115 | 1127 | } |
| 1116 | 1128 | |
| 1117 | 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 | 1132 | const S = struct { |
| 1121 | 1133 | fn doTheTest(p: *align(1) const []u8) !void { |
test/behavior/spirv.zig+5| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | |
| 2 | 3 | const expect = std.testing.expect; |
| 3 | 4 | |
| 4 | 5 | const Sampler = @SpirvType(.sampler); |
| ... | ... | @@ -50,6 +51,8 @@ test "@SpirvType" { |
| 50 | 51 | } |
| 51 | 52 | |
| 52 | 53 | test "@ptrCast to first field type" { |
| 54 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 55 | ||
| 53 | 56 | const Inner = extern struct { a: u32 }; |
| 54 | 57 | const Outer = extern struct { a: Inner, b: u32 }; |
| 55 | 58 | var outer: Outer = undefined; |
| ... | ... | @@ -58,6 +61,8 @@ test "@ptrCast to first field type" { |
| 58 | 61 | } |
| 59 | 62 | |
| 60 | 63 | test "@SpirvType equality" { |
| 64 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 65 | ||
| 61 | 66 | try expect(@SpirvType(.sampler) == Sampler); |
| 62 | 67 | try expect(@SpirvType(.{ .runtime_array = u32 }) == RuntimeArray); |
| 63 | 68 | try expect(@SpirvType(.{ .sampled_image = Image }) == SampledImage); |
test/behavior/splat.zig+6-3| ... | ... | @@ -5,6 +5,7 @@ const expect = std.testing.expect; |
| 5 | 5 | const assert = std.debug.assert; |
| 6 | 6 | |
| 7 | 7 | test "@splat array" { |
| 8 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 8 | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 9 | 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 10 | 11 | |
| ... | ... | @@ -33,7 +34,7 @@ test "@splat array" { |
| 33 | 34 | } |
| 34 | 35 | |
| 35 | 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 | 38 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 38 | 39 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 39 | 40 | |
| ... | ... | @@ -56,7 +57,7 @@ test "@splat array with sentinel" { |
| 56 | 57 | } |
| 57 | 58 | |
| 58 | 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 | 61 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 61 | 62 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 62 | 63 | |
| ... | ... | @@ -79,6 +80,7 @@ test "@splat zero-length array" { |
| 79 | 80 | } |
| 80 | 81 | |
| 81 | 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 | 84 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 83 | 85 | |
| 84 | 86 | const S = struct { |
| ... | ... | @@ -92,7 +94,7 @@ test "splat with an error union or optional result type" { |
| 92 | 94 | } |
| 93 | 95 | |
| 94 | 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 | 98 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 97 | 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 | 115 | } |
| 114 | 116 | |
| 115 | 117 | test "vector @splat" { |
| 118 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 116 | 119 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 117 | 120 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 118 | 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 | 18 | test "@src" { |
| 19 | 19 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 20 | 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 | 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 | |
| 8 | 8 | test "@tagName() returns a string literal" { |
| 9 | 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 | 12 | try std.testing.expect(*const [13:0]u8 == @TypeOf(tag_name)); |
| 13 | 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 | 20 | |
| 21 | 21 | test "@errorName() returns a string literal" { |
| 22 | 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 | 25 | try std.testing.expect(*const [13:0]u8 == @TypeOf(error_name)); |
| 26 | 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 | 33 | |
| 34 | 34 | test "@typeName() returns a string literal" { |
| 35 | 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 | 38 | try std.testing.expect(*const [type_name.len:0]u8 == @TypeOf(type_name)); |
| 39 | 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 | 47 | test "@embedFile() returns a string literal" { |
| 48 | 48 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 49 | 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 | 52 | try std.testing.expect(*const [expected_contents.len:0]u8 == @TypeOf(actual_contents)); |
| 53 | 53 | try std.testing.expect(std.mem.eql(u8, expected_contents, actual_contents)); |
| ... | ... | @@ -62,7 +62,7 @@ fn testFnForSrc() std.builtin.SourceLocation { |
| 62 | 62 | test "@src() returns a struct containing 0-terminated string slices" { |
| 63 | 63 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 64 | 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 | 67 | const src = testFnForSrc(); |
| 68 | 68 | try std.testing.expect([:0]const u8 == @TypeOf(src.file)); |
| ... | ... | @@ -84,7 +84,7 @@ test "string literal pointer sentinel" { |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 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 | 89 | const string = "Hello!\x00World!"; |
| 90 | 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 | 102 | } |
| 103 | 103 | |
| 104 | 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 | 107 | var var_str = "abc"; |
| 107 | 108 | const var_derefed = var_str[0 .. var_str.len + 1].*; |
| 108 | 109 |
test/behavior/struct.zig+105-48| ... | ... | @@ -10,6 +10,7 @@ const maxInt = std.math.maxInt; |
| 10 | 10 | top_level_field: i32, |
| 11 | 11 | |
| 12 | 12 | test "top level fields" { |
| 13 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 13 | 14 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 14 | 15 | |
| 15 | 16 | var instance = @This(){ |
| ... | ... | @@ -43,6 +44,7 @@ const StructWithFields = struct { |
| 43 | 44 | }; |
| 44 | 45 | |
| 45 | 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 | 48 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 47 | 49 | |
| 48 | 50 | const foo = StructWithFields{ .a = 5, .b = 1, .c = 10, .d = 2 }; |
| ... | ... | @@ -66,6 +68,7 @@ const SmallStruct = struct { |
| 66 | 68 | }; |
| 67 | 69 | |
| 68 | 70 | test "lower unnamed constants" { |
| 71 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 69 | 72 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 70 | 73 | |
| 71 | 74 | var foo = SmallStruct{ .a = 1, .b = 255 }; |
| ... | ... | @@ -88,7 +91,7 @@ const StructFoo = struct { |
| 88 | 91 | test "structs" { |
| 89 | 92 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 90 | 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 | 96 | var foo: StructFoo = undefined; |
| 94 | 97 | @memset(@as([*]u8, @ptrCast(&foo))[0..@sizeOf(StructFoo)], 0); |
| ... | ... | @@ -106,6 +109,7 @@ fn testMutation(foo: *StructFoo) void { |
| 106 | 109 | } |
| 107 | 110 | |
| 108 | 111 | test "struct byval assign" { |
| 112 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 109 | 113 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 110 | 114 | |
| 111 | 115 | var foo1: StructFoo = undefined; |
| ... | ... | @@ -170,6 +174,7 @@ const MemberFnTestFoo = struct { |
| 170 | 174 | }; |
| 171 | 175 | |
| 172 | 176 | test "call member function directly" { |
| 177 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 173 | 178 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 174 | 179 | |
| 175 | 180 | const instance = MemberFnTestFoo{ .x = 1234 }; |
| ... | ... | @@ -178,6 +183,7 @@ test "call member function directly" { |
| 178 | 183 | } |
| 179 | 184 | |
| 180 | 185 | test "store member function in variable" { |
| 186 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 181 | 187 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 182 | 188 | |
| 183 | 189 | const instance = MemberFnTestFoo{ .x = 1234 }; |
| ... | ... | @@ -187,6 +193,7 @@ test "store member function in variable" { |
| 187 | 193 | } |
| 188 | 194 | |
| 189 | 195 | test "member functions" { |
| 196 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 190 | 197 | const r = MemberFnRand{ .seed = 1234 }; |
| 191 | 198 | try expect(r.getSeed() == 1234); |
| 192 | 199 | } |
| ... | ... | @@ -198,6 +205,7 @@ const MemberFnRand = struct { |
| 198 | 205 | }; |
| 199 | 206 | |
| 200 | 207 | test "return struct byval from function" { |
| 208 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 201 | 209 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 202 | 210 | |
| 203 | 211 | const Bar = struct { |
| ... | ... | @@ -215,6 +223,7 @@ test "return struct byval from function" { |
| 215 | 223 | } |
| 216 | 224 | |
| 217 | 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 | 227 | const S = struct { |
| 219 | 228 | fn doC(s: *const @This()) bool { |
| 220 | 229 | _ = s; |
| ... | ... | @@ -234,6 +243,7 @@ test "call method with mutable reference to struct with no fields" { |
| 234 | 243 | } |
| 235 | 244 | |
| 236 | 245 | test "struct field init with catch" { |
| 246 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 237 | 247 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 238 | 248 | |
| 239 | 249 | const S = struct { |
| ... | ... | @@ -277,7 +287,7 @@ const Val = struct { |
| 277 | 287 | |
| 278 | 288 | test "struct point to self" { |
| 279 | 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 | 292 | var root: Node = undefined; |
| 283 | 293 | root.val.x = 1; |
| ... | ... | @@ -320,7 +330,7 @@ fn testReturnEmptyStructFromFn() EmptyStruct2 { |
| 320 | 330 | |
| 321 | 331 | test "pass slice of empty struct to fn" { |
| 322 | 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 | 335 | try expect(testPassSliceOfEmptyStructToFn(&[_]EmptyStruct2{EmptyStruct2{}}) == 1); |
| 326 | 336 | } |
| ... | ... | @@ -331,7 +341,7 @@ fn testPassSliceOfEmptyStructToFn(slice: []const EmptyStruct2) usize { |
| 331 | 341 | test "self-referencing struct via array member" { |
| 332 | 342 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 333 | 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 | 346 | const T = struct { |
| 337 | 347 | children: [1]*@This(), |
| ... | ... | @@ -342,6 +352,8 @@ test "self-referencing struct via array member" { |
| 342 | 352 | } |
| 343 | 353 | |
| 344 | 354 | test "empty struct method call" { |
| 355 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 356 | ||
| 345 | 357 | const es = EmptyStruct{}; |
| 346 | 358 | try expect(es.method() == 1234); |
| 347 | 359 | } |
| ... | ... | @@ -355,7 +367,7 @@ const EmptyStruct = struct { |
| 355 | 367 | test "align 1 field before self referential align 8 field as slice return type" { |
| 356 | 368 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 357 | 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 | 372 | const result = alloc(Expr); |
| 361 | 373 | try expect(result.len == 0); |
| ... | ... | @@ -376,7 +388,7 @@ const APackedStruct = packed struct { |
| 376 | 388 | }; |
| 377 | 389 | |
| 378 | 390 | test "packed struct" { |
| 379 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 391 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 380 | 392 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 381 | 393 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 382 | 394 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| ... | ... | @@ -402,7 +414,7 @@ const Foo96Bits = packed struct { |
| 402 | 414 | |
| 403 | 415 | test "packed struct 24bits" { |
| 404 | 416 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 405 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 417 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 406 | 418 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 407 | 419 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 408 | 420 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -444,7 +456,7 @@ test "packed struct 24bits" { |
| 444 | 456 | } |
| 445 | 457 | |
| 446 | 458 | test "runtime struct initialization of bitfield" { |
| 447 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 459 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 448 | 460 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 449 | 461 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 450 | 462 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -487,7 +499,8 @@ test "packed struct fields are ordered from LSB to MSB" { |
| 487 | 499 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 488 | 500 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 489 | 501 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 490 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 502 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 503 | ||
| 491 | 504 | var all: u64 = 0x7765443322221111; |
| 492 | 505 | var bytes: [8]u8 align(@alignOf(Bitfields)) = undefined; |
| 493 | 506 | @memcpy(bytes[0..8], @as([*]u8, @ptrCast(&all))); |
| ... | ... | @@ -503,7 +516,7 @@ test "packed struct fields are ordered from LSB to MSB" { |
| 503 | 516 | } |
| 504 | 517 | |
| 505 | 518 | test "implicit cast packed struct field to const ptr" { |
| 506 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 519 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 507 | 520 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 508 | 521 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 509 | 522 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -525,6 +538,7 @@ test "implicit cast packed struct field to const ptr" { |
| 525 | 538 | } |
| 526 | 539 | |
| 527 | 540 | test "zero-bit field in packed struct" { |
| 541 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 528 | 542 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 529 | 543 | |
| 530 | 544 | const S = packed struct { |
| ... | ... | @@ -539,7 +553,7 @@ test "packed struct with non-ABI-aligned field" { |
| 539 | 553 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 540 | 554 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 541 | 555 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 542 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 556 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 543 | 557 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 544 | 558 | |
| 545 | 559 | const S = packed struct { |
| ... | ... | @@ -566,7 +580,7 @@ const bit_field_1 = BitField1{ |
| 566 | 580 | }; |
| 567 | 581 | |
| 568 | 582 | test "bit field access" { |
| 569 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 583 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 570 | 584 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 571 | 585 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 572 | 586 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -599,6 +613,7 @@ fn getC(data: *const BitField1) u2 { |
| 599 | 613 | } |
| 600 | 614 | |
| 601 | 615 | test "default struct initialization fields" { |
| 616 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 602 | 617 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 603 | 618 | |
| 604 | 619 | const S = struct { |
| ... | ... | @@ -625,7 +640,7 @@ test "packed array 24bits" { |
| 625 | 640 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 626 | 641 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 627 | 642 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 628 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 643 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 629 | 644 | |
| 630 | 645 | comptime { |
| 631 | 646 | try expect(@sizeOf([9]Foo32Bits) == 9 * 4); |
| ... | ... | @@ -689,7 +704,7 @@ const FooArrayOfAligned = packed struct { |
| 689 | 704 | }; |
| 690 | 705 | |
| 691 | 706 | test "pointer to packed struct member in a stack variable" { |
| 692 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 707 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 693 | 708 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 694 | 709 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 695 | 710 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -719,7 +734,7 @@ test "packed struct with u0 field access" { |
| 719 | 734 | } |
| 720 | 735 | |
| 721 | 736 | test "access to global struct fields" { |
| 722 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 737 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 723 | 738 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 724 | 739 | |
| 725 | 740 | g_foo.bar.value = 42; |
| ... | ... | @@ -743,7 +758,7 @@ var g_foo: S0 = S0.init(); |
| 743 | 758 | test "packed struct with fp fields" { |
| 744 | 759 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 745 | 760 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 746 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 761 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 747 | 762 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 748 | 763 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 749 | 764 | |
| ... | ... | @@ -770,6 +785,7 @@ test "packed struct with fp fields" { |
| 770 | 785 | } |
| 771 | 786 | |
| 772 | 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; | |
| 773 | 789 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 774 | 790 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 775 | 791 | |
| ... | ... | @@ -796,7 +812,7 @@ test "fn with C calling convention returns struct by value" { |
| 796 | 812 | test "non-packed struct with u128 entry in union" { |
| 797 | 813 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 798 | 814 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 799 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 815 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 800 | 816 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 801 | 817 | |
| 802 | 818 | const U = union(enum) { |
| ... | ... | @@ -819,7 +835,7 @@ test "non-packed struct with u128 entry in union" { |
| 819 | 835 | } |
| 820 | 836 | |
| 821 | 837 | test "packed struct field passed to generic function" { |
| 822 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 838 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 823 | 839 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 824 | 840 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 825 | 841 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -844,6 +860,7 @@ test "packed struct field passed to generic function" { |
| 844 | 860 | } |
| 845 | 861 | |
| 846 | 862 | test "anonymous struct literal syntax" { |
| 863 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 847 | 864 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 848 | 865 | |
| 849 | 866 | const S = struct { |
| ... | ... | @@ -867,6 +884,8 @@ test "anonymous struct literal syntax" { |
| 867 | 884 | } |
| 868 | 885 | |
| 869 | 886 | test "fully anonymous struct" { |
| 887 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 888 | ||
| 870 | 889 | const S = struct { |
| 871 | 890 | fn doTheTest() !void { |
| 872 | 891 | try dump(.{ |
| ... | ... | @@ -889,6 +908,8 @@ test "fully anonymous struct" { |
| 889 | 908 | } |
| 890 | 909 | |
| 891 | 910 | test "fully anonymous list literal" { |
| 911 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 912 | ||
| 892 | 913 | const S = struct { |
| 893 | 914 | fn doTheTest() !void { |
| 894 | 915 | try dump(.{ @as(u32, 1234), @as(f64, 12.34), true, "hi" }); |
| ... | ... | @@ -906,6 +927,8 @@ test "fully anonymous list literal" { |
| 906 | 927 | } |
| 907 | 928 | |
| 908 | 929 | test "tuple assigned to variable" { |
| 930 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 931 | ||
| 909 | 932 | var vec = .{ @as(i32, 22), @as(i32, 55), @as(i32, 99) }; |
| 910 | 933 | _ = &vec; |
| 911 | 934 | try expect(vec.@"0" == 22); |
| ... | ... | @@ -917,6 +940,7 @@ test "tuple assigned to variable" { |
| 917 | 940 | } |
| 918 | 941 | |
| 919 | 942 | test "comptime struct field" { |
| 943 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 920 | 944 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 921 | 945 | |
| 922 | 946 | const T = struct { |
| ... | ... | @@ -932,7 +956,7 @@ test "comptime struct field" { |
| 932 | 956 | } |
| 933 | 957 | |
| 934 | 958 | test "tuple element initialized with fn call" { |
| 935 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 959 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 936 | 960 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 937 | 961 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 938 | 962 | |
| ... | ... | @@ -950,6 +974,7 @@ test "tuple element initialized with fn call" { |
| 950 | 974 | } |
| 951 | 975 | |
| 952 | 976 | test "struct with union field" { |
| 977 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 953 | 978 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 954 | 979 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 955 | 980 | |
| ... | ... | @@ -970,6 +995,7 @@ test "struct with union field" { |
| 970 | 995 | } |
| 971 | 996 | |
| 972 | 997 | test "struct with 0-length union array field" { |
| 998 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 973 | 999 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 974 | 1000 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 975 | 1001 | |
| ... | ... | @@ -988,7 +1014,7 @@ test "struct with 0-length union array field" { |
| 988 | 1014 | } |
| 989 | 1015 | |
| 990 | 1016 | test "packed struct with undefined initializers" { |
| 991 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1017 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 992 | 1018 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 993 | 1019 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 994 | 1020 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1019,7 +1045,7 @@ test "packed struct with undefined initializers" { |
| 1019 | 1045 | } |
| 1020 | 1046 | |
| 1021 | 1047 | test "for loop over pointers to struct, getting field from struct pointer" { |
| 1022 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1048 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1023 | 1049 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1024 | 1050 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1025 | 1051 | |
| ... | ... | @@ -1061,7 +1087,7 @@ test "anon init through error unions and optionals" { |
| 1061 | 1087 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1062 | 1088 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1063 | 1089 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1064 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1090 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1065 | 1091 | |
| 1066 | 1092 | const S = struct { |
| 1067 | 1093 | a: u32, |
| ... | ... | @@ -1085,6 +1111,7 @@ test "anon init through error unions and optionals" { |
| 1085 | 1111 | } |
| 1086 | 1112 | |
| 1087 | 1113 | test "anon init through optional" { |
| 1114 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1088 | 1115 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1089 | 1116 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1090 | 1117 | |
| ... | ... | @@ -1105,7 +1132,7 @@ test "anon init through optional" { |
| 1105 | 1132 | test "anon init through error union" { |
| 1106 | 1133 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1107 | 1134 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1108 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1135 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1109 | 1136 | |
| 1110 | 1137 | const S = struct { |
| 1111 | 1138 | a: u32, |
| ... | ... | @@ -1122,6 +1149,7 @@ test "anon init through error union" { |
| 1122 | 1149 | } |
| 1123 | 1150 | |
| 1124 | 1151 | test "typed init through error unions and optionals" { |
| 1152 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1125 | 1153 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1126 | 1154 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1127 | 1155 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1148,6 +1176,7 @@ test "typed init through error unions and optionals" { |
| 1148 | 1176 | } |
| 1149 | 1177 | |
| 1150 | 1178 | test "initialize struct with empty literal" { |
| 1179 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1151 | 1180 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1152 | 1181 | |
| 1153 | 1182 | const S = struct { x: i32 = 1234 }; |
| ... | ... | @@ -1157,6 +1186,7 @@ test "initialize struct with empty literal" { |
| 1157 | 1186 | } |
| 1158 | 1187 | |
| 1159 | 1188 | test "loading a struct pointer perfoms a copy" { |
| 1189 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1160 | 1190 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1161 | 1191 | |
| 1162 | 1192 | const S = struct { |
| ... | ... | @@ -1202,7 +1232,7 @@ test "packed struct aggregate init" { |
| 1202 | 1232 | } |
| 1203 | 1233 | |
| 1204 | 1234 | test "packed struct field access via pointer" { |
| 1205 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1235 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1206 | 1236 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1207 | 1237 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1208 | 1238 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1243,6 +1273,7 @@ test "store to comptime field" { |
| 1243 | 1273 | } |
| 1244 | 1274 | |
| 1245 | 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; | |
| 1246 | 1277 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1247 | 1278 | |
| 1248 | 1279 | const namespace = struct { |
| ... | ... | @@ -1259,7 +1290,7 @@ test "struct field init value is size of the struct" { |
| 1259 | 1290 | test "under-aligned struct field" { |
| 1260 | 1291 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1261 | 1292 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1262 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1293 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1263 | 1294 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1264 | 1295 | |
| 1265 | 1296 | const U = extern union { |
| ... | ... | @@ -1281,7 +1312,7 @@ test "under-aligned struct field" { |
| 1281 | 1312 | |
| 1282 | 1313 | test "fieldParentPtr of a zero-bit field" { |
| 1283 | 1314 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1284 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1315 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1285 | 1316 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1286 | 1317 | |
| 1287 | 1318 | const S = struct { |
| ... | ... | @@ -1329,7 +1360,7 @@ test "fieldParentPtr of a zero-bit field" { |
| 1329 | 1360 | } |
| 1330 | 1361 | |
| 1331 | 1362 | test "struct field has a pointer to an aligned version of itself" { |
| 1332 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1363 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1333 | 1364 | |
| 1334 | 1365 | const E = struct { |
| 1335 | 1366 | next: *align(1) @This(), |
| ... | ... | @@ -1341,7 +1372,7 @@ test "struct field has a pointer to an aligned version of itself" { |
| 1341 | 1372 | } |
| 1342 | 1373 | |
| 1343 | 1374 | test "struct has only one reference" { |
| 1344 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1375 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1345 | 1376 | |
| 1346 | 1377 | const S = struct { |
| 1347 | 1378 | fn optionalStructParam(_: ?struct { x: u8 }) void {} |
| ... | ... | @@ -1390,7 +1421,7 @@ test "struct has only one reference" { |
| 1390 | 1421 | |
| 1391 | 1422 | test "no dependency loop on pointer to optional struct" { |
| 1392 | 1423 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1393 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1424 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1394 | 1425 | |
| 1395 | 1426 | const S = struct { |
| 1396 | 1427 | const A = struct { b: B }; |
| ... | ... | @@ -1410,7 +1441,7 @@ test "discarded struct initialization works as expected" { |
| 1410 | 1441 | } |
| 1411 | 1442 | |
| 1412 | 1443 | test "function pointer in struct returns the struct" { |
| 1413 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1444 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1414 | 1445 | |
| 1415 | 1446 | const A = struct { |
| 1416 | 1447 | const A = @This(); |
| ... | ... | @@ -1426,7 +1457,7 @@ test "function pointer in struct returns the struct" { |
| 1426 | 1457 | } |
| 1427 | 1458 | |
| 1428 | 1459 | test "no dependency loop on optional field wrapped in generic function" { |
| 1429 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1460 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1430 | 1461 | |
| 1431 | 1462 | const S = struct { |
| 1432 | 1463 | fn Atomic(comptime T: type) type { |
| ... | ... | @@ -1444,6 +1475,7 @@ test "no dependency loop on optional field wrapped in generic function" { |
| 1444 | 1475 | } |
| 1445 | 1476 | |
| 1446 | 1477 | test "optional field init with tuple" { |
| 1478 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1447 | 1479 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1448 | 1480 | |
| 1449 | 1481 | const S = struct { |
| ... | ... | @@ -1458,6 +1490,8 @@ test "optional field init with tuple" { |
| 1458 | 1490 | } |
| 1459 | 1491 | |
| 1460 | 1492 | test "if inside struct init inside if" { |
| 1493 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1494 | ||
| 1461 | 1495 | const MyStruct = struct { x: u32 }; |
| 1462 | 1496 | const b: u32 = 5; |
| 1463 | 1497 | var i: u32 = 1; |
| ... | ... | @@ -1484,7 +1518,7 @@ test "optional generic function label struct field" { |
| 1484 | 1518 | } |
| 1485 | 1519 | |
| 1486 | 1520 | test "struct fields get automatically reordered" { |
| 1487 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1521 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1488 | 1522 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 1489 | 1523 | |
| 1490 | 1524 | const S1 = struct { |
| ... | ... | @@ -1545,7 +1579,7 @@ test "instantiate struct with comptime field" { |
| 1545 | 1579 | test "struct field pointer has correct alignment" { |
| 1546 | 1580 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1547 | 1581 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1548 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1582 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1549 | 1583 | |
| 1550 | 1584 | const S = struct { |
| 1551 | 1585 | fn doTheTest() !void { |
| ... | ... | @@ -1574,7 +1608,7 @@ test "struct field pointer has correct alignment" { |
| 1574 | 1608 | test "extern struct field pointer has correct alignment" { |
| 1575 | 1609 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1576 | 1610 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1577 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1611 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1578 | 1612 | |
| 1579 | 1613 | const S = struct { |
| 1580 | 1614 | fn doTheTest() !void { |
| ... | ... | @@ -1623,6 +1657,8 @@ fn countFields(v: anytype) usize { |
| 1623 | 1657 | } |
| 1624 | 1658 | |
| 1625 | 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 | ||
| 1626 | 1662 | const S = struct { |
| 1627 | 1663 | // A function parameter has a result type, but no result pointer. |
| 1628 | 1664 | fn f(s: struct { x: u32 }) u32 { |
| ... | ... | @@ -1637,6 +1673,8 @@ test "struct init with no result pointer sets field result types" { |
| 1637 | 1673 | } |
| 1638 | 1674 | |
| 1639 | 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 | ||
| 1640 | 1678 | var side_effects: u4 = 0; |
| 1641 | 1679 | const S = struct { a: u4, b: u4, c: u4, d: u4 }; |
| 1642 | 1680 | const init = S{ |
| ... | ... | @@ -1662,7 +1700,7 @@ test "runtime side-effects in comptime-known struct init" { |
| 1662 | 1700 | } |
| 1663 | 1701 | |
| 1664 | 1702 | test "pointer to struct initialized through reference to anonymous initializer provides result types" { |
| 1665 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1703 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1666 | 1704 | |
| 1667 | 1705 | const S = struct { a: u8, b: u16, c: *const anyopaque }; |
| 1668 | 1706 | var my_u16: u16 = 0xABCD; |
| ... | ... | @@ -1699,6 +1737,8 @@ test "comptimeness of optional and error union payload is analyzed properly" { |
| 1699 | 1737 | } |
| 1700 | 1738 | |
| 1701 | 1739 | test "initializer uses own alignment" { |
| 1740 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1741 | ||
| 1702 | 1742 | const S = struct { |
| 1703 | 1743 | x: u32 = @alignOf(@This()) + 1, |
| 1704 | 1744 | }; |
| ... | ... | @@ -1710,6 +1750,8 @@ test "initializer uses own alignment" { |
| 1710 | 1750 | } |
| 1711 | 1751 | |
| 1712 | 1752 | test "initializer uses own size" { |
| 1753 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1754 | ||
| 1713 | 1755 | const S = struct { |
| 1714 | 1756 | x: u32 = @sizeOf(@This()) + 1, |
| 1715 | 1757 | }; |
| ... | ... | @@ -1721,7 +1763,7 @@ test "initializer uses own size" { |
| 1721 | 1763 | } |
| 1722 | 1764 | |
| 1723 | 1765 | test "initializer takes a pointer to a variable inside its struct" { |
| 1724 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1766 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1725 | 1767 | |
| 1726 | 1768 | const namespace = struct { |
| 1727 | 1769 | const S = struct { |
| ... | ... | @@ -1741,7 +1783,7 @@ test "initializer takes a pointer to a variable inside its struct" { |
| 1741 | 1783 | } |
| 1742 | 1784 | |
| 1743 | 1785 | test "circular dependency through pointer field of a struct" { |
| 1744 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1786 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1745 | 1787 | |
| 1746 | 1788 | const S = struct { |
| 1747 | 1789 | const StructInner = extern struct { |
| ... | ... | @@ -1764,7 +1806,7 @@ test "circular dependency through pointer field of a struct" { |
| 1764 | 1806 | } |
| 1765 | 1807 | |
| 1766 | 1808 | test "field calls do not force struct field init resolution" { |
| 1767 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1809 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1768 | 1810 | |
| 1769 | 1811 | const S = struct { |
| 1770 | 1812 | x: u32 = blk: { |
| ... | ... | @@ -1793,6 +1835,7 @@ test "tuple with comptime-only field" { |
| 1793 | 1835 | } |
| 1794 | 1836 | |
| 1795 | 1837 | test "extern struct fields are aligned to 1" { |
| 1838 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1796 | 1839 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1797 | 1840 | |
| 1798 | 1841 | const Foo = extern struct { |
| ... | ... | @@ -1812,7 +1855,7 @@ test "assign to slice.len of global variable" { |
| 1812 | 1855 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1813 | 1856 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1814 | 1857 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1815 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1858 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1816 | 1859 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1817 | 1860 | |
| 1818 | 1861 | const S = struct { |
| ... | ... | @@ -1825,6 +1868,8 @@ test "assign to slice.len of global variable" { |
| 1825 | 1868 | } |
| 1826 | 1869 | |
| 1827 | 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 | ||
| 1828 | 1873 | const B = extern struct { |
| 1829 | 1874 | a: u32, |
| 1830 | 1875 | b: i32, |
| ... | ... | @@ -1839,6 +1884,8 @@ test "pointers to fields of volatile pointer to struct are also volatile" { |
| 1839 | 1884 | } |
| 1840 | 1885 | |
| 1841 | 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 | ||
| 1842 | 1889 | const D = extern union { |
| 1843 | 1890 | a: u32, |
| 1844 | 1891 | b: i32, |
| ... | ... | @@ -1862,7 +1909,7 @@ test "array of structs inside struct initialized with undefined" { |
| 1862 | 1909 | |
| 1863 | 1910 | test "runtime call in nested initializer" { |
| 1864 | 1911 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1865 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1912 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1866 | 1913 | |
| 1867 | 1914 | const Holder = struct { |
| 1868 | 1915 | array: []const u8, |
| ... | ... | @@ -1892,6 +1939,7 @@ test "runtime call in nested initializer" { |
| 1892 | 1939 | } |
| 1893 | 1940 | |
| 1894 | 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; | |
| 1895 | 1943 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1896 | 1944 | |
| 1897 | 1945 | const Bar = struct { |
| ... | ... | @@ -1915,7 +1963,7 @@ test "runtime value in nested initializer passed as pointer to function" { |
| 1915 | 1963 | } |
| 1916 | 1964 | |
| 1917 | 1965 | test "struct field default value is a call" { |
| 1918 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1966 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1919 | 1967 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1920 | 1968 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1921 | 1969 | |
| ... | ... | @@ -1949,6 +1997,8 @@ test "struct field default value is a call" { |
| 1949 | 1997 | } |
| 1950 | 1998 | |
| 1951 | 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 | ||
| 1952 | 2002 | var x: u32 = 15; |
| 1953 | 2003 | _ = &x; |
| 1954 | 2004 | const T = @TypeOf(.{ @as(i32, -1234), @as(u32, 5678), x }); |
| ... | ... | @@ -1960,6 +2010,7 @@ test "aggregate initializers should allow initializing comptime fields, verifyin |
| 1960 | 2010 | } |
| 1961 | 2011 | |
| 1962 | 2012 | test "assignment of field with padding" { |
| 2013 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1963 | 2014 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1964 | 2015 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1965 | 2016 | |
| ... | ... | @@ -1989,7 +2040,7 @@ test "assignment of field with padding" { |
| 1989 | 2040 | } |
| 1990 | 2041 | |
| 1991 | 2042 | test "initiate global variable with runtime value" { |
| 1992 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 2043 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1993 | 2044 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 1994 | 2045 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1995 | 2046 | |
| ... | ... | @@ -2008,7 +2059,7 @@ test "initiate global variable with runtime value" { |
| 2008 | 2059 | } |
| 2009 | 2060 | |
| 2010 | 2061 | test "struct containing optional pointer to array of @This()" { |
| 2011 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 2062 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 2012 | 2063 | |
| 2013 | 2064 | const S = struct { |
| 2014 | 2065 | x: ?*const [1]@This(), |
| ... | ... | @@ -2081,6 +2132,7 @@ test "anonymous struct equivalence" { |
| 2081 | 2132 | } |
| 2082 | 2133 | |
| 2083 | 2134 | test "field access through mem ptr arg" { |
| 2135 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 2084 | 2136 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2085 | 2137 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2086 | 2138 | |
| ... | ... | @@ -2124,7 +2176,7 @@ test "field access through mem ptr arg" { |
| 2124 | 2176 | } |
| 2125 | 2177 | |
| 2126 | 2178 | test "align 1 struct parameter dereferenced and returned" { |
| 2127 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 2179 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 2128 | 2180 | |
| 2129 | 2181 | const S = extern struct { |
| 2130 | 2182 | a: u32, |
| ... | ... | @@ -2175,7 +2227,8 @@ test "pass a pointer to a comptime-only struct field to a function" { |
| 2175 | 2227 | } |
| 2176 | 2228 | |
| 2177 | 2229 | test "overaligned extern struct fields" { |
| 2178 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 2230 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 2231 | ||
| 2179 | 2232 | const A = struct { |
| 2180 | 2233 | a: *anyopaque, |
| 2181 | 2234 | b: u64, |
| ... | ... | @@ -2225,7 +2278,8 @@ test "overaligned extern struct fields" { |
| 2225 | 2278 | } |
| 2226 | 2279 | |
| 2227 | 2280 | test "runtime-known slice of comptime-only struct" { |
| 2228 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 2281 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 2282 | ||
| 2229 | 2283 | const Mixed = struct { index: u32, T: type }; |
| 2230 | 2284 | |
| 2231 | 2285 | const static = struct { |
| ... | ... | @@ -2247,7 +2301,8 @@ test "runtime-known slice of comptime-only struct" { |
| 2247 | 2301 | } |
| 2248 | 2302 | |
| 2249 | 2303 | test "struct contains aligned pointer to itself through type decl" { |
| 2250 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 2304 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 2305 | ||
| 2251 | 2306 | const Slab = struct { |
| 2252 | 2307 | const Ptr = *align(64) const @This(); |
| 2253 | 2308 | next: Ptr, |
| ... | ... | @@ -2265,7 +2320,7 @@ test "struct contains aligned pointer to itself through type decl" { |
| 2265 | 2320 | } |
| 2266 | 2321 | |
| 2267 | 2322 | test "struct contains underaligned field with overaligned pointer to itself" { |
| 2268 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 2323 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 2269 | 2324 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 2270 | 2325 | |
| 2271 | 2326 | const S = struct { |
| ... | ... | @@ -2301,6 +2356,8 @@ test "struct queries typeinfo of struct containing pointer back to first struct" |
| 2301 | 2356 | } |
| 2302 | 2357 | |
| 2303 | 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 | ||
| 2304 | 2361 | const Foo = struct { |
| 2305 | 2362 | padding: struct { a: u8, b: ?comptime_int }, |
| 2306 | 2363 | number: u8, |
test/behavior/struct_contains_null_ptr_itself.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ const builtin = @import("builtin"); |
| 4 | 4 | |
| 5 | 5 | test "struct contains null pointer which contains original struct" { |
| 6 | 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 | 9 | var x: ?*NodeLineComment = null; |
| 10 | 10 | _ = &x; |
test/behavior/struct_contains_slice_of_itself.zig+2-2| ... | ... | @@ -13,7 +13,7 @@ const NodeAligned = struct { |
| 13 | 13 | |
| 14 | 14 | test "struct contains slice of itself" { |
| 15 | 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 | 18 | var other_nodes = [_]Node{ |
| 19 | 19 | Node{ |
| ... | ... | @@ -53,7 +53,7 @@ test "struct contains slice of itself" { |
| 53 | 53 | |
| 54 | 54 | test "struct contains aligned slice of itself" { |
| 55 | 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 | 58 | var other_nodes = [_]NodeAligned{ |
| 59 | 59 | NodeAligned{ |
test/behavior/switch.zig+51-14| ... | ... | @@ -23,6 +23,7 @@ fn testSwitchWithNumbers(x: u32) !void { |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | test "switch with all ranges" { |
| 26 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 26 | 27 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 27 | 28 | |
| 28 | 29 | try expect(testSwitchWithAllRanges(50, 3) == 1); |
| ... | ... | @@ -44,7 +45,7 @@ test "switch arbitrary int size" { |
| 44 | 45 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 45 | 46 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 46 | 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 | 49 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 49 | 50 | |
| 50 | 51 | const S = struct { |
| ... | ... | @@ -258,6 +259,7 @@ fn trueIfBoolFalseOtherwise(comptime T: type) bool { |
| 258 | 259 | } |
| 259 | 260 | |
| 260 | 261 | test "switching on booleans" { |
| 262 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 261 | 263 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 262 | 264 | |
| 263 | 265 | try testSwitchOnBools(); |
| ... | ... | @@ -313,6 +315,7 @@ test "undefined.u0" { |
| 313 | 315 | } |
| 314 | 316 | |
| 315 | 317 | test "switch with disjoint range" { |
| 318 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 316 | 319 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 317 | 320 | var q: u8 = 0; |
| 318 | 321 | _ = &q; |
| ... | ... | @@ -324,6 +327,8 @@ test "switch with disjoint range" { |
| 324 | 327 | } |
| 325 | 328 | |
| 326 | 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 | 332 | const S = struct { |
| 328 | 333 | fn doTheTest() !void { |
| 329 | 334 | try doTheSwitch(16); |
| ... | ... | @@ -354,7 +359,7 @@ fn poll() void { |
| 354 | 359 | } |
| 355 | 360 | |
| 356 | 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 | 363 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 359 | 364 | |
| 360 | 365 | while (state < 2) { |
| ... | ... | @@ -369,6 +374,7 @@ const SwitchProngWithVarEnum = union(enum) { |
| 369 | 374 | }; |
| 370 | 375 | |
| 371 | 376 | test "switch prong with variable" { |
| 377 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 372 | 378 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 373 | 379 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 374 | 380 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -394,6 +400,7 @@ fn switchProngWithVarFn(a: SwitchProngWithVarEnum) !void { |
| 394 | 400 | } |
| 395 | 401 | |
| 396 | 402 | test "switch on enum using pointer capture" { |
| 403 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 397 | 404 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 398 | 405 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 399 | 406 | |
| ... | ... | @@ -414,6 +421,7 @@ fn testSwitchEnumPtrCapture() !void { |
| 414 | 421 | } |
| 415 | 422 | |
| 416 | 423 | test "switch handles all cases of number" { |
| 424 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 417 | 425 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 418 | 426 | |
| 419 | 427 | try testSwitchHandleAllCases(); |
| ... | ... | @@ -453,6 +461,7 @@ fn testSwitchHandleAllCasesRange(x: u8) u8 { |
| 453 | 461 | } |
| 454 | 462 | |
| 455 | 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 | 465 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 457 | 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 | 499 | } |
| 491 | 500 | |
| 492 | 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 | 503 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 494 | 504 | |
| 495 | 505 | const Foo = union(enum) { |
| ... | ... | @@ -506,6 +516,7 @@ test "anon enum literal used in switch on union enum" { |
| 506 | 516 | } |
| 507 | 517 | |
| 508 | 518 | test "switch all prongs unreachable" { |
| 519 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 509 | 520 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 510 | 521 | |
| 511 | 522 | try testAllProngsUnreachable(); |
| ... | ... | @@ -529,6 +540,7 @@ fn switchWithUnreachable(x: i32) i32 { |
| 529 | 540 | } |
| 530 | 541 | |
| 531 | 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 | 544 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 533 | 545 | |
| 534 | 546 | const x = return_a_number() catch |err| switch (err) { |
| ... | ... | @@ -562,7 +574,7 @@ test "switch on integer with else capturing expr" { |
| 562 | 574 | test "else prong of switch on error set excludes other cases" { |
| 563 | 575 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 564 | 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 | 578 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 567 | 579 | |
| 568 | 580 | const S = struct { |
| ... | ... | @@ -597,7 +609,7 @@ test "else prong of switch on error set excludes other cases" { |
| 597 | 609 | test "switch prongs with error set cases make a new error set type for capture value" { |
| 598 | 610 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 599 | 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 | 613 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 602 | 614 | |
| 603 | 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 | 644 | } |
| 633 | 645 | |
| 634 | 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 | 648 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 636 | 649 | |
| 637 | 650 | const S = struct { |
| ... | ... | @@ -650,6 +663,7 @@ test "return result loc and then switch with range implicit casted to error unio |
| 650 | 663 | } |
| 651 | 664 | |
| 652 | 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 | 667 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 654 | 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 | 683 | } |
| 670 | 684 | |
| 671 | 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 | 687 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 673 | 688 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 674 | 689 | |
| ... | ... | @@ -777,7 +792,7 @@ test "switch prong pointer capture alignment" { |
| 777 | 792 | test "switch on pointer type" { |
| 778 | 793 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 779 | 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 | 796 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/176634 |
| 782 | 797 | |
| 783 | 798 | const S = struct { |
| ... | ... | @@ -824,6 +839,7 @@ test "switch on error set with single else" { |
| 824 | 839 | } |
| 825 | 840 | |
| 826 | 841 | test "switch capture copies its payload" { |
| 842 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 827 | 843 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 828 | 844 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 829 | 845 | |
| ... | ... | @@ -915,6 +931,8 @@ test "comptime inline switch" { |
| 915 | 931 | } |
| 916 | 932 | |
| 917 | 933 | test "switch capture peer type resolution" { |
| 934 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 935 | ||
| 918 | 936 | const U = union(enum) { |
| 919 | 937 | a: u32, |
| 920 | 938 | b: u64, |
| ... | ... | @@ -930,6 +948,7 @@ test "switch capture peer type resolution" { |
| 930 | 948 | } |
| 931 | 949 | |
| 932 | 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 | 952 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 934 | 953 | |
| 935 | 954 | const T1 = c_int; |
| ... | ... | @@ -954,7 +973,7 @@ test "switch capture peer type resolution for in-memory coercible payloads" { |
| 954 | 973 | |
| 955 | 974 | test "switch pointer capture peer type resolution" { |
| 956 | 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 | 978 | const T1 = c_int; |
| 960 | 979 | const t1_info = @typeInfo(T1).int; |
| ... | ... | @@ -983,6 +1002,8 @@ test "switch pointer capture peer type resolution" { |
| 983 | 1002 | } |
| 984 | 1003 | |
| 985 | 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 | 1007 | const inputs: [3]u8 = .{ 0, 254, 255 }; |
| 987 | 1008 | for (inputs) |input| { |
| 988 | 1009 | switch (input) { |
| ... | ... | @@ -995,7 +1016,7 @@ test "inline switch range that includes the maximum value of the switched type" |
| 995 | 1016 | test "nested break ignores switch conditions and breaks instead" { |
| 996 | 1017 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 997 | 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 | 1021 | const S = struct { |
| 1001 | 1022 | fn register_to_address(ident: []const u8) !u8 { |
| ... | ... | @@ -1016,7 +1037,7 @@ test "nested break ignores switch conditions and breaks instead" { |
| 1016 | 1037 | } |
| 1017 | 1038 | |
| 1018 | 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 | 1041 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1021 | 1042 | |
| 1022 | 1043 | const Foo = union(enum) { |
| ... | ... | @@ -1042,7 +1063,7 @@ test "peer type resolution on switch captures ignores unused payload bits" { |
| 1042 | 1063 | |
| 1043 | 1064 | test "switch prong captures range" { |
| 1044 | 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 | 1068 | const S = struct { |
| 1048 | 1069 | fn a(b: []u3, c: u3) void { |
| ... | ... | @@ -1060,6 +1081,8 @@ test "switch prong captures range" { |
| 1060 | 1081 | } |
| 1061 | 1082 | |
| 1062 | 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 | 1086 | const U = union(enum) { |
| 1064 | 1087 | void: void, |
| 1065 | 1088 | bool: bool, |
| ... | ... | @@ -1077,6 +1100,8 @@ test "prong with inline call to unreachable" { |
| 1077 | 1100 | } |
| 1078 | 1101 | |
| 1079 | 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 | 1105 | const S = struct { |
| 1081 | 1106 | fn returnError() error{TestFailed} { |
| 1082 | 1107 | return error.TestFailed; |
| ... | ... | @@ -1105,6 +1130,8 @@ test "block error return trace index is reset between prongs" { |
| 1105 | 1130 | } |
| 1106 | 1131 | |
| 1107 | 1132 | test "labeled switch with break" { |
| 1133 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1134 | ||
| 1108 | 1135 | var six: u32 = undefined; |
| 1109 | 1136 | six = 6; |
| 1110 | 1137 | |
| ... | ... | @@ -1144,6 +1171,8 @@ test "unlabeled break ignores switch" { |
| 1144 | 1171 | } |
| 1145 | 1172 | |
| 1146 | 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 | 1176 | var v: i32 = undefined; |
| 1148 | 1177 | v = -1; |
| 1149 | 1178 | switch (v) { |
| ... | ... | @@ -1153,6 +1182,8 @@ test "switch on a signed value smaller than the smallest prong value" { |
| 1153 | 1182 | } |
| 1154 | 1183 | |
| 1155 | 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 | 1187 | var x: u8 = undefined; |
| 1157 | 1188 | x = 16; |
| 1158 | 1189 | switch (x % 4) { |
| ... | ... | @@ -1261,6 +1292,8 @@ test "switch with uninstantiable union fields" { |
| 1261 | 1292 | } |
| 1262 | 1293 | |
| 1263 | 1294 | test "switch with tag capture" { |
| 1295 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1296 | ||
| 1264 | 1297 | const U = union(enum) { |
| 1265 | 1298 | a, |
| 1266 | 1299 | b: i32, |
| ... | ... | @@ -1312,6 +1345,8 @@ test "switch with tag capture" { |
| 1312 | 1345 | } |
| 1313 | 1346 | |
| 1314 | 1347 | test "switch with complex item expressions" { |
| 1348 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1349 | ||
| 1315 | 1350 | const S = struct { |
| 1316 | 1351 | fn doTheTest() !void { |
| 1317 | 1352 | try doTheSwitch(2000, 20); |
| ... | ... | @@ -1414,7 +1449,7 @@ test "single range switch prong capture" { |
| 1414 | 1449 | } |
| 1415 | 1450 | |
| 1416 | 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 | 1454 | const P = packed struct { |
| 1420 | 1455 | a: u1, |
| ... | ... | @@ -1446,7 +1481,7 @@ test "switch on packed struct" { |
| 1446 | 1481 | } |
| 1447 | 1482 | |
| 1448 | 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 | 1486 | const P = packed union(u2) { |
| 1452 | 1487 | a: u2, |
| ... | ... | @@ -1495,7 +1530,7 @@ test "switch on packed union" { |
| 1495 | 1530 | } |
| 1496 | 1531 | |
| 1497 | 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 | 1535 | const P = packed struct { |
| 1501 | 1536 | iu: u17, |
| ... | ... | @@ -1550,7 +1585,7 @@ test "switch on nested packed containers" { |
| 1550 | 1585 | } |
| 1551 | 1586 | |
| 1552 | 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 | 1590 | const S = struct { |
| 1556 | 1591 | fn doTheTest(a: u128, b: i500) !void { |
| ... | ... | @@ -1652,6 +1687,8 @@ test "repeated switch analysis overrides previous analysis results" { |
| 1652 | 1687 | } |
| 1653 | 1688 | |
| 1654 | 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 | 1692 | const U = union(enum) { |
| 1656 | 1693 | a: u32, |
| 1657 | 1694 | b: u32, |
| ... | ... | @@ -1671,7 +1708,7 @@ test "union field pointer capture preserves alignment in inline prong" { |
| 1671 | 1708 | } |
| 1672 | 1709 | |
| 1673 | 1710 | test "switch on expression" { |
| 1674 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1711 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1675 | 1712 | |
| 1676 | 1713 | var a: []const []const u8 = &.{ "b", "b", "A", "A", "b" }; |
| 1677 | 1714 | _ = &a; |
test/behavior/switch_loop.zig+19-7| ... | ... | @@ -4,6 +4,7 @@ const assert = std.debug.assert; |
| 4 | 4 | const expect = std.testing.expect; |
| 5 | 5 | |
| 6 | 6 | test "simple switch loop" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 7 | 8 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 8 | 9 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 9 | 10 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -27,6 +28,7 @@ test "simple switch loop" { |
| 27 | 28 | } |
| 28 | 29 | |
| 29 | 30 | test "switch loop with ranges" { |
| 31 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 30 | 32 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 31 | 33 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 32 | 34 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -47,6 +49,7 @@ test "switch loop with ranges" { |
| 47 | 49 | } |
| 48 | 50 | |
| 49 | 51 | test "switch loop on enum" { |
| 52 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 50 | 53 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 51 | 54 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 52 | 55 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -70,6 +73,7 @@ test "switch loop on enum" { |
| 70 | 73 | } |
| 71 | 74 | |
| 72 | 75 | test "switch loop with error set" { |
| 76 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 73 | 77 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 74 | 78 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 75 | 79 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -93,6 +97,7 @@ test "switch loop with error set" { |
| 93 | 97 | } |
| 94 | 98 | |
| 95 | 99 | test "switch loop on tagged union" { |
| 100 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 96 | 101 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 97 | 102 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 98 | 103 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -128,7 +133,7 @@ test "switch loop dispatching instructions" { |
| 128 | 133 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 129 | 134 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 130 | 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 | 138 | const S = struct { |
| 134 | 139 | const Inst = union(enum) { |
| ... | ... | @@ -175,6 +180,7 @@ test "switch loop dispatching instructions" { |
| 175 | 180 | } |
| 176 | 181 | |
| 177 | 182 | test "switch loop with pointer capture" { |
| 183 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 178 | 184 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 179 | 185 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 180 | 186 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -222,7 +228,7 @@ test "unanalyzed continue with operand" { |
| 222 | 228 | |
| 223 | 229 | test "switch loop on larger than pointer integer" { |
| 224 | 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 | 233 | var entry: @Int(.unsigned, @bitSizeOf(usize) + 1) = undefined; |
| 228 | 234 | entry = 0; |
| ... | ... | @@ -242,6 +248,7 @@ test "switch loop on larger than pointer integer" { |
| 242 | 248 | } |
| 243 | 249 | |
| 244 | 250 | test "switch loop on non-exhaustive enum" { |
| 251 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 245 | 252 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 246 | 253 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 247 | 254 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -290,6 +297,8 @@ test "switch loop with discarded tag capture" { |
| 290 | 297 | } |
| 291 | 298 | |
| 292 | 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 | 302 | const S = struct { |
| 294 | 303 | const E = enum { a, b, c }; |
| 295 | 304 | const U = union(E) { a: u32, b: u16, c: u8 }; |
| ... | ... | @@ -337,7 +346,7 @@ test "switch loop with single catch-all prong" { |
| 337 | 346 | } |
| 338 | 347 | |
| 339 | 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 | 351 | const S = struct { |
| 343 | 352 | const E = enum { opv }; |
| ... | ... | @@ -385,7 +394,7 @@ test "switch loop on type with opv" { |
| 385 | 394 | } |
| 386 | 395 | |
| 387 | 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 | 399 | const U = union(enum) { |
| 391 | 400 | a, |
| ... | ... | @@ -456,6 +465,8 @@ test "switch loop with tag capture" { |
| 456 | 465 | } |
| 457 | 466 | |
| 458 | 467 | test "switch loop for error handling" { |
| 468 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 469 | ||
| 459 | 470 | const Error = error{ MyError, MyOtherError }; |
| 460 | 471 | const S = struct { |
| 461 | 472 | fn doTheTest() !void { |
| ... | ... | @@ -500,7 +511,8 @@ test "switch loop for error handling" { |
| 500 | 511 | } |
| 501 | 512 | |
| 502 | 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 | 516 | const P = packed struct { |
| 505 | 517 | a: u7, |
| 506 | 518 | b: u20, |
| ... | ... | @@ -518,7 +530,7 @@ test "switch loop with packed structs" { |
| 518 | 530 | } |
| 519 | 531 | |
| 520 | 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 | 535 | const P = packed union { |
| 524 | 536 | a: u7, |
| ... | ... | @@ -558,7 +570,7 @@ test "switch loop with packed unions with OPV" { |
| 558 | 570 | } |
| 559 | 571 | |
| 560 | 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 | 575 | const S = struct { |
| 564 | 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 | 6 | const builtin = @import("builtin"); |
| 7 | 7 | |
| 8 | 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 | 10 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 11 | 11 | |
| 12 | 12 | const S = struct { |
| ... | ... | @@ -370,7 +370,7 @@ test "switch on error union catch capture" { |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 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 | 374 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 375 | 375 | |
| 376 | 376 | const S = struct { |
test/behavior/switch_prong_err_enum.zig+1-1| ... | ... | @@ -24,7 +24,7 @@ test "switch prong returns error enum" { |
| 24 | 24 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 25 | 25 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 26 | 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 | 29 | switch (doThing(17) catch unreachable) { |
| 30 | 30 | FormValue.Address => |payload| { |
test/behavior/switch_prong_implicit_cast.zig+1| ... | ... | @@ -15,6 +15,7 @@ fn foo(id: u64) !FormValue { |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | test "switch prong implicit cast" { |
| 18 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 18 | 19 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 19 | 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 20 | 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 | 26 | } |
| 27 | 27 | |
| 28 | 28 | test "this refer to container" { |
| 29 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 29 | 30 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 30 | 31 | |
| 31 | 32 | var pt: Point(i32) = undefined; |
| ... | ... | @@ -48,7 +49,7 @@ fn prev(p: ?State) void { |
| 48 | 49 | test "this used as optional function parameter" { |
| 49 | 50 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 50 | 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 | 54 | var global: State = undefined; |
| 54 | 55 | global.enter = prev; |
test/behavior/threadlocal.zig+2-2| ... | ... | @@ -19,7 +19,7 @@ test "pointer to thread local array" { |
| 19 | 19 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 20 | 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 21 | 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 | 24 | const s = "Hello world"; |
| 25 | 25 | @memcpy(buffer[0..s.len], s); |
| ... | ... | @@ -32,7 +32,7 @@ test "reference a global threadlocal variable" { |
| 32 | 32 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 33 | 33 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 34 | 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 | 37 | try nrfx_uart_rx(&g_uart0); |
| 38 | 38 | } |
test/behavior/truncate.zig+4-2| ... | ... | @@ -32,6 +32,8 @@ test "truncate.u0.var" { |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | test "truncate on comptime integer" { |
| 35 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 36 | ||
| 35 | 37 | const x: u16 = @truncate(9999); |
| 36 | 38 | try expect(x == 9999); |
| 37 | 39 | const y: u16 = @truncate(-21555); |
| ... | ... | @@ -49,7 +51,7 @@ fn testTruncate(comptime S: type, a: S, comptime D: type, expected: D) !void { |
| 49 | 51 | |
| 50 | 52 | test "@truncate > 128 bits" { |
| 51 | 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 | 56 | try testTruncate(u140, 0, u128, 0); |
| 55 | 57 | try testTruncate(u140, maxInt(u140), u128, maxInt(u128)); |
| ... | ... | @@ -90,7 +92,7 @@ test "truncate on vectors" { |
| 90 | 92 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 91 | 93 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 92 | 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 | 97 | const S = struct { |
| 96 | 98 | fn doTheTest() !void { |
test/behavior/try.zig+9-3| ... | ... | @@ -4,6 +4,7 @@ const assert = std.debug.assert; |
| 4 | 4 | const expect = std.testing.expect; |
| 5 | 5 | |
| 6 | 6 | test "try on error union" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 7 | 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 8 | 9 | |
| 9 | 10 | try tryOnErrorUnionImpl(); |
| ... | ... | @@ -49,7 +50,7 @@ test "try then not executed with assignment" { |
| 49 | 50 | |
| 50 | 51 | test "`try`ing an if/else expression" { |
| 51 | 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 | 54 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 54 | 55 | |
| 55 | 56 | const S = struct { |
| ... | ... | @@ -68,6 +69,7 @@ test "`try`ing an if/else expression" { |
| 68 | 69 | } |
| 69 | 70 | |
| 70 | 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 | 73 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 72 | 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 | 104 | } |
| 103 | 105 | |
| 104 | 106 | test "'return try' through conditional" { |
| 107 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 108 | ||
| 105 | 109 | const S = struct { |
| 106 | 110 | fn get(t: bool) !u32 { |
| 107 | 111 | return try if (t) inner() else error.TestFailed; |
| ... | ... | @@ -124,7 +128,7 @@ test "'return try' through conditional" { |
| 124 | 128 | |
| 125 | 129 | test "try ptr propagation const" { |
| 126 | 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 | 132 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 129 | 133 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 130 | 134 | |
| ... | ... | @@ -156,7 +160,7 @@ test "try ptr propagation const" { |
| 156 | 160 | |
| 157 | 161 | test "try ptr propagation mutate" { |
| 158 | 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 | 164 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 161 | 165 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 162 | 166 | |
| ... | ... | @@ -200,6 +204,8 @@ test "try ptr propagation mutate" { |
| 200 | 204 | } |
| 201 | 205 | |
| 202 | 206 | test "try pointer expression alignment" { |
| 207 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 208 | ||
| 203 | 209 | const S = struct { |
| 204 | 210 | fn doTheTest(p: *align(1) (anyerror!u32)) !void { |
| 205 | 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 | 7 | const expectEqual = std.testing.expectEqual; |
| 8 | 8 | |
| 9 | 9 | test "tuple concatenation" { |
| 10 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 10 | 11 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 11 | 12 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 12 | 13 | |
| ... | ... | @@ -29,7 +30,7 @@ test "tuple concatenation" { |
| 29 | 30 | test "more tuple concatenation" { |
| 30 | 31 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 31 | 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 | 35 | const T = struct { |
| 35 | 36 | fn consume_tuple(tuple: anytype, len: usize) !void { |
| ... | ... | @@ -104,7 +105,9 @@ test "tuple initializer for var" { |
| 104 | 105 | } |
| 105 | 106 | |
| 106 | 107 | test "array-like initializer for tuple types" { |
| 108 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 107 | 109 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 110 | ||
| 108 | 111 | const T = @Tuple(&.{ i32, u8 }); |
| 109 | 112 | const S = struct { |
| 110 | 113 | fn doTheTest() !void { |
| ... | ... | @@ -169,7 +172,8 @@ test "fieldParentPtr of tuple" { |
| 169 | 172 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 170 | 173 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 171 | 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 | 177 | var x: u32 = 0; |
| 174 | 178 | _ = &x; |
| 175 | 179 | const tuple = .{ x, x }; |
| ... | ... | @@ -180,7 +184,7 @@ test "fieldParentPtr of anon struct" { |
| 180 | 184 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 181 | 185 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 182 | 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 | 189 | var x: u32 = 0; |
| 186 | 190 | _ = &x; |
| ... | ... | @@ -238,6 +242,7 @@ test "tuple in tuple passed to generic function" { |
| 238 | 242 | } |
| 239 | 243 | |
| 240 | 244 | test "coerce tuple to tuple" { |
| 245 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 241 | 246 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 242 | 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 | 290 | } |
| 286 | 291 | |
| 287 | 292 | test "branching inside tuple literal" { |
| 293 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 288 | 294 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 289 | 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 | 309 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 304 | 310 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 305 | 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 | 314 | const E = union(enum) { e: []const u8 }; |
| 309 | 315 | const W = union(enum) { w: E }; |
| ... | ... | @@ -317,7 +323,7 @@ test "tuple of struct concatenation and coercion to array" { |
| 317 | 323 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 318 | 324 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 319 | 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 | 328 | const StructWithDefault = struct { value: f32 = 42 }; |
| 323 | 329 | const SomeStruct = struct { array: [4]StructWithDefault }; |
| ... | ... | @@ -331,7 +337,7 @@ test "tuple of struct concatenation and coercion to array" { |
| 331 | 337 | test "nested runtime conditionals in tuple initializer" { |
| 332 | 338 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 333 | 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 | 342 | var data: u8 = 0; |
| 337 | 343 | _ = &data; |
| ... | ... | @@ -364,6 +370,7 @@ test "sentinel slice in tuple" { |
| 364 | 370 | } |
| 365 | 371 | |
| 366 | 372 | test "tuple pointer is indexable" { |
| 373 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 367 | 374 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 368 | 375 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 369 | 376 | |
| ... | ... | @@ -386,6 +393,7 @@ test "tuple pointer is indexable" { |
| 386 | 393 | } |
| 387 | 394 | |
| 388 | 395 | test "coerce anon tuple to tuple" { |
| 396 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 389 | 397 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 390 | 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 | 431 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 424 | 432 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 425 | 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 | 436 | const S = struct { |
| 429 | 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 | 450 | } |
| 443 | 451 | |
| 444 | 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 | 455 | const SomeUnion = union(enum) { |
| 446 | 456 | variant: u8, |
| 447 | 457 | }; |
| ... | ... | @@ -495,7 +505,7 @@ test "comptime fields in tuple can be initialized" { |
| 495 | 505 | test "empty struct in tuple" { |
| 496 | 506 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 497 | 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 | 510 | const T = struct { struct {} }; |
| 501 | 511 | const info = @typeInfo(T); |
| ... | ... | @@ -507,7 +517,7 @@ test "empty struct in tuple" { |
| 507 | 517 | test "empty union in tuple" { |
| 508 | 518 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 509 | 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 | 522 | const T = struct { union {} }; |
| 513 | 523 | const info = @typeInfo(T); |
| ... | ... | @@ -517,7 +527,7 @@ test "empty union in tuple" { |
| 517 | 527 | } |
| 518 | 528 | |
| 519 | 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 | 532 | const S = struct { |
| 523 | 533 | fn doTheTest() !void { |
| ... | ... | @@ -546,7 +556,7 @@ test "OPV tuple fields aren't comptime" { |
| 546 | 556 | } |
| 547 | 557 | |
| 548 | 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 | 561 | const S = struct { |
| 552 | 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 | 6 | |
| 7 | 7 | test "tuple declaration type info" { |
| 8 | 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 | 12 | const T = struct { comptime u32 = 1, []const u8 }; |
| ... | ... | @@ -34,7 +34,7 @@ test "tuple declaration type info" { |
| 34 | 34 | |
| 35 | 35 | test "tuple declaration usage" { |
| 36 | 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 | 39 | const T = struct { u32, []const u8 }; |
| 40 | 40 | var t: T = .{ 1, "foo" }; |
test/behavior/type.zig+17-5| ... | ... | @@ -5,6 +5,8 @@ const testing = std.testing; |
| 5 | 5 | const assert = std.debug.assert; |
| 6 | 6 | |
| 7 | 7 | test "Type.Int" { |
| 8 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 9 | ||
| 8 | 10 | try testing.expect(u1 == @Int(.unsigned, 1)); |
| 9 | 11 | try testing.expect(i1 == @Int(.signed, 1)); |
| 10 | 12 | try testing.expect(u8 == @Int(.unsigned, 8)); |
| ... | ... | @@ -14,6 +16,8 @@ test "Type.Int" { |
| 14 | 16 | } |
| 15 | 17 | |
| 16 | 18 | test "Type.Pointer" { |
| 19 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 20 | ||
| 17 | 21 | inline for (&[_]type{ |
| 18 | 22 | // One Value Pointer Types |
| 19 | 23 | *u8, *const u8, |
| ... | ... | @@ -72,6 +76,8 @@ test "@Pointer create slice with null sentinel" { |
| 72 | 76 | } |
| 73 | 77 | |
| 74 | 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 | 81 | inline for (&[_]type{ |
| 76 | 82 | [*:0]u8, [*:0]const u8, |
| 77 | 83 | [*:0]volatile u8, [*:0]const volatile u8, |
| ... | ... | @@ -105,7 +111,7 @@ test "Type.Opaque" { |
| 105 | 111 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 106 | 112 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 107 | 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 | 116 | const Opaque = opaque {}; |
| 111 | 117 | try testing.expect(Opaque != opaque {}); |
| ... | ... | @@ -124,7 +130,7 @@ test "Type.Struct" { |
| 124 | 130 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 125 | 131 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 126 | 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 | 135 | const A = @Struct(.auto, null, &.{ "x", "y" }, &.{ u8, u32 }, &@splat(.{})); |
| 130 | 136 | const infoA = @typeInfo(A).@"struct"; |
| ... | ... | @@ -193,7 +199,7 @@ test "Type.Struct" { |
| 193 | 199 | |
| 194 | 200 | test "Type.Enum" { |
| 195 | 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 | 204 | const Foo = @Enum(u8, .exhaustive, &.{ "a", "b" }, &.{ 1, 5 }); |
| 199 | 205 | try testing.expectEqual(std.builtin.Type.Enum.Mode.exhaustive, @typeInfo(Foo).@"enum".mode); |
| ... | ... | @@ -229,7 +235,7 @@ test "Type.Enum" { |
| 229 | 235 | |
| 230 | 236 | test "Type.Union" { |
| 231 | 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 | 240 | const Untagged = @Union(.@"extern", null, &.{ "int", "float" }, &.{ i32, f32 }, &.{ .{}, .{} }); |
| 235 | 241 | var untagged = Untagged{ .int = 1 }; |
| ... | ... | @@ -264,6 +270,8 @@ test "Type.Union from regular enum" { |
| 264 | 270 | } |
| 265 | 271 | |
| 266 | 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 | 275 | const E = enum {}; |
| 268 | 276 | const U = @Union(.auto, E, &.{}, &.{}, &.{}); |
| 269 | 277 | |
| ... | ... | @@ -274,6 +282,8 @@ test "Type.Union from empty regular enum" { |
| 274 | 282 | } |
| 275 | 283 | |
| 276 | 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 | 287 | const E = @Enum(noreturn, .exhaustive, &.{}, &.{}); |
| 278 | 288 | const U = @Union(.auto, E, &.{}, &.{}, &.{}); |
| 279 | 289 | |
| ... | ... | @@ -285,7 +295,7 @@ test "Type.Union from empty Type.Enum" { |
| 285 | 295 | |
| 286 | 296 | test "Type.Fn" { |
| 287 | 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 | 300 | const some_opaque = opaque {}; |
| 291 | 301 | const some_ptr = *some_opaque; |
| ... | ... | @@ -406,6 +416,8 @@ test "matching captures causes opaque equivalence" { |
| 406 | 416 | } |
| 407 | 417 | |
| 408 | 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 | 421 | const field_names: [3][]const u8 = .{ "foo", "bar", undefined }; |
| 410 | 422 | const field_values: [3]u8 = .{ undefined, 0, 1 }; |
| 411 | 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 | 10 | const expectEqualStrings = std.testing.expectEqualStrings; |
| 11 | 11 | |
| 12 | 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 | 15 | try testIntFloat(); |
| 14 | 16 | try comptime testIntFloat(); |
| 15 | 17 | } |
| ... | ... | @@ -37,6 +39,8 @@ fn testOptional() !void { |
| 37 | 39 | } |
| 38 | 40 | |
| 39 | 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 | 44 | try testCPtr(); |
| 41 | 45 | try comptime testCPtr(); |
| 42 | 46 | } |
| ... | ... | @@ -60,6 +64,8 @@ test "type info: value is correctly copied" { |
| 60 | 64 | } |
| 61 | 65 | |
| 62 | 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 | 69 | try testBasic(); |
| 64 | 70 | try comptime testBasic(); |
| 65 | 71 | } |
| ... | ... | @@ -72,6 +78,8 @@ fn testBasic() !void { |
| 72 | 78 | } |
| 73 | 79 | |
| 74 | 80 | test "type info: pointer type info" { |
| 81 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 82 | ||
| 75 | 83 | try testPointer(); |
| 76 | 84 | try comptime testPointer(); |
| 77 | 85 | } |
| ... | ... | @@ -88,6 +96,8 @@ fn testPointer() !void { |
| 88 | 96 | } |
| 89 | 97 | |
| 90 | 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 | 101 | try testUnknownLenPtr(); |
| 92 | 102 | try comptime testUnknownLenPtr(); |
| 93 | 103 | } |
| ... | ... | @@ -104,6 +114,8 @@ fn testUnknownLenPtr() !void { |
| 104 | 114 | } |
| 105 | 115 | |
| 106 | 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 | 119 | try testNullTerminatedPtr(); |
| 108 | 120 | try comptime testNullTerminatedPtr(); |
| 109 | 121 | } |
| ... | ... | @@ -120,6 +132,8 @@ fn testNullTerminatedPtr() !void { |
| 120 | 132 | } |
| 121 | 133 | |
| 122 | 134 | test "type info: slice type info" { |
| 135 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 136 | ||
| 123 | 137 | try testSlice(); |
| 124 | 138 | try comptime testSlice(); |
| 125 | 139 | } |
| ... | ... | @@ -135,6 +149,8 @@ fn testSlice() !void { |
| 135 | 149 | } |
| 136 | 150 | |
| 137 | 151 | test "type info: array type info" { |
| 152 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 153 | ||
| 138 | 154 | try testArray(); |
| 139 | 155 | try comptime testArray(); |
| 140 | 156 | } |
| ... | ... | @@ -160,7 +176,7 @@ fn testArray() !void { |
| 160 | 176 | test "type info: error set, error union info, anyerror" { |
| 161 | 177 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 162 | 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 | 181 | try testErrorSet(); |
| 166 | 182 | try comptime testErrorSet(); |
| ... | ... | @@ -191,7 +207,7 @@ fn testErrorSet() !void { |
| 191 | 207 | test "type info: error set single value" { |
| 192 | 208 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 193 | 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 | 212 | const TestSet = error.One; |
| 197 | 213 | |
| ... | ... | @@ -204,7 +220,7 @@ test "type info: error set single value" { |
| 204 | 220 | test "type info: error set merged" { |
| 205 | 221 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 206 | 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 | 225 | const TestSet = error{ One, Two } || error{Three}; |
| 210 | 226 | |
| ... | ... | @@ -219,7 +235,7 @@ test "type info: error set merged" { |
| 219 | 235 | test "type info: enum info" { |
| 220 | 236 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 221 | 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 | 240 | try testEnum(); |
| 225 | 241 | try comptime testEnum(); |
| ... | ... | @@ -244,6 +260,8 @@ fn testEnum() !void { |
| 244 | 260 | } |
| 245 | 261 | |
| 246 | 262 | test "type info: union info" { |
| 263 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 264 | ||
| 247 | 265 | try testUnion(); |
| 248 | 266 | try comptime testUnion(); |
| 249 | 267 | } |
| ... | ... | @@ -287,7 +305,7 @@ fn testUnion() !void { |
| 287 | 305 | |
| 288 | 306 | test "type info: struct info" { |
| 289 | 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 | 310 | try testStruct(); |
| 293 | 311 | try comptime testStruct(); |
| ... | ... | @@ -310,6 +328,8 @@ const TestStruct = struct { |
| 310 | 328 | }; |
| 311 | 329 | |
| 312 | 330 | test "type info: packed struct info" { |
| 331 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 332 | ||
| 313 | 333 | try testPackedStruct(); |
| 314 | 334 | try comptime testPackedStruct(); |
| 315 | 335 | } |
| ... | ... | @@ -361,7 +381,7 @@ fn testOpaque() !void { |
| 361 | 381 | } |
| 362 | 382 | |
| 363 | 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 | 385 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 366 | 386 | |
| 367 | 387 | try testFunction(); |
| ... | ... | @@ -429,6 +449,8 @@ extern fn typeInfoFoo(a: usize, b: bool, ...) callconv(.c) usize; |
| 429 | 449 | extern fn typeInfoFooAligned(a: usize, b: bool, ...) align(4) callconv(.c) usize; |
| 430 | 450 | |
| 431 | 451 | test "type info: generic function types" { |
| 452 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 453 | ||
| 432 | 454 | const G1 = @typeInfo(@TypeOf(generic1)); |
| 433 | 455 | try expect(G1.@"fn".param_types.len == 1); |
| 434 | 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 | 499 | } |
| 478 | 500 | |
| 479 | 501 | test "type info: vectors" { |
| 502 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 503 | ||
| 480 | 504 | try testVector(); |
| 481 | 505 | try comptime testVector(); |
| 482 | 506 | } |
| ... | ... | @@ -549,7 +573,7 @@ fn add(a: i32, b: i32) i32 { |
| 549 | 573 | |
| 550 | 574 | test "Declarations are returned in declaration order" { |
| 551 | 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 | 578 | const S = struct { |
| 555 | 579 | pub const a = 1; |
| ... | ... | @@ -571,8 +595,7 @@ test "Struct.is_tuple for anon list literal" { |
| 571 | 595 | } |
| 572 | 596 | |
| 573 | 597 | test "Struct.is_tuple for anon struct literal" { |
| 574 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 575 | ||
| 598 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 576 | 599 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 577 | 600 | |
| 578 | 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 | 617 | } |
| 595 | 618 | |
| 596 | 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 | 621 | const struct_info = @typeInfo(@TypeOf(.{"hi"})).@"struct"; |
| 598 | 622 | const struct_field_attrs = struct_info.field_attrs[0]; |
| 599 | 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 | 635 | } |
| 612 | 636 | |
| 613 | 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 | 641 | try testSpirv(); |
| 617 | 642 | try comptime testSpirv(); |
test/behavior/typename.zig+8-8| ... | ... | @@ -14,7 +14,7 @@ const expectStringStartsWith = std.testing.expectStringStartsWith; |
| 14 | 14 | test "anon fn param" { |
| 15 | 15 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 16 | 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 | 19 | // https://github.com/ziglang/zig/issues/9339 |
| 20 | 20 | try expectEqualStringsIgnoreDigits( |
| ... | ... | @@ -39,7 +39,7 @@ test "anon fn param" { |
| 39 | 39 | test "anon field init" { |
| 40 | 40 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 41 | 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 | 44 | const Foo = .{ |
| 45 | 45 | .T1 = struct {}, |
| ... | ... | @@ -64,7 +64,7 @@ test "anon field init" { |
| 64 | 64 | test "basic" { |
| 65 | 65 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 66 | 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 | 69 | try expectEqualStrings("i64", @typeName(i64)); |
| 70 | 70 | try expectEqualStrings("*usize", @typeName(*usize)); |
| ... | ... | @@ -85,7 +85,7 @@ test "basic" { |
| 85 | 85 | test "top level decl" { |
| 86 | 86 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 87 | 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 | 90 | try expectEqualStrings( |
| 91 | 91 | "behavior.typename.A_Struct", |
| ... | ... | @@ -134,7 +134,7 @@ const B = struct { |
| 134 | 134 | test "fn param" { |
| 135 | 135 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 136 | 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 | 139 | // https://github.com/ziglang/zig/issues/675 |
| 140 | 140 | try expectEqualStrings( |
| ... | ... | @@ -213,7 +213,7 @@ pub fn expectEqualStringsIgnoreDigits(expected: []const u8, actual: []const u8) |
| 213 | 213 | test "local variable" { |
| 214 | 214 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 215 | 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 | 218 | const Foo = struct { a: u32 }; |
| 219 | 219 | const Bar = union { a: u32 }; |
| ... | ... | @@ -231,7 +231,7 @@ test "local variable" { |
| 231 | 231 | test "comptime parameters not converted to anytype in function type" { |
| 232 | 232 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 233 | 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 | 236 | const T = fn (comptime fn (comptime type) void, void) void; |
| 237 | 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 | 240 | test "anon name strategy used in sub expression" { |
| 241 | 241 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 242 | 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 | 245 | const S = struct { |
| 246 | 246 | fn getTheName() []const u8 { |
test/behavior/undefined.zig+6-3| ... | ... | @@ -14,6 +14,7 @@ fn initStaticArray() [10]i32 { |
| 14 | 14 | } |
| 15 | 15 | const static_array = initStaticArray(); |
| 16 | 16 | test "init static array to undefined" { |
| 17 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 17 | 18 | // This test causes `initStaticArray()` to be codegen'd, and the |
| 18 | 19 | // C backend does not yet support returning arrays, so it fails |
| 19 | 20 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| ... | ... | @@ -45,6 +46,7 @@ fn setFooX(foo: *Foo) void { |
| 45 | 46 | } |
| 46 | 47 | |
| 47 | 48 | test "assign undefined to struct" { |
| 49 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 48 | 50 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 49 | 51 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 50 | 52 | |
| ... | ... | @@ -61,6 +63,7 @@ test "assign undefined to struct" { |
| 61 | 63 | } |
| 62 | 64 | |
| 63 | 65 | test "assign undefined to struct with method" { |
| 66 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 64 | 67 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 65 | 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 | 80 | } |
| 78 | 81 | |
| 79 | 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 | 84 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 82 | 85 | |
| 83 | 86 | const x = undefined; |
| ... | ... | @@ -88,7 +91,7 @@ var buf: []u8 = undefined; |
| 88 | 91 | |
| 89 | 92 | test "reslice of undefined global var slice" { |
| 90 | 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 | 96 | var stack_buf: [100]u8 = @splat(0); |
| 94 | 97 | buf = &stack_buf; |
| ... | ... | @@ -98,7 +101,7 @@ test "reslice of undefined global var slice" { |
| 98 | 101 | |
| 99 | 102 | test "returned undef is 0xaa bytes when runtime safety is enabled" { |
| 100 | 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 | 105 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 103 | 106 | |
| 104 | 107 | const Rect = struct { |
test/behavior/underscore.zig+1| ... | ... | @@ -7,6 +7,7 @@ test "ignore lval with underscore" { |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | test "ignore lval with underscore (while loop)" { |
| 10 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 10 | 11 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 11 | 12 | |
| 12 | 13 | while (optionalReturnError()) |_| { |
test/behavior/union.zig+85-39| ... | ... | @@ -15,7 +15,7 @@ test "basic unions with floats" { |
| 15 | 15 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 16 | 16 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 17 | 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 | 20 | var foo = FooWithFloats{ .int = 1 }; |
| 21 | 21 | try expect(foo.int == 1); |
| ... | ... | @@ -28,6 +28,7 @@ fn setFloat(foo: *FooWithFloats, x: f64) void { |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | test "init union with runtime value - floats" { |
| 31 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 31 | 32 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 32 | 33 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 33 | 34 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -41,7 +42,7 @@ test "init union with runtime value - floats" { |
| 41 | 42 | test "basic unions" { |
| 42 | 43 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 43 | 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 | 47 | var foo = Foo{ .int = 1 }; |
| 47 | 48 | try expect(foo.int == 1); |
| ... | ... | @@ -60,7 +61,7 @@ test "init union with runtime value" { |
| 60 | 61 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 61 | 62 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 62 | 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 | 66 | var foo: Foo = undefined; |
| 66 | 67 | |
| ... | ... | @@ -98,7 +99,7 @@ const FooExtern = extern union { |
| 98 | 99 | |
| 99 | 100 | test "basic extern unions" { |
| 100 | 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 | 104 | var foo = FooExtern{ .int = 1 }; |
| 104 | 105 | try expect(foo.int == 1); |
| ... | ... | @@ -160,6 +161,7 @@ test "unions embedded in aggregate types" { |
| 160 | 161 | } |
| 161 | 162 | |
| 162 | 163 | test "constant tagged union with payload" { |
| 164 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 163 | 165 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 164 | 166 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 165 | 167 | |
| ... | ... | @@ -212,7 +214,7 @@ test "union with specified enum tag" { |
| 212 | 214 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 213 | 215 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 214 | 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 | 219 | try doTest(); |
| 218 | 220 | try comptime doTest(); |
| ... | ... | @@ -245,7 +247,7 @@ fn testComparison() !void { |
| 245 | 247 | test "comparison between union and enum literal" { |
| 246 | 248 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 247 | 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 | 252 | try testComparison(); |
| 251 | 253 | try comptime testComparison(); |
| ... | ... | @@ -258,6 +260,7 @@ const TheUnion = union(TheTag) { |
| 258 | 260 | C: i32, |
| 259 | 261 | }; |
| 260 | 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 | 264 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 262 | 265 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 263 | 266 | |
| ... | ... | @@ -272,12 +275,14 @@ fn testCastUnionToTag() !void { |
| 272 | 275 | } |
| 273 | 276 | |
| 274 | 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 | 279 | try expect(TheUnion.A == TheTag.A); |
| 276 | 280 | try expect(TheUnion.B == TheTag.B); |
| 277 | 281 | try expect(TheUnion.C == TheTag.C); |
| 278 | 282 | } |
| 279 | 283 | |
| 280 | 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 | 286 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 282 | 287 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 283 | 288 | |
| ... | ... | @@ -293,6 +298,7 @@ const Value2 = union(Letter2) { |
| 293 | 298 | }; |
| 294 | 299 | |
| 295 | 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 | 302 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 297 | 303 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 298 | 304 | |
| ... | ... | @@ -315,7 +321,7 @@ pub const PackThis = union(enum) { |
| 315 | 321 | test "constant packed union" { |
| 316 | 322 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 317 | 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 | 326 | try testConstPackedUnion(&[_]PackThis{PackThis{ .StringLiteral = 1 }}); |
| 321 | 327 | } |
| ... | ... | @@ -407,7 +413,7 @@ test "tagged union with no payloads" { |
| 407 | 413 | |
| 408 | 414 | test "union with only 1 field casted to its enum type" { |
| 409 | 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 | 418 | const Literal = union(enum) { |
| 413 | 419 | Number: f64, |
| ... | ... | @@ -442,7 +448,7 @@ const Foo1 = union(enum) { |
| 442 | 448 | var glbl: Foo1 = undefined; |
| 443 | 449 | |
| 444 | 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 | 452 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 447 | 453 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 448 | 454 | |
| ... | ... | @@ -462,7 +468,7 @@ var glbl_array: [2]FooUnion = undefined; |
| 462 | 468 | test "initialize global array of union" { |
| 463 | 469 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 464 | 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 | 473 | glbl_array[1] = FooUnion{ .U1 = 2 }; |
| 468 | 474 | glbl_array[0] = FooUnion{ .U0 = 1 }; |
| ... | ... | @@ -471,6 +477,7 @@ test "initialize global array of union" { |
| 471 | 477 | } |
| 472 | 478 | |
| 473 | 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 | 481 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 475 | 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 | 492 | } |
| 486 | 493 | |
| 487 | 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 | 496 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 489 | 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 | 507 | |
| 500 | 508 | test "runtime tag name with single field" { |
| 501 | 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 | 512 | const U = union(enum) { |
| 505 | 513 | A: i32, |
| ... | ... | @@ -511,6 +519,7 @@ test "runtime tag name with single field" { |
| 511 | 519 | } |
| 512 | 520 | |
| 513 | 521 | test "method call on an empty union" { |
| 522 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 514 | 523 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 515 | 524 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 516 | 525 | |
| ... | ... | @@ -551,6 +560,7 @@ const FooNoVoid = union(enum) { |
| 551 | 560 | const Baz = enum { A, B, C, D }; |
| 552 | 561 | |
| 553 | 562 | test "tagged union type" { |
| 563 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 554 | 564 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 555 | 565 | |
| 556 | 566 | const foo1 = TaggedFoo{ .One = 13 }; |
| ... | ... | @@ -572,6 +582,7 @@ test "tagged union type" { |
| 572 | 582 | } |
| 573 | 583 | |
| 574 | 584 | test "tagged union as return value" { |
| 585 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 575 | 586 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 576 | 587 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 577 | 588 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -588,6 +599,7 @@ fn returnAnInt(x: i32) TaggedFoo { |
| 588 | 599 | } |
| 589 | 600 | |
| 590 | 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 | 603 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 592 | 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 | 627 | } |
| 616 | 628 | |
| 617 | 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 | 631 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 619 | 632 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 620 | 633 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -652,6 +665,7 @@ fn testEnumWithSpecifiedAndUnspecifiedTagValues(x: MultipleChoice2) !void { |
| 652 | 665 | } |
| 653 | 666 | |
| 654 | 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 | 669 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 656 | 670 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 657 | 671 | |
| ... | ... | @@ -682,7 +696,7 @@ const PartialInstWithPayload = union(enum) { |
| 682 | 696 | |
| 683 | 697 | test "union with only 1 field casted to its enum type which has enum value specified" { |
| 684 | 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 | 701 | const Literal = union(enum) { |
| 688 | 702 | number: f64, |
| ... | ... | @@ -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 | 721 | test "@intFromEnum works on unions" { |
| 722 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 708 | 723 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 709 | 724 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 710 | 725 | |
| ... | ... | @@ -724,6 +739,8 @@ test "@intFromEnum works on unions" { |
| 724 | 739 | } |
| 725 | 740 | |
| 726 | 741 | test "comptime union field value equality" { |
| 742 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 743 | ||
| 727 | 744 | const a0 = Setter(Attribute{ .A = false }); |
| 728 | 745 | const a1 = Setter(Attribute{ .A = true }); |
| 729 | 746 | const a2 = Setter(Attribute{ .A = false }); |
| ... | ... | @@ -763,6 +780,7 @@ fn Setter(comptime attr: Attribute) type { |
| 763 | 780 | } |
| 764 | 781 | |
| 765 | 782 | test "return union init with void payload" { |
| 783 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 766 | 784 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 767 | 785 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 768 | 786 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -787,6 +805,7 @@ test "return union init with void payload" { |
| 787 | 805 | } |
| 788 | 806 | |
| 789 | 807 | test "@unionInit stored to a const" { |
| 808 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 790 | 809 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 791 | 810 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 792 | 811 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -817,6 +836,7 @@ test "@unionInit stored to a const" { |
| 817 | 836 | } |
| 818 | 837 | |
| 819 | 838 | test "@unionInit can modify a union type" { |
| 839 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 820 | 840 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 821 | 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 | 859 | } |
| 840 | 860 | |
| 841 | 861 | test "@unionInit can modify a pointer value" { |
| 862 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 842 | 863 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 843 | 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 | 881 | test "union no tag with struct member" { |
| 861 | 882 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 862 | 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 | 886 | const Struct = struct {}; |
| 866 | 887 | const Union = union { |
| ... | ... | @@ -887,7 +908,8 @@ test "anonymous union literal syntax" { |
| 887 | 908 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 888 | 909 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 889 | 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 | 913 | const S = struct { |
| 892 | 914 | const Number = union { |
| 893 | 915 | int: i32, |
| ... | ... | @@ -911,6 +933,7 @@ test "anonymous union literal syntax" { |
| 911 | 933 | } |
| 912 | 934 | |
| 913 | 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 | 937 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 915 | 938 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 916 | 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 | 969 | } |
| 947 | 970 | |
| 948 | 971 | test "switching on non exhaustive union" { |
| 972 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 949 | 973 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 950 | 974 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 951 | 975 | |
| ... | ... | @@ -973,6 +997,7 @@ test "switching on non exhaustive union" { |
| 973 | 997 | } |
| 974 | 998 | |
| 975 | 999 | test "containers with single-field enums" { |
| 1000 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 976 | 1001 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 977 | 1002 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 978 | 1003 | |
| ... | ... | @@ -1004,7 +1029,7 @@ test "containers with single-field enums" { |
| 1004 | 1029 | test "@unionInit on union with u8 tag but no fields" { |
| 1005 | 1030 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1006 | 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 | 1034 | const S = struct { |
| 1010 | 1035 | const Type = enum(u8) { no_op = 105 }; |
| ... | ... | @@ -1049,7 +1074,7 @@ test "union enum type gets a separate scope" { |
| 1049 | 1074 | test "global variable struct contains union initialized to non-most-aligned field" { |
| 1050 | 1075 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1051 | 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 | 1079 | const T = struct { |
| 1055 | 1080 | const U = union(enum) { |
| ... | ... | @@ -1073,6 +1098,7 @@ test "global variable struct contains union initialized to non-most-aligned fiel |
| 1073 | 1098 | } |
| 1074 | 1099 | |
| 1075 | 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 | 1102 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1077 | 1103 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1078 | 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 | 1116 | } |
| 1091 | 1117 | |
| 1092 | 1118 | test "union with a large struct field" { |
| 1119 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1093 | 1120 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1094 | 1121 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1095 | 1122 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1124,6 +1151,7 @@ test "comptime equality of extern unions with same tag" { |
| 1124 | 1151 | } |
| 1125 | 1152 | |
| 1126 | 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 | 1155 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1128 | 1156 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1129 | 1157 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1146,7 +1174,7 @@ test "extern union most-aligned field is smaller" { |
| 1146 | 1174 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1147 | 1175 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1148 | 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 | 1179 | const U = extern union { |
| 1152 | 1180 | in6: extern struct { |
| ... | ... | @@ -1166,7 +1194,7 @@ test "return an extern union from C calling convention" { |
| 1166 | 1194 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1167 | 1195 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1168 | 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 | 1199 | const namespace = struct { |
| 1172 | 1200 | const S = extern struct { |
| ... | ... | @@ -1195,6 +1223,7 @@ test "return an extern union from C calling convention" { |
| 1195 | 1223 | } |
| 1196 | 1224 | |
| 1197 | 1225 | test "noreturn field in union" { |
| 1226 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1198 | 1227 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1199 | 1228 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1200 | 1229 | const U = union(enum) { |
| ... | ... | @@ -1244,6 +1273,7 @@ test "noreturn field in union" { |
| 1244 | 1273 | } |
| 1245 | 1274 | |
| 1246 | 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 | 1277 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1248 | 1278 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1249 | 1279 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -1274,7 +1304,7 @@ test "@unionInit uses tag value instead of field index" { |
| 1274 | 1304 | test "union field ptr - zero sized payload" { |
| 1275 | 1305 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1276 | 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 | 1309 | const U = union { |
| 1280 | 1310 | foo: void, |
| ... | ... | @@ -1288,7 +1318,7 @@ test "union field ptr - zero sized payload" { |
| 1288 | 1318 | test "union field ptr - zero sized field" { |
| 1289 | 1319 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1290 | 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 | 1323 | const U = union { |
| 1294 | 1324 | foo: void, |
| ... | ... | @@ -1303,7 +1333,7 @@ test "packed union in packed struct" { |
| 1303 | 1333 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1304 | 1334 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1305 | 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 | 1338 | const S = packed struct { |
| 1309 | 1339 | nested: packed union { |
| ... | ... | @@ -1353,7 +1383,7 @@ test "union int tag type is properly managed" { |
| 1353 | 1383 | |
| 1354 | 1384 | test "no dependency loop when function pointer in union returns the union" { |
| 1355 | 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 | 1387 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1358 | 1388 | |
| 1359 | 1389 | const U = union(enum) { |
| ... | ... | @@ -1373,6 +1403,7 @@ test "no dependency loop when function pointer in union returns the union" { |
| 1373 | 1403 | } |
| 1374 | 1404 | |
| 1375 | 1405 | test "union reassignment can use previous value" { |
| 1406 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1376 | 1407 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1377 | 1408 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1378 | 1409 | |
| ... | ... | @@ -1387,7 +1418,7 @@ test "union reassignment can use previous value" { |
| 1387 | 1418 | |
| 1388 | 1419 | test "reinterpreting enum value inside packed union" { |
| 1389 | 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 | 1423 | const U = packed union { |
| 1393 | 1424 | tag: enum(u8) { a, b }, |
| ... | ... | @@ -1404,7 +1435,7 @@ test "reinterpreting enum value inside packed union" { |
| 1404 | 1435 | } |
| 1405 | 1436 | |
| 1406 | 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 | 1440 | const U = union(enum) { |
| 1410 | 1441 | a, |
| ... | ... | @@ -1415,6 +1446,8 @@ test "access the tag of a global tagged union" { |
| 1415 | 1446 | } |
| 1416 | 1447 | |
| 1417 | 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 | 1451 | const U = union(enum) { |
| 1419 | 1452 | a, |
| 1420 | 1453 | b: u8, |
| ... | ... | @@ -1431,7 +1464,7 @@ test "coerce enum literal to union in result loc" { |
| 1431 | 1464 | test "defined-layout union field pointer has correct alignment" { |
| 1432 | 1465 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1433 | 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 | 1469 | const S = struct { |
| 1437 | 1470 | fn doTheTest(comptime U: type) !void { |
| ... | ... | @@ -1465,7 +1498,7 @@ test "defined-layout union field pointer has correct alignment" { |
| 1465 | 1498 | test "undefined-layout union field pointer has correct alignment" { |
| 1466 | 1499 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1467 | 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 | 1503 | const S = struct { |
| 1471 | 1504 | fn doTheTest(comptime U: type) !void { |
| ... | ... | @@ -1500,7 +1533,7 @@ test "packed union field pointer has correct alignment" { |
| 1500 | 1533 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1501 | 1534 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1502 | 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 | 1538 | const U = packed union { x: u20 }; |
| 1506 | 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 | 1564 | } |
| 1532 | 1565 | |
| 1533 | 1566 | test "union with 128 bit integer" { |
| 1567 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1534 | 1568 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1535 | 1569 | |
| 1536 | 1570 | const ValueTag = enum { int, other }; |
| ... | ... | @@ -1554,7 +1588,7 @@ test "union with 128 bit integer" { |
| 1554 | 1588 | } |
| 1555 | 1589 | |
| 1556 | 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 | 1593 | const U = extern union { |
| 1560 | 1594 | foo: u8, |
| ... | ... | @@ -1575,7 +1609,7 @@ test "memset extern union" { |
| 1575 | 1609 | } |
| 1576 | 1610 | |
| 1577 | 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 | 1614 | const U = packed union { |
| 1581 | 1615 | a: u32, |
| ... | ... | @@ -1677,7 +1711,7 @@ test "reinterpret extern union" { |
| 1677 | 1711 | |
| 1678 | 1712 | test "reinterpret packed union" { |
| 1679 | 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 | 1716 | const U = packed union { |
| 1683 | 1717 | foo: packed struct(u64) { |
| ... | ... | @@ -1755,7 +1789,7 @@ test "reinterpret packed union" { |
| 1755 | 1789 | |
| 1756 | 1790 | test "reinterpret packed union inside packed struct" { |
| 1757 | 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 | 1793 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 1760 | 1794 | |
| 1761 | 1795 | const U = packed union { |
| ... | ... | @@ -1794,6 +1828,8 @@ test "reinterpret packed union inside packed struct" { |
| 1794 | 1828 | } |
| 1795 | 1829 | |
| 1796 | 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 | 1833 | const namespace = struct { |
| 1798 | 1834 | const U = union { |
| 1799 | 1835 | a: struct { |
| ... | ... | @@ -1818,6 +1854,8 @@ test "inner struct initializer uses union layout" { |
| 1818 | 1854 | } |
| 1819 | 1855 | |
| 1820 | 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 | 1859 | const namespace = struct { |
| 1822 | 1860 | const U = packed union { |
| 1823 | 1861 | a: packed struct { |
| ... | ... | @@ -1861,7 +1899,7 @@ test "extern union initialized via reintepreted struct field initializer" { |
| 1861 | 1899 | |
| 1862 | 1900 | test "packed union initialized via reintepreted struct field initializer" { |
| 1863 | 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 | 1904 | const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd }; |
| 1867 | 1905 | |
| ... | ... | @@ -1884,7 +1922,7 @@ test "packed union initialized via reintepreted struct field initializer" { |
| 1884 | 1922 | } |
| 1885 | 1923 | |
| 1886 | 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 | 1927 | const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd }; |
| 1890 | 1928 | |
| ... | ... | @@ -1907,7 +1945,7 @@ test "store of comptime reinterpreted memory to extern union" { |
| 1907 | 1945 | |
| 1908 | 1946 | test "store of comptime reinterpreted memory to packed union" { |
| 1909 | 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 | 1950 | const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd }; |
| 1913 | 1951 | |
| ... | ... | @@ -1933,7 +1971,7 @@ test "store of comptime reinterpreted memory to packed union" { |
| 1933 | 1971 | |
| 1934 | 1972 | test "union field is a pointer to an aligned version of itself" { |
| 1935 | 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 | 1976 | const E = union { |
| 1939 | 1977 | next: *align(1) @This(), |
| ... | ... | @@ -1947,7 +1985,7 @@ test "union field is a pointer to an aligned version of itself" { |
| 1947 | 1985 | test "pass register-sized field as non-register-sized union" { |
| 1948 | 1986 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1949 | 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 | 1990 | const S = struct { |
| 1953 | 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 | 2009 | } |
| 1972 | 2010 | |
| 1973 | 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 | 2014 | const S = struct { |
| 1977 | 2015 | const UnionInner = extern struct { |
| ... | ... | @@ -1994,6 +2032,7 @@ test "circular dependency through pointer field of a union" { |
| 1994 | 2032 | } |
| 1995 | 2033 | |
| 1996 | 2034 | test "pass nested union with rls" { |
| 2035 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1997 | 2036 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1998 | 2037 | |
| 1999 | 2038 | const Union = union(enum) { |
| ... | ... | @@ -2014,6 +2053,7 @@ test "pass nested union with rls" { |
| 2014 | 2053 | } |
| 2015 | 2054 | |
| 2016 | 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 | 2057 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2018 | 2058 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 2019 | 2059 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -2039,6 +2079,7 @@ test "runtime union init, most-aligned field != largest" { |
| 2039 | 2079 | } |
| 2040 | 2080 | |
| 2041 | 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 | 2083 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2043 | 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 | 2100 | test "create union(enum) from other union(enum)" { |
| 2060 | 2101 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 2061 | 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 | 2104 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2064 | 2105 | |
| 2065 | 2106 | const string = "hello world"; |
| ... | ... | @@ -2192,6 +2233,7 @@ test "capture used as explicit field value" { |
| 2192 | 2233 | } |
| 2193 | 2234 | |
| 2194 | 2235 | test "signed enum tag with negative value" { |
| 2236 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 2195 | 2237 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 2196 | 2238 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 2197 | 2239 | |
| ... | ... | @@ -2247,7 +2289,7 @@ test "extern union @FieldType" { |
| 2247 | 2289 | } |
| 2248 | 2290 | |
| 2249 | 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 | 2294 | const U = union(enum) { |
| 2253 | 2295 | a: u16, |
| ... | ... | @@ -2268,6 +2310,8 @@ test "assign global tagged union" { |
| 2268 | 2310 | } |
| 2269 | 2311 | |
| 2270 | 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 | 2315 | const U = union(enum) { |
| 2272 | 2316 | foo, |
| 2273 | 2317 | bar: usize, |
| ... | ... | @@ -2292,6 +2336,8 @@ test "initialize empty field of union inside comptime-known struct constant" { |
| 2292 | 2336 | } |
| 2293 | 2337 | |
| 2294 | 2338 | test "union with function body field" { |
| 2339 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 2340 | ||
| 2295 | 2341 | const U = union { |
| 2296 | 2342 | f: fn () void, |
| 2297 | 2343 | fn foo() void {} |
test/behavior/var_args.zig+10-6| ... | ... | @@ -14,6 +14,8 @@ fn add(args: anytype) i32 { |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | test "add arbitrary args" { |
| 17 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 18 | ||
| 17 | 19 | try expect(add(.{ @as(i32, 1), @as(i32, 2), @as(i32, 3), @as(i32, 4) }) == 10); |
| 18 | 20 | try expect(add(.{@as(i32, 1234)}) == 1234); |
| 19 | 21 | try expect(add(.{}) == 0); |
| ... | ... | @@ -28,6 +30,7 @@ test "send void arg to var args" { |
| 28 | 30 | } |
| 29 | 31 | |
| 30 | 32 | test "pass args directly" { |
| 33 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 31 | 34 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 32 | 35 | |
| 33 | 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 | 43 | } |
| 41 | 44 | |
| 42 | 45 | test "runtime parameter before var args" { |
| 46 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 43 | 47 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 44 | 48 | |
| 45 | 49 | try expect((try extraFn(10, .{})) == 0); |
| ... | ... | @@ -94,7 +98,7 @@ fn doNothingWithFirstArg(args: anytype) void { |
| 94 | 98 | test "simple variadic function" { |
| 95 | 99 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 96 | 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 | 102 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 99 | 103 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { |
| 100 | 104 | // https://github.com/ziglang/zig/issues/14096 |
| ... | ... | @@ -155,7 +159,7 @@ test "simple variadic function" { |
| 155 | 159 | test "coerce reference to var arg" { |
| 156 | 160 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 157 | 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 | 163 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 160 | 164 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { |
| 161 | 165 | // https://github.com/ziglang/zig/issues/14096 |
| ... | ... | @@ -187,7 +191,7 @@ test "variadic functions" { |
| 187 | 191 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 188 | 192 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 189 | 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 | 195 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { |
| 192 | 196 | // https://github.com/ziglang/zig/issues/14096 |
| 193 | 197 | return error.SkipZigTest; |
| ... | ... | @@ -238,7 +242,7 @@ test "variadic functions" { |
| 238 | 242 | |
| 239 | 243 | test "copy VaList" { |
| 240 | 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 | 246 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 243 | 247 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { |
| 244 | 248 | // https://github.com/ziglang/zig/issues/14096 |
| ... | ... | @@ -272,7 +276,7 @@ test "copy VaList" { |
| 272 | 276 | |
| 273 | 277 | test "unused VaList arg" { |
| 274 | 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 | 280 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 277 | 281 | if (builtin.zig_backend == .stage2_llvm and !builtin.os.tag.isDarwin() and builtin.cpu.arch.isAARCH64()) { |
| 278 | 282 | // https://github.com/ziglang/zig/issues/14096 |
| ... | ... | @@ -303,7 +307,7 @@ test "unused VaList arg" { |
| 303 | 307 | |
| 304 | 308 | test "floating point VaList args" { |
| 305 | 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 | 311 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 308 | 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 | 8 | |
| 9 | 9 | test "implicit cast vector to array - bool" { |
| 10 | 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 | 13 | const S = struct { |
| 14 | 14 | fn doTheTest() !void { |
| ... | ... | @@ -31,7 +31,7 @@ test "implicit cast vector to array - bool" { |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 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 | 35 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 36 | 36 | |
| 37 | 37 | const S = struct { |
| ... | ... | @@ -59,7 +59,7 @@ test "vector wrap operators" { |
| 59 | 59 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 60 | 60 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 61 | 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 | 64 | const S = struct { |
| 65 | 65 | fn doTheTest() !void { |
| ... | ... | @@ -82,7 +82,7 @@ test "vector bin compares with mem.eql" { |
| 82 | 82 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 83 | 83 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 84 | 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 | 87 | const S = struct { |
| 88 | 88 | fn doTheTest() !void { |
| ... | ... | @@ -106,7 +106,7 @@ test "vector int operators" { |
| 106 | 106 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 107 | 107 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 108 | 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 | 111 | const S = struct { |
| 112 | 112 | fn doTheTest() !void { |
| ... | ... | @@ -127,7 +127,7 @@ test "vector float operators" { |
| 127 | 127 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 128 | 128 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 129 | 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 | 132 | const S = struct { |
| 133 | 133 | fn doTheTest(T: type) !void { |
| ... | ... | @@ -164,7 +164,7 @@ test "vector bit operators" { |
| 164 | 164 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 165 | 165 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 166 | 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 | 169 | const S = struct { |
| 170 | 170 | fn doTheTest() !void { |
| ... | ... | @@ -195,7 +195,7 @@ test "implicit cast vector to array" { |
| 195 | 195 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 196 | 196 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 197 | 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 | 200 | const S = struct { |
| 201 | 201 | fn doTheTest() !void { |
| ... | ... | @@ -214,7 +214,7 @@ test "array to vector" { |
| 214 | 214 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 215 | 215 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 216 | 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 | 219 | const S = struct { |
| 220 | 220 | fn doTheTest() !void { |
| ... | ... | @@ -233,7 +233,7 @@ test "array of abi-sized integer to vector of same type" { |
| 233 | 233 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 234 | 234 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 235 | 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 | 238 | const S = struct { |
| 239 | 239 | const one: u32 = 1; |
| ... | ... | @@ -318,7 +318,7 @@ test "array of float to vector of same type" { |
| 318 | 318 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 319 | 319 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 320 | 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 | 322 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 323 | 323 | |
| 324 | 324 | const S = struct { |
| ... | ... | @@ -375,6 +375,7 @@ test "array of float to vector of same type" { |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 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 | 379 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 379 | 380 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 380 | 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 | 428 | } |
| 428 | 429 | |
| 429 | 430 | test "array vector coercion - odd sizes" { |
| 431 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 430 | 432 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 431 | 433 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 432 | 434 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -468,7 +470,7 @@ test "array to vector with element type coercion" { |
| 468 | 470 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 469 | 471 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 470 | 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 | 474 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 473 | 475 | |
| 474 | 476 | const S = struct { |
| ... | ... | @@ -502,7 +504,7 @@ test "peer type resolution with coercible element types" { |
| 502 | 504 | } |
| 503 | 505 | |
| 504 | 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 | 508 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 507 | 509 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 508 | 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 | 531 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 530 | 532 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 531 | 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 | 536 | const S = struct { |
| 535 | 537 | fn doTheTest() !void { |
| ... | ... | @@ -564,6 +566,7 @@ test "vector casts of sizes not divisible by 8" { |
| 564 | 566 | } |
| 565 | 567 | |
| 566 | 568 | test "load vector elements via comptime index" { |
| 569 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 567 | 570 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 568 | 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 | 587 | } |
| 585 | 588 | |
| 586 | 589 | test "store vector elements via comptime index" { |
| 590 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 587 | 591 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 588 | 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 | 614 | } |
| 611 | 615 | |
| 612 | 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 | 618 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 614 | 619 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 615 | 620 | |
| ... | ... | @@ -634,7 +639,7 @@ test "vector comparison operators" { |
| 634 | 639 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 635 | 640 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 636 | 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 | 644 | const S = struct { |
| 640 | 645 | fn doTheTest() !void { |
| ... | ... | @@ -679,7 +684,7 @@ test "vector division operators" { |
| 679 | 684 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 680 | 685 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 681 | 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 | 689 | const S = struct { |
| 685 | 690 | fn doTheTestDiv(comptime T: type, x: @Vector(4, T), y: @Vector(4, T)) !void { |
| ... | ... | @@ -798,6 +803,7 @@ test "vector division operators" { |
| 798 | 803 | } |
| 799 | 804 | |
| 800 | 805 | test "vector bitwise not operator" { |
| 806 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 801 | 807 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 802 | 808 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 803 | 809 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -830,6 +836,7 @@ test "vector bitwise not operator" { |
| 830 | 836 | } |
| 831 | 837 | |
| 832 | 838 | test "vector boolean not operator" { |
| 839 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 833 | 840 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 834 | 841 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 835 | 842 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -856,7 +863,7 @@ test "vector shift operators" { |
| 856 | 863 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 857 | 864 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 858 | 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 | 868 | const S = struct { |
| 862 | 869 | fn doTheTestShift(x: anytype, y: anytype) !void { |
| ... | ... | @@ -926,7 +933,7 @@ test "vector reduce operation" { |
| 926 | 933 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 927 | 934 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 928 | 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 | 937 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 931 | 938 | |
| 932 | 939 | const S = struct { |
| ... | ... | @@ -1087,7 +1094,7 @@ test "saturating add" { |
| 1087 | 1094 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1088 | 1095 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1089 | 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 | 1098 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1092 | 1099 | |
| 1093 | 1100 | const S = struct { |
| ... | ... | @@ -1187,7 +1194,7 @@ test "saturating subtraction" { |
| 1187 | 1194 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1188 | 1195 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1189 | 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 | 1198 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1192 | 1199 | |
| 1193 | 1200 | const S = struct { |
| ... | ... | @@ -1279,7 +1286,7 @@ test "saturating multiplication" { |
| 1279 | 1286 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1280 | 1287 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1281 | 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 | 1290 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1284 | 1291 | |
| 1285 | 1292 | const S = struct { |
| ... | ... | @@ -1303,7 +1310,7 @@ test "saturating shift-left" { |
| 1303 | 1310 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1304 | 1311 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1305 | 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 | 1314 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1308 | 1315 | |
| 1309 | 1316 | const S = struct { |
| ... | ... | @@ -1323,6 +1330,7 @@ test "saturating shift-left" { |
| 1323 | 1330 | } |
| 1324 | 1331 | |
| 1325 | 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 | 1334 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1327 | 1335 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1328 | 1336 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1346,7 +1354,7 @@ test "@addWithOverflow" { |
| 1346 | 1354 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1347 | 1355 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1348 | 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 | 1359 | const S = struct { |
| 1352 | 1360 | fn doTheTest() !void { |
| ... | ... | @@ -1393,7 +1401,7 @@ test "@subWithOverflow" { |
| 1393 | 1401 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1394 | 1402 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1395 | 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 | 1406 | const S = struct { |
| 1399 | 1407 | fn doTheTest() !void { |
| ... | ... | @@ -1420,7 +1428,7 @@ test "@subWithOverflow" { |
| 1420 | 1428 | } |
| 1421 | 1429 | |
| 1422 | 1430 | test "@mulWithOverflow" { |
| 1423 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1431 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1424 | 1432 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1425 | 1433 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1426 | 1434 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1441,7 +1449,7 @@ test "@mulWithOverflow" { |
| 1441 | 1449 | } |
| 1442 | 1450 | |
| 1443 | 1451 | test "@shlWithOverflow" { |
| 1444 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | |
| 1452 | if (builtin.cpu.arch.isSpirv()) return error.SkipZigTest; | |
| 1445 | 1453 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1446 | 1454 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1447 | 1455 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1462,6 +1470,8 @@ test "@shlWithOverflow" { |
| 1462 | 1470 | } |
| 1463 | 1471 | |
| 1464 | 1472 | test "alignment of vectors" { |
| 1473 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1474 | ||
| 1465 | 1475 | try expect(@alignOf(@Vector(2, u8)) == switch (builtin.zig_backend) { |
| 1466 | 1476 | else => 2, |
| 1467 | 1477 | .stage2_c, .stage2_wasm => @alignOf(u8), |
| ... | ... | @@ -1487,7 +1497,7 @@ test "alignment of vectors" { |
| 1487 | 1497 | test "loading the second vector from a slice of vectors" { |
| 1488 | 1498 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1489 | 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 | 1502 | @setRuntimeSafety(false); |
| 1493 | 1503 | var small_bases = [2]@Vector(2, u8){ |
| ... | ... | @@ -1503,7 +1513,7 @@ test "array of vectors is copied" { |
| 1503 | 1513 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1504 | 1514 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1505 | 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 | 1518 | const Vec3 = @Vector(3, i32); |
| 1509 | 1519 | var points = [_]Vec3{ |
| ... | ... | @@ -1567,7 +1577,7 @@ test "zero multiplicand" { |
| 1567 | 1577 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1568 | 1578 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO |
| 1569 | 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 | 1582 | const zeros = @Vector(2, u32){ 0.0, 0.0 }; |
| 1573 | 1583 | var ones = @Vector(2, u32){ 1.0, 1.0 }; |
| ... | ... | @@ -1610,7 +1620,7 @@ test "modRem with zero divisor" { |
| 1610 | 1620 | } |
| 1611 | 1621 | |
| 1612 | 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 | 1624 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1615 | 1625 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1616 | 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 | 1635 | } |
| 1626 | 1636 | |
| 1627 | 1637 | test "load packed vector element" { |
| 1638 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1628 | 1639 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1629 | 1640 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1630 | 1641 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1636,7 +1647,7 @@ test "load packed vector element" { |
| 1636 | 1647 | } |
| 1637 | 1648 | |
| 1638 | 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 | 1651 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1641 | 1652 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1642 | 1653 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1653,7 +1664,7 @@ test "store to vector in slice" { |
| 1653 | 1664 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1654 | 1665 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1655 | 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 | 1669 | var v = [_]@Vector(3, f32){ |
| 1659 | 1670 | .{ 1, 1, 1 }, |
| ... | ... | @@ -1670,7 +1681,7 @@ test "store vector with memset" { |
| 1670 | 1681 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1671 | 1682 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1672 | 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 | 1685 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1675 | 1686 | |
| 1676 | 1687 | var a: [5]@Vector(2, i1) = undefined; |
| ... | ... | @@ -1697,7 +1708,7 @@ test "store vector with memset" { |
| 1697 | 1708 | } |
| 1698 | 1709 | |
| 1699 | 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 | 1712 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1702 | 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 | 1719 | } |
| 1709 | 1720 | |
| 1710 | 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 | 1723 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1713 | 1724 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1714 | 1725 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| ... | ... | @@ -1721,6 +1732,7 @@ test "compare vectors with different element types" { |
| 1721 | 1732 | } |
| 1722 | 1733 | |
| 1723 | 1734 | test "vector pointer is indexable" { |
| 1735 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 1724 | 1736 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1725 | 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 | 1770 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1759 | 1771 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1760 | 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 | 1775 | const S = struct { |
| 1764 | 1776 | fn doTheTest() !void { |
| ... | ... | @@ -1810,7 +1822,7 @@ test "@reduce on bool vector" { |
| 1810 | 1822 | test "bitcast vector to array of smaller vectors" { |
| 1811 | 1823 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1812 | 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 | 1827 | const u8x32 = @Vector(32, u8); |
| 1816 | 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 | 21 | test "iterate over a void slice" { |
| 22 | 22 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 23 | 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 | 26 | var j: usize = 0; |
| 27 | 27 | for (times(10), 0..) |_, i| { |
test/behavior/while.zig+18-6| ... | ... | @@ -4,6 +4,7 @@ const expect = std.testing.expect; |
| 4 | 4 | const assert = std.debug.assert; |
| 5 | 5 | |
| 6 | 6 | test "while loop" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 7 | 8 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 8 | 9 | |
| 9 | 10 | var i: i32 = 0; |
| ... | ... | @@ -50,6 +51,8 @@ test "while with continue expression" { |
| 50 | 51 | } |
| 51 | 52 | |
| 52 | 53 | test "while with else" { |
| 54 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 55 | ||
| 53 | 56 | var sum: i32 = 0; |
| 54 | 57 | var i: i32 = 0; |
| 55 | 58 | var got_else: i32 = 0; |
| ... | ... | @@ -104,6 +107,7 @@ fn testBreakOuter() void { |
| 104 | 107 | } |
| 105 | 108 | |
| 106 | 109 | test "while copies its payload" { |
| 110 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 107 | 111 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 108 | 112 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 109 | 113 | |
| ... | ... | @@ -122,7 +126,7 @@ test "while copies its payload" { |
| 122 | 126 | } |
| 123 | 127 | |
| 124 | 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 | 131 | try runContinueAndBreakTest(); |
| 128 | 132 | try expect(continue_and_break_counter == 8); |
| ... | ... | @@ -142,7 +146,7 @@ fn runContinueAndBreakTest() !void { |
| 142 | 146 | } |
| 143 | 147 | |
| 144 | 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 | 150 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 147 | 151 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 148 | 152 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -156,7 +160,7 @@ test "while with optional as condition" { |
| 156 | 160 | } |
| 157 | 161 | |
| 158 | 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 | 164 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 161 | 165 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 162 | 166 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -175,7 +179,7 @@ test "while with optional as condition with else" { |
| 175 | 179 | } |
| 176 | 180 | |
| 177 | 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 | 183 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 180 | 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 | 211 | } |
| 208 | 212 | |
| 209 | 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 | 215 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 211 | 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 | 222 | } |
| 218 | 223 | |
| 219 | 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 | 226 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 221 | 227 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 222 | 228 | |
| ... | ... | @@ -255,6 +261,7 @@ fn returnWithImplicitCastFromWhileLoopTest() anyerror!void { |
| 255 | 261 | } |
| 256 | 262 | |
| 257 | 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 | 265 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 259 | 266 | |
| 260 | 267 | const result = while (returnError()) |value| { |
| ... | ... | @@ -264,6 +271,7 @@ test "while on error union with else result follow else prong" { |
| 264 | 271 | } |
| 265 | 272 | |
| 266 | 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 | 275 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 268 | 276 | |
| 269 | 277 | const result = while (returnSuccess(10)) |value| { |
| ... | ... | @@ -288,6 +296,7 @@ test "while bool 2 break statements and an else" { |
| 288 | 296 | } |
| 289 | 297 | |
| 290 | 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 | 300 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 292 | 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 | 315 | } |
| 307 | 316 | |
| 308 | 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 | 319 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 310 | 320 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 311 | 321 | |
| ... | ... | @@ -344,7 +354,7 @@ test "else continue outer while" { |
| 344 | 354 | |
| 345 | 355 | test "try terminating an infinite loop" { |
| 346 | 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 | 359 | // Test coverage for https://github.com/ziglang/zig/issues/13546 |
| 350 | 360 | const Foo = struct { |
| ... | ... | @@ -370,6 +380,7 @@ test "while loop with comptime true condition needs no else block to return valu |
| 370 | 380 | } |
| 371 | 381 | |
| 372 | 382 | test "int returned from switch in while" { |
| 383 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 373 | 384 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 374 | 385 | |
| 375 | 386 | var x: u32 = 3; |
| ... | ... | @@ -381,6 +392,7 @@ test "int returned from switch in while" { |
| 381 | 392 | } |
| 382 | 393 | |
| 383 | 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 | 396 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 385 | 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 | 414 | } |
| 403 | 415 | |
| 404 | 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 | 419 | const S = struct { |
| 408 | 420 | fn doTheTest(x: u32) !void { |
test/behavior/widening.zig+5-4| ... | ... | @@ -4,6 +4,7 @@ const mem = std.mem; |
| 4 | 4 | const builtin = @import("builtin"); |
| 5 | 5 | |
| 6 | 6 | test "integer widening" { |
| 7 | if (builtin.cpu.arch.isSpirv() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; | |
| 7 | 8 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 8 | 9 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 9 | 10 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| ... | ... | @@ -28,7 +29,7 @@ test "integer widening u0 to u8" { |
| 28 | 29 | |
| 29 | 30 | test "implicit unsigned integer to signed integer" { |
| 30 | 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 | 34 | var a: u8 = 250; |
| 34 | 35 | var b: i16 = a; |
| ... | ... | @@ -39,7 +40,7 @@ test "implicit unsigned integer to signed integer" { |
| 39 | 40 | test "float widening" { |
| 40 | 41 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 41 | 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 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 44 | 45 | |
| 45 | 46 | var a: f16 = 12.34; |
| ... | ... | @@ -58,7 +59,7 @@ test "float widening" { |
| 58 | 59 | test "float widening f16 to f128" { |
| 59 | 60 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 60 | 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 | 63 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 63 | 64 | |
| 64 | 65 | var x: f16 = 12.34; |
| ... | ... | @@ -70,7 +71,7 @@ test "float widening f16 to f128" { |
| 70 | 71 | test "cast small unsigned to larger signed" { |
| 71 | 72 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 72 | 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 | 76 | try expect(castSmallUnsignedToLargerSigned1(200) == @as(i16, 200)); |
| 76 | 77 | try expect(castSmallUnsignedToLargerSigned2(9999) == @as(i64, 9999)); |
test/src/Cases.zig+1-1| ... | ... | @@ -465,7 +465,7 @@ pub fn lowerToBuildSteps( |
| 465 | 465 | if (options.skip_non_native and !std.zig.target.isNative(&case.target.query, &case.target.result, &b.graph.host.result)) |
| 466 | 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 | 469 | if (options.skip_wasm and case.target.query.cpu_arch != null and case.target.query.cpu_arch.?.isWasm()) continue; |
| 470 | 470 | |
| 471 | 471 | if (options.skip_freebsd and case.target.query.os_tag == .freebsd) continue; |
test/tests.zig+1-1| ... | ... | @@ -2567,7 +2567,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { |
| 2567 | 2567 | if (test_target.link_libc == null and !std.os.targetRequiresLibC(target)) continue; |
| 2568 | 2568 | } |
| 2569 | 2569 | |
| 2570 | if (options.skip_spirv and target.cpu.arch.isSpirV()) continue; | |
| 2570 | if (options.skip_spirv and target.cpu.arch.isSpirv()) continue; | |
| 2571 | 2571 | if (options.skip_wasm and target.cpu.arch.isWasm()) continue; |
| 2572 | 2572 | |
| 2573 | 2573 | if (options.skip_freebsd and target.os.tag == .freebsd) continue; |