rust/tests/codegen/naked-fn/naked-nocoverage.rs
Zalathar 5330ccdb34 Use -Zno-profiler-runtime instead of //@ needs-profiler-support
For PGO/coverage tests that don't need to build or run an actual artifact, we
can use `-Zno-profiler-runtime` to run the test even when the profiler runtime
is not available.
2024-06-14 13:31:46 +10:00

20 lines
535 B
Rust

// Checks that naked functions are not instrumented by -Cinstrument-coverage.
// Regression test for issue #105170.
//
//@ needs-asm-support
//@ compile-flags: -Zno-profiler-runtime
//@ 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 {{(dso_local )?}}void @f()
// CHECK-NEXT: start:
// CHECK-NEXT: call void asm
// CHECK-NEXT: unreachable
asm!("", options(noreturn));
}