Skip to content

Commit 683c90c

Browse files
committed
feat: enhance unsupported combination checks and update build configurations for JIT and SIMD
1 parent 75d7e81 commit 683c90c

File tree

4 files changed

+40
-12
lines changed

4 files changed

+40
-12
lines changed

build-scripts/unsupported_combination.cmake

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (C) 2019 Intel Corporation. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4+
include(CMakePrintHelpers)
5+
46
# Define a function to check for unsupported combinations
57
function(check_aot_mode_error error_message)
68
if(WAMR_BUILD_AOT EQUAL 1)
@@ -10,13 +12,33 @@ endfunction()
1012

1113
# Define a function to check for unsupported combinations with CLASSIC_INTERP
1214
function(check_classic_interp_error error_message)
13-
if(WAMR_BUILD_INTERP EQUAL 1 AND WAMR_BUILD_FAST_INTERP EQUAL 0 AND WAMR_BUILD_JIT EQUAL 0)
15+
# Usually, Enable INTERP to enable wasm loader for JIT
16+
# WAMR_BUILD_JIT might be undefined, so check it first
17+
if(WAMR_BUILD_JIT EQUAL 1)
18+
return()
19+
endif()
20+
21+
if(WAMR_BUILD_FAST_JIT EQUAL 1)
22+
return()
23+
endif()
24+
25+
if(WAMR_BUILD_INTERP EQUAL 1 AND WAMR_BUILD_FAST_INTERP EQUAL 0)
1426
message(FATAL_ERROR "${error_message}")
1527
endif()
1628
endfunction()
1729

1830
# Define a function to check for unsupported combinations with FAST_INTERP
1931
function(check_fast_interp_error error_message)
32+
# Usually, Enable INTERP to enable wasm loader for JIT
33+
# WAMR_BUILD_JIT might be undefined, so check it first
34+
if(WAMR_BUILD_JIT EQUAL 1)
35+
return()
36+
endif()
37+
38+
if(WAMR_BUILD_FAST_JIT EQUAL 1)
39+
return()
40+
endif()
41+
2042
if(WAMR_BUILD_INTERP EQUAL 1 AND WAMR_BUILD_FAST_INTERP EQUAL 1)
2143
message(FATAL_ERROR "${error_message}")
2244
endif()
@@ -39,6 +61,8 @@ endfunction()
3961
# Below are the unsupported combinations checks
4062
# Please keep this list in sync with tests/unit/unsupported-features/CMakeLists.txt
4163
# and tests/wamr-test-suites/test_wamr.sh
64+
#cmake_print_variables(WAMR_BUILD_INTERP WAMR_BUILD_FAST_INTERP WAMR_BUILD_JIT)
65+
4266
if(WAMR_BUILD_EXCE_HANDLING EQUAL 1)
4367
check_aot_mode_error("Unsupported build configuration: EXCE_HANDLING + AOT")
4468
check_fast_interp_error("Unsupported build configuration: EXCE_HANDLING + FAST_INTERP")

tests/regression/ba-issues/build_wamr.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ build_iwasm "-DWAMR_BUILD_GC=1 -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=1 -DW
4949
build_iwasm "-DWAMR_BUILD_REF_TYPES=1 -DWAMR_BUILD_JIT=1" "llvm-jit"
5050

5151
# build multi-tier-jit iwasm for testing classic-interp, fast-jit, llvm-jit and multi-tier-jit
52-
build_iwasm "-DWAMR_BUILD_REF_TYPES=1 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=1" "multi-tier-jit"
52+
build_iwasm "-DWAMR_BUILD_REF_TYPES=1 -DWAMR_BUILD_SIMD=0 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=1" "multi-tier-jit"
5353

5454
# build default iwasm for testing fast-interp and AOT with libc-wasi disabled
5555
build_iwasm "-DWAMR_BUILD_REF_TYPES=1 -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=1 -DWAMR_BUILD_LIBC_WASI=0" "default-wasi-disabled"
@@ -58,6 +58,6 @@ build_iwasm "-DWAMR_BUILD_REF_TYPES=1 -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTER
5858
build_iwasm "-DWAMR_BUILD_REF_TYPES=1 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LIBC_WASI=0" "llvm-jit-wasi-disabled"
5959

6060
# build multi-tier-jit iwasm for testing classic-interp, fast-jit, llvm-jit and multi-tier-jit with libc-wasi disabled
61-
build_iwasm "-DWAMR_BUILD_REF_TYPES=1 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LIBC_WASI=0" "multi-tier-jit-wasi-disabled"
61+
build_iwasm "-DWAMR_BUILD_REF_TYPES=1 -DWAMR_BUILD_SIMD=0-DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LIBC_WASI=0" "multi-tier-jit-wasi-disabled"
6262

6363
# TODO: add more version of iwasm, for example, sgx version

tests/unit/shared-heap/CMakeLists.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@ add_definitions(-DRUN_ON_LINUX)
1010
set(WAMR_BUILD_APP_FRAMEWORK 0)
1111
set(WAMR_BUILD_AOT 1)
1212
set(WAMR_BUILD_INTERP 1)
13-
set(WAMR_BUILD_FAST_INTERP 0)
13+
set(WAMR_BUILD_FAST_INTERP 1)
1414
set(WAMR_BUILD_JIT 0)
15-
if(WAMR_BUILD_TARGET STREQUAL "X86_32")
16-
set(WAMR_BUILD_MEMORY64 0)
17-
else()
18-
set(WAMR_BUILD_MEMORY64 1)
19-
endif()
15+
set(WAMR_BUILD_MEMORY64 0)
2016
set(WAMR_BUILD_SHARED_HEAP 1)
2117

2218
# Compile wasm modules

tests/unit/unsupported-features/CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,29 @@ project(unsupported_features_tests)
88
include(CMakePrintHelpers)
99

1010
# fake target
11+
if(NOT DEFINED WAMR_BUILD_AOT)
12+
set(WAMR_BUILD_AOT 0)
13+
endif()
1114
set(WAMR_BUILD_INTERP 1)
15+
if(NOT DEFINED WAMR_BUILD_JIT)
16+
set(WAMR_BUILD_JIT 0)
17+
endif()
18+
if(NOT DEFINED WAMR_BUILD_FAST_JIT)
19+
set(WAMR_BUILD_FAST_JIT 0)
20+
endif()
1221
include(../unit_common.cmake)
1322
add_library(unsupported_features_tests ${WAMR_RUNTIME_LIB_SOURCE})
1423

1524
enable_testing()
1625

1726
# Define a function to add tests with unsupported features
1827
function(add_unsupported_feature_test test_name flags)
19-
cmake_print_variables(test_name flags)
2028
add_test(
21-
NAME verify_${test_name}
29+
NAME ${PROJECT_NAME}.verify_${test_name}
2230
COMMAND ${CMAKE_COMMAND} -S ${CMAKE_CURRENT_LIST_DIR} -B build_${test_name} ${flags} --fresh
2331
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
2432
)
25-
set_tests_properties(verify_${test_name} PROPERTIES WILL_FAIL TRUE)
33+
set_tests_properties(${PROJECT_NAME}.verify_${test_name} PROPERTIES WILL_FAIL TRUE)
2634
endfunction()
2735

2836
# List of unsupported feature tests

0 commit comments

Comments
 (0)