aboutsummaryrefslogtreecommitdiff
path: root/std/math.zig
diff options
context:
space:
mode:
Diffstat (limited to 'std/math.zig')
-rw-r--r--std/math.zig12
1 files changed, 5 insertions, 7 deletions
diff --git a/std/math.zig b/std/math.zig
index 49396ca25d..cc2eb44795 100644
--- a/std/math.zig
+++ b/std/math.zig
@@ -71,15 +71,13 @@ fn getReturnTypeForAbs(comptime T: type) -> type {
fn testMath() {
@setFnTest(this);
+ testMathImpl();
+ comptime testMathImpl();
+}
+
+fn testMathImpl() {
assert(%%mulOverflow(i32, 3, 4) == 12);
assert(%%addOverflow(i32, 3, 4) == 7);
assert(%%subOverflow(i32, 3, 4) == -1);
assert(%%shlOverflow(i32, 0b11, 4) == 0b110000);
-
- comptime {
- assert(%%mulOverflow(i32, 3, 4) == 12);
- assert(%%addOverflow(i32, 3, 4) == 7);
- assert(%%subOverflow(i32, 3, 4) == -1);
- assert(%%shlOverflow(i32, 0b11, 4) == 0b110000);
- }
}