| author | |
| committer | |
| log | d1705baa749a696132e272974858fef8273614ff |
| tree | c5ef1538c0bfa2bb37382c979ee90a3a881a584e |
| parent | 40e77dad836abf130bf49af1838d108f0fc2e94e |
| signature |
* fix libc prototypes of offsets to have correct integer sizes and
signedness. This gets all behavior tests to pass for
armv8-linux-musleabihf
* fix linux mmap syscall to have correct integer size and signedness
for offset
* disable failing armv8-linux-musleabihf std lib tests. See 3289. I
suspect compiler-rt issue. Note these tests fail with this target
triple regardless of whether musl is actually linked (-lc).16 files changed, 115 insertions(+), 19 deletions(-)
std/c.zig+3-3| ... | @@ -70,13 +70,13 @@ pub extern "c" fn raise(sig: c_int) c_int; | ... | @@ -70,13 +70,13 @@ pub extern "c" fn raise(sig: c_int) c_int; |
| 70 | pub extern "c" fn read(fd: fd_t, buf: [*]u8, nbyte: usize) isize; | 70 | pub extern "c" fn read(fd: fd_t, buf: [*]u8, nbyte: usize) isize; |
| 71 | pub extern "c" fn readv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint) isize; | 71 | pub extern "c" fn readv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint) isize; |
| 72 | pub extern "c" fn pread(fd: fd_t, buf: [*]u8, nbyte: usize, offset: u64) isize; | 72 | pub extern "c" fn pread(fd: fd_t, buf: [*]u8, nbyte: usize, offset: u64) isize; |
| 73 | pub extern "c" fn preadv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint, offset: usize) isize; | 73 | pub extern "c" fn preadv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint, offset: u64) isize; |
| 74 | pub extern "c" fn writev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint) isize; | 74 | pub extern "c" fn writev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint) isize; |
| 75 | pub extern "c" fn pwritev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: usize) isize; | 75 | pub extern "c" fn pwritev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: u64) isize; |
| 76 | pub extern "c" fn stat(noalias path: [*]const u8, noalias buf: *Stat) c_int; | 76 | pub extern "c" fn stat(noalias path: [*]const u8, noalias buf: *Stat) c_int; |
| 77 | pub extern "c" fn write(fd: fd_t, buf: [*]const u8, nbyte: usize) isize; | 77 | pub extern "c" fn write(fd: fd_t, buf: [*]const u8, nbyte: usize) isize; |
| 78 | pub extern "c" fn pwrite(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: u64) isize; | 78 | pub extern "c" fn pwrite(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: u64) isize; |
| 79 | pub extern "c" fn mmap(addr: ?*align(page_size) c_void, len: usize, prot: c_uint, flags: c_uint, fd: fd_t, offset: isize) *c_void; | 79 | pub extern "c" fn mmap(addr: ?*align(page_size) c_void, len: usize, prot: c_uint, flags: c_uint, fd: fd_t, offset: u64) *c_void; |
| 80 | pub extern "c" fn munmap(addr: *align(page_size) c_void, len: usize) c_int; | 80 | pub extern "c" fn munmap(addr: *align(page_size) c_void, len: usize) c_int; |
| 81 | pub extern "c" fn mprotect(addr: *align(page_size) c_void, len: usize, prot: c_uint) c_int; | 81 | pub extern "c" fn mprotect(addr: *align(page_size) c_void, len: usize, prot: c_uint) c_int; |
| 82 | pub extern "c" fn unlink(path: [*]const u8) c_int; | 82 | pub extern "c" fn unlink(path: [*]const u8) c_int; |
std/fmt.zig+24| ... | @@ -1233,6 +1233,10 @@ test "cstr" { | ... | @@ -1233,6 +1233,10 @@ test "cstr" { |
| 1233 | } | 1233 | } |
| 1234 | 1234 | ||
| 1235 | test "filesize" { | 1235 | test "filesize" { |
| 1236 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 1237 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 1238 | return error.SkipZigTest; | ||
| 1239 | } | ||
| 1236 | try testFmt("file size: 63MiB\n", "file size: {Bi}\n", usize(63 * 1024 * 1024)); | 1240 | try testFmt("file size: 63MiB\n", "file size: {Bi}\n", usize(63 * 1024 * 1024)); |
| 1237 | try testFmt("file size: 66.06MB\n", "file size: {B:.2}\n", usize(63 * 1024 * 1024)); | 1241 | try testFmt("file size: 66.06MB\n", "file size: {B:.2}\n", usize(63 * 1024 * 1024)); |
| 1238 | } | 1242 | } |
| ... | @@ -1267,6 +1271,10 @@ test "enum" { | ... | @@ -1267,6 +1271,10 @@ test "enum" { |
| 1267 | } | 1271 | } |
| 1268 | 1272 | ||
| 1269 | test "float.scientific" { | 1273 | test "float.scientific" { |
| 1274 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 1275 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 1276 | return error.SkipZigTest; | ||
| 1277 | } | ||
| 1270 | try testFmt("f32: 1.34000003e+00", "f32: {e}", f32(1.34)); | 1278 | try testFmt("f32: 1.34000003e+00", "f32: {e}", f32(1.34)); |
| 1271 | try testFmt("f32: 1.23400001e+01", "f32: {e}", f32(12.34)); | 1279 | try testFmt("f32: 1.23400001e+01", "f32: {e}", f32(12.34)); |
| 1272 | try testFmt("f64: -1.234e+11", "f64: {e}", f64(-12.34e10)); | 1280 | try testFmt("f64: -1.234e+11", "f64: {e}", f64(-12.34e10)); |
| ... | @@ -1274,6 +1282,10 @@ test "float.scientific" { | ... | @@ -1274,6 +1282,10 @@ test "float.scientific" { |
| 1274 | } | 1282 | } |
| 1275 | 1283 | ||
| 1276 | test "float.scientific.precision" { | 1284 | test "float.scientific.precision" { |
| 1285 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 1286 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 1287 | return error.SkipZigTest; | ||
| 1288 | } | ||
| 1277 | try testFmt("f64: 1.40971e-42", "f64: {e:.5}", f64(1.409706e-42)); | 1289 | try testFmt("f64: 1.40971e-42", "f64: {e:.5}", f64(1.409706e-42)); |
| 1278 | try testFmt("f64: 1.00000e-09", "f64: {e:.5}", f64(@bitCast(f32, u32(814313563)))); | 1290 | try testFmt("f64: 1.00000e-09", "f64: {e:.5}", f64(@bitCast(f32, u32(814313563)))); |
| 1279 | try testFmt("f64: 7.81250e-03", "f64: {e:.5}", f64(@bitCast(f32, u32(1006632960)))); | 1291 | try testFmt("f64: 7.81250e-03", "f64: {e:.5}", f64(@bitCast(f32, u32(1006632960)))); |
| ... | @@ -1283,6 +1295,10 @@ test "float.scientific.precision" { | ... | @@ -1283,6 +1295,10 @@ test "float.scientific.precision" { |
| 1283 | } | 1295 | } |
| 1284 | 1296 | ||
| 1285 | test "float.special" { | 1297 | test "float.special" { |
| 1298 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 1299 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 1300 | return error.SkipZigTest; | ||
| 1301 | } | ||
| 1286 | try testFmt("f64: nan", "f64: {}", math.nan_f64); | 1302 | try testFmt("f64: nan", "f64: {}", math.nan_f64); |
| 1287 | // negative nan is not defined by IEE 754, | 1303 | // negative nan is not defined by IEE 754, |
| 1288 | // and ARM thus normalizes it to positive nan | 1304 | // and ARM thus normalizes it to positive nan |
| ... | @@ -1294,6 +1310,10 @@ test "float.special" { | ... | @@ -1294,6 +1310,10 @@ test "float.special" { |
| 1294 | } | 1310 | } |
| 1295 | 1311 | ||
| 1296 | test "float.decimal" { | 1312 | test "float.decimal" { |
| 1313 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 1314 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 1315 | return error.SkipZigTest; | ||
| 1316 | } | ||
| 1297 | try testFmt("f64: 152314000000000000000000000000", "f64: {d}", f64(1.52314e+29)); | 1317 | try testFmt("f64: 152314000000000000000000000000", "f64: {d}", f64(1.52314e+29)); |
| 1298 | try testFmt("f32: 1.1", "f32: {d:.1}", f32(1.1234)); | 1318 | try testFmt("f32: 1.1", "f32: {d:.1}", f32(1.1234)); |
| 1299 | try testFmt("f32: 1234.57", "f32: {d:.2}", f32(1234.567)); | 1319 | try testFmt("f32: 1234.57", "f32: {d:.2}", f32(1234.567)); |
| ... | @@ -1312,6 +1332,10 @@ test "float.decimal" { | ... | @@ -1312,6 +1332,10 @@ test "float.decimal" { |
| 1312 | } | 1332 | } |
| 1313 | 1333 | ||
| 1314 | test "float.libc.sanity" { | 1334 | test "float.libc.sanity" { |
| 1335 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 1336 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 1337 | return error.SkipZigTest; | ||
| 1338 | } | ||
| 1315 | try testFmt("f64: 0.00001", "f64: {d:.5}", f64(@bitCast(f32, u32(916964781)))); | 1339 | try testFmt("f64: 0.00001", "f64: {d:.5}", f64(@bitCast(f32, u32(916964781)))); |
| 1316 | try testFmt("f64: 0.00001", "f64: {d:.5}", f64(@bitCast(f32, u32(925353389)))); | 1340 | try testFmt("f64: 0.00001", "f64: {d:.5}", f64(@bitCast(f32, u32(925353389)))); |
| 1317 | try testFmt("f64: 0.10000", "f64: {d:.5}", f64(@bitCast(f32, u32(1036831278)))); | 1341 | try testFmt("f64: 0.10000", "f64: {d:.5}", f64(@bitCast(f32, u32(1036831278)))); |
std/heap.zig+1-1| ... | @@ -780,7 +780,7 @@ test "FixedBufferAllocator" { | ... | @@ -780,7 +780,7 @@ test "FixedBufferAllocator" { |
| 780 | } | 780 | } |
| 781 | 781 | ||
| 782 | test "FixedBufferAllocator.reset" { | 782 | test "FixedBufferAllocator.reset" { |
| 783 | var buf: [8]u8 align(@alignOf(usize)) = undefined; | 783 | var buf: [8]u8 align(@alignOf(u64)) = undefined; |
| 784 | var fba = FixedBufferAllocator.init(buf[0..]); | 784 | var fba = FixedBufferAllocator.init(buf[0..]); |
| 785 | 785 | ||
| 786 | const X = 0xeeeeeeeeeeeeeeee; | 786 | const X = 0xeeeeeeeeeeeeeeee; |
std/math/big/rational.zig+8| ... | @@ -742,6 +742,10 @@ test "big.rational setFloatString" { | ... | @@ -742,6 +742,10 @@ test "big.rational setFloatString" { |
| 742 | } | 742 | } |
| 743 | 743 | ||
| 744 | test "big.rational toFloat" { | 744 | test "big.rational toFloat" { |
| 745 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 746 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 747 | return error.SkipZigTest; | ||
| 748 | } | ||
| 745 | var a = try Rational.init(al); | 749 | var a = try Rational.init(al); |
| 746 | 750 | ||
| 747 | // = 3.14159297943115234375 | 751 | // = 3.14159297943115234375 |
| ... | @@ -754,6 +758,10 @@ test "big.rational toFloat" { | ... | @@ -754,6 +758,10 @@ test "big.rational toFloat" { |
| 754 | } | 758 | } |
| 755 | 759 | ||
| 756 | test "big.rational set/to Float round-trip" { | 760 | test "big.rational set/to Float round-trip" { |
| 761 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 762 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 763 | return error.SkipZigTest; | ||
| 764 | } | ||
| 757 | var a = try Rational.init(al); | 765 | var a = try Rational.init(al); |
| 758 | var prng = std.rand.DefaultPrng.init(0x5EED); | 766 | var prng = std.rand.DefaultPrng.init(0x5EED); |
| 759 | var i: usize = 0; | 767 | var i: usize = 0; |
std/math/complex/atan.zig+5| ... | @@ -5,6 +5,7 @@ | ... | @@ -5,6 +5,7 @@ |
| 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/catan.c | 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/catan.c |
| 6 | 6 | ||
| 7 | const std = @import("../../std.zig"); | 7 | const std = @import("../../std.zig"); |
| 8 | const builtin = @import("builtin"); | ||
| 8 | const testing = std.testing; | 9 | const testing = std.testing; |
| 9 | const math = std.math; | 10 | const math = std.math; |
| 10 | const cmath = math.complex; | 11 | const cmath = math.complex; |
| ... | @@ -129,6 +130,10 @@ test "complex.catan32" { | ... | @@ -129,6 +130,10 @@ test "complex.catan32" { |
| 129 | } | 130 | } |
| 130 | 131 | ||
| 131 | test "complex.catan64" { | 132 | test "complex.catan64" { |
| 133 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 134 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 135 | return error.SkipZigTest; | ||
| 136 | } | ||
| 132 | const a = Complex(f64).new(5, 3); | 137 | const a = Complex(f64).new(5, 3); |
| 133 | const c = atan(a); | 138 | const c = atan(a); |
| 134 | 139 |
std/math/complex/cosh.zig+5| ... | @@ -4,6 +4,7 @@ | ... | @@ -4,6 +4,7 @@ |
| 4 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/ccoshf.c | 4 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/ccoshf.c |
| 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/ccosh.c | 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/ccosh.c |
| 6 | 6 | ||
| 7 | const builtin = @import("builtin"); | ||
| 7 | const std = @import("../../std.zig"); | 8 | const std = @import("../../std.zig"); |
| 8 | const testing = std.testing; | 9 | const testing = std.testing; |
| 9 | const math = std.math; | 10 | const math = std.math; |
| ... | @@ -164,6 +165,10 @@ test "complex.ccosh32" { | ... | @@ -164,6 +165,10 @@ test "complex.ccosh32" { |
| 164 | } | 165 | } |
| 165 | 166 | ||
| 166 | test "complex.ccosh64" { | 167 | test "complex.ccosh64" { |
| 168 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 169 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 170 | return error.SkipZigTest; | ||
| 171 | } | ||
| 167 | const a = Complex(f64).new(5, 3); | 172 | const a = Complex(f64).new(5, 3); |
| 168 | const c = cosh(a); | 173 | const c = cosh(a); |
| 169 | 174 |
std/math/complex/exp.zig+5| ... | @@ -4,6 +4,7 @@ | ... | @@ -4,6 +4,7 @@ |
| 4 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/cexpf.c | 4 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/cexpf.c |
| 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/cexp.c | 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/cexp.c |
| 6 | 6 | ||
| 7 | const builtin = @import("builtin"); | ||
| 7 | const std = @import("../../std.zig"); | 8 | const std = @import("../../std.zig"); |
| 8 | const testing = std.testing; | 9 | const testing = std.testing; |
| 9 | const math = std.math; | 10 | const math = std.math; |
| ... | @@ -130,6 +131,10 @@ test "complex.cexp32" { | ... | @@ -130,6 +131,10 @@ test "complex.cexp32" { |
| 130 | } | 131 | } |
| 131 | 132 | ||
| 132 | test "complex.cexp64" { | 133 | test "complex.cexp64" { |
| 134 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 135 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 136 | return error.SkipZigTest; | ||
| 137 | } | ||
| 133 | const a = Complex(f64).new(5, 3); | 138 | const a = Complex(f64).new(5, 3); |
| 134 | const c = exp(a); | 139 | const c = exp(a); |
| 135 | 140 |
std/math/complex/sinh.zig+5| ... | @@ -4,6 +4,7 @@ | ... | @@ -4,6 +4,7 @@ |
| 4 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/csinhf.c | 4 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/csinhf.c |
| 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/csinh.c | 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/csinh.c |
| 6 | 6 | ||
| 7 | const builtin = @import("builtin"); | ||
| 7 | const std = @import("../../std.zig"); | 8 | const std = @import("../../std.zig"); |
| 8 | const testing = std.testing; | 9 | const testing = std.testing; |
| 9 | const math = std.math; | 10 | const math = std.math; |
| ... | @@ -163,6 +164,10 @@ test "complex.csinh32" { | ... | @@ -163,6 +164,10 @@ test "complex.csinh32" { |
| 163 | } | 164 | } |
| 164 | 165 | ||
| 165 | test "complex.csinh64" { | 166 | test "complex.csinh64" { |
| 167 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 168 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 169 | return error.SkipZigTest; | ||
| 170 | } | ||
| 166 | const a = Complex(f64).new(5, 3); | 171 | const a = Complex(f64).new(5, 3); |
| 167 | const c = sinh(a); | 172 | const c = sinh(a); |
| 168 | 173 |
std/math/complex/tanh.zig+5| ... | @@ -4,6 +4,7 @@ | ... | @@ -4,6 +4,7 @@ |
| 4 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/ctanhf.c | 4 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/ctanhf.c |
| 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/ctanh.c | 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/ctanh.c |
| 6 | 6 | ||
| 7 | const builtin = @import("builtin"); | ||
| 7 | const std = @import("../../std.zig"); | 8 | const std = @import("../../std.zig"); |
| 8 | const testing = std.testing; | 9 | const testing = std.testing; |
| 9 | const math = std.math; | 10 | const math = std.math; |
| ... | @@ -112,6 +113,10 @@ test "complex.ctanh32" { | ... | @@ -112,6 +113,10 @@ test "complex.ctanh32" { |
| 112 | } | 113 | } |
| 113 | 114 | ||
| 114 | test "complex.ctanh64" { | 115 | test "complex.ctanh64" { |
| 116 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 117 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 118 | return error.SkipZigTest; | ||
| 119 | } | ||
| 115 | const a = Complex(f64).new(5, 3); | 120 | const a = Complex(f64).new(5, 3); |
| 116 | const c = tanh(a); | 121 | const c = tanh(a); |
| 117 | 122 |
std/math/cos.zig+4| ... | @@ -100,6 +100,10 @@ test "math.cos32" { | ... | @@ -100,6 +100,10 @@ test "math.cos32" { |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | test "math.cos64" { | 102 | test "math.cos64" { |
| 103 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 104 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 105 | return error.SkipZigTest; | ||
| 106 | } | ||
| 103 | const epsilon = 0.000001; | 107 | const epsilon = 0.000001; |
| 104 | 108 | ||
| 105 | expect(math.approxEq(f64, cos_(f64, 0.0), 1.0, epsilon)); | 109 | expect(math.approxEq(f64, cos_(f64, 0.0), 1.0, epsilon)); |
std/math/pow.zig+12| ... | @@ -184,6 +184,10 @@ fn isOddInteger(x: f64) bool { | ... | @@ -184,6 +184,10 @@ fn isOddInteger(x: f64) bool { |
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | test "math.pow" { | 186 | test "math.pow" { |
| 187 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 188 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 189 | return error.SkipZigTest; | ||
| 190 | } | ||
| 187 | const epsilon = 0.000001; | 191 | const epsilon = 0.000001; |
| 188 | 192 | ||
| 189 | expect(math.approxEq(f32, pow(f32, 0.0, 3.3), 0.0, epsilon)); | 193 | expect(math.approxEq(f32, pow(f32, 0.0, 3.3), 0.0, epsilon)); |
| ... | @@ -202,6 +206,10 @@ test "math.pow" { | ... | @@ -202,6 +206,10 @@ test "math.pow" { |
| 202 | } | 206 | } |
| 203 | 207 | ||
| 204 | test "math.pow.special" { | 208 | test "math.pow.special" { |
| 209 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 210 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 211 | return error.SkipZigTest; | ||
| 212 | } | ||
| 205 | const epsilon = 0.000001; | 213 | const epsilon = 0.000001; |
| 206 | 214 | ||
| 207 | expect(pow(f32, 4, 0.0) == 1.0); | 215 | expect(pow(f32, 4, 0.0) == 1.0); |
| ... | @@ -244,6 +252,10 @@ test "math.pow.special" { | ... | @@ -244,6 +252,10 @@ test "math.pow.special" { |
| 244 | } | 252 | } |
| 245 | 253 | ||
| 246 | test "math.pow.overflow" { | 254 | test "math.pow.overflow" { |
| 255 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 256 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 257 | return error.SkipZigTest; | ||
| 258 | } | ||
| 247 | expect(math.isPositiveInf(pow(f64, 2, 1 << 32))); | 259 | expect(math.isPositiveInf(pow(f64, 2, 1 << 32))); |
| 248 | expect(pow(f64, 2, -(1 << 32)) == 0); | 260 | expect(pow(f64, 2, -(1 << 32)) == 0); |
| 249 | expect(math.isNegativeInf(pow(f64, -2, (1 << 32) + 1))); | 261 | expect(math.isNegativeInf(pow(f64, -2, (1 << 32) + 1))); |
std/math/sin.zig+20| ... | @@ -84,12 +84,20 @@ fn sin_(comptime T: type, x_: T) T { | ... | @@ -84,12 +84,20 @@ fn sin_(comptime T: type, x_: T) T { |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | test "math.sin" { | 86 | test "math.sin" { |
| 87 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 88 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 89 | return error.SkipZigTest; | ||
| 90 | } | ||
| 87 | expect(sin(f32(0.0)) == sin_(f32, 0.0)); | 91 | expect(sin(f32(0.0)) == sin_(f32, 0.0)); |
| 88 | expect(sin(f64(0.0)) == sin_(f64, 0.0)); | 92 | expect(sin(f64(0.0)) == sin_(f64, 0.0)); |
| 89 | expect(comptime (math.sin(f64(2))) == math.sin(f64(2))); | 93 | expect(comptime (math.sin(f64(2))) == math.sin(f64(2))); |
| 90 | } | 94 | } |
| 91 | 95 | ||
| 92 | test "math.sin32" { | 96 | test "math.sin32" { |
| 97 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 98 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 99 | return error.SkipZigTest; | ||
| 100 | } | ||
| 93 | const epsilon = 0.000001; | 101 | const epsilon = 0.000001; |
| 94 | 102 | ||
| 95 | expect(math.approxEq(f32, sin_(f32, 0.0), 0.0, epsilon)); | 103 | expect(math.approxEq(f32, sin_(f32, 0.0), 0.0, epsilon)); |
| ... | @@ -102,6 +110,10 @@ test "math.sin32" { | ... | @@ -102,6 +110,10 @@ test "math.sin32" { |
| 102 | } | 110 | } |
| 103 | 111 | ||
| 104 | test "math.sin64" { | 112 | test "math.sin64" { |
| 113 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 114 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 115 | return error.SkipZigTest; | ||
| 116 | } | ||
| 105 | const epsilon = 0.000001; | 117 | const epsilon = 0.000001; |
| 106 | 118 | ||
| 107 | expect(math.approxEq(f64, sin_(f64, 0.0), 0.0, epsilon)); | 119 | expect(math.approxEq(f64, sin_(f64, 0.0), 0.0, epsilon)); |
| ... | @@ -114,6 +126,10 @@ test "math.sin64" { | ... | @@ -114,6 +126,10 @@ test "math.sin64" { |
| 114 | } | 126 | } |
| 115 | 127 | ||
| 116 | test "math.sin32.special" { | 128 | test "math.sin32.special" { |
| 129 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 130 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 131 | return error.SkipZigTest; | ||
| 132 | } | ||
| 117 | expect(sin_(f32, 0.0) == 0.0); | 133 | expect(sin_(f32, 0.0) == 0.0); |
| 118 | expect(sin_(f32, -0.0) == -0.0); | 134 | expect(sin_(f32, -0.0) == -0.0); |
| 119 | expect(math.isNan(sin_(f32, math.inf(f32)))); | 135 | expect(math.isNan(sin_(f32, math.inf(f32)))); |
| ... | @@ -122,6 +138,10 @@ test "math.sin32.special" { | ... | @@ -122,6 +138,10 @@ test "math.sin32.special" { |
| 122 | } | 138 | } |
| 123 | 139 | ||
| 124 | test "math.sin64.special" { | 140 | test "math.sin64.special" { |
| 141 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 142 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 143 | return error.SkipZigTest; | ||
| 144 | } | ||
| 125 | expect(sin_(f64, 0.0) == 0.0); | 145 | expect(sin_(f64, 0.0) == 0.0); |
| 126 | expect(sin_(f64, -0.0) == -0.0); | 146 | expect(sin_(f64, -0.0) == -0.0); |
| 127 | expect(math.isNan(sin_(f64, math.inf(f64)))); | 147 | expect(math.isNan(sin_(f64, math.inf(f64)))); |
std/math/tan.zig+4| ... | @@ -91,6 +91,10 @@ test "math.tan32" { | ... | @@ -91,6 +91,10 @@ test "math.tan32" { |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | test "math.tan64" { | 93 | test "math.tan64" { |
| 94 | if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { | ||
| 95 | // TODO https://github.com/ziglang/zig/issues/3289 | ||
| 96 | return error.SkipZigTest; | ||
| 97 | } | ||
| 94 | const epsilon = 0.000001; | 98 | const epsilon = 0.000001; |
| 95 | 99 | ||
| 96 | expect(math.approxEq(f64, tan_(f64, 0.0), 0.0, epsilon)); | 100 | expect(math.approxEq(f64, tan_(f64, 0.0), 0.0, epsilon)); |
std/os.zig+1-1| ... | @@ -2048,7 +2048,7 @@ pub fn mmap( | ... | @@ -2048,7 +2048,7 @@ pub fn mmap( |
| 2048 | prot: u32, | 2048 | prot: u32, |
| 2049 | flags: u32, | 2049 | flags: u32, |
| 2050 | fd: fd_t, | 2050 | fd: fd_t, |
| 2051 | offset: isize, | 2051 | offset: u64, |
| 2052 | ) MMapError![]align(mem.page_size) u8 { | 2052 | ) MMapError![]align(mem.page_size) u8 { |
| 2053 | const err = if (builtin.link_libc) blk: { | 2053 | const err = if (builtin.link_libc) blk: { |
| 2054 | const rc = std.c.mmap(ptr, length, prot, flags, fd, offset); | 2054 | const rc = std.c.mmap(ptr, length, prot, flags, fd, offset); |
std/os/linux.zig+3-3| ... | @@ -190,11 +190,11 @@ pub fn umount2(special: [*]const u8, flags: u32) usize { | ... | @@ -190,11 +190,11 @@ pub fn umount2(special: [*]const u8, flags: u32) usize { |
| 190 | return syscall2(SYS_umount2, @ptrToInt(special), flags); | 190 | return syscall2(SYS_umount2, @ptrToInt(special), flags); |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, offset: isize) usize { | 193 | pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, offset: u64) usize { |
| 194 | if (@hasDecl(@This(), "SYS_mmap2")) { | 194 | if (@hasDecl(@This(), "SYS_mmap2")) { |
| 195 | return syscall6(SYS_mmap2, @ptrToInt(address), length, prot, flags, @bitCast(usize, isize(fd)), @bitCast(usize, @divTrunc(offset, MMAP2_UNIT))); | 195 | return syscall6(SYS_mmap2, @ptrToInt(address), length, prot, flags, @bitCast(usize, isize(fd)), @truncate(usize, offset / MMAP2_UNIT)); |
| 196 | } else { | 196 | } else { |
| 197 | return syscall6(SYS_mmap, @ptrToInt(address), length, prot, flags, @bitCast(usize, isize(fd)), @bitCast(usize, offset)); | 197 | return syscall6(SYS_mmap, @ptrToInt(address), length, prot, flags, @bitCast(usize, isize(fd)), offset); |
| 198 | } | 198 | } |
| 199 | } | 199 | } |
| 200 | 200 |
test/tests.zig+10-11| ... | @@ -109,17 +109,16 @@ const test_targets = [_]TestTarget{ | ... | @@ -109,17 +109,16 @@ const test_targets = [_]TestTarget{ |
| 109 | }, | 109 | }, |
| 110 | }, | 110 | }, |
| 111 | }, | 111 | }, |
| 112 | // TODO https://github.com/ziglang/zig/issues/3286 | 112 | TestTarget{ |
| 113 | //TestTarget{ | 113 | .target = Target{ |
| 114 | // .target = Target{ | 114 | .Cross = CrossTarget{ |
| 115 | // .Cross = CrossTarget{ | 115 | .os = .linux, |
| 116 | // .os = .linux, | 116 | .arch = builtin.Arch{ .arm = builtin.Arch.Arm32.v8_5a }, |
| 117 | // .arch = builtin.Arch{ .arm = builtin.Arch.Arm32.v8_5a }, | 117 | .abi = .musleabihf, |
| 118 | // .abi = .musleabihf, | 118 | }, |
| 119 | // }, | 119 | }, |
| 120 | // }, | 120 | .link_libc = true, |
| 121 | // .link_libc = true, | 121 | }, |
| 122 | //}, | ||
| 123 | // TODO https://github.com/ziglang/zig/issues/3287 | 122 | // TODO https://github.com/ziglang/zig/issues/3287 |
| 124 | //TestTarget{ | 123 | //TestTarget{ |
| 125 | // .target = Target{ | 124 | // .target = Target{ |