]> git.lizzy.rs Git - rust.git/blob - tests/codegen/naked-nocoverage.rs
Rollup merge of #106106 - jyn514:remote-tracking-branch, r=Mark-Simulacrum
[rust.git] / tests / codegen / naked-nocoverage.rs
1 // Checks that naked functions are not instrumented by -Cinstrument-coverage.
2 // Regression test for issue #105170.
3 //
4 // needs-asm-support
5 // needs-profiler-support
6 // compile-flags: -Cinstrument-coverage
7 #![crate_type = "lib"]
8 #![feature(naked_functions)]
9 use std::arch::asm;
10
11 #[naked]
12 #[no_mangle]
13 pub unsafe extern "C" fn f() {
14     // CHECK:       define void @f()
15     // CHECK-NEXT:  start:
16     // CHECK-NEXT:    call void asm
17     // CHECK-NEXT:    unreachable
18     asm!("", options(noreturn));
19 }