Add predicate script for wasm-tools shrink and similar reduction tools.

This commit is contained in:
Chris Fallin 2022-11-30 23:56:58 -08:00
parent 4b40e52c28
commit 9730254c41
No known key found for this signature in database
GPG key ID: 31649E4FE65EB465

20
scripts/reduce-predicate.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/bash
timeout 1 wasmtime run --disable-cache $1
if [ $? -ne 0 ]; then
echo bad: initial run crashes too
exit 1
fi
target/release/waffle-util roundtrip -i $1 -o o.wasm
if [ $? -ne 0 ]; then
echo bad: roundtrip
exit 1
fi
wasmtime run --disable-cache o.wasm
if [ $? -ne 0 ]; then
echo ok: still crashes
exit 0
else
echo bad: no longer crashes
exit 1
fi