Skip to content

Commit 699aab9

Browse files
committed
rewrite intrinsic-unreachable to rmake
1 parent 11dd90f commit 699aab9

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ run-make/foreign-rust-exceptions/Makefile
4949
run-make/incr-add-rust-src-component/Makefile
5050
run-make/incr-foreign-head-span/Makefile
5151
run-make/interdependent-c-libraries/Makefile
52-
run-make/intrinsic-unreachable/Makefile
5352
run-make/issue-107094/Makefile
5453
run-make/issue-109934-lto-debuginfo/Makefile
5554
run-make/issue-14698/Makefile

tests/run-make/intrinsic-unreachable/Makefile

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// intrinsics::unreachable tells the compiler that a certain point in the code
2+
// is not reachable by any means, which enables some useful optimizations.
3+
// In this test, exit-unreachable contains this instruction and exit-ret does not,
4+
// which means the emitted artifacts should be shorter in length.
5+
// See https://github.com/rust-lang/rust/pull/16970
6+
7+
//@ needs-asm-support
8+
//@ ignore-windows-msvc
9+
// Reason: Because of Windows exception handling, the code is not necessarily any shorter.
10+
11+
use run_make_support::rustc;
12+
use std::io::BufReader;
13+
use std::fs::File;
14+
15+
fn main() {
16+
rustc().opt().emit("asm").input("exit-ret.rs").run();
17+
rustc().opt().emit("asm").input("exit-unreachable.rs").run();
18+
assert!(BufReader::new(File::open("exit-unreachable.s")).lines().count() < BufReader::new(File::open("exit-ret.s")).lines().count());
19+
}

0 commit comments

Comments
 (0)