zig/lib/compiler
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
..
aro sync Aro dependency 2024-09-09 12:35:49 +03:00
aro_translate_c fix(fmt): pointer type syntax to index (take 2) (#20336) 2024-07-21 01:55:52 -07:00
reduce reduce: fix compile errors 2024-03-24 17:29:39 +01:00
resinator sync Aro dependency 2024-09-09 12:35:49 +03:00
aro_translate_c.zig sync Aro dependency 2024-09-09 12:35:49 +03:00
build_runner.zig build runner: --fuzz not yet supported on Windows 2024-08-07 00:48:32 -07:00
fmt.zig std.posix: read on timerfd can return error.Canceled 2024-08-08 01:12:26 -07:00
libc.zig zig libc: allow non-native targets 2024-03-13 02:17:28 -04:00
objcopy.zig fix various issues related to Path handling in the compiler and std 2024-08-19 19:09:11 +02:00
reduce.zig Rename Dir.writeFile2 -> Dir.writeFile and update all callsites 2024-05-03 13:29:22 -07:00
std-docs.zig fix autodocs regression FTBFS 2024-08-23 19:23:38 -07:00
test_runner.zig rework fuzzing API 2024-09-11 13:41:29 -07:00