From 2a7eff0188dc3b4903ef6f99fcd29ee806c354e3 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Wed, 12 Oct 2022 20:18:07 +0200 Subject: [PATCH] Enable threads/imports test, but disabling multiple table individual tests as it's not yet supported --- tests/compilers/wast.rs | 8 ++++++ tests/ignores.txt | 5 ---- tests/lib/wast/src/spectest.rs | 4 +++ .../wast/spec/proposals/threads/imports.wast | 26 +++++++++---------- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/tests/compilers/wast.rs b/tests/compilers/wast.rs index 576e62e19fa..a27d24b56f5 100644 --- a/tests/compilers/wast.rs +++ b/tests/compilers/wast.rs @@ -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); } @@ -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(&[ diff --git a/tests/ignores.txt b/tests/ignores.txt index ee5deb2a7ee..19d28fbf16f 100644 --- a/tests/ignores.txt +++ b/tests/ignores.txt @@ -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 diff --git a/tests/lib/wast/src/spectest.rs b/tests/lib/wast/src/spectest.rs index 9c2433ecd48..b4d44938491 100644 --- a/tests/lib/wast/src/spectest.rs +++ b/tests/lib/wast/src/spectest.rs @@ -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, @@ -43,6 +46,7 @@ pub fn spectest_importobject(store: &mut Store) -> Imports { "global_f64" => global_f64, "table" => table, "memory" => memory, + "shared_memory" => shared_memory, }, } } diff --git a/tests/wast/spec/proposals/threads/imports.wast b/tests/wast/spec/proposals/threads/imports.wast index 51dfbceaa28..4567171c782 100644 --- a/tests/wast/spec/proposals/threads/imports.wast +++ b/tests/wast/spec/proposals/threads/imports.wast @@ -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)))