2023-10-16 12:36:39 -05:00
|
|
|
// skip-filecheck
|
2022-10-07 06:59:26 -05:00
|
|
|
// Tests inlining of `may_unwind` inline assembly.
|
|
|
|
//
|
2023-06-08 02:18:34 -05:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2022-10-07 12:01:17 -05:00
|
|
|
// needs-asm-support
|
2023-06-04 19:21:00 -05:00
|
|
|
// compile-flags: -Zinline-mir-hint-threshold=1000
|
2022-10-07 06:59:26 -05:00
|
|
|
#![feature(asm_unwind)]
|
|
|
|
|
|
|
|
struct D;
|
|
|
|
|
|
|
|
impl Drop for D {
|
|
|
|
fn drop(&mut self) {}
|
|
|
|
}
|
|
|
|
|
2023-06-04 19:21:00 -05:00
|
|
|
#[inline]
|
2022-10-07 06:59:26 -05:00
|
|
|
fn foo() {
|
|
|
|
let _d = D;
|
|
|
|
unsafe { std::arch::asm!("", options(may_unwind)) };
|
|
|
|
}
|
|
|
|
|
|
|
|
// EMIT_MIR asm_unwind.main.Inline.diff
|
|
|
|
pub fn main() {
|
|
|
|
foo();
|
|
|
|
}
|