authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-10-20 17:52:34-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-10-21 10:55:41-04:00
log70c8e7f91dcfdc908bcb41311b24cb2e150182d0
treeb9db9bc2814383a2931175f13a7c514dcafe1438
parent32e85d44eb72122d174de02d4020f149026dd787

x86_64: disable failing tests, enable test-compiler-rt testing


8 files changed, 47 insertions(+), 2 deletions(-)

lib/compiler_rt/addf3_test.zig+3
......@@ -76,6 +76,9 @@ fn test__subtf3(a: f128, b: f128, expected_hi: u64, expected_lo: u64) !void {
7676}
7777
7878test "subtf3" {
79 if (builtin.zig_backend == .stage2_x86_64 and
80 !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
81
7982 // qNaN - any = qNaN
8083 try test__subtf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0);
8184
lib/compiler_rt/divtf3_test.zig+4
......@@ -1,4 +1,5 @@
11const std = @import("std");
2const builtin = @import("builtin");
23const math = std.math;
34const testing = std.testing;
45
......@@ -30,6 +31,9 @@ fn test__divtf3(a: f128, b: f128, expectedHi: u64, expectedLo: u64) !void {
3031}
3132
3233test "divtf3" {
34 if (builtin.zig_backend == .stage2_x86_64 and
35 !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
36
3337 // NaN / any = NaN
3438 try test__divtf3(math.nan(f128), 0x1.23456789abcdefp+5, 0x7fff800000000000, 0);
3539 // inf / any(except inf and nan) = inf
lib/compiler_rt/float_from_int_test.zig+22
......@@ -1,4 +1,5 @@
11const std = @import("std");
2const builtin = @import("builtin");
23const testing = std.testing;
34const math = std.math;
45
......@@ -125,6 +126,9 @@ fn test__floatuntisf(a: u128, expected: f32) !void {
125126}
126127
127128test "floattisf" {
129 if (builtin.zig_backend == .stage2_x86_64 and
130 !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
131
128132 try test__floattisf(0, 0.0);
129133
130134 try test__floattisf(1, 1.0);
......@@ -171,6 +175,9 @@ test "floattisf" {
171175}
172176
173177test "floatuntisf" {
178 if (builtin.zig_backend == .stage2_x86_64 and
179 !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
180
174181 try test__floatuntisf(0, 0.0);
175182
176183 try test__floatuntisf(1, 1.0);
......@@ -367,6 +374,9 @@ fn test__floatuntidf(a: u128, expected: f64) !void {
367374}
368375
369376test "floattidf" {
377 if (builtin.zig_backend == .stage2_x86_64 and
378 !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
379
370380 try test__floattidf(0, 0.0);
371381
372382 try test__floattidf(1, 1.0);
......@@ -437,6 +447,9 @@ test "floattidf" {
437447}
438448
439449test "floatuntidf" {
450 if (builtin.zig_backend == .stage2_x86_64 and
451 !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
452
440453 try test__floatuntidf(0, 0.0);
441454
442455 try test__floatuntidf(1, 1.0);
......@@ -582,6 +595,9 @@ test "floatditf" {
582595}
583596
584597test "floatunditf" {
598 if (builtin.zig_backend == .stage2_x86_64 and
599 !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
600
585601 try test__floatunditf(0xffffffffffffffff, 0x403effffffffffff, 0xfffe000000000000);
586602 try test__floatunditf(0xfffffffffffffffe, 0x403effffffffffff, 0xfffc000000000000);
587603 try test__floatunditf(0x8000000000000000, 0x403e000000000000, 0x0);
......@@ -603,6 +619,9 @@ fn test__floatuntitf(a: u128, expected: f128) !void {
603619}
604620
605621test "floattitf" {
622 if (builtin.zig_backend == .stage2_x86_64 and
623 !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
624
606625 try test__floattitf(0, 0.0);
607626
608627 try test__floattitf(1, 1.0);
......@@ -685,6 +704,9 @@ test "floattitf" {
685704}
686705
687706test "floatuntitf" {
707 if (builtin.zig_backend == .stage2_x86_64 and
708 !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
709
688710 try test__floatuntitf(0, 0.0);
689711
690712 try test__floatuntitf(1, 1.0);
lib/compiler_rt/fma.zig+3
......@@ -343,6 +343,9 @@ test "64" {
343343}
344344
345345test "128" {
346 if (builtin.zig_backend == .stage2_x86_64 and
347 !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
348
346349 const epsilon = 0.000001;
347350
348351 try expect(math.approxEqAbs(f128, fmaq(0.0, 5.0, 9.124), 9.124, epsilon));
lib/compiler_rt/fmodx_test.zig+4
......@@ -1,4 +1,5 @@
11const std = @import("std");
2const builtin = @import("builtin");
23const fmod = @import("fmod.zig");
34const testing = std.testing;
45
......@@ -22,6 +23,9 @@ fn test_fmodx_infs() !void {
2223}
2324
2425test "fmodx" {
26 if (builtin.zig_backend == .stage2_x86_64 and
27 !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
28
2529 try test_fmodx(6.4, 4.0, 2.4);
2630 try test_fmodx(6.4, -4.0, 2.4);
2731 try test_fmodx(-6.4, 4.0, -2.4);
lib/compiler_rt/mulf3_test.zig+4
......@@ -3,6 +3,7 @@
33// https://github.com/llvm/llvm-project/blob/2ffb1b0413efa9a24eb3c49e710e36f92e2cb50b/compiler-rt/test/builtins/Unit/multf3_test.c
44
55const std = @import("std");
6const builtin = @import("builtin");
67const math = std.math;
78const qnan128: f128 = @bitCast(@as(u128, 0x7fff800000000000) << 64);
89const inf128: f128 = @bitCast(@as(u128, 0x7fff000000000000) << 64);
......@@ -48,6 +49,9 @@ fn makeNaN128(rand: u64) f128 {
4849 return @bitCast(int_result);
4950}
5051test "multf3" {
52 if (builtin.zig_backend == .stage2_x86_64 and
53 !comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .bmi, .lzcnt })) return error.SkipZigTest;
54
5155 // qNaN * any = qNaN
5256 try test__multf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0);
5357
lib/compiler_rt/powiXf2_test.zig+3
......@@ -34,6 +34,9 @@ fn test__powixf2(a: f80, b: i32, expected: f80) !void {
3434}
3535
3636test "powihf2" {
37 if (builtin.zig_backend == .stage2_x86_64 and
38 !comptime std.Target.x86.featureSetHas(builtin.cpu.features, .f16c)) return error.SkipZigTest;
39
3740 const inf_f16 = math.inf(f16);
3841 try test__powisf2(0, 0, 1);
3942 try test__powihf2(1, 0, 1);
test/tests.zig+4-2
......@@ -985,7 +985,9 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
985985 continue;
986986
987987 // TODO get compiler-rt tests passing for self-hosted backends.
988 if (test_target.use_llvm == false and mem.eql(u8, options.name, "compiler-rt"))
988 if ((test_target.target.getCpuArch() != .x86_64 or
989 test_target.target.getObjectFormat() != .elf) and
990 test_target.use_llvm == false and mem.eql(u8, options.name, "compiler-rt"))
989991 continue;
990992
991993 // TODO get compiler-rt tests passing for wasm32-wasi
......@@ -1004,7 +1006,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
10041006
10051007 // TODO get std lib tests passing for other self-hosted backends.
10061008 if ((test_target.target.getCpuArch() != .x86_64 or
1007 test_target.target.os_tag != .linux) and
1009 test_target.target.getObjectFormat() != .elf) and
10081010 test_target.use_llvm == false and mem.eql(u8, options.name, "std"))
10091011 continue;
10101012