| author | |
| committer | |
| log | f112e8af2760f9b475289966db7c0c53f4c6b310 |
| tree | c5ef1538c0bfa2bb37382c979ee90a3a881a584e |
| parent | dc3c4197c6e6564fb2558768cf2102b868347442 |
| parent | d1705baa749a696132e272974858fef8273614ff |
| signature |
Enable test coverage for armv8-linux-musleabihf21 files changed, 219 insertions(+), 109 deletions(-)
lib/libc/musl/src/setjmp/arm/longjmp.S created+50| ... | ... | @@ -0,0 +1,50 @@ |
| 1 | .syntax unified | |
| 2 | .global _longjmp | |
| 3 | .global longjmp | |
| 4 | .type _longjmp,%function | |
| 5 | .type longjmp,%function | |
| 6 | _longjmp: | |
| 7 | longjmp: | |
| 8 | 	mov ip,r0 | |
| 9 | 	movs r0,r1 | |
| 10 | 	moveq r0,#1 | |
| 11 | 	ldmia ip!, {v1,v2,v3,v4,v5,v6,sl,fp} | |
| 12 | 	ldmia ip!, {r2,lr} | |
| 13 | 	mov sp,r2 | |
| 14 | ||
| 15 | 	adr r1,1f | |
| 16 | 	ldr r2,1f | |
| 17 | 	ldr r1,[r1,r2] | |
| 18 | ||
| 19 | #if __ARM_ARCH < 8 | |
| 20 | 	tst r1,#0x260 | |
| 21 | 	beq 3f | |
| 22 | 	// HWCAP_ARM_FPA | |
| 23 | 	tst r1,#0x20 | |
| 24 | 	beq 2f | |
| 25 | 	ldc p2, cr4, [ip], #48 | |
| 26 | #endif | |
| 27 | 2:	tst r1,#0x40 | |
| 28 | 	beq 2f | |
| 29 | 	.fpu vfp | |
| 30 | 	vldmia ip!, {d8-d15} | |
| 31 | 	.fpu softvfp | |
| 32 | 	.eabi_attribute 10, 0 | |
| 33 | 	.eabi_attribute 27, 0 | |
| 34 | #if __ARM_ARCH < 8 | |
| 35 | 	// HWCAP_ARM_IWMMXT | |
| 36 | 2:	tst r1,#0x200 | |
| 37 | 	beq 3f | |
| 38 | 	ldcl p1, cr10, [ip], #8 | |
| 39 | 	ldcl p1, cr11, [ip], #8 | |
| 40 | 	ldcl p1, cr12, [ip], #8 | |
| 41 | 	ldcl p1, cr13, [ip], #8 | |
| 42 | 	ldcl p1, cr14, [ip], #8 | |
| 43 | 	ldcl p1, cr15, [ip], #8 | |
| 44 | #endif | |
| 45 | 2: | |
| 46 | 3:	bx lr | |
| 47 | ||
| 48 | .hidden __hwcap | |
| 49 | .align 2 | |
| 50 | 1:	.word __hwcap-1b |
lib/libc/musl/src/setjmp/arm/longjmp.s deleted-43| ... | ... | @@ -1,43 +0,0 @@ |
| 1 | .syntax unified | |
| 2 | .global _longjmp | |
| 3 | .global longjmp | |
| 4 | .type _longjmp,%function | |
| 5 | .type longjmp,%function | |
| 6 | _longjmp: | |
| 7 | longjmp: | |
| 8 | 	mov ip,r0 | |
| 9 | 	movs r0,r1 | |
| 10 | 	moveq r0,#1 | |
| 11 | 	ldmia ip!, {v1,v2,v3,v4,v5,v6,sl,fp} | |
| 12 | 	ldmia ip!, {r2,lr} | |
| 13 | 	mov sp,r2 | |
| 14 | ||
| 15 | 	adr r1,1f | |
| 16 | 	ldr r2,1f | |
| 17 | 	ldr r1,[r1,r2] | |
| 18 | ||
| 19 | 	tst r1,#0x260 | |
| 20 | 	beq 3f | |
| 21 | 	tst r1,#0x20 | |
| 22 | 	beq 2f | |
| 23 | 	ldc p2, cr4, [ip], #48 | |
| 24 | 2:	tst r1,#0x40 | |
| 25 | 	beq 2f | |
| 26 | 	.fpu vfp | |
| 27 | 	vldmia ip!, {d8-d15} | |
| 28 | 	.fpu softvfp | |
| 29 | 	.eabi_attribute 10, 0 | |
| 30 | 	.eabi_attribute 27, 0 | |
| 31 | 2:	tst r1,#0x200 | |
| 32 | 	beq 3f | |
| 33 | 	ldcl p1, cr10, [ip], #8 | |
| 34 | 	ldcl p1, cr11, [ip], #8 | |
| 35 | 	ldcl p1, cr12, [ip], #8 | |
| 36 | 	ldcl p1, cr13, [ip], #8 | |
| 37 | 	ldcl p1, cr14, [ip], #8 | |
| 38 | 	ldcl p1, cr15, [ip], #8 | |
| 39 | 3:	bx lr | |
| 40 | ||
| 41 | .hidden __hwcap | |
| 42 | .align 2 | |
| 43 | 1:	.word __hwcap-1b |
lib/libc/musl/src/setjmp/arm/setjmp.S created+52| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | .syntax unified | |
| 2 | .global __setjmp | |
| 3 | .global _setjmp | |
| 4 | .global setjmp | |
| 5 | .type __setjmp,%function | |
| 6 | .type _setjmp,%function | |
| 7 | .type setjmp,%function | |
| 8 | __setjmp: | |
| 9 | _setjmp: | |
| 10 | setjmp: | |
| 11 | 	mov ip,r0 | |
| 12 | 	stmia ip!,{v1,v2,v3,v4,v5,v6,sl,fp} | |
| 13 | 	mov r2,sp | |
| 14 | 	stmia ip!,{r2,lr} | |
| 15 | 	mov r0,#0 | |
| 16 | ||
| 17 | 	adr r1,1f | |
| 18 | 	ldr r2,1f | |
| 19 | 	ldr r1,[r1,r2] | |
| 20 | ||
| 21 | #if __ARM_ARCH < 8 | |
| 22 | 	tst r1,#0x260 | |
| 23 | 	beq 3f | |
| 24 | 	// HWCAP_ARM_FPA | |
| 25 | 	tst r1,#0x20 | |
| 26 | 	beq 2f | |
| 27 | 	stc p2, cr4, [ip], #48 | |
| 28 | #endif | |
| 29 | 2:	tst r1,#0x40 | |
| 30 | 	beq 2f | |
| 31 | 	.fpu vfp | |
| 32 | 	vstmia ip!, {d8-d15} | |
| 33 | 	.fpu softvfp | |
| 34 | 	.eabi_attribute 10, 0 | |
| 35 | 	.eabi_attribute 27, 0 | |
| 36 | #if __ARM_ARCH < 8 | |
| 37 | 	// HWCAP_ARM_IWMMXT | |
| 38 | 2:	tst r1,#0x200 | |
| 39 | 	beq 3f | |
| 40 | 	stcl p1, cr10, [ip], #8 | |
| 41 | 	stcl p1, cr11, [ip], #8 | |
| 42 | 	stcl p1, cr12, [ip], #8 | |
| 43 | 	stcl p1, cr13, [ip], #8 | |
| 44 | 	stcl p1, cr14, [ip], #8 | |
| 45 | 	stcl p1, cr15, [ip], #8 | |
| 46 | #endif | |
| 47 | 2: | |
| 48 | 3:	bx lr | |
| 49 | ||
| 50 | .hidden __hwcap | |
| 51 | .align 2 | |
| 52 | 1:	.word __hwcap-1b |
lib/libc/musl/src/setjmp/arm/setjmp.s deleted-45| ... | ... | @@ -1,45 +0,0 @@ |
| 1 | .syntax unified | |
| 2 | .global __setjmp | |
| 3 | .global _setjmp | |
| 4 | .global setjmp | |
| 5 | .type __setjmp,%function | |
| 6 | .type _setjmp,%function | |
| 7 | .type setjmp,%function | |
| 8 | __setjmp: | |
| 9 | _setjmp: | |
| 10 | setjmp: | |
| 11 | 	mov ip,r0 | |
| 12 | 	stmia ip!,{v1,v2,v3,v4,v5,v6,sl,fp} | |
| 13 | 	mov r2,sp | |
| 14 | 	stmia ip!,{r2,lr} | |
| 15 | 	mov r0,#0 | |
| 16 | ||
| 17 | 	adr r1,1f | |
| 18 | 	ldr r2,1f | |
| 19 | 	ldr r1,[r1,r2] | |
| 20 | ||
| 21 | 	tst r1,#0x260 | |
| 22 | 	beq 3f | |
| 23 | 	tst r1,#0x20 | |
| 24 | 	beq 2f | |
| 25 | 	stc p2, cr4, [ip], #48 | |
| 26 | 2:	tst r1,#0x40 | |
| 27 | 	beq 2f | |
| 28 | 	.fpu vfp | |
| 29 | 	vstmia ip!, {d8-d15} | |
| 30 | 	.fpu softvfp | |
| 31 | 	.eabi_attribute 10, 0 | |
| 32 | 	.eabi_attribute 27, 0 | |
| 33 | 2:	tst r1,#0x200 | |
| 34 | 	beq 3f | |
| 35 | 	stcl p1, cr10, [ip], #8 | |
| 36 | 	stcl p1, cr11, [ip], #8 | |
| 37 | 	stcl p1, cr12, [ip], #8 | |
| 38 | 	stcl p1, cr13, [ip], #8 | |
| 39 | 	stcl p1, cr14, [ip], #8 | |
| 40 | 	stcl p1, cr15, [ip], #8 | |
| 41 | 3:	bx lr | |
| 42 | ||
| 43 | .hidden __hwcap | |
| 44 | .align 2 | |
| 45 | 1:	.word __hwcap-1b |
src/install_files.h+2-2| ... | ... | @@ -1155,8 +1155,8 @@ static const char *ZIG_MUSL_SRC_FILES[] = { |
| 1155 | 1155 | "musl/src/select/select.c", |
| 1156 | 1156 | "musl/src/setjmp/aarch64/longjmp.s", |
| 1157 | 1157 | "musl/src/setjmp/aarch64/setjmp.s", |
| 1158 | "musl/src/setjmp/arm/longjmp.s", | |
| 1159 | "musl/src/setjmp/arm/setjmp.s", | |
| 1158 | "musl/src/setjmp/arm/longjmp.S", | |
| 1159 | "musl/src/setjmp/arm/setjmp.S", | |
| 1160 | 1160 | "musl/src/setjmp/i386/longjmp.s", |
| 1161 | 1161 | "musl/src/setjmp/i386/setjmp.s", |
| 1162 | 1162 | "musl/src/setjmp/longjmp.c", |
std/c.zig+3-3| ... | ... | @@ -70,13 +70,13 @@ pub extern "c" fn raise(sig: c_int) c_int; |
| 70 | 70 | pub extern "c" fn read(fd: fd_t, buf: [*]u8, nbyte: usize) isize; |
| 71 | 71 | pub extern "c" fn readv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint) isize; |
| 72 | 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 | 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 | 76 | pub extern "c" fn stat(noalias path: [*]const u8, noalias buf: *Stat) c_int; |
| 77 | 77 | pub extern "c" fn write(fd: fd_t, buf: [*]const u8, nbyte: usize) isize; |
| 78 | 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 | 80 | pub extern "c" fn munmap(addr: *align(page_size) c_void, len: usize) c_int; |
| 81 | 81 | pub extern "c" fn mprotect(addr: *align(page_size) c_void, len: usize, prot: c_uint) c_int; |
| 82 | 82 | pub extern "c" fn unlink(path: [*]const u8) c_int; |
std/fmt.zig+24| ... | ... | @@ -1233,6 +1233,10 @@ test "cstr" { |
| 1233 | 1233 | } |
| 1234 | 1234 | |
| 1235 | 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 | 1240 | try testFmt("file size: 63MiB\n", "file size: {Bi}\n", usize(63 * 1024 * 1024)); |
| 1237 | 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 | 1271 | } |
| 1268 | 1272 | |
| 1269 | 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 | 1278 | try testFmt("f32: 1.34000003e+00", "f32: {e}", f32(1.34)); |
| 1271 | 1279 | try testFmt("f32: 1.23400001e+01", "f32: {e}", f32(12.34)); |
| 1272 | 1280 | try testFmt("f64: -1.234e+11", "f64: {e}", f64(-12.34e10)); |
| ... | ... | @@ -1274,6 +1282,10 @@ test "float.scientific" { |
| 1274 | 1282 | } |
| 1275 | 1283 | |
| 1276 | 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 | 1289 | try testFmt("f64: 1.40971e-42", "f64: {e:.5}", f64(1.409706e-42)); |
| 1278 | 1290 | try testFmt("f64: 1.00000e-09", "f64: {e:.5}", f64(@bitCast(f32, u32(814313563)))); |
| 1279 | 1291 | try testFmt("f64: 7.81250e-03", "f64: {e:.5}", f64(@bitCast(f32, u32(1006632960)))); |
| ... | ... | @@ -1283,6 +1295,10 @@ test "float.scientific.precision" { |
| 1283 | 1295 | } |
| 1284 | 1296 | |
| 1285 | 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 | 1302 | try testFmt("f64: nan", "f64: {}", math.nan_f64); |
| 1287 | 1303 | // negative nan is not defined by IEE 754, |
| 1288 | 1304 | // and ARM thus normalizes it to positive nan |
| ... | ... | @@ -1294,6 +1310,10 @@ test "float.special" { |
| 1294 | 1310 | } |
| 1295 | 1311 | |
| 1296 | 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 | 1317 | try testFmt("f64: 152314000000000000000000000000", "f64: {d}", f64(1.52314e+29)); |
| 1298 | 1318 | try testFmt("f32: 1.1", "f32: {d:.1}", f32(1.1234)); |
| 1299 | 1319 | try testFmt("f32: 1234.57", "f32: {d:.2}", f32(1234.567)); |
| ... | ... | @@ -1312,6 +1332,10 @@ test "float.decimal" { |
| 1312 | 1332 | } |
| 1313 | 1333 | |
| 1314 | 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 | 1339 | try testFmt("f64: 0.00001", "f64: {d:.5}", f64(@bitCast(f32, u32(916964781)))); |
| 1316 | 1340 | try testFmt("f64: 0.00001", "f64: {d:.5}", f64(@bitCast(f32, u32(925353389)))); |
| 1317 | 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 | 780 | } |
| 781 | 781 | |
| 782 | 782 | test "FixedBufferAllocator.reset" { |
| 783 | var buf: [8]u8 align(@alignOf(usize)) = undefined; | |
| 783 | var buf: [8]u8 align(@alignOf(u64)) = undefined; | |
| 784 | 784 | var fba = FixedBufferAllocator.init(buf[0..]); |
| 785 | 785 | |
| 786 | 786 | const X = 0xeeeeeeeeeeeeeeee; |
std/math/big/rational.zig+8| ... | ... | @@ -742,6 +742,10 @@ test "big.rational setFloatString" { |
| 742 | 742 | } |
| 743 | 743 | |
| 744 | 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 | 749 | var a = try Rational.init(al); |
| 746 | 750 | |
| 747 | 751 | // = 3.14159297943115234375 |
| ... | ... | @@ -754,6 +758,10 @@ test "big.rational toFloat" { |
| 754 | 758 | } |
| 755 | 759 | |
| 756 | 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 | 765 | var a = try Rational.init(al); |
| 758 | 766 | var prng = std.rand.DefaultPrng.init(0x5EED); |
| 759 | 767 | var i: usize = 0; |
std/math/complex/atan.zig+5| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/catan.c |
| 6 | 6 | |
| 7 | 7 | const std = @import("../../std.zig"); |
| 8 | const builtin = @import("builtin"); | |
| 8 | 9 | const testing = std.testing; |
| 9 | 10 | const math = std.math; |
| 10 | 11 | const cmath = math.complex; |
| ... | ... | @@ -129,6 +130,10 @@ test "complex.catan32" { |
| 129 | 130 | } |
| 130 | 131 | |
| 131 | 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 | 137 | const a = Complex(f64).new(5, 3); |
| 133 | 138 | const c = atan(a); |
| 134 | 139 |
std/math/complex/cosh.zig+5| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/ccoshf.c |
| 5 | 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/ccosh.c |
| 6 | 6 | |
| 7 | const builtin = @import("builtin"); | |
| 7 | 8 | const std = @import("../../std.zig"); |
| 8 | 9 | const testing = std.testing; |
| 9 | 10 | const math = std.math; |
| ... | ... | @@ -164,6 +165,10 @@ test "complex.ccosh32" { |
| 164 | 165 | } |
| 165 | 166 | |
| 166 | 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 | 172 | const a = Complex(f64).new(5, 3); |
| 168 | 173 | const c = cosh(a); |
| 169 | 174 |
std/math/complex/exp.zig+5| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/cexpf.c |
| 5 | 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/cexp.c |
| 6 | 6 | |
| 7 | const builtin = @import("builtin"); | |
| 7 | 8 | const std = @import("../../std.zig"); |
| 8 | 9 | const testing = std.testing; |
| 9 | 10 | const math = std.math; |
| ... | ... | @@ -130,6 +131,10 @@ test "complex.cexp32" { |
| 130 | 131 | } |
| 131 | 132 | |
| 132 | 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 | 138 | const a = Complex(f64).new(5, 3); |
| 134 | 139 | const c = exp(a); |
| 135 | 140 |
std/math/complex/sinh.zig+5| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/csinhf.c |
| 5 | 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/csinh.c |
| 6 | 6 | |
| 7 | const builtin = @import("builtin"); | |
| 7 | 8 | const std = @import("../../std.zig"); |
| 8 | 9 | const testing = std.testing; |
| 9 | 10 | const math = std.math; |
| ... | ... | @@ -163,6 +164,10 @@ test "complex.csinh32" { |
| 163 | 164 | } |
| 164 | 165 | |
| 165 | 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 | 171 | const a = Complex(f64).new(5, 3); |
| 167 | 172 | const c = sinh(a); |
| 168 | 173 |
std/math/complex/tanh.zig+5| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/ctanhf.c |
| 5 | 5 | // https://git.musl-libc.org/cgit/musl/tree/src/complex/ctanh.c |
| 6 | 6 | |
| 7 | const builtin = @import("builtin"); | |
| 7 | 8 | const std = @import("../../std.zig"); |
| 8 | 9 | const testing = std.testing; |
| 9 | 10 | const math = std.math; |
| ... | ... | @@ -112,6 +113,10 @@ test "complex.ctanh32" { |
| 112 | 113 | } |
| 113 | 114 | |
| 114 | 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 | 120 | const a = Complex(f64).new(5, 3); |
| 116 | 121 | const c = tanh(a); |
| 117 | 122 |
std/math/cos.zig+4| ... | ... | @@ -100,6 +100,10 @@ test "math.cos32" { |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 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 | 107 | const epsilon = 0.000001; |
| 104 | 108 | |
| 105 | 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 | 184 | } |
| 185 | 185 | |
| 186 | 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 | 191 | const epsilon = 0.000001; |
| 188 | 192 | |
| 189 | 193 | expect(math.approxEq(f32, pow(f32, 0.0, 3.3), 0.0, epsilon)); |
| ... | ... | @@ -202,6 +206,10 @@ test "math.pow" { |
| 202 | 206 | } |
| 203 | 207 | |
| 204 | 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 | 213 | const epsilon = 0.000001; |
| 206 | 214 | |
| 207 | 215 | expect(pow(f32, 4, 0.0) == 1.0); |
| ... | ... | @@ -244,6 +252,10 @@ test "math.pow.special" { |
| 244 | 252 | } |
| 245 | 253 | |
| 246 | 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 | 259 | expect(math.isPositiveInf(pow(f64, 2, 1 << 32))); |
| 248 | 260 | expect(pow(f64, 2, -(1 << 32)) == 0); |
| 249 | 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 | 84 | } |
| 85 | 85 | |
| 86 | 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 | 91 | expect(sin(f32(0.0)) == sin_(f32, 0.0)); |
| 88 | 92 | expect(sin(f64(0.0)) == sin_(f64, 0.0)); |
| 89 | 93 | expect(comptime (math.sin(f64(2))) == math.sin(f64(2))); |
| 90 | 94 | } |
| 91 | 95 | |
| 92 | 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 | 101 | const epsilon = 0.000001; |
| 94 | 102 | |
| 95 | 103 | expect(math.approxEq(f32, sin_(f32, 0.0), 0.0, epsilon)); |
| ... | ... | @@ -102,6 +110,10 @@ test "math.sin32" { |
| 102 | 110 | } |
| 103 | 111 | |
| 104 | 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 | 117 | const epsilon = 0.000001; |
| 106 | 118 | |
| 107 | 119 | expect(math.approxEq(f64, sin_(f64, 0.0), 0.0, epsilon)); |
| ... | ... | @@ -114,6 +126,10 @@ test "math.sin64" { |
| 114 | 126 | } |
| 115 | 127 | |
| 116 | 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 | 133 | expect(sin_(f32, 0.0) == 0.0); |
| 118 | 134 | expect(sin_(f32, -0.0) == -0.0); |
| 119 | 135 | expect(math.isNan(sin_(f32, math.inf(f32)))); |
| ... | ... | @@ -122,6 +138,10 @@ test "math.sin32.special" { |
| 122 | 138 | } |
| 123 | 139 | |
| 124 | 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 | 145 | expect(sin_(f64, 0.0) == 0.0); |
| 126 | 146 | expect(sin_(f64, -0.0) == -0.0); |
| 127 | 147 | expect(math.isNan(sin_(f64, math.inf(f64)))); |
std/math/tan.zig+4| ... | ... | @@ -91,6 +91,10 @@ test "math.tan32" { |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 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 | 98 | const epsilon = 0.000001; |
| 95 | 99 | |
| 96 | 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 | 2048 | prot: u32, |
| 2049 | 2049 | flags: u32, |
| 2050 | 2050 | fd: fd_t, |
| 2051 | offset: isize, | |
| 2051 | offset: u64, | |
| 2052 | 2052 | ) MMapError![]align(mem.page_size) u8 { |
| 2053 | 2053 | const err = if (builtin.link_libc) blk: { |
| 2054 | 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 | 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 | 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 | 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 | 109 | }, |
| 110 | 110 | }, |
| 111 | 111 | }, |
| 112 | // TODO https://github.com/ziglang/zig/issues/3286 | |
| 113 | //TestTarget{ | |
| 114 | // .target = Target{ | |
| 115 | // .Cross = CrossTarget{ | |
| 116 | // .os = .linux, | |
| 117 | // .arch = builtin.Arch{ .arm = builtin.Arch.Arm32.v8_5a }, | |
| 118 | // .abi = .musleabihf, | |
| 119 | // }, | |
| 120 | // }, | |
| 121 | // .link_libc = true, | |
| 122 | //}, | |
| 112 | TestTarget{ | |
| 113 | .target = Target{ | |
| 114 | .Cross = CrossTarget{ | |
| 115 | .os = .linux, | |
| 116 | .arch = builtin.Arch{ .arm = builtin.Arch.Arm32.v8_5a }, | |
| 117 | .abi = .musleabihf, | |
| 118 | }, | |
| 119 | }, | |
| 120 | .link_libc = true, | |
| 121 | }, | |
| 123 | 122 | // TODO https://github.com/ziglang/zig/issues/3287 |
| 124 | 123 | //TestTarget{ |
| 125 | 124 | // .target = Target{ |