about summary refs log tree commit diff
path: root/src/test/codegen/asm-may_unwind.rs
blob: 3b34d79c3a946a1b18017bceb48fccc8ed0566be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// min-llvm-version: 13.0.0
// compile-flags: -O
// only-x86_64

#![crate_type = "rlib"]
#![feature(asm_unwind)]

use std::arch::asm;

#[no_mangle]
pub extern "C" fn panicky() {}

struct Foo;

impl Drop for Foo {
    fn drop(&mut self) {
        println!();
    }
}

// CHECK-LABEL: @may_unwind
#[no_mangle]
pub unsafe fn may_unwind() {
    let _m = Foo;
    // CHECK: invoke void asm sideeffect alignstack inteldialect unwind ""
    asm!("", options(may_unwind));
}