From 8e9ccdf28f91d56113117fd512819363602bdf89 Mon Sep 17 00:00:00 2001 From: cynecx Date: Sun, 14 Nov 2021 03:08:12 +0100 Subject: add tests for asm's options(may_unwind) --- src/test/codegen/asm-may_unwind.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/test/codegen/asm-may_unwind.rs (limited to 'src/test/codegen') diff --git a/src/test/codegen/asm-may_unwind.rs b/src/test/codegen/asm-may_unwind.rs new file mode 100644 index 00000000000..267eab7d105 --- /dev/null +++ b/src/test/codegen/asm-may_unwind.rs @@ -0,0 +1,24 @@ +// min-llvm-version: 13.0.0 +// compile-flags: -O + +#![crate_type = "rlib"] +#![feature(asm, asm_unwind)] + +#[no_mangle] +pub extern "C" fn panicky() {} + +struct Foo; + +impl Drop for Foo { + fn drop(&mut self) { + println!(); + } +} + +// CHECK-LABEL: @may_unwind +// CHECK: invoke void asm sideeffect alignstack unwind +#[no_mangle] +pub unsafe fn may_unwind() { + let _m = Foo; + asm!("", options(may_unwind)); +} -- cgit 1.4.1-3-g733a5