From 63a074791e587fa2cbb9d1b2bfdd08e08a001d9f Mon Sep 17 00:00:00 2001 From: "A.J. Gardner" Date: Fri, 7 Apr 2017 09:46:34 -0500 Subject: Make simple_global_asm even simpler Windows builder croaked. This change tries to fix that by actually calling the global_asm-defined function so the symbol doesn't get optimized away, if that is in fact what was happening. Additionally, we provide an empty main() for non-x86 arches. --- src/test/run-pass/simple_global_asm.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/test') diff --git a/src/test/run-pass/simple_global_asm.rs b/src/test/run-pass/simple_global_asm.rs index a5ffe607fdf..ac2cacf3db2 100644 --- a/src/test/run-pass/simple_global_asm.rs +++ b/src/test/run-pass/simple_global_asm.rs @@ -9,19 +9,21 @@ // except according to those terms. #![feature(global_asm)] +#![feature(naked_functions)] #[cfg(any(target_arch = "x86_64", target_arch = "x86"))] global_asm!(r#" .global foo foo: - jmp baz + ret "#); extern { fn foo(); } -#[no_mangle] -pub extern fn baz() {} +#[cfg(any(target_arch = "x86_64", target_arch = "x86"))] +fn main() { unsafe { foo(); } } +#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))] fn main() {} -- cgit 1.4.1-3-g733a5