mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 14:36:08 +00:00

This patch adds a new command-line option -mutation_graph_file=FILE for debugging purposes, which traces how corpus inputs evolve during a fuzzing run. For each new input that is added to the corpus, a new vertex corresponding to the added input, as well as a new edge that connects its base input to itself are written to the given file. Each vertex is labeled with the filename of the input, and each edge is labeled with the mutation sequence that led to the input w.r.t. its base input. The format of the mutation graph file is the dot file format. Once prepended and appended with "graph {" and "}", respectively, the graph becomes a valid dot file and can be visualized. Differential Revision: https://reviews.llvm.org/D86560
18 lines
675 B
Plaintext
18 lines
675 B
Plaintext
REQUIRES: linux, x86_64
|
|
RUN: %cpp_compiler %S/SimpleTest.cpp -o %t-SimpleTest
|
|
|
|
RUN: rm -rf %t-SimpleTestGraph
|
|
|
|
RUN: not %run %t-SimpleTest -seed=1 -max_len=3 -mutation_graph_file=%t-SimpleTestGraph 2>&1 | FileCheck %s
|
|
CHECK: BINGO
|
|
|
|
RUN: cat %t-SimpleTestGraph | FileCheck %s --check-prefix=GRAPH
|
|
|
|
# A vertex and edge that correspond to the discovery of "H"
|
|
GRAPH: "7cf184f4c67ad58283ecb19349720b0cae756829"
|
|
GRAPH: {{.*}} -> "7cf184f4c67ad58283ecb19349720b0cae756829" [label="{{.*}}"];
|
|
|
|
# A vertex and edge that correspond to the discovery of "Hi"
|
|
GRAPH: "94dd9e08c129c785f7f256e82fbe0a30e6d1ae40"
|
|
GRAPH: {{.*}} -> "94dd9e08c129c785f7f256e82fbe0a30e6d1ae40" [label="{{.*}}"];
|