about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorA.J. Gardner <aaron.j.gardner@gmail.com>2017-04-07 09:46:34 -0500
committerA.J. Gardner <aaron.j.gardner@gmail.com>2017-04-13 00:49:13 -0500
commit63a074791e587fa2cbb9d1b2bfdd08e08a001d9f (patch)
tree10963a5692ce2e2175439032e042860add73cc3e /src/test
parent24a89a015e93afb473c267dbddc5c856d62a639c (diff)
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.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/simple_global_asm.rs8
1 files changed, 5 insertions, 3 deletions
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() {}