summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcsmith-fuzzing/predicate.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/csmith-fuzzing/predicate.py b/csmith-fuzzing/predicate.py
index 3bf452ef..4909b4f6 100755
--- a/csmith-fuzzing/predicate.py
+++ b/csmith-fuzzing/predicate.py
@@ -84,6 +84,10 @@ reducing.add_argument(
dest="rustc",
help="Do not attempt to compile the emitted bindings with `rustc`.")
reducing.add_argument(
+ "--extra-compile-file",
+ type=str,
+ help="Append the content of this extra file to the end of the emitted bindings just before compiling it.")
+reducing.add_argument(
"--expect-compile-fail",
action="store_true",
help="Exit non-zero if `rustc` successfully compiles the emitted bindings.")
@@ -221,6 +225,10 @@ def run_bindgen(args, bindings):
raise ExitOne()
def run_rustc(args, bindings, test_exe):
+ if args.extra_compile_file:
+ with open(bindings, mode="a") as outfile:
+ with open(args.extra_compile_file, mode="r") as infile:
+ outfile.write(infile.read())
child = run(
["rustc", "--crate-type", "lib", "--test", "-o", test_exe, bindings],
stdout=subprocess.PIPE,