Skip to content

Commit 68b6bb2

Browse files
committed
Migrate wasm-exceptions-nostd to rmake
1 parent 189232b commit 68b6bb2

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -186,5 +186,4 @@ run-make/track-pgo-dep-info/Makefile
186186
run-make/translation/Makefile
187187
run-make/type-mismatch-same-crate-name/Makefile
188188
run-make/unstable-flag-required/Makefile
189-
run-make/wasm-exceptions-nostd/Makefile
190189
run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile

tests/run-make/wasm-exceptions-nostd/Makefile

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//@ only-wasm32-bare
2+
3+
use std::path::Path;
4+
5+
use run_make_support::{cmd, env_var, rustc};
6+
7+
fn main() {
8+
// Add a few command line args to make exceptions work
9+
rustc()
10+
.input(Path::new("src").join("lib.rs"))
11+
.target("wasm32-unknown-unknown")
12+
.panic("unwind")
13+
.arg("-Cllvm-args=-wasm-enable-eh")
14+
.arg("-Ctarget-feature=+exception-handling")
15+
.run();
16+
17+
cmd(&env_var("NODE")).arg("verify.mjs").arg("lib.wasm").run();
18+
}

tests/run-make/wasm-exceptions-nostd/src/panicking.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ fn panic_handler(info: &core::panic::PanicInfo<'_>) -> ! {
1717
use alloc::boxed::Box;
1818
use alloc::string::ToString;
1919

20-
let msg = info.message().map(|msg| msg.to_string()).unwrap_or("(no message)".to_string());
21-
let exception = Box::new(msg.to_string());
20+
let msg = info.message().to_string();
21+
let exception = Box::new(msg);
2222
unsafe {
2323
let exception_raw = Box::into_raw(exception);
2424
wasm_throw(exception_raw as *mut u8);

0 commit comments

Comments
 (0)