Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update spec test repo #4974

Merged
merged 4 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 13 additions & 20 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ fn main() -> anyhow::Result<()> {
// out.
if spec_tests > 0 {
test_directory_module(out, "tests/spec_testsuite/proposals/memory64", strategy)?;
test_directory_module(
out,
"tests/spec_testsuite/proposals/multi-memory",
strategy,
)?;
} else {
println!(
"cargo:warning=The spec testsuite is disabled. To enable, run `git submodule \
Expand Down Expand Up @@ -167,26 +172,14 @@ fn write_testsuite_tests(

/// Ignore tests that aren't supported yet.
fn ignore(testsuite: &str, testname: &str, strategy: &str) -> bool {
match strategy {
"Cranelift" => match (testsuite, testname) {
assert_eq!(strategy, "Cranelift");
drop(testsuite);
match env::var("CARGO_CFG_TARGET_ARCH").unwrap().as_str() {
"s390x" => {
// FIXME: These tests fail under qemu due to a qemu bug.
(_, "simd_f32x4_pmin_pmax") if platform_is_s390x() => return true,
(_, "simd_f64x2_pmin_pmax") if platform_is_s390x() => return true,
// riscv64 backend does not yet have a fully complete SIMD backend.
("simd", _) if platform_is_riscv64() => return true,
("memory64", "simd") if platform_is_riscv64() => return true,
_ => {}
},
_ => panic!("unrecognized strategy"),
testname == "simd_f32x4_pmin_pmax" || testname == "simd_f64x2_pmin_pmax"
}
"riscv64" => testname.contains("simd"),
_ => false,
}

false
}

fn platform_is_s390x() -> bool {
env::var("CARGO_CFG_TARGET_ARCH").unwrap() == "s390x"
}

fn platform_is_riscv64() -> bool {
env::var("CARGO_CFG_TARGET_ARCH").unwrap() == "riscv64"
}
6 changes: 3 additions & 3 deletions crates/wast/src/wast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,14 @@ impl<T> WastContext<T> {

fn is_matching_assert_invalid_error_message(expected: &str, actual: &str) -> bool {
actual.contains(expected)
// `elem.wast` and `proposals/bulk-memory-operations/elem.wast` disagree
// on the expected error message for the same error.
|| (expected.contains("out of bounds") && actual.contains("does not fit"))
// slight difference in error messages
|| (expected.contains("unknown elem segment") && actual.contains("unknown element segment"))
// The same test here is asserted to have one error message in
// `memory.wast` and a different error message in
// `memory64/memory.wast`, so we equate these two error messages to get
// the memory64 tests to pass.
|| (expected.contains("memory size must be at most 65536 pages") && actual.contains("invalid u32 number"))
// the spec test suite asserts a different error message than we print
// for this scenario
|| (expected == "unknown global" && actual.contains("global.get of locally defined global"))
}
4 changes: 1 addition & 3 deletions tests/all/wast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ fn run_wast(wast: &str, strategy: Strategy, pooling: bool) -> anyhow::Result<()>
}
let wast = Path::new(wast);

let simd = feature_found(wast, "simd");
let memory64 = feature_found(wast, "memory64");
let multi_memory = feature_found(wast, "multi-memory");
let threads = feature_found(wast, "threads");

let mut cfg = Config::new();
cfg.wasm_simd(simd)
.wasm_multi_memory(multi_memory)
cfg.wasm_multi_memory(multi_memory)
.wasm_threads(threads)
.wasm_memory64(memory64)
.cranelift_debug_verifier(true);
Expand Down
2 changes: 1 addition & 1 deletion tests/spec_testsuite
Submodule spec_testsuite updated 171 files