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 {...@@ -76,6 +76,9 @@ fn test__subtf3(a: f128, b: f128, expected_hi: u64, expected_lo: u64) !void {
76}76}
7777
78test "subtf3" {78test "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
79 // qNaN - any = qNaN82 // qNaN - any = qNaN
80 try test__subtf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0);83 try test__subtf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0);
8184
lib/compiler_rt/divtf3_test.zig+4
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1const std = @import("std");1const std = @import("std");
2const builtin = @import("builtin");
2const math = std.math;3const math = std.math;
3const testing = std.testing;4const testing = std.testing;
45
...@@ -30,6 +31,9 @@ fn test__divtf3(a: f128, b: f128, expectedHi: u64, expectedLo: u64) !void {...@@ -30,6 +31,9 @@ fn test__divtf3(a: f128, b: f128, expectedHi: u64, expectedLo: u64) !void {
30}31}
3132
32test "divtf3" {33test "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
33 // NaN / any = NaN37 // NaN / any = NaN
34 try test__divtf3(math.nan(f128), 0x1.23456789abcdefp+5, 0x7fff800000000000, 0);38 try test__divtf3(math.nan(f128), 0x1.23456789abcdefp+5, 0x7fff800000000000, 0);
35 // inf / any(except inf and nan) = inf39 // inf / any(except inf and nan) = inf
lib/compiler_rt/float_from_int_test.zig+22
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1const std = @import("std");1const std = @import("std");
2const builtin = @import("builtin");
2const testing = std.testing;3const testing = std.testing;
3const math = std.math;4const math = std.math;
45
...@@ -125,6 +126,9 @@ fn test__floatuntisf(a: u128, expected: f32) !void {...@@ -125,6 +126,9 @@ fn test__floatuntisf(a: u128, expected: f32) !void {
125}126}
126127
127test "floattisf" {128test "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
128 try test__floattisf(0, 0.0);132 try test__floattisf(0, 0.0);
129133
130 try test__floattisf(1, 1.0);134 try test__floattisf(1, 1.0);
...@@ -171,6 +175,9 @@ test "floattisf" {...@@ -171,6 +175,9 @@ test "floattisf" {
171}175}
172176
173test "floatuntisf" {177test "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
174 try test__floatuntisf(0, 0.0);181 try test__floatuntisf(0, 0.0);
175182
176 try test__floatuntisf(1, 1.0);183 try test__floatuntisf(1, 1.0);
...@@ -367,6 +374,9 @@ fn test__floatuntidf(a: u128, expected: f64) !void {...@@ -367,6 +374,9 @@ fn test__floatuntidf(a: u128, expected: f64) !void {
367}374}
368375
369test "floattidf" {376test "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
370 try test__floattidf(0, 0.0);380 try test__floattidf(0, 0.0);
371381
372 try test__floattidf(1, 1.0);382 try test__floattidf(1, 1.0);
...@@ -437,6 +447,9 @@ test "floattidf" {...@@ -437,6 +447,9 @@ test "floattidf" {
437}447}
438448
439test "floatuntidf" {449test "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
440 try test__floatuntidf(0, 0.0);453 try test__floatuntidf(0, 0.0);
441454
442 try test__floatuntidf(1, 1.0);455 try test__floatuntidf(1, 1.0);
...@@ -582,6 +595,9 @@ test "floatditf" {...@@ -582,6 +595,9 @@ test "floatditf" {
582}595}
583596
584test "floatunditf" {597test "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
585 try test__floatunditf(0xffffffffffffffff, 0x403effffffffffff, 0xfffe000000000000);601 try test__floatunditf(0xffffffffffffffff, 0x403effffffffffff, 0xfffe000000000000);
586 try test__floatunditf(0xfffffffffffffffe, 0x403effffffffffff, 0xfffc000000000000);602 try test__floatunditf(0xfffffffffffffffe, 0x403effffffffffff, 0xfffc000000000000);
587 try test__floatunditf(0x8000000000000000, 0x403e000000000000, 0x0);603 try test__floatunditf(0x8000000000000000, 0x403e000000000000, 0x0);
...@@ -603,6 +619,9 @@ fn test__floatuntitf(a: u128, expected: f128) !void {...@@ -603,6 +619,9 @@ fn test__floatuntitf(a: u128, expected: f128) !void {
603}619}
604620
605test "floattitf" {621test "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
606 try test__floattitf(0, 0.0);625 try test__floattitf(0, 0.0);
607626
608 try test__floattitf(1, 1.0);627 try test__floattitf(1, 1.0);
...@@ -685,6 +704,9 @@ test "floattitf" {...@@ -685,6 +704,9 @@ test "floattitf" {
685}704}
686705
687test "floatuntitf" {706test "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
688 try test__floatuntitf(0, 0.0);710 try test__floatuntitf(0, 0.0);
689711
690 try test__floatuntitf(1, 1.0);712 try test__floatuntitf(1, 1.0);
lib/compiler_rt/fma.zig+3
...@@ -343,6 +343,9 @@ test "64" {...@@ -343,6 +343,9 @@ test "64" {
343}343}
344344
345test "128" {345test "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
346 const epsilon = 0.000001;349 const epsilon = 0.000001;
347350
348 try expect(math.approxEqAbs(f128, fmaq(0.0, 5.0, 9.124), 9.124, epsilon));351 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 @@...@@ -1,4 +1,5 @@
1const std = @import("std");1const std = @import("std");
2const builtin = @import("builtin");
2const fmod = @import("fmod.zig");3const fmod = @import("fmod.zig");
3const testing = std.testing;4const testing = std.testing;
45
...@@ -22,6 +23,9 @@ fn test_fmodx_infs() !void {...@@ -22,6 +23,9 @@ fn test_fmodx_infs() !void {
22}23}
2324
24test "fmodx" {25test "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
25 try test_fmodx(6.4, 4.0, 2.4);29 try test_fmodx(6.4, 4.0, 2.4);
26 try test_fmodx(6.4, -4.0, 2.4);30 try test_fmodx(6.4, -4.0, 2.4);
27 try test_fmodx(-6.4, 4.0, -2.4);31 try test_fmodx(-6.4, 4.0, -2.4);
lib/compiler_rt/mulf3_test.zig+4
...@@ -3,6 +3,7 @@...@@ -3,6 +3,7 @@
3// https://github.com/llvm/llvm-project/blob/2ffb1b0413efa9a24eb3c49e710e36f92e2cb50b/compiler-rt/test/builtins/Unit/multf3_test.c3// https://github.com/llvm/llvm-project/blob/2ffb1b0413efa9a24eb3c49e710e36f92e2cb50b/compiler-rt/test/builtins/Unit/multf3_test.c
44
5const std = @import("std");5const std = @import("std");
6const builtin = @import("builtin");
6const math = std.math;7const math = std.math;
7const qnan128: f128 = @bitCast(@as(u128, 0x7fff800000000000) << 64);8const qnan128: f128 = @bitCast(@as(u128, 0x7fff800000000000) << 64);
8const inf128: f128 = @bitCast(@as(u128, 0x7fff000000000000) << 64);9const inf128: f128 = @bitCast(@as(u128, 0x7fff000000000000) << 64);
...@@ -48,6 +49,9 @@ fn makeNaN128(rand: u64) f128 {...@@ -48,6 +49,9 @@ fn makeNaN128(rand: u64) f128 {
48 return @bitCast(int_result);49 return @bitCast(int_result);
49}50}
50test "multf3" {51test "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
51 // qNaN * any = qNaN55 // qNaN * any = qNaN
52 try test__multf3(qnan128, 0x1.23456789abcdefp+5, 0x7fff800000000000, 0x0);56 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 {...@@ -34,6 +34,9 @@ fn test__powixf2(a: f80, b: i32, expected: f80) !void {
34}34}
3535
36test "powihf2" {36test "powihf2" {
37 if (builtin.zig_backend == .stage2_x86_64 and
38 !comptime std.Target.x86.featureSetHas(builtin.cpu.features, .f16c)) return error.SkipZigTest;
39
37 const inf_f16 = math.inf(f16);40 const inf_f16 = math.inf(f16);
38 try test__powisf2(0, 0, 1);41 try test__powisf2(0, 0, 1);
39 try test__powihf2(1, 0, 1);42 try test__powihf2(1, 0, 1);
test/tests.zig+4-2
...@@ -985,7 +985,9 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {...@@ -985,7 +985,9 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
985 continue;985 continue;
986986
987 // TODO get compiler-rt tests passing for self-hosted backends.987 // 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"))
989 continue;991 continue;
990992
991 // TODO get compiler-rt tests passing for wasm32-wasi993 // TODO get compiler-rt tests passing for wasm32-wasi
...@@ -1004,7 +1006,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {...@@ -1004,7 +1006,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
10041006
1005 // TODO get std lib tests passing for other self-hosted backends.1007 // TODO get std lib tests passing for other self-hosted backends.
1006 if ((test_target.target.getCpuArch() != .x86_64 or1008 if ((test_target.target.getCpuArch() != .x86_64 or
1007 test_target.target.os_tag != .linux) and1009 test_target.target.getObjectFormat() != .elf) and
1008 test_target.use_llvm == false and mem.eql(u8, options.name, "std"))1010 test_target.use_llvm == false and mem.eql(u8, options.name, "std"))
1009 continue;1011 continue;
10101012