summaryrefslogtreecommitdiffstats
path: root/tests/codegen/naked-nocoverage.rs
blob: 91a6260bf2aa2f1794b3f676a1b231ab91b69848 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Checks that naked functions are not instrumented by -Cinstrument-coverage.
// Regression test for issue #105170.
//
// needs-asm-support
// needs-profiler-support
// compile-flags: -Cinstrument-coverage
#![crate_type = "lib"]
#![feature(naked_functions)]
use std::arch::asm;

#[naked]
#[no_mangle]
pub unsafe extern "C" fn f() {
    // CHECK:       define void @f()
    // CHECK-NEXT:  start:
    // CHECK-NEXT:    call void asm
    // CHECK-NEXT:    unreachable
    asm!("", options(noreturn));
}