Commit Graph
31033 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
Jesse Wattenbarger 218cf059dd remove explicit ComplexTypeTag from switch 2024-09-10 20:28:40 -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
Andrew Kelley 0e84fedbe0 update zig1.wasm
Notably, contains the implementation of labeled switch expressions and
decl literals.
2024-09-10 16:15:25 -07:00
Alex Rønne Petersen 2fc1f9b971 llvm: Don't use the optimized jump table construction logic for wasm. 2024-09-10 16:09:43 -07:00
Eric Petersen 36b89101df tokenizer: use labeled switch statements 2024-09-10 16:09:37 -07:00
Jacob Young 8ec68c63fa Merge pull request #21323 from jacobly0/dwarf-decls
Dwarf: implement more decls
2024-09-10 17:31:06 -04:00
Jacob Young 6aa6d088d9 Dwarf: implement and test hash maps 2024-09-10 13:06:08 -04:00
Jacob Young d5a7fcfc13 Dwarf: implement and test multi array list slices 2024-09-10 13:06:08 -04:00
Jacob Young faafc41327 Dwarf: prevent crash on missing field inits
Workaround for #21362
2024-09-10 13:06:08 -04:00
Jacob Young 0f0142527a Dwarf: implement default field values 2024-09-10 13:06:08 -04:00
Jacob Young cdaf3154ee Dwarf: implement variables without runtime bits 2024-09-10 12:27:57 -04:00
Jacob Young e048e78886 Dwarf: implement and test multi array list 2024-09-10 12:27:57 -04:00
Jacob Young e046977354 codegen: implement output to the .debug_info section 2024-09-10 12:27:57 -04:00
Jacob Young 6459212ebe Dwarf: implement and test segmented list 2024-09-10 12:27:57 -04:00
Jacob Young f34b198251 Dwarf: implement and test decls 2024-09-10 12:27:56 -04:00
Jacob Young 778519bb0d Dwarf: fix missing padding before incrementally updated entries 2024-09-10 08:29:31 -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 75983c692f test: Switch all arm-linux-* triples for module tests from v8a to v7a.
Broadly speaking, versions 6, 7, and 8 are the ones that are in common use. Of
these, v7 is what you'll typically see for 32-bit Arm today. So let's actually
make sure that that's what we're testing.
2024-09-10 08:53:30 +02:00
Alex Rønne Petersen a872b61021 test: Add arm, mips, and powerpc soft float targets to module tests.
Prefer `eabi` and `eabihf` over the ambiguous `none` when not using libc.
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 5285f41267 test: Disable store vector with memset on soft float arm.
https://github.com/ziglang/zig/issues/16177
2024-09-10 08:53:30 +02:00
Alex Rønne Petersen 4fcd3e00fa musl: Build with -ffp-contract=off.
https://www.openwall.com/lists/musl/2024/08/28/1
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
Alex Rønne Petersen f9455511fa Compilation: Work around llvm/llvm-project#105972 by defining the macros.
https://github.com/llvm/llvm-project/issues/105972
2024-09-10 08:53:30 +02:00
Alex Rønne Petersen 77c8f4b671 Compilation: Pass hard/soft float flags to Clang as appropriate. 2024-09-10 08:53:30 +02:00
Alex Rønne Petersen 70c92331c7 llvm: Limit f16/f128 lowering on arm to fp_armv8 and soft float. 2024-09-10 08:53:30 +02:00
Alex Rønne Petersen 6836799935 llvm: Set use-soft-float and noimplicitfloat on functions for soft float.
Closes #10961.
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
Alex Rønne Petersen 95bb53653d zig cc: Support -rtlib=none for disabling compiler-rt. 2024-09-09 10:47:35 -07:00
Veikka Tuominen de8cece6e7 sync Aro dependency
ref: adfd13c6ffb563b1379052b92f6ae4148b91cc12
2024-09-09 12:35:49 +03:00
David Rubin 9e6d167bb7 comp: populateTestFunctions shouldn't bubble up AnalysisFail
`ensureCauAnalyzed` adds the anal_unit to the transitive failures, so we don't need to do anything here. The errors will be handled after this function.
2024-09-09 10:05:42 +01: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
Maciej 'vesim' Kuliński fb0028a0d7 mips: fix C ABI compatibility 2024-09-07 23:46:30 -07:00
Andrew Kelley fb81522e0b Merge pull request #21327 from alexrp/reenable-tests
`test`: Re-enable `vector shift operators` and `vector reduce operation`
2024-09-07 13:17:25 -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
Alex Rønne Petersen ccf852c31e test: Re-enable vector reduce operation for most LLVM targets.
mips64 failure is tracked in #21091.

Closes #7138.
2024-09-07 02:47:57 +02:00