File tree Expand file tree Collapse file tree 10 files changed +23
-0
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 10 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -941,6 +941,7 @@ pub fn make_test_description<R: Read>(
941941 let has_hwasan = util:: HWASAN_SUPPORTED_TARGETS . contains ( & & * config. target ) ;
942942 let has_memtag = util:: MEMTAG_SUPPORTED_TARGETS . contains ( & & * config. target ) ;
943943 let has_shadow_call_stack = util:: SHADOWCALLSTACK_SUPPORTED_TARGETS . contains ( & & * config. target ) ;
944+ let has_xray = util:: XRAY_SUPPORTED_TARGETS . contains ( & & * config. target ) ;
944945
945946 // For tests using the `needs-rust-lld` directive (e.g. for `-Zgcc-ld=lld`), we need to find
946947 // whether `rust-lld` is present in the compiler under test.
@@ -1019,6 +1020,7 @@ pub fn make_test_description<R: Read>(
10191020 && config. parse_name_directive( ln, "needs-sanitizer-shadow-call-stack" )
10201021 ) ;
10211022 reason ! ( !config. can_unwind( ) && config. parse_name_directive( ln, "needs-unwind" ) ) ;
1023+ reason ! ( !has_xray && config. parse_name_directive( ln, "needs-xray" ) ) ;
10221024 reason ! (
10231025 config. target == "wasm32-unknown-unknown"
10241026 && config. parse_name_directive( ln, directives:: CHECK_RUN_RESULTS )
Original file line number Diff line number Diff line change @@ -78,6 +78,19 @@ pub const MEMTAG_SUPPORTED_TARGETS: &[&str] =
7878
7979pub const SHADOWCALLSTACK_SUPPORTED_TARGETS : & [ & str ] = & [ "aarch64-linux-android" ] ;
8080
81+ pub const XRAY_SUPPORTED_TARGETS : & [ & str ] = & [
82+ "aarch64-linux-android" ,
83+ "aarch64-unknown-linux-gnu" ,
84+ "aarch64-unknown-linux-musl" ,
85+ "x86_64-linux-android" ,
86+ "x86_64-unknown-freebsd" ,
87+ "x86_64-unknown-linux-gnu" ,
88+ "x86_64-unknown-linux-musl" ,
89+ "x86_64-unknown-netbsd" ,
90+ "x86_64-unknown-none-linuxkernel" ,
91+ "x86_64-unknown-openbsd" ,
92+ ] ;
93+
8194pub fn make_new_path ( path : & str ) -> String {
8295 assert ! ( cfg!( windows) ) ;
8396 // Windows just uses PATH as the library search path, so we have to
Original file line number Diff line number Diff line change 11// Checks that `-Z instrument-xray` produces expected instrumentation.
22//
3+ // needs-xray
34// compile-flags: -Z instrument-xray=always
45
56#![ crate_type = "lib" ]
Original file line number Diff line number Diff line change 11// Checks that `-Z instrument-xray` options can be specified multiple times.
22//
3+ // needs-xray
34// compile-flags: -Z instrument-xray=skip-exit
45// compile-flags: -Z instrument-xray=instruction-threshold=123
56// compile-flags: -Z instrument-xray=instruction-threshold=456
Original file line number Diff line number Diff line change 11// Checks that the last `-Z instrument-xray` option wins.
22//
3+ // needs-xray
34// compile-flags: -Z instrument-xray=always
45// compile-flags: -Z instrument-xray=never
56
Original file line number Diff line number Diff line change 11// Checks that `-Z instrument-xray` does not allow `always` and `never` simultaneously.
22//
3+ // needs-xray
34// compile-flags: -Z instrument-xray=always,never
45// error-pattern: incorrect value `always,never` for unstable option `instrument-xray`
56
Original file line number Diff line number Diff line change 11// Checks that `-Z instrument-xray` allows `always` and `never` sequentially.
22// (The last specified setting wins, like `-Z instrument-xray=no` as well.)
33//
4+ // needs-xray
45// compile-flags: -Z instrument-xray=always
56// compile-flags: -Z instrument-xray=never
67// check-pass
Original file line number Diff line number Diff line change 11// Verifies basic `-Z instrument-xray` flags.
22//
3+ // needs-xray
34// compile-flags: -Z instrument-xray
45// compile-flags: -Z instrument-xray=skip-exit
56// compile-flags: -Z instrument-xray=ignore-loops,instruction-threshold=300
Original file line number Diff line number Diff line change 11// Checks that `-Z instrument-xray` does not allow duplicates.
22//
3+ // needs-xray
34// compile-flags: -Z instrument-xray=always,always
45// error-pattern: incorrect value `always,always` for unstable option `instrument-xray`
56
Original file line number Diff line number Diff line change 11// Checks that `-Z instrument-xray` does not allow duplicates.
22//
3+ // needs-xray
34// compile-flags: -Z instrument-xray=ignore-loops,ignore-loops
45// error-pattern: incorrect value `ignore-loops,ignore-loops` for unstable option `instrument-xray`
56
You can’t perform that action at this time.
0 commit comments