]> git.proxmox.com Git - rustc.git/blob - tests/codegen/naked-nocoverage.rs
New upstream version 1.69.0+dfsg1
[rustc.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 }