about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-04 05:59:16 +0000
committerbors <bors@rust-lang.org>2021-12-04 05:59:16 +0000
commit887999d163bace7e79370b952bdd1f930ff4cdd5 (patch)
tree0b2a5642dfe49a0cebe9744394169acebf412ccc /src/test/codegen
parentf5815727786aa1ed2793af05cf65c5d79c290c67 (diff)
parent3dbb621c72e57c7eee9c10f20316d76c59168f83 (diff)
downloadrust-887999d163bace7e79370b952bdd1f930ff4cdd5.tar.gz
rust-887999d163bace7e79370b952bdd1f930ff4cdd5.zip
Auto merge of #88439 - cynecx:unwind_asm, r=Amanieu
Unwinding support for inline assembly

r? `@Amanieu`
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/asm-may_unwind.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/codegen/asm-may_unwind.rs b/src/test/codegen/asm-may_unwind.rs
new file mode 100644
index 00000000000..85cae8b2b1c
--- /dev/null
+++ b/src/test/codegen/asm-may_unwind.rs
@@ -0,0 +1,25 @@
+// min-llvm-version: 13.0.0
+// compile-flags: -O
+// only-x86_64
+
+#![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
+#[no_mangle]
+pub unsafe fn may_unwind() {
+    let _m = Foo;
+    // CHECK: invoke void asm sideeffect alignstack inteldialect unwind ""
+    asm!("", options(may_unwind));
+}