Skip to content

Commit

Permalink
Merge pull request #738 from bytecodealliance/main
Browse files Browse the repository at this point in the history
Import test suites to test spec cases (#736)
  • Loading branch information
wenyongh committed Sep 9, 2021
2 parents 3f71a1f + 00663f0 commit 87d0dfd
Show file tree
Hide file tree
Showing 15 changed files with 4,290 additions and 6 deletions.
4 changes: 4 additions & 0 deletions ATTRIBUTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ The WAMR fast interpreter is a clean room development. We would acknowledge the
### zephyr

[LICENSE](./samples/gui/wasm-runtime-wgl/src/platform/zephyr/LICENSE)

### wac

[LICENSE](./tests/wamr-test-suites/spec-test-script/LICENSE)
8 changes: 4 additions & 4 deletions core/iwasm/compilation/aot_llvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ WAMRCreateMCJITCompilerForModule(LLVMExecutionEngineRef *OutJIT,
void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM);

#if WASM_ENABLE_LAZY_JIT != 0
void
void
aot_handle_llvm_errmsg(char *error_buf,
uint32 error_buf_size,
const char *string,
Expand All @@ -1234,7 +1234,7 @@ aot_handle_llvm_errmsg(char *error_buf,
LLVMDisposeErrorMessage(err_msg);
}

static bool
static bool
llvm_orcjit_create(AOTCompContext *comp_ctx)
{
char *err_msg = NULL;
Expand Down Expand Up @@ -1329,7 +1329,7 @@ llvm_orcjit_create(AOTCompContext *comp_ctx)
/* if success, it will dispose lazy_orcjit_builder memory */
error = LLVMOrcCreateLLLazyJIT(&lazy_orcjit, lazy_orcjit_builder);
if (error) {
aot_handle_llvm_errmsg(buf, sizeof(buf),
aot_handle_llvm_errmsg(buf, sizeof(buf),
"failed to create llvm lazy orcjit instance",
error);
goto fail;
Expand All @@ -1340,7 +1340,7 @@ llvm_orcjit_create(AOTCompContext *comp_ctx)
&main_gen, LLVMOrcLLLazyJITGetGlobalPrefix(lazy_orcjit),
0, NULL);
if (error) {
aot_handle_llvm_errmsg(buf, sizeof(buf),
aot_handle_llvm_errmsg(buf, sizeof(buf),
"failed to create dynmaic library search generator", error);
goto fail;
}
Expand Down
2 changes: 1 addition & 1 deletion core/iwasm/compilation/aot_llvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ bool
aot_check_simd_compatibility(const char *arch_c_str, const char *cpu_c_str);

#if WASM_ENABLE_LAZY_JIT != 0
void
void
aot_handle_llvm_errmsg(char *error_buf,
uint32 error_buf_size,
const char *string,
Expand Down
2 changes: 1 addition & 1 deletion doc/build_wamr.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ make
```
By default in Linux, the interpreter, AOT and WASI are enabled, and JIT and LazyJIT are disabled.
By default in Linux, the interpreter, AOT and WASI are enabled, and JIT and LazyJIT are disabled.
And the build target is set to X86_64 or X86_32 depending on the platform's bitwidth.
To enable WASM JIT, firstly we should build LLVM:
Expand Down
40 changes: 40 additions & 0 deletions tests/wamr-test-suites/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# WAMR test suites

This folder contains test scripts and cases for wamr.

## Help
```
./test_wamr.sh --help
```

## Examples
Test spec cases with fast interpreter mode, which will create folder `workspace`, download the `spec` and `wabt` repo, and build `iwasm` automatically to test spec cases:
```
./test_wamr.sh -s spec -t fast-interp
```

Test spec cases with aot mode, and use the wabt binary release package instead of compiling wabt from the source code:
```
./test_wamr.sh -s spec -t aot -b
```

Test spec cases with all modes (classic-interp/fast-interp/aot/jit):
```
./test_wamr.sh -s spec
```

Test spec cases with aot mode and pthread enabled:
```
./test_wamr.sh -s spec -t aot -p
```

Test spec cases with aot mode and SIMD enabled:
```
./test_wamr.sh -s spec -t aot -S
```

Test spec cases with fast-interp on target x86_32:
```
./test_wamr.sh -s spec -t fast-interp -m x86_32
```

5 changes: 5 additions & 0 deletions tests/wamr-test-suites/spec-test-script/CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
####################
2021-9-8

Modify runtest.py from https://github.com/kanaka/wac/blob/master/runtest.py
to enable testing spec cases with more checks and support more runtime modes.

0 comments on commit 87d0dfd

Please sign in to comment.