Skip to content

Commit f461cee

Browse files
StackOverflowExcept1onroot
authored andcommitted
change test target to wasm32-unknown-unknown
1 parent c334c30 commit f461cee

File tree

4 files changed

+37
-13
lines changed

4 files changed

+37
-13
lines changed

src/tools/compiletest/src/directives/directive_names.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ pub(crate) const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
228228
"only-wasm32",
229229
"only-wasm32-bare",
230230
"only-wasm32-wasip1",
231-
"only-wasm32v1-none",
232231
"only-watchos",
233232
"only-windows",
234233
"only-windows-gnu",

tests/run-make/wasm-unexpected-features/rmake.rs

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,32 @@
1-
//@ only-wasm32v1-none
1+
//@ only-wasm32-bare
22

33
use std::path::Path;
44

5-
use run_make_support::{rfs, rustc, wasmparser};
5+
use run_make_support::{cargo, path, rfs, target, wasmparser};
66

77
fn main() {
8-
rustc()
9-
.input("foo.rs")
10-
.target("wasm32v1-none")
11-
.lto("fat")
12-
.linker_plugin_lto("on")
13-
.link_arg("--import-memory")
14-
.opt_level("z")
8+
let target_dir = path("target");
9+
10+
cargo()
11+
.args([
12+
"rustc",
13+
"--manifest-path",
14+
"wasm32_test/Cargo.toml",
15+
"--profile",
16+
"release",
17+
"--target",
18+
"wasm32-unknown-unknown",
19+
"-Zbuild-std=std,core,panic_abort",
20+
"--",
21+
"-Clink-arg=--import-memory",
22+
"-Clinker-plugin-lto=on",
23+
])
24+
.env("RUSTFLAGS", "-Ctarget-cpu=mvp")
25+
.env("CARGO_TARGET_DIR", &target_dir)
1526
.run();
16-
verify_features(Path::new("foo.wasm"));
27+
28+
let wasm32_program_path = target_dir.join(target()).join("release").join("wasm32_program.wasm");
29+
verify_features(&wasm32_program_path);
1730
}
1831

1932
fn verify_features(path: &Path) {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[package]
2+
name = "wasm32_test"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[lib]
7+
crate-type = ["cdylib"]
8+
name = "wasm32_program"
9+
10+
[profile.release]
11+
codegen-units = 1
12+
lto = "fat"
13+
opt-level = "z"

tests/run-make/wasm-unexpected-features/foo.rs renamed to tests/run-make/wasm-unexpected-features/wasm32_test/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![no_std]
2-
#![crate_type = "cdylib"]
32

43
extern crate alloc;
54

@@ -24,7 +23,7 @@ unsafe impl GlobalAlloc for GlobalDlmalloc {
2423
#[used]
2524
static mut BUF: MaybeUninit<[u8; 1024]> = MaybeUninit::uninit();
2625

27-
#[no_mangle]
26+
#[unsafe(no_mangle)]
2827
extern "C" fn init() {
2928
alloc::alloc::handle_alloc_error(Layout::new::<[u8; 64 * 1024]>());
3029
}

0 commit comments

Comments
 (0)