1#!/bin/bash 2# Copyright 2016 the V8 project authors. All rights reserved. 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6set -ex 7 8cd "$( dirname "${BASH_SOURCE[0]}" )" 9cd ../.. 10 11BUILD_DIR=out/mk_wasm_fuzzer_corpus 12CORPUS_DIR=test/fuzzer/wasm_corpus 13 14rm -rf $BUILD_DIR $CORPUS_DIR 15mkdir -p $CORPUS_DIR 16 17# Build optdebug such that the --dump-wasm-module flag is available. 18gn gen $BUILD_DIR --args='is_debug=true v8_optimized_debug=true target_cpu="x64" use_goma=true' 19autoninja -C $BUILD_DIR 20 21./tools/run-tests.py --outdir=$BUILD_DIR --extra-flags="--dump-wasm-module \ 22 --dump-wasm-module-path=./$CORPUS_DIR/" 23 24rm -rf $BUILD_DIR 25 26# Delete items over 20k. 27find $CORPUS_DIR -type f -size +20k | xargs rm 28 29# Upload changes. 30cd $CORPUS_DIR/.. 31upload_to_google_storage.py -a -b v8-wasm-fuzzer wasm_corpus 32