rewrite test-benches to rmake

This commit is contained in:
Oneirical 2024-07-19 14:05:09 -04:00
parent 3811f40d27
commit 7b19389d58
3 changed files with 21 additions and 13 deletions

View File

@ -100,7 +100,6 @@ run-make/staticlib-dylib-linkage/Makefile
run-make/symbol-mangling-hashed/Makefile
run-make/symbol-visibility/Makefile
run-make/sysroot-crates-are-unstable/Makefile
run-make/test-benches/Makefile
run-make/thumb-none-cortex-m/Makefile
run-make/thumb-none-qemu/Makefile
run-make/translation/Makefile

View File

@ -1,12 +0,0 @@
include ../tools.mk
# ignore-cross-compile
# needs-unwind #[bench] and -Zpanic-abort-tests can't be combined
all:
# Smoke-test that `#[bench]` isn't entirely broken.
$(RUSTC) --test smokebench.rs -O
$(call RUN,smokebench --bench)
$(call RUN,smokebench --bench noiter)
$(call RUN,smokebench --bench yesiter)
$(call RUN,smokebench)

View File

@ -0,0 +1,21 @@
// #[bench] is a Rust feature to run benchmarks on performance-critical
// code, which previously experienced a runtime panic bug in #103794.
// In order to ensure future breakages of this feature are detected, this
// smoke test was created, using the benchmarking feature with various
// runtime flags.
// See https://github.com/rust-lang/rust/issues/103794
//@ ignore-cross-compile
// Reason: the compiled binary is executed
//@ needs-unwind
// Reason: #[bench] and -Zpanic-abort-tests can't be combined
use run_make_support::{run, run_with_args, rustc};
fn main() {
rustc().arg("--test").input("smokebench.rs").opt().run();
run_with_args("smokebench", &["--bench"]);
run_with_args("smokebench", &["--bench", "noiter"]);
run_with_args("smokebench", &["--bench", "yesiter"]);
run("smokebench");
}