File tree Expand file tree Collapse file tree 3 files changed +19
-13
lines changed
tests/run-make/intrinsic-unreachable Expand file tree Collapse file tree 3 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ run-make/foreign-rust-exceptions/Makefile
4949run-make/incr-add-rust-src-component/Makefile
5050run-make/incr-foreign-head-span/Makefile
5151run-make/interdependent-c-libraries/Makefile
52- run-make/intrinsic-unreachable/Makefile
5352run-make/issue-107094/Makefile
5453run-make/issue-109934-lto-debuginfo/Makefile
5554run-make/issue-14698/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments