2024-03-27 16:55:09 -05:00
|
|
|
//@ only-wasm32-wasip1
|
2024-03-06 14:39:07 -06:00
|
|
|
#![deny(warnings)]
|
|
|
|
|
2024-07-17 08:31:38 -05:00
|
|
|
use run_make_support::{rfs, rustc};
|
2024-03-06 14:39:07 -06:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
test("a");
|
|
|
|
test("b");
|
|
|
|
test("c");
|
|
|
|
test("d");
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test(cfg: &str) {
|
|
|
|
eprintln!("running cfg {cfg:?}");
|
|
|
|
|
2024-07-19 12:27:14 -05:00
|
|
|
rustc()
|
|
|
|
.input("foo.rs")
|
|
|
|
.target("wasm32-wasip1")
|
|
|
|
.arg("-Clto")
|
|
|
|
.arg("-Cstrip=debuginfo")
|
|
|
|
.opt()
|
|
|
|
.cfg(cfg)
|
|
|
|
.run();
|
2024-03-13 16:52:23 -05:00
|
|
|
|
2024-07-17 07:42:06 -05:00
|
|
|
let bytes = rfs::read("foo.wasm");
|
2024-03-06 14:39:07 -06:00
|
|
|
println!("{}", bytes.len());
|
|
|
|
assert!(bytes.len() < 40_000);
|
|
|
|
}
|