Skip to content

Commit a0f3751

Browse files
committed
clean up incompatible running mode checks in test script and ci
Rearrange the content of do_execute_in_running_mode() in alphabetical order. Add an incompatible check for x86_32.
1 parent 933f812 commit a0f3751

File tree

3 files changed

+43
-85
lines changed

3 files changed

+43
-85
lines changed

.github/workflows/compilation_on_android_ubuntu.yml

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -618,49 +618,6 @@ jobs:
618618
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
619619
running_mode: aot
620620
test_option: $WAMR_COMPILER_TEST_OPTIONS
621-
exclude:
622-
# incompatible modes and features
623-
# classic-interp doesn't support simd
624-
- running_mode: "classic-interp"
625-
test_option: $SIMD_TEST_OPTIONS
626-
# llvm jit doesn't support multi module
627-
- running_mode: "jit"
628-
test_option: $MULTI_MODULES_TEST_OPTIONS
629-
# fast-jit doesn't support multi module, simd
630-
- running_mode: "fast-jit"
631-
test_option: $MULTI_MODULES_TEST_OPTIONS
632-
- running_mode: "fast-jit"
633-
test_option: $SIMD_TEST_OPTIONS
634-
# multi-tier-jit doesn't support multi module, simd
635-
- running_mode: "multi-tier-jit"
636-
test_option: $MULTI_MODULES_TEST_OPTIONS
637-
- running_mode: "multi-tier-jit"
638-
test_option: $SIMD_TEST_OPTIONS
639-
# fast-jit and multi-tier-jit don't support GC
640-
- running_mode: "fast-jit"
641-
test_option: $GC_TEST_OPTIONS
642-
- running_mode: "multi-tier-jit"
643-
test_option: $GC_TEST_OPTIONS
644-
# fast-interp, fast-jit, llvm-jit, multi-tier-jit don't support Memory64
645-
- running_mode: "fast-interp"
646-
test_option: $MEMORY64_TEST_OPTIONS
647-
- running_mode: "fast-jit"
648-
test_option: $MEMORY64_TEST_OPTIONS
649-
- running_mode: "jit"
650-
test_option: $MEMORY64_TEST_OPTIONS
651-
- running_mode: "multi-tier-jit"
652-
test_option: $MEMORY64_TEST_OPTIONS
653-
# aot, fast-interp, fast-jit, llvm-jit, multi-tier-jit don't support Multi Memory
654-
- running_mode: "aot"
655-
test_option: $MULTI_MEMORY_TEST_OPTIONS
656-
- running_mode: "fast-interp"
657-
test_option: $MULTI_MEMORY_TEST_OPTIONS
658-
- running_mode: "fast-jit"
659-
test_option: $MULTI_MEMORY_TEST_OPTIONS
660-
- running_mode: "jit"
661-
test_option: $MULTI_MEMORY_TEST_OPTIONS
662-
- running_mode: "multi-tier-jit"
663-
test_option: $MULTI_MEMORY_TEST_OPTIONS
664621

665622
steps:
666623
- name: checkout

.github/workflows/nightly_run.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -617,24 +617,11 @@ jobs:
617617
sanitizer: tsan
618618
- running_mode: "multi-tier-jit"
619619
sanitizer: tsan
620-
# classic-interp and fast-interp don't support simd
621-
- running_mode: "classic-interp"
622-
test_option: $SIMD_TEST_OPTIONS
620+
# simd128.h brings ubsan errors
621+
# like: negation of XXXcannot be represented in type 'long int';
622+
# cast to an unsigned type to negate this value to itself
623623
- running_mode: "fast-interp"
624-
test_option: $SIMD_TEST_OPTIONS
625-
# llvm jit doesn't support multi module
626-
- running_mode: "jit"
627-
test_option: $MULTI_MODULES_TEST_OPTIONS
628-
# fast-jit doesn't support multi module, simd
629-
- running_mode: "fast-jit"
630-
test_option: $MULTI_MODULES_TEST_OPTIONS
631-
- running_mode: "fast-jit"
632-
test_option: $SIMD_TEST_OPTIONS
633-
# multi-tier-jit doesn't support multi module, simd
634-
- running_mode: "multi-tier-jit"
635-
test_option: $MULTI_MODULES_TEST_OPTIONS
636-
- running_mode: "multi-tier-jit"
637-
test_option: $SIMD_TEST_OPTIONS
624+
sanitizer: ubsan
638625
steps:
639626
- name: checkout
640627
uses: actions/checkout@v4

tests/wamr-test-suites/test_wamr.sh

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,9 @@ function spec_test()
478478
fi
479479

480480
# As of version 1.0.36, wabt is still unable to correctly handle the GC proposal.
481-
#
481+
#
482482
# $ $ /opt/wabt-1.0.36/bin/wast2json --enable-all ../spec/test/core/br_if.wast
483-
#
483+
#
484484
# ../spec/test/core/br_if.wast:670:26: error: unexpected token "null", expected a numeric index or a name (e.g. 12 or $foo).
485485
# (func $f (param (ref null $t)) (result funcref) (local.get 0))
486486
#
@@ -877,11 +877,23 @@ function do_execute_in_running_mode()
877877
{
878878
local RUNNING_MODE="$1"
879879

880-
if [[ ${ENABLE_MULTI_MEMORY} -eq 1 ]]; then
880+
# filter out uncompatible running mode based on targeting proposal features
881+
# keep alpha order
882+
883+
if [[ ${ENABLE_EH} -eq 1 ]]; then
884+
if [[ "${RUNNING_MODE}" != "classic-interp" ]]; then
885+
echo "support exception handling in classic-interp"
886+
return 0;
887+
fi
888+
fi
889+
890+
if [[ ${ENABLE_GC} -eq 1 ]]; then
881891
if [[ "${RUNNING_MODE}" != "classic-interp" \
892+
&& "${RUNNING_MODE}" != "fast-interp" \
893+
&& "${RUNNING_MODE}" != "jit" \
882894
&& "${RUNNING_MODE}" != "aot" ]]; then
883-
echo "support multi-memory in classic-interp mode and aot mode"
884-
return 0
895+
echo "support gc in both interp modes, llvm-jit mode and aot mode"
896+
return 0;
885897
fi
886898
fi
887899

@@ -893,6 +905,13 @@ function do_execute_in_running_mode()
893905
fi
894906
fi
895907

908+
if [[ ${ENABLE_MULTI_MEMORY} -eq 1 ]]; then
909+
if [[ "${RUNNING_MODE}" != "classic-interp" ]]; then
910+
echo "support multi-memory in classic-interp mode mode"
911+
return 0
912+
fi
913+
fi
914+
896915
if [[ ${ENABLE_MULTI_MODULE} -eq 1 ]]; then
897916
if [[ "${RUNNING_MODE}" != "classic-interp" \
898917
&& "${RUNNING_MODE}" != "fast-interp" \
@@ -902,6 +921,14 @@ function do_execute_in_running_mode()
902921
fi
903922
fi
904923

924+
if [[ ${ENABLE_SIMD} -eq 1 ]]; then
925+
if [[ "${RUNNING_MODE}" != "jit" && "${RUNNING_MODE}" != "aot" && "${RUNNING_MODE}" != "fast-interp" ]]; then
926+
echo "support simd in llvm-jit, aot and fast-interp mode"
927+
return 0;
928+
fi
929+
fi
930+
931+
# filter out uncompatible running mode based on SGX support
905932
if [[ ${SGX_OPT} == "--sgx" ]]; then
906933
if [[ "${RUNNING_MODE}" != "classic-interp" \
907934
&& "${RUNNING_MODE}" != "fast-interp" \
@@ -912,33 +939,20 @@ function do_execute_in_running_mode()
912939
fi
913940
fi
914941

915-
if [[ ${ENABLE_SIMD} -eq 1 ]]; then
916-
if [[ "${RUNNING_MODE}" != "jit" && "${RUNNING_MODE}" != "aot" && "${RUNNING_MODE}" != "fast-interp" ]]; then
917-
echo "support simd in llvm-jit, aot and fast-interp mode"
918-
return 0;
919-
fi
920-
fi
921-
942+
# filter out uncompatible running mode based on architecture
922943
if [[ ${TARGET} == "X86_32" ]]; then
923-
if [[ "${RUNNING_MODE}" == "jit" || "${RUNNING_MODE}" == "fast-jit" ]]; then
924-
echo "both llvm-jit mode and fast-jit mode do not support X86_32 target"
944+
if [[ "${RUNNING_MODE}" == "jit" || "${RUNNING_MODE}" == "fast-jit" || "${RUNNING_MODE}" == "multi-tier-jit" ]]; then
945+
echo "both llvm-jit, fast-jit and multi-tier-jit mode do not support X86_32 target"
925946
return 0;
926947
fi
927-
fi
928948

929-
if [[ ${ENABLE_GC} -eq 1 ]]; then
930-
if [[ "${RUNNING_MODE}" != "classic-interp" \
931-
&& "${RUNNING_MODE}" != "fast-interp" \
932-
&& "${RUNNING_MODE}" != "jit" \
933-
&& "${RUNNING_MODE}" != "aot" ]]; then
934-
echo "support gc in both interp modes, llvm-jit mode and aot mode"
949+
if [[ ${ENABLE_MULTI_MEMORY} -eq 1 ]]; then
950+
echo "multi-memory does not support X86_32 target"
935951
return 0;
936952
fi
937-
fi
938953

939-
if [[ ${ENABLE_EH} -eq 1 ]]; then
940-
if [[ "${RUNNING_MODE}" != "classic-interp" ]]; then
941-
echo "support exception handling in classic-interp"
954+
if [[ ${ENABLE_SIMD} -eq 1 ]]; then
955+
echo "simd does not support X86_32 target"
942956
return 0;
943957
fi
944958
fi

0 commit comments

Comments
 (0)