about summary refs log tree commit diff
path: root/tests/ui/asm/x86_64/issue-96797.rs
blob: 531e16795dd8dcdb7997aca2f9f318517dd75350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//@ 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
.pushsection .text.call_foobar,\"ax\",@progbits
call_foobar: jmp {}
.size call_foobar, .-call_foobar
.popsection
", sym foobar);

fn foobar() {}

fn main() {
    extern "Rust" {
        fn call_foobar();
    }
    unsafe { call_foobar() };
}