authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-25 15:57:13-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-25 16:21:04-04:00
logd1705baa749a696132e272974858fef8273614ff
treec5ef1538c0bfa2bb37382c979ee90a3a881a584e
parent40e77dad836abf130bf49af1838d108f0fc2e94e
signaturelock-open Commit is signed but in an unrecognized format.

enable test coverage for armv8-linux-musleabihf

* 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;
70pub extern "c" fn read(fd: fd_t, buf: [*]u8, nbyte: usize) isize;70pub extern "c" fn read(fd: fd_t, buf: [*]u8, nbyte: usize) isize;
71pub extern "c" fn readv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint) isize;71pub extern "c" fn readv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint) isize;
72pub extern "c" fn pread(fd: fd_t, buf: [*]u8, nbyte: usize, offset: u64) isize;72pub extern "c" fn pread(fd: fd_t, buf: [*]u8, nbyte: usize, offset: u64) isize;
73pub extern "c" fn preadv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint, offset: usize) isize;73pub extern "c" fn preadv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint, offset: u64) isize;
74pub extern "c" fn writev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint) isize;74pub extern "c" fn writev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint) isize;
75pub extern "c" fn pwritev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: usize) isize;75pub extern "c" fn pwritev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: u64) isize;
76pub extern "c" fn stat(noalias path: [*]const u8, noalias buf: *Stat) c_int;76pub extern "c" fn stat(noalias path: [*]const u8, noalias buf: *Stat) c_int;
77pub extern "c" fn write(fd: fd_t, buf: [*]const u8, nbyte: usize) isize;77pub extern "c" fn write(fd: fd_t, buf: [*]const u8, nbyte: usize) isize;
78pub extern "c" fn pwrite(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: u64) isize;78pub extern "c" fn pwrite(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: u64) isize;
79pub 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;79pub 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;
80pub extern "c" fn munmap(addr: *align(page_size) c_void, len: usize) c_int;80pub extern "c" fn munmap(addr: *align(page_size) c_void, len: usize) c_int;
81pub extern "c" fn mprotect(addr: *align(page_size) c_void, len: usize, prot: c_uint) c_int;81pub extern "c" fn mprotect(addr: *align(page_size) c_void, len: usize, prot: c_uint) c_int;
82pub extern "c" fn unlink(path: [*]const u8) c_int;82pub 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}
12341234
1235test "filesize" {1235test "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}
12681272
1269test "float.scientific" {1273test "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}
12751283
1276test "float.scientific.precision" {1284test "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}
12841296
1285test "float.special" {1297test "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 nan1304 // and ARM thus normalizes it to positive nan
...@@ -1294,6 +1310,10 @@ test "float.special" {...@@ -1294,6 +1310,10 @@ test "float.special" {
1294}1310}
12951311
1296test "float.decimal" {1312test "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}
13131333
1314test "float.libc.sanity" {1334test "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}
781781
782test "FixedBufferAllocator.reset" {782test "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..]);
785785
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}
743743
744test "big.rational toFloat" {744test "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);
746750
747 // = 3.14159297943115234375751 // = 3.14159297943115234375
...@@ -754,6 +758,10 @@ test "big.rational toFloat" {...@@ -754,6 +758,10 @@ test "big.rational toFloat" {
754}758}
755759
756test "big.rational set/to Float round-trip" {760test "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.c5// https://git.musl-libc.org/cgit/musl/tree/src/complex/catan.c
66
7const std = @import("../../std.zig");7const std = @import("../../std.zig");
8const builtin = @import("builtin");
8const testing = std.testing;9const testing = std.testing;
9const math = std.math;10const math = std.math;
10const cmath = math.complex;11const cmath = math.complex;
...@@ -129,6 +130,10 @@ test "complex.catan32" {...@@ -129,6 +130,10 @@ test "complex.catan32" {
129}130}
130131
131test "complex.catan64" {132test "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);
134139
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.c4// https://git.musl-libc.org/cgit/musl/tree/src/complex/ccoshf.c
5// https://git.musl-libc.org/cgit/musl/tree/src/complex/ccosh.c5// https://git.musl-libc.org/cgit/musl/tree/src/complex/ccosh.c
66
7const builtin = @import("builtin");
7const std = @import("../../std.zig");8const std = @import("../../std.zig");
8const testing = std.testing;9const testing = std.testing;
9const math = std.math;10const math = std.math;
...@@ -164,6 +165,10 @@ test "complex.ccosh32" {...@@ -164,6 +165,10 @@ test "complex.ccosh32" {
164}165}
165166
166test "complex.ccosh64" {167test "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);
169174
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.c4// https://git.musl-libc.org/cgit/musl/tree/src/complex/cexpf.c
5// https://git.musl-libc.org/cgit/musl/tree/src/complex/cexp.c5// https://git.musl-libc.org/cgit/musl/tree/src/complex/cexp.c
66
7const builtin = @import("builtin");
7const std = @import("../../std.zig");8const std = @import("../../std.zig");
8const testing = std.testing;9const testing = std.testing;
9const math = std.math;10const math = std.math;
...@@ -130,6 +131,10 @@ test "complex.cexp32" {...@@ -130,6 +131,10 @@ test "complex.cexp32" {
130}131}
131132
132test "complex.cexp64" {133test "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);
135140
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.c4// https://git.musl-libc.org/cgit/musl/tree/src/complex/csinhf.c
5// https://git.musl-libc.org/cgit/musl/tree/src/complex/csinh.c5// https://git.musl-libc.org/cgit/musl/tree/src/complex/csinh.c
66
7const builtin = @import("builtin");
7const std = @import("../../std.zig");8const std = @import("../../std.zig");
8const testing = std.testing;9const testing = std.testing;
9const math = std.math;10const math = std.math;
...@@ -163,6 +164,10 @@ test "complex.csinh32" {...@@ -163,6 +164,10 @@ test "complex.csinh32" {
163}164}
164165
165test "complex.csinh64" {166test "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);
168173
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.c4// https://git.musl-libc.org/cgit/musl/tree/src/complex/ctanhf.c
5// https://git.musl-libc.org/cgit/musl/tree/src/complex/ctanh.c5// https://git.musl-libc.org/cgit/musl/tree/src/complex/ctanh.c
66
7const builtin = @import("builtin");
7const std = @import("../../std.zig");8const std = @import("../../std.zig");
8const testing = std.testing;9const testing = std.testing;
9const math = std.math;10const math = std.math;
...@@ -112,6 +113,10 @@ test "complex.ctanh32" {...@@ -112,6 +113,10 @@ test "complex.ctanh32" {
112}113}
113114
114test "complex.ctanh64" {115test "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);
117122
std/math/cos.zig+4
...@@ -100,6 +100,10 @@ test "math.cos32" {...@@ -100,6 +100,10 @@ test "math.cos32" {
100}100}
101101
102test "math.cos64" {102test "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;
104108
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}
185185
186test "math.pow" {186test "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;
188192
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}
203207
204test "math.pow.special" {208test "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;
206214
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}
245253
246test "math.pow.overflow" {254test "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}
8585
86test "math.sin" {86test "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}
9195
92test "math.sin32" {96test "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;
94102
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}
103111
104test "math.sin64" {112test "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;
106118
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}
115127
116test "math.sin32.special" {128test "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}
123139
124test "math.sin64.special" {140test "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}
9292
93test "math.tan64" {93test "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;
9599
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}
192192
193pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, offset: isize) usize {193pub 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}
200200
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/3286112 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/3287122 // TODO https://github.com/ziglang/zig/issues/3287
124 //TestTarget{123 //TestTarget{
125 // .target = Target{124 // .target = Target{