Commit Graph
10782 Commits
Author SHA1 Message Date
Linus Groh 8588964972 Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
Andrew Kelley eccd06f5d0 Merge pull request #21370 from ziglang/fuzz
rework fuzzing API to accept a function pointer parameter
2024-09-11 23:41:51 -07:00
Andrew Kelley e3f58bd551 add runs per second to fuzzing ui
closes #21025
2024-09-11 19:53:29 -07:00
Andrew Kelley 4fba7336a9 Merge pull request #21269 from alexrp/soft-float
Fix soft float support, split musl triples by float ABI, and enable CI
2024-09-11 17:41:55 -07:00
Andrew Kelley 9dc75f03e2 fix init template for new fuzz testing API 2024-09-11 13:41:29 -07:00
Andrew Kelley 2d005827b8 make lowest stack an internal libfuzzer detail
This value is useful to help determine run uniqueness in the face of
recursion, however it is not valuable to expose to the fuzzing UI.
2024-09-11 13:41:29 -07:00
Andrew Kelley 0cdccff519 fuzzer: move web files into separate directory 2024-09-11 13:41:29 -07:00
Andrew Kelley 9bc731b30a fuzzing: better std.testing.allocator lifetime management 2024-09-11 13:41:29 -07:00
Andrew Kelley 2b76221a46 libfuzzer: use a function pointer instead of extern
solves the problem presented in the previous commit message
2024-09-11 13:41:29 -07:00
Andrew Kelley 892ce7ef52 rework fuzzing API
The previous API used `std.testing.fuzzInput(.{})` however that has the
problem that users call it multiple times incorrectly, and there might
be work happening to obtain the corpus which should not be included in
coverage analysis, and which must not slow down iteration speed.

This commit restructures it so that the main loop lives in libfuzzer and
directly calls the "test one" function.

In this commit I was a little too aggressive because I made the test
runner export `fuzzer_one` for this purpose. This was motivated by
performance, but it causes "exported symbol collision: fuzzer_one" to
occur when more than one fuzz test is provided.

There are three ways to solve this:

1. libfuzzer needs to be passed a function pointer instead. Possible
   performance downside.

2. build runner needs to build a different process per fuzz test.
   Potentially wasteful and unclear how to isolate them.

3. test runner needs to perform a relocation at runtime to point the
   function call to the relevant unit test. Portability issues and
   dubious performance gains.
2024-09-11 13:41:29 -07:00
Andrew Kelley b81782366b Merge pull request #21367 from RetroDev256/faster-tokenizer
Update the zig tokenizer to use labeled switch statements
2024-09-10 19:59:43 -07:00
David Rubin 421fbd939c thread: don't leak the thread in spawnManager (#21379) 2024-09-11 01:04:59 +00:00
Eric Petersen 36b89101df tokenizer: use labeled switch statements 2024-09-10 16:09:37 -07:00
Jacob Young 6aa6d088d9 Dwarf: implement and test hash maps 2024-09-10 13:06:08 -04:00
Jacob Young e048e78886 Dwarf: implement and test multi array list 2024-09-10 12:27:57 -04:00
Ian Johnson 9007534551 std.zig.tokenizer: simplify line-based tokens
Closes #21358
Closes #21360

This commit modifies the `multiline_string_literal_line`, `doc_comment`,
and `container_doc_comment` tokens to no longer include the line ending
as part of the token. This makes it easier to handle line endings (which
may be LF, CRLF, or in edge cases possibly nonexistent) consistently.

In the two issues linked above, Autodoc was already assuming this for
doc comments, and yielding incorrect results when handling files with
CRLF line endings (both in Markdown parsing and source rendering).

Applying the same simplification for multiline string literals also
brings `zig fmt` into conformance with
https://github.com/ziglang/zig-spec/issues/38 regarding formatting of
multiline strings with CRLF line endings: the spec says that `zig fmt`
should remove the CR from such line endings, but this was not previously
the case.
2024-09-10 13:34:33 +03:00
Alex Rønne Petersen f1645772c1 compiler_rt: Export __truncdfhf2() for AEABI too.
Similar to __truncsfhf2() and __extendhfsf2().
2024-09-10 08:53:30 +02:00
Alex Rønne Petersen 26119bd98d test: Skip some floating point tests that fail on arm-linux-(gnu,musl)eabi.
https://github.com/ziglang/zig/issues/21234
2024-09-10 08:53:30 +02:00
Alex Rønne Petersen 65d36be4a8 std.zig.system: Work around llvm/llvm-project#105978 by disabling vfp2.
https://github.com/llvm/llvm-project/issues/105978
2024-09-10 08:53:30 +02:00
xdBronch d6d09f4ea7 add error for discarding if/while pointer capture 2024-09-10 01:45:48 +03:00
Des-Nerger 6b1f509422 std.zig.render: replace magic number 4 with indent_delta. 2024-09-10 01:27:49 +03:00
Veikka Tuominen de8cece6e7 sync Aro dependency
ref: adfd13c6ffb563b1379052b92f6ae4148b91cc12
2024-09-09 12:35:49 +03:00
Linus Groh 54b668f8a3 std.fmt: Update casing of a few functions to match naming style guide 2024-09-08 11:30:20 -07:00
Alex Rønne Petersen af04404b49 std: Fix assembler comment syntax for sparc. 2024-09-07 13:16:22 -07:00
pfg c97db8e497 Support stringifying non-exhaustive enum to json (#21228) 2024-09-07 11:06:41 -04:00
Andrew Kelley 5f3d9e0b7a Merge pull request #21261 from alexrp/riscv32
More `riscv32-linux` port work
2024-09-06 17:43:10 -07:00
Alex Rønne Petersen af370a69cd std.Target: Make Abi.floatAbi() more accurate.
Also rename Target.getFloatAbi() to floatAbi().
2024-09-06 20:11:47 +02:00
Alex Rønne Petersen 17f54e8274 std.zig.target: Split powerpc-linux-musl triple into powerpc-linux-musleabi(hf). 2024-09-06 20:11:47 +02:00
Alex Rønne Petersen c1a70acc91 std.zig.target: Split mips(el)-linux-musl triples into mips(el)-linux-musleabi(hf).
Closes #21184.
2024-09-06 20:11:47 +02:00
Alex Rønne Petersen a0205fff98 std.DynLib: Prefer std.fs.File.stat() over posix.fstat().
This is necessary for riscv32-linux.
2024-09-06 20:03:15 +02:00
Alex Rønne Petersen 65a6e9eee5 std.posix: Skip a couple of tests that use fstat()/fstatat() on riscv32. 2024-09-06 20:03:15 +02:00
Alex Rønne Petersen f35015575e std.time: Use clock_nanosleep() to implement sleep() on Linux.
This fixes the function for riscv32 where the old nanosleep() is not available.
clock_nanosleep() has been available since Linux 2.6 and glibc 2.1 anyway.
2024-09-06 20:03:12 +02:00
Alex Rønne Petersen 8043197995 std.os.linux: Add clock_nanosleep() syscall wrapper. 2024-09-06 20:03:00 +02:00
Andrew Kelley f29bdd6746 Merge pull request #21263 from alexrp/thumb-fixes
Some fixes for `thumb-linux-*` support
2024-09-06 10:55:45 -07:00
Andrew Kelley 96fcc8d63b Merge pull request #21195 from alexrp/glibc-fixes
`glibc`: Some bug fixes, plus arc and csky start files
2024-09-06 10:50:56 -07:00
Alex Rønne Petersen b230e4f598 glibc: Patch to work around missing features in LLVM's s390x assembler.
Revert this with LLVM 20.
2024-09-06 10:39:30 -07:00
Ian Johnson 3543f28320 std.math.big.int: fix shiftRight sign handling
Closes #21311

The sign of the result `r` needs to be initialized before the correction
`r.addScalar(r.toConst(), -1)`, or the intended end result could be off
by 2 (depending on the original sign of `r`).
2024-09-06 10:36:12 -07:00
Alex Rønne Petersen 747460025e glibc: Add csky start files. 2024-09-05 06:16:26 +02:00
Alex Rønne Petersen 06945d5eb7 glibc: Add arc start files. 2024-09-05 06:16:26 +02:00
Andrew Kelley 3929cac154 Merge pull request #21257 from mlugg/computed-goto-3
compiler: implement labeled switch/continue
2024-09-04 18:31:28 -07:00
Arwalk f87dd43c12 stdlib : base64 encode to writer (#20961) 2024-09-04 08:10:12 +00:00
Alex Rønne Petersen e5ee9c1e43 std.elf: Bring the EM enum up to date.
Based on:

* `include/elf/common.h` in binutils
* `include/uapi/linux/elf-em.h` in Linux
* https://www.sco.com/developers/gabi/latest/ch4.eheader.html

I opted to use the tag naming of binutils because it seems to be by far the most
complete and authoritative source at this point in time.
2024-09-03 17:44:01 -07:00
Michael Dusan 7a4d69983a AstGen: update @errorCast to maybe eval to err
Consequently, `AstGen.ret()` now passes the error code to
`.defer_error_code`. Previously, the error union value was passed.

closes #20371
2024-09-03 22:56:23 +01:00
Alex Rønne Petersen 9bcb0e938c std.crypto.ml_kem: Reduce test iteration counts from 100 to 10. (#21285)
Closes #21255.
2024-09-02 23:20:48 +00:00
fdfdjfk3 a670f55195 std.fmt.fmtIntSize*: document when precision is ignored 2024-09-02 14:21:59 +03:00
Jeremy Hertel 13da34955c std.hash_map: fix error message in getAutoHashFn 2024-09-02 12:09:10 +03:00
Matthew Lugg 6d2945f1fe Merge pull request #21264 from mlugg/decl-literals
compiler: implement decl literals
2024-09-02 00:44:11 +01:00
Jeremy Hertel 227fb4875f std.math: rename make_f80 to F80.toFloat and break_f80 to F80.fromFloat 2024-09-02 00:10:22 +03:00
mlugg 2b9af9e825 AstGen: error on unused switch label 2024-09-01 18:31:01 +01:00
mlugg b7a55cd6c3 AstGen: allow breaking from labeled switch
Also, don't use the special switch lowering for errors if the switch
is labeled; this isn't currently supported. Related: #20627.
2024-09-01 18:31:01 +01:00