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