mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 18:23:49 +00:00
rewrite intrinsic-unreachable to rmake
This commit is contained in:
parent
59a4f02f83
commit
a4c72b6275
@ -47,7 +47,6 @@ run-make/foreign-rust-exceptions/Makefile
|
||||
run-make/incr-add-rust-src-component/Makefile
|
||||
run-make/incr-foreign-head-span/Makefile
|
||||
run-make/interdependent-c-libraries/Makefile
|
||||
run-make/intrinsic-unreachable/Makefile
|
||||
run-make/issue-107094/Makefile
|
||||
run-make/issue-109934-lto-debuginfo/Makefile
|
||||
run-make/issue-14698/Makefile
|
||||
|
@ -1,12 +0,0 @@
|
||||
include ../tools.mk
|
||||
|
||||
# needs-asm-support
|
||||
# ignore-windows-msvc
|
||||
#
|
||||
# Because of Windows exception handling, the code is not necessarily any shorter.
|
||||
# https://github.com/llvm-mirror/llvm/commit/64b2297786f7fd6f5fa24cdd4db0298fbf211466
|
||||
|
||||
all:
|
||||
$(RUSTC) -O --emit asm exit-ret.rs
|
||||
$(RUSTC) -O --emit asm exit-unreachable.rs
|
||||
test `wc -l < $(TMPDIR)/exit-unreachable.s` -lt `wc -l < $(TMPDIR)/exit-ret.s`
|
19
tests/run-make/intrinsic-unreachable/rmake.rs
Normal file
19
tests/run-make/intrinsic-unreachable/rmake.rs
Normal file
@ -0,0 +1,19 @@
|
||||
// intrinsics::unreachable tells the compiler that a certain point in the code
|
||||
// is not reachable by any means, which enables some useful optimizations.
|
||||
// In this test, exit-unreachable contains this instruction and exit-ret does not,
|
||||
// which means the emitted artifacts should be shorter in length.
|
||||
// See https://github.com/rust-lang/rust/pull/16970
|
||||
|
||||
//@ needs-asm-support
|
||||
//@ ignore-windows-msvc
|
||||
// Reason: Because of Windows exception handling, the code is not necessarily any shorter.
|
||||
|
||||
use run_make_support::rustc;
|
||||
use std::io::BufReader;
|
||||
use std::fs::File;
|
||||
|
||||
fn main() {
|
||||
rustc().opt().emit("asm").input("exit-ret.rs").run();
|
||||
rustc().opt().emit("asm").input("exit-unreachable.rs").run();
|
||||
assert!(BufReader::new(File::open("exit-unreachable.s")).lines().count() < BufReader::new(File::open("exit-ret.s")).lines().count());
|
||||
}
|
Loading…
Reference in New Issue
Block a user