Skip to content

Commit a44c487

Browse files
authored
runtest.py: Normallize option handling for XIP mode (#3722)
1 parent 63df2cf commit a44c487

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@
6262
"xtensa": ["--target=xtensa"],
6363
}
6464

65+
# AOT compilation options mapping for XIP mode
66+
aot_target_options_map_xip = {
67+
# avoid l32r relocations for xtensa
68+
"xtensa": ["--mllvm=-mtext-section-literals"]
69+
}
70+
6571
def debug(data):
6672
if debug_file:
6773
debug_file.write(data)
@@ -1122,10 +1128,8 @@ def compile_wasm_to_aot(wasm_tempfile, aot_tempfile, runner, opts, r, output = '
11221128

11231129
if opts.xip:
11241130
cmd.append("--xip")
1125-
1126-
# avoid l32r relocations for xtensa
1127-
if opts.target == "xtensa":
1128-
cmd.append("--mllvm=-mtext-section-literals")
1131+
if test_target in aot_target_options_map_xip:
1132+
cmd += aot_target_options_map_xip[test_target]
11291133

11301134
if opts.multi_thread:
11311135
cmd.append("--enable-multi-thread")
@@ -1308,8 +1312,8 @@ def test_assert_with_exception(form, wast_tempfile, wasm_tempfile, aot_tempfile,
13081312
if test_aot:
13091313
aot_tempfile = create_tmp_file(".aot")
13101314
# could be potientially compiled to aot
1311-
# with the future following call test_assert_xxx,
1312-
# add them to temp_file_repo now even if no actual following file,
1315+
# with the future following call test_assert_xxx,
1316+
# add them to temp_file_repo now even if no actual following file,
13131317
# it will be simple ignore during final deletion if not exist
13141318
prefix = wasm_tempfile.split(".wasm")[0]
13151319
temp_file_repo.append(prefix + ".aot")
@@ -1436,8 +1440,8 @@ def test_assert_with_exception(form, wast_tempfile, wasm_tempfile, aot_tempfile,
14361440
if test_aot:
14371441
r = compile_wasm_to_aot(temp_files[1], temp_files[2], True, opts, r)
14381442
# could be potientially compiled to aot
1439-
# with the future following call test_assert_xxx,
1440-
# add them to temp_file_repo now even if no actual following file,
1443+
# with the future following call test_assert_xxx,
1444+
# add them to temp_file_repo now even if no actual following file,
14411445
# it will be simple ignore during final deletion if not exist
14421446
prefix = temp_files[1].split(".wasm")[0]
14431447
temp_file_repo.append(prefix + ".aot")

0 commit comments

Comments
 (0)