Skip to content

Commit 7b19389

Browse files
committed
rewrite test-benches to rmake
1 parent 3811f40 commit 7b19389

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ run-make/staticlib-dylib-linkage/Makefile
100100
run-make/symbol-mangling-hashed/Makefile
101101
run-make/symbol-visibility/Makefile
102102
run-make/sysroot-crates-are-unstable/Makefile
103-
run-make/test-benches/Makefile
104103
run-make/thumb-none-cortex-m/Makefile
105104
run-make/thumb-none-qemu/Makefile
106105
run-make/translation/Makefile

tests/run-make/test-benches/Makefile

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/run-make/test-benches/rmake.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// #[bench] is a Rust feature to run benchmarks on performance-critical
2+
// code, which previously experienced a runtime panic bug in #103794.
3+
// In order to ensure future breakages of this feature are detected, this
4+
// smoke test was created, using the benchmarking feature with various
5+
// runtime flags.
6+
// See https://github.com/rust-lang/rust/issues/103794
7+
8+
//@ ignore-cross-compile
9+
// Reason: the compiled binary is executed
10+
//@ needs-unwind
11+
// Reason: #[bench] and -Zpanic-abort-tests can't be combined
12+
13+
use run_make_support::{run, run_with_args, rustc};
14+
15+
fn main() {
16+
rustc().arg("--test").input("smokebench.rs").opt().run();
17+
run_with_args("smokebench", &["--bench"]);
18+
run_with_args("smokebench", &["--bench", "noiter"]);
19+
run_with_args("smokebench", &["--bench", "yesiter"]);
20+
run("smokebench");
21+
}

0 commit comments

Comments
 (0)