From a707f380a5f54b70ee7664708d83c9002de6644d Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 25 Jul 2023 21:09:17 -0700 Subject: [PATCH] llvm: disable LTO on C ABI tests This required disabling some failing tests. See #14908 --- test/c_abi/cfuncs.c | 7 +++++++ test/c_abi/main.zig | 10 ++++++++++ test/tests.zig | 9 +++------ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/test/c_abi/cfuncs.c b/test/c_abi/cfuncs.c index bdf58db335..545abdece7 100644 --- a/test/c_abi/cfuncs.c +++ b/test/c_abi/cfuncs.c @@ -20,6 +20,11 @@ static void assert_or_panic(bool ok) { # define ZIG_RISCV32 #endif +#if defined(__aarch64__) && defined(__linux__) +// TODO: https://github.com/ziglang/zig/issues/14908 +#define ZIG_BUG_14908 +#endif + #ifdef __i386__ # define ZIG_NO_I128 #endif @@ -263,8 +268,10 @@ void run_c_tests(void) { } #endif +#ifndef ZIG_BUG_14908 zig_i8(-1); zig_i16(-2); +#endif zig_i32(-3); zig_i64(-4); diff --git a/test/c_abi/main.zig b/test/c_abi/main.zig index d421f0aace..c089173945 100644 --- a/test/c_abi/main.zig +++ b/test/c_abi/main.zig @@ -813,6 +813,11 @@ extern fn c_ret_medium_vec() MediumVec; test "medium simd vector" { if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest; + if (builtin.cpu.arch == .x86_64 and builtin.os.tag == .linux) { + // TODO: https://github.com/ziglang/zig/issues/14908 + return error.SkipZigTest; + } + c_medium_vec(.{ 1, 2, 3, 4 }); var x = c_ret_medium_vec(); @@ -832,6 +837,11 @@ test "big simd vector" { if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest; if (builtin.cpu.arch == .x86_64 and builtin.os.tag == .macos and builtin.mode != .Debug) return error.SkipZigTest; + if (builtin.cpu.arch == .x86_64 and builtin.os.tag == .linux) { + // TODO: https://github.com/ziglang/zig/issues/14908 + return error.SkipZigTest; + } + c_big_vec(.{ 1, 2, 3, 4, 5, 6, 7, 8 }); var x = c_ret_big_vec(); diff --git a/test/tests.zig b/test/tests.zig index b73b5f0519..b76f7baf84 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -1133,12 +1133,9 @@ pub fn addCAbiTests(b: *std.Build, skip_non_native: bool, skip_release: bool) *S test_step.linkLibC(); test_step.addCSourceFile("test/c_abi/cfuncs.c", &.{"-std=c99"}); - // test-c-abi should test both with LTO on and with LTO off. Only - // some combinations are passing currently: - // https://github.com/ziglang/zig/issues/14908 - if (c_abi_target.isWindows()) { - test_step.want_lto = false; - } + // This test is intentionally trying to check if the external ABI is + // done properly. LTO would be a hindrance to this. + test_step.want_lto = false; const run = b.addRunArtifact(test_step); run.skip_foreign_checks = true;