]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/sanitizer-option.rs
Rollup merge of #106113 - krasimirgg:llvm-16-ext-tyid, r=nikic
[rust.git] / tests / rustdoc / sanitizer-option.rs
1 // needs-sanitizer-support
2 // needs-sanitizer-address
3 // compile-flags: --test -Z sanitizer=address
4 //
5 // #43031: Verify that rustdoc passes `-Z` options to rustc. Use an extern
6 // function that is provided by the sanitizer runtime, if flag is not passed
7 // correctly, then linking will fail.
8
9 /// ```
10 /// extern "C" {
11 ///     fn __sanitizer_print_stack_trace();
12 /// }
13 ///
14 /// fn main() {
15 ///     unsafe { __sanitizer_print_stack_trace() };
16 /// }
17 /// ```
18 pub fn z_flag_is_passed_to_rustc() {}