aboutsummaryrefslogtreecommitdiff
path: root/lib/std/math.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-10-22 12:16:35 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-10-22 12:16:35 -0700
commit6f0198cadbe29294f2bf3153a27beebd64377566 (patch)
tree99e6a8657282d9ffe09944a52c78b7e5b6949071 /lib/std/math.zig
parent9f0359d78f9facc38418e32b0e8c1bf6f99f0d26 (diff)
downloadzig-6f0198cadbe29294f2bf3153a27beebd64377566.tar.gz
zig-6f0198cadbe29294f2bf3153a27beebd64377566.zip
Revert "Merge pull request #17637 from jacobly0/x86_64-test-std"
This reverts commit 0c99ba1eab63865592bb084feb271cd4e4b0357e, reversing changes made to 5f92b070bf284f1493b1b5d433dd3adde2f46727. This caused a CI failure when it landed in master branch due to a 128-bit `@byteSwap` in std.mem.
Diffstat (limited to 'lib/std/math.zig')
-rw-r--r--lib/std/math.zig26
1 files changed, 0 insertions, 26 deletions
diff --git a/lib/std/math.zig b/lib/std/math.zig
index 57376f4d61..817a98f314 100644
--- a/lib/std/math.zig
+++ b/lib/std/math.zig
@@ -492,13 +492,10 @@ pub fn shl(comptime T: type, a: T, shift_amt: anytype) T {
}
test "shl" {
- if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
-
if (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);
@@ -539,13 +536,10 @@ pub fn shr(comptime T: type, a: T, shift_amt: anytype) T {
}
test "shr" {
- if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
-
if (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);
@@ -587,13 +581,10 @@ pub fn rotr(comptime T: type, x: T, r: anytype) T {
}
test "rotr" {
- if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
-
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
// https://github.com/ziglang/zig/issues/12012
return error.SkipZigTest;
}
-
try testing.expect(rotr(u0, 0b0, @as(usize, 3)) == 0b0);
try testing.expect(rotr(u5, 0b00001, @as(usize, 0)) == 0b00001);
try testing.expect(rotr(u6, 0b000001, @as(usize, 7)) == 0b100000);
@@ -634,13 +625,10 @@ pub fn rotl(comptime T: type, x: T, r: anytype) T {
}
test "rotl" {
- if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
-
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
// https://github.com/ziglang/zig/issues/12012
return error.SkipZigTest;
}
-
try testing.expect(rotl(u0, 0b0, @as(usize, 3)) == 0b0);
try testing.expect(rotl(u5, 0b00001, @as(usize, 0)) == 0b00001);
try testing.expect(rotl(u6, 0b000001, @as(usize, 7)) == 0b000010);
@@ -764,8 +752,6 @@ pub fn divTrunc(comptime T: type, numerator: T, denominator: T) !T {
}
test "divTrunc" {
- if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
-
try testDivTrunc();
try comptime testDivTrunc();
}
@@ -790,8 +776,6 @@ pub fn divFloor(comptime T: type, numerator: T, denominator: T) !T {
}
test "divFloor" {
- if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
-
try testDivFloor();
try comptime testDivFloor();
}
@@ -829,8 +813,6 @@ pub fn divCeil(comptime T: type, numerator: T, denominator: T) !T {
}
test "divCeil" {
- if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
-
try testDivCeil();
try comptime testDivCeil();
}
@@ -875,8 +857,6 @@ pub fn divExact(comptime T: type, numerator: T, denominator: T) !T {
}
test "divExact" {
- if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
-
try testDivExact();
try comptime testDivExact();
}
@@ -907,8 +887,6 @@ test "mod" {
try comptime testMod();
}
fn testMod() !void {
- if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
-
try testing.expect((mod(i32, -5, 3) catch unreachable) == 1);
try testing.expect((mod(i32, 5, 3) catch unreachable) == 2);
try testing.expectError(error.NegativeDenominator, mod(i32, 10, -1));
@@ -931,8 +909,6 @@ pub fn rem(comptime T: type, numerator: T, denominator: T) !T {
}
test "rem" {
- if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
-
try testRem();
try comptime testRem();
}
@@ -1285,8 +1261,6 @@ pub fn lerp(a: anytype, b: anytype, t: anytype) @TypeOf(a, b, t) {
}
test "lerp" {
- if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
-
try testing.expectEqual(@as(f64, 75), lerp(50, 100, 0.5));
try testing.expectEqual(@as(f32, 43.75), lerp(50, 25, 0.25));
try testing.expectEqual(@as(f64, -31.25), lerp(-50, 25, 0.25));