Skip to content

Commit 9facf0b

Browse files
committed
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.
1 parent 3bcad65 commit 9facf0b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: tests/ui/asm/x86_64/issue-96797.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ use std::arch::global_asm;
1111
#[no_mangle]
1212
fn my_func() {}
1313

14-
global_asm!("call_foobar: jmp {}", sym foobar);
14+
global_asm!("
15+
.globl call_foobar
16+
.type call_foobar,@function
17+
.section .text.call_foobar,\"ax\",@progbits
18+
call_foobar: jmp {}
19+
.size call_foobar, .-call_foobar
20+
.text
21+
", sym foobar);
1522

1623
fn foobar() {}
1724

0 commit comments

Comments
 (0)