rust/tests/codegen/noreturnflag.rs
2023-01-11 09:32:08 +00:00

23 lines
432 B
Rust

// compile-flags: -g -C no-prepopulate-passes
#![crate_type = "lib"]
#[no_mangle]
pub fn foo() -> ! {
// CHECK: @foo() unnamed_addr #0
loop {}
}
pub enum EmptyEnum {}
#[no_mangle]
pub fn bar() -> EmptyEnum {
// CHECK: @bar() unnamed_addr #0
loop {}
}
// CHECK: attributes #0 = {{{.*}} noreturn {{.*}}}
// CHECK: DISubprogram(name: "foo", {{.*}} DIFlagNoReturn
// CHECK: DISubprogram(name: "bar", {{.*}} DIFlagNoReturn