File tree Expand file tree Collapse file tree 7 files changed +79
-10
lines changed
compiler/rustc_target/src/spec/targets Expand file tree Collapse file tree 7 files changed +79
-10
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ pub(crate) fn target() -> Target {
2222 max_atomic_width : Some ( 128 ) ,
2323 // FIXME: The leak sanitizer currently fails the tests, see #88132.
2424 supported_sanitizers : SanitizerSet :: ADDRESS | SanitizerSet :: CFI | SanitizerSet :: THREAD ,
25+ supports_xray : true ,
2526 ..opts
2627 } ,
2728 }
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ pub(crate) fn target() -> Target {
2323 | SanitizerSet :: CFI
2424 | SanitizerSet :: LEAK
2525 | SanitizerSet :: THREAD ,
26+ supports_xray : true ,
2627 ..opts
2728 } ,
2829 }
Original file line number Diff line number Diff line change 1+ //@ assembly-output: emit-asm
2+ //@ compile-flags: -Zinstrument-xray=always
3+
4+ //@ revisions: aarch64-linux
5+ //@[aarch64-linux] compile-flags: --target=aarch64-unknown-linux-gnu
6+ //@[aarch64-linux] needs-llvm-components: aarch64
7+ //@[aarch64-linux] only-aarch64-unknown-linux-gnu
8+
9+ //@ revisions: aarch64-darwin
10+ //@[aarch64-darwin] compile-flags: --target=aarch64-apple-darwin
11+ //@[aarch64-darwin] needs-llvm-components: aarch64
12+ //@[aarch64-darwin] only-aarch64-apple-darwin
13+
14+ #![ crate_type = "lib" ]
15+
16+ // CHECK-LABEL: xray_func:
17+ #[ no_mangle]
18+ pub fn xray_func ( ) {
19+ // CHECK: nop
20+
21+ std:: hint:: black_box ( ( ) ) ;
22+
23+ // CHECK: b #32
24+ // CHECK-NEXT: nop
25+ }
Original file line number Diff line number Diff line change 1+ //@ assembly-output: emit-asm
2+ //@ compile-flags: -Zinstrument-xray=always -Cllvm-args=-x86-asm-syntax=intel
3+
4+ //@ revisions: x86_64-linux
5+ //@[x86_64-linux] compile-flags: --target=x86_64-unknown-linux-gnu
6+ //@[x86_64-linux] needs-llvm-components: x86
7+ //@[x86_64-linux] only-x86_64-unknown-linux-gnu
8+
9+ //@ revisions: x86_64-darwin
10+ //@[x86_64-darwin] compile-flags: --target=x86_64-apple-darwin
11+ //@[x86_64-darwin] needs-llvm-components: x86
12+ //@[x86_64-darwin] only-x86_64-apple-darwin
13+
14+ #![ crate_type = "lib" ]
15+
16+ // CHECK-LABEL: xray_func:
17+ #[ no_mangle]
18+ pub fn xray_func ( ) {
19+ // CHECK: nop word ptr [rax + rax + 512]
20+
21+ std:: hint:: black_box ( ( ) ) ;
22+
23+ // CHECK: ret
24+ // CHECK-NEXT: nop word ptr cs:[rax + rax + 512]
25+ }
Original file line number Diff line number Diff line change 1+ //@ only-nightly (flag is still unstable)
2+ //@ needs-xray
3+
4+ //@ revisions: unsupported
5+ //@[unsupported] needs-llvm-components: x86
6+ //@[unsupported] compile-flags: -Z instrument-xray --target=x86_64-pc-windows-msvc
7+
8+ //@ revisions: x86_64-linux
9+ //@[x86_64-linux] needs-llvm-components: x86
10+ //@[x86_64-linux] compile-flags: -Z instrument-xray --target=x86_64-unknown-linux-gnu
11+ //@[x86_64-linux] check-pass
12+
13+ //@ revisions: x86_64-darwin
14+ //@[x86_64-darwin] needs-llvm-components: x86
15+ //@[x86_64-darwin] compile-flags: -Z instrument-xray --target=x86_64-apple-darwin
16+ //@[x86_64-darwin] check-pass
17+
18+ //@ revisions: aarch64-darwin
19+ //@[aarch64-darwin] needs-llvm-components: aarch64
20+ //@[aarch64-darwin] compile-flags: -Z instrument-xray --target=aarch64-apple-darwin
21+ //@[aarch64-darwin] check-pass
22+
23+ #![ feature( no_core) ]
24+ #![ no_core]
25+ #![ no_main]
26+
27+ //[unsupported]~? ERROR XRay instrumentation is not supported for this target
File renamed without changes.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments