about summary refs log tree commit diff
path: root/example
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2022-08-12 12:30:24 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2022-08-12 12:38:48 +0000
commitf76ca2247998bff4e10b73fcb464a0a83edbfeb0 (patch)
treee8106540ae6ea395c5fdf9f92e78995285881c03 /example
parente45f6000a0bd46d4b7580db59c86f3d30adbc270 (diff)
downloadrust-f76ca2247998bff4e10b73fcb464a0a83edbfeb0.tar.gz
rust-f76ca2247998bff4e10b73fcb464a0a83edbfeb0.zip
Enable inline asm on macOS
Diffstat (limited to 'example')
-rw-r--r--example/mini_core_hello_world.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/example/mini_core_hello_world.rs b/example/mini_core_hello_world.rs
index 7e9cbe1bba5..e83be3a3df5 100644
--- a/example/mini_core_hello_world.rs
+++ b/example/mini_core_hello_world.rs
@@ -321,7 +321,7 @@ fn main() {
     #[cfg(not(any(jit, windows)))]
     test_tls();
 
-    #[cfg(all(not(jit), target_arch = "x86_64", target_os = "linux"))]
+    #[cfg(all(not(jit), target_arch = "x86_64", any(target_os = "linux", target_os = "darwin")))]
     unsafe {
         global_asm_test();
     }
@@ -343,7 +343,7 @@ fn main() {
 }
 }
 
-#[cfg(all(not(jit), target_arch = "x86_64", target_os = "linux"))]
+#[cfg(all(not(jit), target_arch = "x86_64", any(target_os = "linux", target_os = "darwin")))]
 extern "C" {
     fn global_asm_test();
 }
@@ -358,6 +358,16 @@ global_asm! {
     "
 }
 
+#[cfg(all(not(jit), target_arch = "x86_64", target_os = "darwin"))]
+global_asm! {
+    "
+    .global _global_asm_test
+    _global_asm_test:
+    // comment that would normally be removed by LLVM
+    ret
+    "
+}
+
 #[repr(C)]
 enum c_void {
     _1,