mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-26 13:01:34 +03:00
test: skip .stage2_c for > 128 bits tests + remove skip for x86_64
This commit is contained in:
@@ -129,6 +129,7 @@ fn testIntFromFloat(comptime F: type, f: F, comptime I: type, i: I) !void {
|
||||
test "@intFromFloat > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testIntFromFloat(f16, 1024, u140, 1024);
|
||||
try testIntFromFloat(f16, -1024, i140, -1024);
|
||||
@@ -153,6 +154,7 @@ fn testFloatFromInt(comptime I: type, i: I, comptime F: type, expected: F) !void
|
||||
test "@floatFromInt > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testFloatFromInt(u140, 1024, f16, 1024);
|
||||
try testFloatFromInt(i140, -1024, f16, -1024);
|
||||
|
||||
@@ -169,6 +169,7 @@ test "@intCast <= 64 bits" {
|
||||
|
||||
test "@intCast > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testIntCast(u8, 123, u140, 123);
|
||||
try testIntCast(u64, 1 << 63, u140, 1 << 63);
|
||||
|
||||
+20
-1
@@ -1102,6 +1102,7 @@ test "@mulWithOverflow bitsize 128 bits" {
|
||||
|
||||
test "@mulWithOverflow > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testMulWithOverflow(u140, 0, maxInt(u140), 0, 0);
|
||||
try testMulWithOverflow(u140, 1, maxInt(u140), maxInt(u140), 0);
|
||||
@@ -1327,6 +1328,7 @@ test "@shlWithOverflow > 64 bits" {
|
||||
|
||||
test "@shlWithOverflow > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testShlWithOverflow(u140, 1 << 100, 20, 1 << 120, 0);
|
||||
try testShlWithOverflow(u140, 1 << 100, 40, 0, 1);
|
||||
@@ -1355,6 +1357,7 @@ fn testAnd(comptime T: type, a: T, b: T, expected: T) !void {
|
||||
|
||||
test "and > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testAnd(u140, (1 << 139) | (1 << 70) | 0xaa, (1 << 139) | (1 << 69) | 0xcc, (1 << 139) | 0x88);
|
||||
try testAnd(u140, maxInt(u140), 1 << 100, 1 << 100);
|
||||
@@ -1383,6 +1386,7 @@ fn testOr(comptime T: type, a: T, b: T, expected: T) !void {
|
||||
|
||||
test "or > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testOr(u140, 0, 1 << 139, 1 << 139);
|
||||
try testOr(u140, (1 << 70) | 0xa, (1 << 69) | 0x5, (1 << 70) | (1 << 69) | 0xf);
|
||||
@@ -1411,6 +1415,7 @@ fn testXor(comptime T: type, a: T, b: T, expected: T) !void {
|
||||
|
||||
test "xor > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testXor(u140, 0, maxInt(u140), maxInt(u140));
|
||||
try testXor(u140, 1 << 139, 1 << 139, 0);
|
||||
@@ -1439,6 +1444,7 @@ fn testNot(comptime T: type, a: T, expected: T) !void {
|
||||
|
||||
test "not > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testNot(u140, 0, maxInt(u140));
|
||||
try testNot(u140, maxInt(u140), 0);
|
||||
@@ -1467,6 +1473,7 @@ fn testShl(comptime T: type, a: T, b: std.math.Log2Int(T), expected: T) !void {
|
||||
|
||||
test "shl > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testShl(u140, 1 << 5, 10, 1 << 15);
|
||||
try testShl(u140, 3, 138, (1 << 139) | (1 << 138));
|
||||
@@ -1495,6 +1502,7 @@ fn testShr(comptime T: type, a: T, b: std.math.Log2Int(T), expected: T) !void {
|
||||
|
||||
test "shr > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testShr(u140, 1 << 139, 39, 1 << 100);
|
||||
try testShr(u140, (1 << 70) | 8, 3, (1 << 67) | 1);
|
||||
@@ -1523,6 +1531,7 @@ fn testClz(comptime T: type, a: T, expected: u16) !void {
|
||||
|
||||
test "@clz > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testClz(u140, 0, 140);
|
||||
try testClz(u140, 1 << 139, 0);
|
||||
@@ -1551,6 +1560,7 @@ fn testCtz(comptime T: type, a: T, expected: u16) !void {
|
||||
|
||||
test "@ctz > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testCtz(u140, 0, 140);
|
||||
try testCtz(u140, 1 << 139, 139);
|
||||
@@ -1579,6 +1589,7 @@ fn testPopCount(comptime T: type, a: T, expected: u16) !void {
|
||||
|
||||
test "@popCount > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testPopCount(u140, 0, 0);
|
||||
try testPopCount(u140, maxInt(u140), 140);
|
||||
@@ -1607,6 +1618,7 @@ fn testBitReverse(comptime T: type, a: T, expected: T) !void {
|
||||
|
||||
test "@bitReverse > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testBitReverse(u140, 1 << 139, 1);
|
||||
try testBitReverse(u140, 1 << 70, 1 << 69);
|
||||
@@ -1635,6 +1647,7 @@ fn testByteSwap(comptime T: type, a: T, expected: T) !void {
|
||||
|
||||
test "@byteSwap > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testByteSwap(u144, 1 << 136, 1);
|
||||
try testByteSwap(u144, 1, 1 << 136);
|
||||
@@ -1663,6 +1676,7 @@ fn testMax(comptime T: type, a: T, b: T, expected: T) !void {
|
||||
|
||||
test "@max > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testMax(u140, 0, maxInt(u140), maxInt(u140));
|
||||
try testMax(u140, 1 << 139, 1 << 138, 1 << 139);
|
||||
@@ -1691,6 +1705,7 @@ fn testMin(comptime T: type, a: T, b: T, expected: T) !void {
|
||||
|
||||
test "@min > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testMin(u140, 0, maxInt(u140), 0);
|
||||
try testMin(u140, 1 << 139, 1 << 138, 1 << 138);
|
||||
@@ -1719,6 +1734,7 @@ fn testAbs(comptime T: type, a: T, expected: anytype) !void {
|
||||
|
||||
test "@abs > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testAbs(u140, 0, 0);
|
||||
try testAbs(u140, 1 << 139, 1 << 139);
|
||||
@@ -1742,6 +1758,7 @@ fn testRem(comptime T: type, numerator: T, denominator: T, expected: T) !void {
|
||||
|
||||
test "@rem > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testRem(u140, 0, maxInt(u140), 0);
|
||||
try testRem(u140, maxInt(u140), maxInt(u140), 0);
|
||||
@@ -1768,7 +1785,7 @@ fn testMod(comptime T: type, numerator: T, denominator: T, expected: T) !void {
|
||||
|
||||
test "@mod > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testMod(u140, 0, maxInt(u140), 0);
|
||||
try testMod(u140, maxInt(u140), maxInt(u140), 0);
|
||||
@@ -1795,6 +1812,7 @@ fn testDivFloor(comptime T: type, numerator: T, denominator: T, expected: T) !vo
|
||||
|
||||
test "@divFloor > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testDivFloor(u140, 0, maxInt(u140), 0);
|
||||
try testDivFloor(u140, maxInt(u140), maxInt(u140), 1);
|
||||
@@ -1822,6 +1840,7 @@ fn testDivTrunc(comptime T: type, numerator: T, denominator: T, expected: T) !vo
|
||||
|
||||
test "@divTrunc > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testDivTrunc(u140, 0, maxInt(u140), 0);
|
||||
try testDivTrunc(u140, maxInt(u140), maxInt(u140), 1);
|
||||
|
||||
@@ -370,6 +370,7 @@ test "saturating shl uses the LHS type" {
|
||||
|
||||
test "sat add > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testSatAdd(u140, 0, 0, 0);
|
||||
try testSatAdd(u140, maxInt(u140), 1, maxInt(u140));
|
||||
@@ -384,6 +385,7 @@ test "sat add > 128 bits" {
|
||||
|
||||
test "sat sub > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testSatSub(u140, 0, 1, 0);
|
||||
try testSatSub(u140, maxInt(u140), maxInt(u140), 0);
|
||||
@@ -398,6 +400,7 @@ test "sat sub > 128 bits" {
|
||||
|
||||
test "sat mul > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testSatMul(u140, 0, maxInt(u140), 0);
|
||||
try testSatMul(u140, 1 << 70, 1 << 69, 1 << 139);
|
||||
@@ -412,6 +415,7 @@ test "sat mul > 128 bits" {
|
||||
|
||||
test "sat shl > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testSatShl(u140, 0, u8, 17, 0);
|
||||
try testSatShl(u140, 1 << 100, u8, 20, 1 << 120);
|
||||
|
||||
@@ -74,6 +74,7 @@ fn testTruncate(comptime S: type, a: S, comptime D: type, expected: D) !void {
|
||||
|
||||
test "@truncate > 128 bits" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
|
||||
|
||||
try testTruncate(u140, 0, u128, 0);
|
||||
try testTruncate(u140, maxInt(u140), u128, maxInt(u128));
|
||||
|
||||
Reference in New Issue
Block a user