]> git.proxmox.com Git - rustc.git/blob - src/test/ui/simple_global_asm.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / simple_global_asm.rs
1 // run-pass
2
3 #![feature(naked_functions)]
4 #![allow(dead_code)]
5
6 #[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
7 core::arch::global_asm!(
8 r#"
9 .global foo
10 .global _foo
11 foo:
12 _foo:
13 ret
14 "#
15 );
16
17 extern "C" {
18 fn foo();
19 }
20
21 #[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
22 fn main() {
23 unsafe {
24 foo();
25 }
26 }
27
28 #[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
29 fn main() {}