1 // Checks that naked functions are never inlined.
2 // compile-flags: -O -Zmir-opt-level=3
6 #![feature(naked_functions)]
12 pub unsafe extern "C" fn f() {
13 // Check that f has naked and noinline attributes.
15 // CHECK: define void @f() unnamed_addr [[ATTR:#[0-9]+]]
17 // CHECK-NEXT: call void asm
18 asm!("", options(noreturn));
23 // Check that call to f is not inlined.
25 // CHECK-LABEL: define void @g()
27 // CHECK-NEXT: call void @f()
31 // CHECK: attributes [[ATTR]] = { naked noinline{{.*}} }