From c9c34fb31f67c59c1c75fb9b567ee1fa4791cea8 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 19 May 2024 13:04:29 +0200 Subject: [PATCH] Always add -enable-sign-ext to the wasm-opt command-line At least LLVM 18 seems to emit these instructions by default. --- test/default/wasi-test-wrapper.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/default/wasi-test-wrapper.sh b/test/default/wasi-test-wrapper.sh index 5c3cea76..a05fb6be 100755 --- a/test/default/wasi-test-wrapper.sh +++ b/test/default/wasi-test-wrapper.sh @@ -4,7 +4,8 @@ unset LDFLAGS unset CFLAGS if command -v wasm-opt >/dev/null; then - wasm-opt -O4 -o "${1}.tmp" "$1" && mv -f "${1}.tmp" "$1" + wasm-opt -O4 --enable-sign-ext --emit-target-features $WASMOPT_FLAGS \ + -o "${1}.tmp" "$1" && mv -f "${1}.tmp" "$1" fi if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmedge" ]; then @@ -71,15 +72,15 @@ fi if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "iwasm" ]; then if command -v iwasm >/dev/null; then - if iwasm | grep -qi wasi >/dev/null 2>&1; then - if wamrc --version; then - wamrc -o "${1}.o" "$1" >/dev/null && - iwasm --dir=. "${1}.o" && exit 0 - else - iwasm --dir=. "$1" && exit 0 + if iwasm | grep -qi wasi >/dev/null 2>&1; then + if wamrc --version; then + wamrc -o "${1}.o" "$1" >/dev/null && + iwasm --dir=. "${1}.o" && exit 0 + else + iwasm --dir=. "$1" && exit 0 + fi fi fi - fi fi if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wazero" ]; then