]> git.lizzy.rs Git - rust.git/blob - src/test/ui/simple_global_asm.rs
Rollup merge of #89945 - JohnTitor:we-now-specialize-clone-from-slice, r=the8472
[rust.git] / src / test / ui / simple_global_asm.rs
1 // run-pass
2
3 #![feature(global_asm)]
4 #![feature(naked_functions)]
5 #![allow(dead_code)]
6
7 #[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
8 global_asm!(
9     r#"
10     .global foo
11     .global _foo
12 foo:
13 _foo:
14     ret
15 "#
16 );
17
18 extern "C" {
19     fn foo();
20 }
21
22 #[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
23 fn main() {
24     unsafe {
25         foo();
26     }
27 }
28
29 #[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
30 fn main() {}