From c061b3a5726f1a6cc1a6983e067312dddda94f42 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 6 Jul 2022 15:10:41 -0700 Subject: [PATCH 1/3] disable more standalone tests these are tripping LLVM 13 assertions. See #12015 See #12022 --- test/standalone.zig | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/standalone.zig b/test/standalone.zig index fe26bdc808..8eb274fa39 100644 --- a/test/standalone.zig +++ b/test/standalone.zig @@ -62,8 +62,15 @@ pub fn addCases(cases: *tests.StandaloneContext) void { cases.add("tools/process_headers.zig"); cases.add("tools/update-license-headers.zig"); cases.add("tools/update-linux-headers.zig"); - cases.add("tools/update_clang_options.zig"); + + // Disabled due to tripping LLVM 13 assertion: + // https://github.com/ziglang/zig/issues/12022 + //cases.add("tools/update_clang_options.zig"); + cases.add("tools/update_cpu_features.zig"); cases.add("tools/update_glibc.zig"); - cases.add("tools/update_spirv_features.zig"); + + // Disabled due to tripping LLVM 13 assertion: + // https://github.com/ziglang/zig/issues/12015 + //cases.add("tools/update_spirv_features.zig"); } From 4e002dde69cfe470f0f848dcf203f755b66d9f6f Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 6 Jul 2022 15:45:53 -0700 Subject: [PATCH 2/3] std: disable tests tripping LLVM assertions see #12012 --- lib/std/math.zig | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/std/math.zig b/lib/std/math.zig index de77663d5b..94a7cc7e01 100644 --- a/lib/std/math.zig +++ b/lib/std/math.zig @@ -1,3 +1,4 @@ +const builtin = @import("builtin"); const std = @import("std.zig"); const assert = std.debug.assert; const mem = std.mem; @@ -506,6 +507,12 @@ pub fn shl(comptime T: type, a: T, shift_amt: anytype) T { } test "shl" { + if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and + builtin.cpu.arch == .aarch64) + { + // https://github.com/ziglang/zig/issues/12012 + return error.SkipZigTest; + } try testing.expect(shl(u8, 0b11111111, @as(usize, 3)) == 0b11111000); try testing.expect(shl(u8, 0b11111111, @as(usize, 8)) == 0); try testing.expect(shl(u8, 0b11111111, @as(usize, 9)) == 0); @@ -546,6 +553,12 @@ pub fn shr(comptime T: type, a: T, shift_amt: anytype) T { } test "shr" { + if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and + builtin.cpu.arch == .aarch64) + { + // https://github.com/ziglang/zig/issues/12012 + return error.SkipZigTest; + } try testing.expect(shr(u8, 0b11111111, @as(usize, 3)) == 0b00011111); try testing.expect(shr(u8, 0b11111111, @as(usize, 8)) == 0); try testing.expect(shr(u8, 0b11111111, @as(usize, 9)) == 0); @@ -578,6 +591,12 @@ pub fn rotr(comptime T: type, x: T, r: anytype) T { } test "rotr" { + if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and + builtin.cpu.arch == .aarch64) + { + // https://github.com/ziglang/zig/issues/12012 + return error.SkipZigTest; + } try testing.expect(rotr(u8, 0b00000001, @as(usize, 0)) == 0b00000001); try testing.expect(rotr(u8, 0b00000001, @as(usize, 9)) == 0b10000000); try testing.expect(rotr(u8, 0b00000001, @as(usize, 8)) == 0b00000001); @@ -606,6 +625,12 @@ pub fn rotl(comptime T: type, x: T, r: anytype) T { } test "rotl" { + if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and + builtin.cpu.arch == .aarch64) + { + // https://github.com/ziglang/zig/issues/12012 + return error.SkipZigTest; + } try testing.expect(rotl(u8, 0b00000001, @as(usize, 0)) == 0b00000001); try testing.expect(rotl(u8, 0b00000001, @as(usize, 9)) == 0b00000010); try testing.expect(rotl(u8, 0b00000001, @as(usize, 8)) == 0b00000001); From f3069f51aa0e395ce9de60a2876c37042b2a1a35 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 6 Jul 2022 17:00:17 -0700 Subject: [PATCH 3/3] Sema: fix type resolution during generic function instantiation Found when trying to compile the std lib tests for x86_64-macos. --- src/Sema.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Sema.zig b/src/Sema.zig index 60d636b81e..c72a73dd11 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -6042,12 +6042,12 @@ fn instantiateGenericCall( .param_comptime, .param_anytype_comptime, .param, .param_anytype => {}, else => continue, } + const arg_src = call_src; // TODO: better source location const is_runtime = comptime_args[total_i].val.tag() == .generic_poison and comptime_args[total_i].ty.hasRuntimeBits() and - !comptime_args[total_i].ty.comptimeOnly(); + !(try sema.typeRequiresComptime(block, arg_src, comptime_args[total_i].ty)); if (is_runtime) { const param_ty = new_fn_info.param_types[runtime_i]; - const arg_src = call_src; // TODO: better source location const uncasted_arg = uncasted_args[total_i]; const casted_arg = try sema.coerce(block, param_ty, uncasted_arg, arg_src); try sema.queueFullTypeResolution(param_ty);