Add fuzz tests for parsers
Consider AFL and libFuzzer. The latter appears to be more promising, especially combined with sanitisers.
In any case, we'll need to figure out build. I don't want this to explode into numerous files for each little parser.
LLVMFuzzerTestOneInput only has the data for arguments, though
LLVMFuzzerInitialize may switch targets according to arguments--we'll have to erase elements from the argv array for this. Perhaps scan for a new custom
-test=choice option that either sets the target or lists all choices when not found (and returns failure).
Complex things may make use of seeds but let's see how far we can get without. It would be possible to add a "fuzz" directory with some samples, prefixed by test name.
The "superdriver" will want to use the
-artifact_prefix option of libFuzzer. It might very well be a simple shell script since CMake would be hard to convince to use a different subcompiler--everything depends on clang.
I suppose I won't think of any better way to use the fuzzer than to give it in the script a length limit and a timeout and enumerate all available targets. I'm slightly disappointed. On the other hand, nothing has failed so far.
Deleting a branch is permanent. It CANNOT be undone. Continue?