rust/tests/ui/asm/x86_64/issue-96797.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
478 B
Rust
Raw Normal View History

// build-pass
// compile-flags: -O
// needs-asm-support
// only-x86_64
// only-linux
// regression test for #96797
use std::arch::global_asm;
#[no_mangle]
fn my_func() {}
global_asm!("
.globl call_foobar
.type call_foobar,@function
2023-10-06 06:02:11 -05:00
.pushsection .text.call_foobar,\"ax\",@progbits
call_foobar: jmp {}
.size call_foobar, .-call_foobar
2023-10-06 06:02:11 -05:00
.popsection
", sym foobar);
fn foobar() {}
fn main() {
extern "Rust" {
fn call_foobar();
}
unsafe { call_foobar() };
}