Skip to content

Commit 57d3a69

Browse files
add rmake test
1 parent 3569883 commit 57d3a69

File tree

5 files changed

+93
-8
lines changed

5 files changed

+93
-8
lines changed

Cargo.lock

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ dependencies = [
2828
"cpufeatures",
2929
]
3030

31+
[[package]]
32+
name = "ahash"
33+
version = "0.8.12"
34+
source = "registry+https://github.com/rust-lang/crates.io-index"
35+
checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
36+
dependencies = [
37+
"cfg-if",
38+
"once_cell",
39+
"version_check",
40+
"zerocopy",
41+
]
42+
3143
[[package]]
3244
name = "aho-corasick"
3345
version = "1.1.3"
@@ -1565,6 +1577,15 @@ dependencies = [
15651577
"serde",
15661578
]
15671579

1580+
[[package]]
1581+
name = "hashbrown"
1582+
version = "0.14.5"
1583+
source = "registry+https://github.com/rust-lang/crates.io-index"
1584+
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
1585+
dependencies = [
1586+
"ahash",
1587+
]
1588+
15681589
[[package]]
15691590
name = "hashbrown"
15701591
version = "0.15.4"
@@ -1920,7 +1941,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
19201941
checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
19211942
dependencies = [
19221943
"equivalent",
1923-
"hashbrown",
1944+
"hashbrown 0.15.4",
19241945
"serde",
19251946
]
19261947

@@ -2635,7 +2656,7 @@ checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
26352656
dependencies = [
26362657
"crc32fast",
26372658
"flate2",
2638-
"hashbrown",
2659+
"hashbrown 0.15.4",
26392660
"indexmap",
26402661
"memchr",
26412662
"ruzstd 0.7.3",
@@ -2649,7 +2670,7 @@ checksum = "b3e3d0a7419f081f4a808147e845310313a39f322d7ae1f996b7f001d6cbed04"
26492670
dependencies = [
26502671
"crc32fast",
26512672
"flate2",
2652-
"hashbrown",
2673+
"hashbrown 0.15.4",
26532674
"indexmap",
26542675
"memchr",
26552676
"ruzstd 0.8.1",
@@ -3675,7 +3696,7 @@ dependencies = [
36753696
"either",
36763697
"elsa",
36773698
"ena",
3678-
"hashbrown",
3699+
"hashbrown 0.15.4",
36793700
"indexmap",
36803701
"jobserver",
36813702
"libc",
@@ -4494,7 +4515,7 @@ dependencies = [
44944515
name = "rustc_query_system"
44954516
version = "0.0.0"
44964517
dependencies = [
4497-
"hashbrown",
4518+
"hashbrown 0.15.4",
44984519
"parking_lot",
44994520
"rustc_abi",
45004521
"rustc_ast",
@@ -5433,7 +5454,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
54335454
checksum = "9e9c1e705f82a260173f3eec93f2ff6d7807f23ad5a8cc2e7316a891733ea7a1"
54345455
dependencies = [
54355456
"gimli 0.31.1",
5436-
"hashbrown",
5457+
"hashbrown 0.15.4",
54375458
"object 0.36.7",
54385459
"tracing",
54395460
]
@@ -6126,8 +6147,11 @@ version = "0.219.2"
61266147
source = "registry+https://github.com/rust-lang/crates.io-index"
61276148
checksum = "5220ee4c6ffcc0cb9d7c47398052203bc902c8ef3985b0c8134118440c0b2921"
61286149
dependencies = [
6150+
"ahash",
61296151
"bitflags",
6152+
"hashbrown 0.14.5",
61306153
"indexmap",
6154+
"semver",
61316155
]
61326156

61336157
[[package]]
@@ -6137,7 +6161,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
61376161
checksum = "be22e5a8f600afce671dd53c8d2dd26b4b7aa810fd18ae27dfc49737f3e02fc5"
61386162
dependencies = [
61396163
"bitflags",
6140-
"hashbrown",
6164+
"hashbrown 0.15.4",
61416165
"indexmap",
61426166
"semver",
61436167
"serde",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ pub(crate) const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
227227
"only-visionos",
228228
"only-wasm32",
229229
"only-wasm32-bare",
230+
"only-wasm32v1-none",
230231
"only-wasm32-wasip1",
231232
"only-watchos",
232233
"only-windows",

src/tools/run-make-support/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ object = "0.37"
1717
regex = "1.11"
1818
serde_json = "1.0"
1919
similar = "2.7"
20-
wasmparser = { version = "0.219", default-features = false, features = ["std"] }
20+
wasmparser = { version = "0.219", default-features = false, features = ["std", "features", "validate"] }
2121
# tidy-alphabetical-end
2222

2323
# Shared with bootstrap and compiletest
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#![no_std]
2+
#![crate_type = "cdylib"]
3+
4+
extern crate alloc;
5+
6+
use core::alloc::{GlobalAlloc, Layout};
7+
use core::mem::MaybeUninit;
8+
9+
#[global_allocator]
10+
static ALLOC: GlobalDlmalloc = GlobalDlmalloc;
11+
12+
struct GlobalDlmalloc;
13+
14+
unsafe impl GlobalAlloc for GlobalDlmalloc {
15+
#[inline]
16+
unsafe fn alloc(&self, _layout: Layout) -> *mut u8 {
17+
core::ptr::null_mut()
18+
}
19+
20+
#[inline]
21+
unsafe fn dealloc(&self, _ptr: *mut u8, _layout: Layout) {}
22+
}
23+
24+
#[used]
25+
static mut BUF: MaybeUninit<[u8; 1024]> = MaybeUninit::uninit();
26+
27+
#[no_mangle]
28+
extern "C" fn init() {
29+
alloc::alloc::handle_alloc_error(Layout::new::<[u8; 64 * 1024]>());
30+
}
31+
32+
#[panic_handler]
33+
fn my_panic(_: &core::panic::PanicInfo) -> ! {
34+
loop {}
35+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//@ only-wasm32v1-none
2+
3+
use std::path::Path;
4+
5+
use run_make_support::{rfs, rustc, wasmparser};
6+
7+
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")
15+
.run();
16+
verify_features(Path::new("foo.wasm"));
17+
}
18+
19+
fn verify_features(path: &Path) {
20+
eprintln!("verify {path:?}");
21+
let file = rfs::read(&path);
22+
23+
let mut validator = wasmparser::Validator::new_with_features(wasmparser::WasmFeatures::WASM1);
24+
validator.validate_all(&file).unwrap();
25+
}

0 commit comments

Comments
 (0)