Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ cargo_test() {
else
dir="debug"
fi
export CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime -Wexceptions --dir /checkout/target/wasm32-wasip1/$dir/deps::."
export CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime -Wexceptions --dir /checkout/target/wasm32-wasip1/$dir/build::."
cmd="$cmd --nocapture"
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion crates/core_arch/src/wasm32/simd128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4323,7 +4323,7 @@ mod tests {
let vec = i64x2_load_extend_i32x2(arr.as_ptr());
compare_bytes(vec, i64x2(-1, 1));
let vec = i64x2_load_extend_u32x2(arr.as_ptr() as *const u32);
compare_bytes(vec, i64x2(u32::max_value().into(), 1));
compare_bytes(vec, i64x2(u32::MAX.into(), 1));
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/core_arch/src/x86/sse2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3332,7 +3332,7 @@ mod tests {
core_arch::{simd::*, x86::*},
hint::black_box,
};
use std::{boxed, f32, f64, mem, ptr};
use std::{boxed, mem, ptr};
use stdarch_test::simd_test;

const NAN: f64 = f64::NAN;
Expand Down
22 changes: 22 additions & 0 deletions crates/stdarch-test/src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use crate::Function;
use std::collections::HashSet;
use std::path::Path;

pub(crate) fn disassemble_myself() -> HashSet<Function> {
// Use `std::env::args` to find the path to our executable. Assume the
Expand All @@ -11,6 +12,27 @@ pub(crate) fn disassemble_myself() -> HashSet<Function> {
let me = std::env::args()
.next()
.expect("failed to find current wasm file");
let me = Path::new(&me);
let me = if me.exists() {
// Old build-dir layout
me.to_path_buf()
} else {
// Cargo's build-dir layout stores an artifact named
// `<crate>-<hash>.wasm` at `<crate>/<hash>/out/<crate>-<hash>.wasm`.
// The build directory is mounted as the WASI working directory, so
// reconstruct that guest-visible path from the executable name.
let file_name = me
.file_name()
.and_then(|name| name.to_str())
.expect("current wasm file has a file name");
let stem = file_name
.strip_suffix(".wasm")
.expect("current wasm file does not have a .wasm extension");
let (crate_name, hash) = stem
.rsplit_once('-')
.expect("current wasm file name does not contain an artifact hash");
Path::new(crate_name).join(hash).join("out").join(file_name)
};
let output = wasmprinter::print_file(&me).unwrap();

let mut ret: HashSet<Function> = HashSet::new();
Expand Down
Loading