2019-07-26 21:54:25 +00:00
|
|
|
// run-pass
|
|
|
|
|
2017-04-07 14:46:34 +00:00
|
|
|
#![feature(naked_functions)]
|
2018-09-19 14:28:06 +00:00
|
|
|
#![allow(dead_code)]
|
2017-03-22 04:47:25 +00:00
|
|
|
|
|
|
|
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
|
2021-12-10 00:15:33 +00:00
|
|
|
core::arch::global_asm!(
|
2020-09-01 21:12:52 +00:00
|
|
|
r#"
|
2017-03-22 04:47:25 +00:00
|
|
|
.global foo
|
2017-04-14 04:41:03 +00:00
|
|
|
.global _foo
|
2017-03-22 04:47:25 +00:00
|
|
|
foo:
|
2017-04-14 04:41:03 +00:00
|
|
|
_foo:
|
2017-04-07 14:46:34 +00:00
|
|
|
ret
|
2020-09-01 21:12:52 +00:00
|
|
|
"#
|
|
|
|
);
|
2017-03-22 04:47:25 +00:00
|
|
|
|
2020-09-01 21:12:52 +00:00
|
|
|
extern "C" {
|
2017-03-22 04:47:25 +00:00
|
|
|
fn foo();
|
|
|
|
}
|
|
|
|
|
2017-04-07 14:46:34 +00:00
|
|
|
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
|
2020-09-01 21:12:52 +00:00
|
|
|
fn main() {
|
|
|
|
unsafe {
|
|
|
|
foo();
|
|
|
|
}
|
|
|
|
}
|
2017-03-22 04:47:25 +00:00
|
|
|
|
2017-04-07 14:46:34 +00:00
|
|
|
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
|
2017-03-22 04:47:25 +00:00
|
|
|
fn main() {}
|