| ... | @@ -1102,6 +1102,7 @@ test "@mulWithOverflow bitsize 128 bits" { | ... | @@ -1102,6 +1102,7 @@ test "@mulWithOverflow bitsize 128 bits" { |
| 1102 | | 1102 | |
| 1103 | test "@mulWithOverflow > 128 bits" { | 1103 | test "@mulWithOverflow > 128 bits" { |
| 1104 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1104 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1105 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1105 | | 1106 | |
| 1106 | try testMulWithOverflow(u140, 0, maxInt(u140), 0, 0); | 1107 | try testMulWithOverflow(u140, 0, maxInt(u140), 0, 0); |
| 1107 | try testMulWithOverflow(u140, 1, maxInt(u140), maxInt(u140), 0); | 1108 | try testMulWithOverflow(u140, 1, maxInt(u140), maxInt(u140), 0); |
| ... | @@ -1327,6 +1328,7 @@ test "@shlWithOverflow > 64 bits" { | ... | @@ -1327,6 +1328,7 @@ test "@shlWithOverflow > 64 bits" { |
| 1327 | | 1328 | |
| 1328 | test "@shlWithOverflow > 128 bits" { | 1329 | test "@shlWithOverflow > 128 bits" { |
| 1329 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1330 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1331 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1330 | | 1332 | |
| 1331 | try testShlWithOverflow(u140, 1 << 100, 20, 1 << 120, 0); | 1333 | try testShlWithOverflow(u140, 1 << 100, 20, 1 << 120, 0); |
| 1332 | try testShlWithOverflow(u140, 1 << 100, 40, 0, 1); | 1334 | try testShlWithOverflow(u140, 1 << 100, 40, 0, 1); |
| ... | @@ -1355,6 +1357,7 @@ fn testAnd(comptime T: type, a: T, b: T, expected: T) !void { | ... | @@ -1355,6 +1357,7 @@ fn testAnd(comptime T: type, a: T, b: T, expected: T) !void { |
| 1355 | | 1357 | |
| 1356 | test "and > 128 bits" { | 1358 | test "and > 128 bits" { |
| 1357 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1359 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1360 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1358 | | 1361 | |
| 1359 | try testAnd(u140, (1 << 139) | (1 << 70) | 0xaa, (1 << 139) | (1 << 69) | 0xcc, (1 << 139) | 0x88); | 1362 | try testAnd(u140, (1 << 139) | (1 << 70) | 0xaa, (1 << 139) | (1 << 69) | 0xcc, (1 << 139) | 0x88); |
| 1360 | try testAnd(u140, maxInt(u140), 1 << 100, 1 << 100); | 1363 | 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 { | ... | @@ -1383,6 +1386,7 @@ fn testOr(comptime T: type, a: T, b: T, expected: T) !void { |
| 1383 | | 1386 | |
| 1384 | test "or > 128 bits" { | 1387 | test "or > 128 bits" { |
| 1385 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1388 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1389 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1386 | | 1390 | |
| 1387 | try testOr(u140, 0, 1 << 139, 1 << 139); | 1391 | try testOr(u140, 0, 1 << 139, 1 << 139); |
| 1388 | try testOr(u140, (1 << 70) | 0xa, (1 << 69) | 0x5, (1 << 70) | (1 << 69) | 0xf); | 1392 | 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 { | ... | @@ -1411,6 +1415,7 @@ fn testXor(comptime T: type, a: T, b: T, expected: T) !void { |
| 1411 | | 1415 | |
| 1412 | test "xor > 128 bits" { | 1416 | test "xor > 128 bits" { |
| 1413 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1417 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1418 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1414 | | 1419 | |
| 1415 | try testXor(u140, 0, maxInt(u140), maxInt(u140)); | 1420 | try testXor(u140, 0, maxInt(u140), maxInt(u140)); |
| 1416 | try testXor(u140, 1 << 139, 1 << 139, 0); | 1421 | try testXor(u140, 1 << 139, 1 << 139, 0); |
| ... | @@ -1439,6 +1444,7 @@ fn testNot(comptime T: type, a: T, expected: T) !void { | ... | @@ -1439,6 +1444,7 @@ fn testNot(comptime T: type, a: T, expected: T) !void { |
| 1439 | | 1444 | |
| 1440 | test "not > 128 bits" { | 1445 | test "not > 128 bits" { |
| 1441 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1446 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1447 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1442 | | 1448 | |
| 1443 | try testNot(u140, 0, maxInt(u140)); | 1449 | try testNot(u140, 0, maxInt(u140)); |
| 1444 | try testNot(u140, maxInt(u140), 0); | 1450 | 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 { | ... | @@ -1467,6 +1473,7 @@ fn testShl(comptime T: type, a: T, b: std.math.Log2Int(T), expected: T) !void { |
| 1467 | | 1473 | |
| 1468 | test "shl > 128 bits" { | 1474 | test "shl > 128 bits" { |
| 1469 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1475 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1476 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1470 | | 1477 | |
| 1471 | try testShl(u140, 1 << 5, 10, 1 << 15); | 1478 | try testShl(u140, 1 << 5, 10, 1 << 15); |
| 1472 | try testShl(u140, 3, 138, (1 << 139) | (1 << 138)); | 1479 | 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 { | ... | @@ -1495,6 +1502,7 @@ fn testShr(comptime T: type, a: T, b: std.math.Log2Int(T), expected: T) !void { |
| 1495 | | 1502 | |
| 1496 | test "shr > 128 bits" { | 1503 | test "shr > 128 bits" { |
| 1497 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1504 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1505 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1498 | | 1506 | |
| 1499 | try testShr(u140, 1 << 139, 39, 1 << 100); | 1507 | try testShr(u140, 1 << 139, 39, 1 << 100); |
| 1500 | try testShr(u140, (1 << 70) | 8, 3, (1 << 67) | 1); | 1508 | try testShr(u140, (1 << 70) | 8, 3, (1 << 67) | 1); |
| ... | @@ -1523,6 +1531,7 @@ fn testClz(comptime T: type, a: T, expected: u16) !void { | ... | @@ -1523,6 +1531,7 @@ fn testClz(comptime T: type, a: T, expected: u16) !void { |
| 1523 | | 1531 | |
| 1524 | test "@clz > 128 bits" { | 1532 | test "@clz > 128 bits" { |
| 1525 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1533 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1534 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1526 | | 1535 | |
| 1527 | try testClz(u140, 0, 140); | 1536 | try testClz(u140, 0, 140); |
| 1528 | try testClz(u140, 1 << 139, 0); | 1537 | try testClz(u140, 1 << 139, 0); |
| ... | @@ -1551,6 +1560,7 @@ fn testCtz(comptime T: type, a: T, expected: u16) !void { | ... | @@ -1551,6 +1560,7 @@ fn testCtz(comptime T: type, a: T, expected: u16) !void { |
| 1551 | | 1560 | |
| 1552 | test "@ctz > 128 bits" { | 1561 | test "@ctz > 128 bits" { |
| 1553 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1562 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1563 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1554 | | 1564 | |
| 1555 | try testCtz(u140, 0, 140); | 1565 | try testCtz(u140, 0, 140); |
| 1556 | try testCtz(u140, 1 << 139, 139); | 1566 | try testCtz(u140, 1 << 139, 139); |
| ... | @@ -1579,6 +1589,7 @@ fn testPopCount(comptime T: type, a: T, expected: u16) !void { | ... | @@ -1579,6 +1589,7 @@ fn testPopCount(comptime T: type, a: T, expected: u16) !void { |
| 1579 | | 1589 | |
| 1580 | test "@popCount > 128 bits" { | 1590 | test "@popCount > 128 bits" { |
| 1581 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1591 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1592 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1582 | | 1593 | |
| 1583 | try testPopCount(u140, 0, 0); | 1594 | try testPopCount(u140, 0, 0); |
| 1584 | try testPopCount(u140, maxInt(u140), 140); | 1595 | try testPopCount(u140, maxInt(u140), 140); |
| ... | @@ -1607,6 +1618,7 @@ fn testBitReverse(comptime T: type, a: T, expected: T) !void { | ... | @@ -1607,6 +1618,7 @@ fn testBitReverse(comptime T: type, a: T, expected: T) !void { |
| 1607 | | 1618 | |
| 1608 | test "@bitReverse > 128 bits" { | 1619 | test "@bitReverse > 128 bits" { |
| 1609 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1620 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1621 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1610 | | 1622 | |
| 1611 | try testBitReverse(u140, 1 << 139, 1); | 1623 | try testBitReverse(u140, 1 << 139, 1); |
| 1612 | try testBitReverse(u140, 1 << 70, 1 << 69); | 1624 | try testBitReverse(u140, 1 << 70, 1 << 69); |
| ... | @@ -1635,6 +1647,7 @@ fn testByteSwap(comptime T: type, a: T, expected: T) !void { | ... | @@ -1635,6 +1647,7 @@ fn testByteSwap(comptime T: type, a: T, expected: T) !void { |
| 1635 | | 1647 | |
| 1636 | test "@byteSwap > 128 bits" { | 1648 | test "@byteSwap > 128 bits" { |
| 1637 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1649 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1650 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1638 | | 1651 | |
| 1639 | try testByteSwap(u144, 1 << 136, 1); | 1652 | try testByteSwap(u144, 1 << 136, 1); |
| 1640 | try testByteSwap(u144, 1, 1 << 136); | 1653 | try testByteSwap(u144, 1, 1 << 136); |
| ... | @@ -1663,6 +1676,7 @@ fn testMax(comptime T: type, a: T, b: T, expected: T) !void { | ... | @@ -1663,6 +1676,7 @@ fn testMax(comptime T: type, a: T, b: T, expected: T) !void { |
| 1663 | | 1676 | |
| 1664 | test "@max > 128 bits" { | 1677 | test "@max > 128 bits" { |
| 1665 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1678 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1679 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1666 | | 1680 | |
| 1667 | try testMax(u140, 0, maxInt(u140), maxInt(u140)); | 1681 | try testMax(u140, 0, maxInt(u140), maxInt(u140)); |
| 1668 | try testMax(u140, 1 << 139, 1 << 138, 1 << 139); | 1682 | 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 { | ... | @@ -1691,6 +1705,7 @@ fn testMin(comptime T: type, a: T, b: T, expected: T) !void { |
| 1691 | | 1705 | |
| 1692 | test "@min > 128 bits" { | 1706 | test "@min > 128 bits" { |
| 1693 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1707 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1708 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1694 | | 1709 | |
| 1695 | try testMin(u140, 0, maxInt(u140), 0); | 1710 | try testMin(u140, 0, maxInt(u140), 0); |
| 1696 | try testMin(u140, 1 << 139, 1 << 138, 1 << 138); | 1711 | try testMin(u140, 1 << 139, 1 << 138, 1 << 138); |
| ... | @@ -1719,6 +1734,7 @@ fn testAbs(comptime T: type, a: T, expected: anytype) !void { | ... | @@ -1719,6 +1734,7 @@ fn testAbs(comptime T: type, a: T, expected: anytype) !void { |
| 1719 | | 1734 | |
| 1720 | test "@abs > 128 bits" { | 1735 | test "@abs > 128 bits" { |
| 1721 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1736 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1737 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1722 | | 1738 | |
| 1723 | try testAbs(u140, 0, 0); | 1739 | try testAbs(u140, 0, 0); |
| 1724 | try testAbs(u140, 1 << 139, 1 << 139); | 1740 | try testAbs(u140, 1 << 139, 1 << 139); |
| ... | @@ -1742,6 +1758,7 @@ fn testRem(comptime T: type, numerator: T, denominator: T, expected: T) !void { | ... | @@ -1742,6 +1758,7 @@ fn testRem(comptime T: type, numerator: T, denominator: T, expected: T) !void { |
| 1742 | | 1758 | |
| 1743 | test "@rem > 128 bits" { | 1759 | test "@rem > 128 bits" { |
| 1744 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1760 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1761 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1745 | | 1762 | |
| 1746 | try testRem(u140, 0, maxInt(u140), 0); | 1763 | try testRem(u140, 0, maxInt(u140), 0); |
| 1747 | try testRem(u140, maxInt(u140), maxInt(u140), 0); | 1764 | try testRem(u140, maxInt(u140), maxInt(u140), 0); |
| ... | @@ -1768,7 +1785,7 @@ fn testMod(comptime T: type, numerator: T, denominator: T, expected: T) !void { | ... | @@ -1768,7 +1785,7 @@ fn testMod(comptime T: type, numerator: T, denominator: T, expected: T) !void { |
| 1768 | | 1785 | |
| 1769 | test "@mod > 128 bits" { | 1786 | test "@mod > 128 bits" { |
| 1770 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1787 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 1771 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | 1788 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1772 | | 1789 | |
| 1773 | try testMod(u140, 0, maxInt(u140), 0); | 1790 | try testMod(u140, 0, maxInt(u140), 0); |
| 1774 | try testMod(u140, maxInt(u140), maxInt(u140), 0); | 1791 | try testMod(u140, maxInt(u140), maxInt(u140), 0); |
| ... | @@ -1795,6 +1812,7 @@ fn testDivFloor(comptime T: type, numerator: T, denominator: T, expected: T) !vo | ... | @@ -1795,6 +1812,7 @@ fn testDivFloor(comptime T: type, numerator: T, denominator: T, expected: T) !vo |
| 1795 | | 1812 | |
| 1796 | test "@divFloor > 128 bits" { | 1813 | test "@divFloor > 128 bits" { |
| 1797 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1814 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1815 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1798 | | 1816 | |
| 1799 | try testDivFloor(u140, 0, maxInt(u140), 0); | 1817 | try testDivFloor(u140, 0, maxInt(u140), 0); |
| 1800 | try testDivFloor(u140, maxInt(u140), maxInt(u140), 1); | 1818 | try testDivFloor(u140, maxInt(u140), maxInt(u140), 1); |
| ... | @@ -1822,6 +1840,7 @@ fn testDivTrunc(comptime T: type, numerator: T, denominator: T, expected: T) !vo | ... | @@ -1822,6 +1840,7 @@ fn testDivTrunc(comptime T: type, numerator: T, denominator: T, expected: T) !vo |
| 1822 | | 1840 | |
| 1823 | test "@divTrunc > 128 bits" { | 1841 | test "@divTrunc > 128 bits" { |
| 1824 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 1842 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 1843 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1825 | | 1844 | |
| 1826 | try testDivTrunc(u140, 0, maxInt(u140), 0); | 1845 | try testDivTrunc(u140, 0, maxInt(u140), 0); |
| 1827 | try testDivTrunc(u140, maxInt(u140), maxInt(u140), 1); | 1846 | try testDivTrunc(u140, maxInt(u140), maxInt(u140), 1); |