authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-25 21:09:17-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-26 11:07:11-07:00
loga707f380a5f54b70ee7664708d83c9002de6644d
treefc8a7aa3b0c50566c50360256d590539bbf72439
parentf821543e4b5e44b2ca3217c189272105fc3effb9

llvm: disable LTO on C ABI tests

This required disabling some failing tests. See #14908

3 files changed, 20 insertions(+), 6 deletions(-)

test/c_abi/cfuncs.c+7
...@@ -20,6 +20,11 @@ static void assert_or_panic(bool ok) {...@@ -20,6 +20,11 @@ static void assert_or_panic(bool ok) {
20# define ZIG_RISCV3220# define ZIG_RISCV32
21#endif21#endif
2222
23#if defined(__aarch64__) && defined(__linux__)
24// TODO: https://github.com/ziglang/zig/issues/14908
25#define ZIG_BUG_14908
26#endif
27
23#ifdef __i386__28#ifdef __i386__
24# define ZIG_NO_I12829# define ZIG_NO_I128
25#endif30#endif
...@@ -263,8 +268,10 @@ void run_c_tests(void) {...@@ -263,8 +268,10 @@ void run_c_tests(void) {
263 }268 }
264#endif269#endif
265270
271#ifndef ZIG_BUG_14908
266 zig_i8(-1);272 zig_i8(-1);
267 zig_i16(-2);273 zig_i16(-2);
274#endif
268 zig_i32(-3);275 zig_i32(-3);
269 zig_i64(-4);276 zig_i64(-4);
270277
test/c_abi/main.zig+10
...@@ -813,6 +813,11 @@ extern fn c_ret_medium_vec() MediumVec;...@@ -813,6 +813,11 @@ extern fn c_ret_medium_vec() MediumVec;
813test "medium simd vector" {813test "medium simd vector" {
814 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;814 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;
815815
816 if (builtin.cpu.arch == .x86_64 and builtin.os.tag == .linux) {
817 // TODO: https://github.com/ziglang/zig/issues/14908
818 return error.SkipZigTest;
819 }
820
816 c_medium_vec(.{ 1, 2, 3, 4 });821 c_medium_vec(.{ 1, 2, 3, 4 });
817822
818 var x = c_ret_medium_vec();823 var x = c_ret_medium_vec();
...@@ -832,6 +837,11 @@ test "big simd vector" {...@@ -832,6 +837,11 @@ test "big simd vector" {
832 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;837 if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest;
833 if (builtin.cpu.arch == .x86_64 and builtin.os.tag == .macos and builtin.mode != .Debug) return error.SkipZigTest;838 if (builtin.cpu.arch == .x86_64 and builtin.os.tag == .macos and builtin.mode != .Debug) return error.SkipZigTest;
834839
840 if (builtin.cpu.arch == .x86_64 and builtin.os.tag == .linux) {
841 // TODO: https://github.com/ziglang/zig/issues/14908
842 return error.SkipZigTest;
843 }
844
835 c_big_vec(.{ 1, 2, 3, 4, 5, 6, 7, 8 });845 c_big_vec(.{ 1, 2, 3, 4, 5, 6, 7, 8 });
836846
837 var x = c_ret_big_vec();847 var x = c_ret_big_vec();
test/tests.zig+3-6
...@@ -1133,12 +1133,9 @@ pub fn addCAbiTests(b: *std.Build, skip_non_native: bool, skip_release: bool) *S...@@ -1133,12 +1133,9 @@ pub fn addCAbiTests(b: *std.Build, skip_non_native: bool, skip_release: bool) *S
1133 test_step.linkLibC();1133 test_step.linkLibC();
1134 test_step.addCSourceFile("test/c_abi/cfuncs.c", &.{"-std=c99"});1134 test_step.addCSourceFile("test/c_abi/cfuncs.c", &.{"-std=c99"});
11351135
1136 // test-c-abi should test both with LTO on and with LTO off. Only1136 // This test is intentionally trying to check if the external ABI is
1137 // some combinations are passing currently:1137 // done properly. LTO would be a hindrance to this.
1138 // https://github.com/ziglang/zig/issues/149081138 test_step.want_lto = false;
1139 if (c_abi_target.isWindows()) {
1140 test_step.want_lto = false;
1141 }
11421139
1143 const run = b.addRunArtifact(test_step);1140 const run = b.addRunArtifact(test_step);
1144 run.skip_foreign_checks = true;1141 run.skip_foreign_checks = true;