2022-07-08 11:08:32 -05:00
|
|
|
//@revisions: extern_block definition both
|
2021-04-15 16:19:23 -05:00
|
|
|
#![feature(rustc_attrs, c_unwind)]
|
|
|
|
|
|
|
|
#[cfg_attr(any(definition, both), rustc_allocator_nounwind)]
|
|
|
|
#[no_mangle]
|
|
|
|
extern "C-unwind" fn nounwind() {
|
2022-07-11 06:44:55 -05:00
|
|
|
//[definition]~^ ERROR: abnormal termination: the program aborted execution
|
|
|
|
//[both]~^^ ERROR: abnormal termination: the program aborted execution
|
2021-04-15 16:19:23 -05:00
|
|
|
panic!();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
extern "C-unwind" {
|
|
|
|
#[cfg_attr(any(extern_block, both), rustc_allocator_nounwind)]
|
|
|
|
fn nounwind();
|
|
|
|
}
|
|
|
|
unsafe { nounwind() }
|
2022-07-11 06:44:55 -05:00
|
|
|
//[extern_block]~^ ERROR: unwinding past a stack frame that does not allow unwinding
|
2021-04-15 16:19:23 -05:00
|
|
|
}
|