File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed
tests/run-make/branch-protection-check-IBT Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 1+ #![ no_std]
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4141use run_make_support:: { bare_rustc, llvm_readobj} ;
4242
4343fn main ( ) {
44- // `main .rs` is `#![no_std]` to not pull in the currently not-compiled-with-IBT precompiled std.
44+ // `lib .rs` is `#![no_std]` to not pull in the currently not-compiled-with-IBT precompiled std.
4545 bare_rustc ( )
46- . input ( "main.rs" )
46+ . input ( "lib.rs" )
47+ . crate_type ( "lib" )
48+ . emit ( "obj=lib.o" )
4749 . target ( "x86_64-unknown-linux-gnu" )
4850 . arg ( "-Zcf-protection=branch" )
49- . arg ( "-Clink-args=-nostartfiles" )
5051 . run ( ) ;
5152
52- llvm_readobj ( ) . arg ( "-nW" ) . input ( "main" ) . run ( ) . assert_stdout_contains ( ".note.gnu.property" ) ;
53+ llvm_readobj ( )
54+ . arg ( "-nW" )
55+ . input ( "lib.o" )
56+ . run ( )
57+ . assert_stdout_contains ( ".note.gnu.property" )
58+ . assert_stdout_contains ( "feature: IBT" ) ;
5359}
You can’t perform that action at this time.
0 commit comments