summaryrefslogtreecommitdiffstats
path: root/tests/ui/asm/x86_64/issue-96797.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/asm/x86_64/issue-96797.rs')
-rw-r--r--tests/ui/asm/x86_64/issue-96797.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/asm/x86_64/issue-96797.rs b/tests/ui/asm/x86_64/issue-96797.rs
new file mode 100644
index 000000000..954f8c5cc
--- /dev/null
+++ b/tests/ui/asm/x86_64/issue-96797.rs
@@ -0,0 +1,24 @@
+// build-pass
+// compile-flags: -O
+// min-llvm-version: 14.0.5
+// needs-asm-support
+// only-x86_64
+// only-linux
+
+// regression test for #96797
+
+use std::arch::global_asm;
+
+#[no_mangle]
+fn my_func() {}
+
+global_asm!("call_foobar: jmp {}", sym foobar);
+
+fn foobar() {}
+
+fn main() {
+ extern "Rust" {
+ fn call_foobar();
+ }
+ unsafe { call_foobar() };
+}