Skip to content

Commit 583fa52

Browse files
authored
spec-test-script: Add xtensa case (#3643)
1 parent 7c9686d commit 583fa52

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

tests/wamr-test-suites/spec-test-script/all.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def get_iwasm_cmd(platform: str) -> str:
6666
"RISCV64_LP64D",
6767
"THUMBV7",
6868
"THUMBV7_VFP",
69+
"XTENSA",
6970
]
7071

7172
def ignore_the_case(

tests/wamr-test-suites/spec-test-script/runtest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"riscv64": ["--target=riscv64", "--target-abi=lp64", "--cpu=generic-rv64", "--cpu-features=+m,+a,+c"],
5959
"riscv64_lp64f": ["--target=riscv64", "--target-abi=lp64f", "--cpu=generic-rv64", "--cpu-features=+m,+a,+c,+f"],
6060
"riscv64_lp64d": ["--target=riscv64", "--target-abi=lp64d", "--cpu=generic-rv64", "--cpu-features=+m,+a,+c,+f,+d"],
61+
"xtensa": ["--target=xtensa"],
6162
}
6263

6364
def debug(data):
@@ -1185,6 +1186,8 @@ def run_wasm_with_repl(wasm_tempfile, aot_tempfile, opts, r):
11851186
elif opts.target.startswith("riscv64"):
11861187
cmd = "qemu-system-riscv64 -semihosting -M virt,aclint=on -cpu rv64 -smp 1 -nographic -bios none -kernel".split()
11871188
cmd.append(opts.qemu_firmware)
1189+
elif opts.target.startswith("xtensa"):
1190+
cmd = f"qemu-system-xtensa -semihosting -nographic -serial mon:stdio -machine esp32s3 -drive file={opts.qemu_firmware},if=mtd,format=raw".split()
11881191
else:
11891192
raise Exception("Unknwon target for QEMU: %s" % opts.target)
11901193

tests/wamr-test-suites/test_wamr.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ WAMRC_CMD=""
8080
# prod/testsuite-all branch
8181
WASI_TESTSUITE_COMMIT="ee807fc551978490bf1c277059aabfa1e589a6c2"
8282
TARGET_LIST=("AARCH64" "AARCH64_VFP" "ARMV7" "ARMV7_VFP" "THUMBV7" "THUMBV7_VFP" \
83-
"RISCV32" "RISCV32_ILP32F" "RISCV32_ILP32D" "RISCV64" "RISCV64_LP64F" "RISCV64_LP64D")
83+
"RISCV32" "RISCV32_ILP32F" "RISCV32_ILP32D" "RISCV64" "RISCV64_LP64F" "RISCV64_LP64D" "XTENSA")
8484
REQUIREMENT_NAME=""
8585
# Initialize an empty array for subrequirement IDs
8686
SUBREQUIREMENT_IDS=()
@@ -792,9 +792,14 @@ function build_wamrc()
792792
return
793793
fi
794794

795+
BUILD_LLVM_SH=build_llvm.sh
796+
if [ ${TARGET} = "XTENSA" ]; then
797+
BUILD_LLVM_SH=build_llvm_xtensa.sh
798+
fi
799+
795800
echo "Build wamrc for spec test under aot compile type"
796801
cd ${WAMR_DIR}/wamr-compiler \
797-
&& ./build_llvm.sh \
802+
&& ./${BUILD_LLVM_SH} \
798803
&& if [ -d build ]; then rm -r build/*; else mkdir build; fi \
799804
&& cd build \
800805
&& cmake .. -DCOLLECT_CODE_COVERAGE=${COLLECT_CODE_COVERAGE} \

0 commit comments

Comments
 (0)