Skip to content

Commit

Permalink
Enable more tests on AArch64
Browse files Browse the repository at this point in the history
Copyright (c) 2021, Arm Limited.
  • Loading branch information
akirilov-arm committed Jun 17, 2021
1 parent fb07ff5 commit 19e218b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
11 changes: 9 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ fn write_testsuite_tests(
writeln!(out, r#"#[should_panic]"#)?;
} else if ignore(testsuite, &testname, strategy) {
writeln!(out, "#[ignore]")?;
} else if pooling {
// Ignore on aarch64 due to using QEMU for running tests (limited memory)
} else if pooling && platform_is_emulated_aarch64() {
// Ignore on aarch64 when using QEMU for running tests (limited memory)
writeln!(out, r#"#[cfg_attr(target_arch = "aarch64", ignore)]"#)?;
}

Expand Down Expand Up @@ -255,3 +255,10 @@ fn platform_is_x64() -> bool {
fn platform_is_s390x() -> bool {
env::var("CARGO_CFG_TARGET_ARCH").unwrap() == "s390x"
}

fn platform_is_emulated_aarch64() -> bool {
env::var("CARGO_CFG_TARGET_ARCH").unwrap() == "aarch64"
&& env::var("CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER")
.unwrap_or_default()
.contains("qemu")
}
1 change: 1 addition & 0 deletions crates/debug/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ fn ensure_supported_elf_format(bytes: &[u8]) -> Result<Endianness, Error> {
let e = header.endian().unwrap();

match header.e_machine.get(e) {
EM_AARCH64 => (),
EM_X86_64 => (),
EM_S390 => (),
machine => {
Expand Down
1 change: 0 additions & 1 deletion crates/wasmtime/src/module/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,6 @@ mod test {
Ok(())
}

#[cfg(target_arch = "x86_64")]
#[test]
fn test_isa_flags_mismatch() -> Result<()> {
let engine = Engine::default();
Expand Down
8 changes: 2 additions & 6 deletions tests/all/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,7 @@ fn func_write_nothing() -> anyhow::Result<()> {
}

#[test]
// Note: Cranelift only supports refrerence types (used in the wasm in this
// test) on x64.
#[cfg(target_arch = "x86_64")]
#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
fn return_cross_store_value() -> anyhow::Result<()> {
let wasm = wat::parse_str(
r#"
Expand Down Expand Up @@ -490,9 +488,7 @@ fn return_cross_store_value() -> anyhow::Result<()> {
}

#[test]
// Note: Cranelift only supports refrerence types (used in the wasm in this
// test) on x64.
#[cfg(target_arch = "x86_64")]
#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
fn pass_cross_store_arg() -> anyhow::Result<()> {
let mut config = Config::new();
config.wasm_reference_types(true);
Expand Down
1 change: 0 additions & 1 deletion tests/all/fuzzing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ fn instantiate_empty_module_with_memory() {
}

#[test]
#[cfg_attr(target_arch = "aarch64", ignore)] // FIXME(#1523)
fn instantiate_module_that_compiled_to_x64_has_register_32() {
let mut config = Config::new();
config.debug_info(true);
Expand Down
7 changes: 3 additions & 4 deletions tests/all/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ mod table;
mod traps;
mod wast;

// TODO(#1886): Cranelift only supports reference types on x64.
#[cfg(target_arch = "x86_64")]
#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
mod funcref;
#[cfg(target_arch = "x86_64")]
#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
mod gc;

/// A helper to compile a module in a new store with reference types enabled.
#[cfg(target_arch = "x86_64")]
#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
pub(crate) fn ref_types_module(
source: &str,
) -> anyhow::Result<(wasmtime::Store<()>, wasmtime::Module)> {
Expand Down

0 comments on commit 19e218b

Please sign in to comment.