about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-10-05 19:41:41 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-10-05 19:42:25 +0000
commit9facf0bf72acf6cbf6ecb6c28c4b5364efc6b83f (patch)
tree885eb800e6a114fdd41d9624e16cdbc0fbc7a3da
parent3bcad65fbf67b6edf87c949531fbc13435882e6b (diff)
downloadrust-9facf0bf72acf6cbf6ecb6c28c4b5364efc6b83f.tar.gz
rust-9facf0bf72acf6cbf6ecb6c28c4b5364efc6b83f.zip
Properly export function defined in test which uses global_asm!()
Currently the test passes with the LLVM backend as the codegen unit
partitioning logic happens to place both the global_asm!() and the
function which calls the function defined by the global_asm!() in the
same CGU. With the Cranelift backend it breaks however as it will place
all assembly in separate codegen units to be passed to an external
linker.
-rw-r--r--tests/ui/asm/x86_64/issue-96797.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/ui/asm/x86_64/issue-96797.rs b/tests/ui/asm/x86_64/issue-96797.rs
index 951dd949b32..17985d7e8c8 100644
--- a/tests/ui/asm/x86_64/issue-96797.rs
+++ b/tests/ui/asm/x86_64/issue-96797.rs
@@ -11,7 +11,14 @@ use std::arch::global_asm;
 #[no_mangle]
 fn my_func() {}
 
-global_asm!("call_foobar: jmp {}", sym foobar);
+global_asm!("
+.globl call_foobar
+.type call_foobar,@function
+.section .text.call_foobar,\"ax\",@progbits
+call_foobar: jmp {}
+.size call_foobar, .-call_foobar
+.text
+", sym foobar);
 
 fn foobar() {}