Skip to content

Commit

Permalink
Unrolled build for rust-lang#116458
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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.
  • Loading branch information
rust-timer authored Oct 7, 2023
2 parents 8fdb0a9 + ecf271c commit ae5b9ea
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/ui/asm/x86_64/issue-96797.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
.pushsection .text.call_foobar,\"ax\",@progbits
call_foobar: jmp {}
.size call_foobar, .-call_foobar
.popsection
", sym foobar);

fn foobar() {}

Expand Down

0 comments on commit ae5b9ea

Please sign in to comment.