run_wamr_compiler_tests.sh 545 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. # Copyright (C) 2023 Amazon Inc. All rights reserved.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. set -e
  5. WAT2WASM_CMD=$1
  6. WAMRC_CMD=$2
  7. IWASM_CMD=$3
  8. for wat_file in ../../wamr-compiler/*.wat; do
  9. wasm_file="${wat_file%.wat}.wasm"
  10. aot_file="${wat_file%.wat}.aot"
  11. echo "Compiling $wat_file to $wasm_file"
  12. $WAT2WASM_CMD "$wat_file" -o "$wasm_file"
  13. echo "Compiling $wasm_file to $aot_file"
  14. $WAMRC_CMD -o $aot_file $wasm_file
  15. echo "Testing $aot_file"
  16. $IWASM_CMD -f _start "$aot_file"
  17. done