Skip to content

Commit

Permalink
Always add -enable-sign-ext to the wasm-opt command-line
Browse files Browse the repository at this point in the history
At least LLVM 18 seems to emit these instructions by default.
  • Loading branch information
jedisct1 committed May 19, 2024
1 parent b582d20 commit c9c34fb
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions test/default/wasi-test-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c9c34fb

Please sign in to comment.