# initial support for integrated fuzzing · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/54b7e144b126beb89e86dd8f3dc7ddc7a13871c9)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 54b7e144b126beb89e86dd8f3dc7ddc7a13871c9

Requested commit: 54b7e144b126beb89e86dd8f3dc7ddc7a13871c9

Commit: 54b7e144b126beb89e86dd8f3dc7ddc7a13871c9

Tree: c85d2d46f22ffe935223adc3d5c44379438bd89b

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
initial support for integrated fuzzing

* Add the `-ffuzz` and `-fno-fuzz` CLI arguments.
* Detect fuzz testing flags from zig cc.
* Set the correct clang flags when fuzz testing is requested. It can be
  combined with TSAN and UBSAN.
* Compilation: build fuzzer library when needed which is currently an
  empty zig file.
* Add optforfuzzing to every function in the llvm backend for modules
  that have requested fuzzing.
* In ZigLLVMTargetMachineEmitToFile, add the optimization passes for
  sanitizer coverage.
* std.mem.eql uses a naive implementation optimized for fuzzing when
  builtin.fuzz is true.

Tracked by #20702

```

## Parents

- [eac7fd4da5992299a1f2fb59c5aa237c0c6c6761](https://git.cafe/gitcafe/zig/commit/eac7fd4da5992299a1f2fb59c5aa237c0c6c6761?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/54b7e144b126beb89e86dd8f3dc7ddc7a13871c9?format=markdown)
