Skip to content

Commit

Permalink
Enable threads/imports test, but disabling multiple table individual …
Browse files Browse the repository at this point in the history
…tests as it's not yet supported
  • Loading branch information
ptitSeb committed Nov 22, 2022
1 parent b86f129 commit 3144ef2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
8 changes: 8 additions & 0 deletions tests/compilers/wast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ pub fn run_wast(mut config: crate::Config, wast_path: &str) -> anyhow::Result<()
let mut features = Features::default();
let is_bulkmemory = wast_path.contains("bulk-memory");
let is_simd = wast_path.contains("simd");
let is_threads = wast_path.contains("threads");
if is_bulkmemory {
features.bulk_memory(true);
}
if is_simd {
features.simd(true);
}
if is_threads {
features.threads(true);
}
if config.compiler == crate::Compiler::Singlepass {
features.multi_value(false);
}
Expand All @@ -53,6 +57,10 @@ pub fn run_wast(mut config: crate::Config, wast_path: &str) -> anyhow::Result<()
"Validation error: Invalid var_u32",
]);
}
if is_threads {
// We allow this, so tests can be run properly for `simd_const` test.
wast.allow_instantiation_failures(&["Validation error: multiple tables"]);
}
if config.compiler == crate::Compiler::Singlepass {
// We don't support multivalue yet in singlepass
wast.allow_instantiation_failures(&[
Expand Down
5 changes: 0 additions & 5 deletions tests/ignores.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ singlepass+aarch64+macos traps::start_trap_pretty
llvm traps::start_trap_pretty
cranelift+aarch64+macos traps::start_trap_pretty

# Atomics (WIP)
singlepass spec::threads::imports
cranelift spec::threads::imports
llvm spec::threads::imports

# Also neither LLVM nor Cranelift currently implement stack probing on AArch64.
# https://github.com/wasmerio/wasmer/issues/2808
cranelift+aarch64 spec::skip_stack_guard_page
Expand Down
4 changes: 4 additions & 0 deletions tests/lib/wast/src/spectest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ pub fn spectest_importobject(store: &mut Store) -> Imports {
let ty = MemoryType::new(1, Some(2), false);
let memory = Memory::new(store, ty).unwrap();

let ty = MemoryType::new(1, Some(2), true);
let shared_memory = Memory::new(store, ty).unwrap();

imports! {
"spectest" => {
"print" => print,
Expand All @@ -43,6 +46,7 @@ pub fn spectest_importobject(store: &mut Store) -> Imports {
"global_f64" => global_f64,
"table" => table,
"memory" => memory,
"shared_memory" => shared_memory,
},
}
}
26 changes: 13 additions & 13 deletions tests/wast/spec/proposals/threads/imports.wast
Original file line number Diff line number Diff line change
Expand Up @@ -305,19 +305,19 @@
(assert_trap (invoke "call" (i32.const 3)) "uninitialized element")
(assert_trap (invoke "call" (i32.const 100)) "undefined element")


(assert_invalid
(module (import "" "" (table 10 funcref)) (import "" "" (table 10 funcref)))
"multiple tables"
)
(assert_invalid
(module (import "" "" (table 10 funcref)) (table 10 funcref))
"multiple tables"
)
(assert_invalid
(module (table 10 funcref) (table 10 funcref))
"multiple tables"
)
;; No multiple table yet.
;;(assert_invalid
;; (module (import "" "" (table 10 funcref)) (import "" "" (table 10 funcref)))
;; "multiple tables"
;;)
;;(assert_invalid
;; (module (import "" "" (table 10 funcref)) (table 10 funcref))
;; "multiple tables"
;;)
;;(assert_invalid
;; (module (table 10 funcref) (table 10 funcref))
;; "multiple tables"
;;)

(module (import "test" "table-10-inf" (table 10 funcref)))
(module (import "test" "table-10-inf" (table 5 funcref)))
Expand Down

0 comments on commit 3144ef2

Please sign in to comment.