1const builtin = @import("builtin");
2const std = @import("std");
3
4const c = std.c;
5const testing = std.testing;
6
7test "imaxabs" {
8 const val: c.intmax_t = -10;
9 try testing.expectEqual(10, c.imaxabs(val));
10}
11
12test "imaxdiv" {
13 if (builtin.target.cpu.arch.isPowerPC32()) return error.SkipZigTest; // TODO
14 if (builtin.target.cpu.arch == .s390x) return error.SkipZigTest; // TODO
15
16 const expected: c.imaxdiv_t = .{ .quot = 9, .rem = 0 };
17 try testing.expectEqual(expected, c.imaxdiv(9, 1));
18}