Эх сурвалжийг харах

spec-test-script: Add xtensa case (#3643)

YAMAMOTO Takashi 1 жил өмнө
parent
commit
583fa52226

+ 1 - 0
tests/wamr-test-suites/spec-test-script/all.py

@@ -66,6 +66,7 @@ AVAILABLE_TARGETS = [
     "RISCV64_LP64D",
     "THUMBV7",
     "THUMBV7_VFP",
+    "XTENSA",
 ]
 
 def ignore_the_case(

+ 3 - 0
tests/wamr-test-suites/spec-test-script/runtest.py

@@ -58,6 +58,7 @@ aot_target_options_map = {
     "riscv64": ["--target=riscv64", "--target-abi=lp64", "--cpu=generic-rv64", "--cpu-features=+m,+a,+c"],
     "riscv64_lp64f": ["--target=riscv64", "--target-abi=lp64f", "--cpu=generic-rv64", "--cpu-features=+m,+a,+c,+f"],
     "riscv64_lp64d": ["--target=riscv64", "--target-abi=lp64d", "--cpu=generic-rv64", "--cpu-features=+m,+a,+c,+f,+d"],
+    "xtensa": ["--target=xtensa"],
 }
 
 def debug(data):
@@ -1185,6 +1186,8 @@ def run_wasm_with_repl(wasm_tempfile, aot_tempfile, opts, r):
         elif opts.target.startswith("riscv64"):
             cmd = "qemu-system-riscv64 -semihosting -M virt,aclint=on -cpu rv64 -smp 1 -nographic -bios none -kernel".split()
             cmd.append(opts.qemu_firmware)
+        elif opts.target.startswith("xtensa"):
+            cmd = f"qemu-system-xtensa -semihosting -nographic -serial mon:stdio -machine esp32s3 -drive file={opts.qemu_firmware},if=mtd,format=raw".split()
         else:
             raise Exception("Unknwon target for QEMU: %s" % opts.target)
 

+ 7 - 2
tests/wamr-test-suites/test_wamr.sh

@@ -80,7 +80,7 @@ WAMRC_CMD=""
 # prod/testsuite-all branch
 WASI_TESTSUITE_COMMIT="ee807fc551978490bf1c277059aabfa1e589a6c2"
 TARGET_LIST=("AARCH64" "AARCH64_VFP" "ARMV7" "ARMV7_VFP" "THUMBV7" "THUMBV7_VFP" \
-             "RISCV32" "RISCV32_ILP32F" "RISCV32_ILP32D" "RISCV64" "RISCV64_LP64F" "RISCV64_LP64D")
+             "RISCV32" "RISCV32_ILP32F" "RISCV32_ILP32D" "RISCV64" "RISCV64_LP64F" "RISCV64_LP64D" "XTENSA")
 REQUIREMENT_NAME=""
 # Initialize an empty array for subrequirement IDs
 SUBREQUIREMENT_IDS=()
@@ -792,9 +792,14 @@ function build_wamrc()
         return
     fi
 
+    BUILD_LLVM_SH=build_llvm.sh
+    if [ ${TARGET} = "XTENSA" ]; then
+        BUILD_LLVM_SH=build_llvm_xtensa.sh
+    fi
+
     echo "Build wamrc for spec test under aot compile type"
     cd ${WAMR_DIR}/wamr-compiler \
-        && ./build_llvm.sh \
+        && ./${BUILD_LLVM_SH} \
         && if [ -d build ]; then rm -r build/*; else mkdir build; fi \
         && cd build \
         && cmake .. -DCOLLECT_CODE_COVERAGE=${COLLECT_CODE_COVERAGE} \