aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/math.zig
diff options
context:
space:
mode:
authorDavid Rubin <daviru007@icloud.com>2024-07-05 03:49:09 -0700
committerDavid Rubin <daviru007@icloud.com>2024-07-26 04:05:39 -0700
commit8d30fc45c424ed1aaf9067436a64b0744619c250 (patch)
tree69d6d86af25281f7d999990629305da76ff9913b /test/behavior/math.zig
parent9766b68c475438e24885dd75cf137d51e72ccfa3 (diff)
downloadzig-8d30fc45c424ed1aaf9067436a64b0744619c250.tar.gz
zig-8d30fc45c424ed1aaf9067436a64b0744619c250.zip
riscv: implement more operators
we can run `std.debug.print` now, with both run-time strings and integers!
Diffstat (limited to 'test/behavior/math.zig')
-rw-r--r--test/behavior/math.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/behavior/math.zig b/test/behavior/math.zig
index cd110bc80d..ec326acc5a 100644
--- a/test/behavior/math.zig
+++ b/test/behavior/math.zig
@@ -689,6 +689,8 @@ fn testSignedWrappingEval(x: i32) !void {
}
test "signed negation wrapping" {
+ if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
+
try testSignedNegationWrappingEval(minInt(i16));
try comptime testSignedNegationWrappingEval(minInt(i16));
}
@@ -699,6 +701,8 @@ fn testSignedNegationWrappingEval(x: i16) !void {
}
test "unsigned negation wrapping" {
+ if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
+
try testUnsignedNegationWrappingEval(1);
try comptime testUnsignedNegationWrappingEval(1);
}
@@ -725,7 +729,6 @@ fn negateWrap(comptime T: type, x: T) T {
test "unsigned 64-bit division" {
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
- if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isMIPS()) {
// https://github.com/ziglang/zig/issues/16846
@@ -838,7 +841,6 @@ test "@addWithOverflow" {
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
- if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
try testAddWithOverflow(u8, 250, 100, 94, 1);
try testAddWithOverflow(u8, 100, 150, 250, 0);
@@ -927,7 +929,6 @@ fn testMulWithOverflow(comptime T: type, a: T, b: T, mul: T, bit: u1) !void {
test "basic @mulWithOverflow" {
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
- if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
try testMulWithOverflow(u8, 86, 3, 2, 1);
try testMulWithOverflow(u8, 85, 3, 255, 0);
@@ -1330,6 +1331,8 @@ test "quad hex float literal parsing accurate" {
}
test "truncating shift left" {
+ if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
+
try testShlTrunc(maxInt(u16));
try comptime testShlTrunc(maxInt(u16));
}