Skip to content

Commit 5268120

Browse files
Rollup merge of #116458 - bjorn3:fix_global_asm_test, r=workingjubilee
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.
2 parents 0d68e41 + ecf271c commit 5268120

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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+
.pushsection .text.call_foobar,\"ax\",@progbits
18+
call_foobar: jmp {}
19+
.size call_foobar, .-call_foobar
20+
.popsection
21+
", sym foobar);
1522

1623
fn foobar() {}
1724

0 commit comments

Comments
 (0)