Skip to content

Commit 19f3c52

Browse files
committed
Fix tests on non-x86_64 targets
1 parent 3698cd5 commit 19f3c52

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/inline-assembly.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -857,9 +857,9 @@ r[asm.abi-clobbers.many]
857857
`clobber_abi` may be specified any number of times. It will insert a clobber for all unique registers in the union of all specified calling conventions.
858858

859859
```rust
860+
# #[cfg(target_arch = "x86_64")] {
860861
extern "sysv64" fn foo() -> i32{ 0 }
861862
extern "win64" fn bar(x: i32) -> i32{ x + 1}
862-
# #[cfg(target_arch = "x86_64")] {
863863
let z: i32;
864864
// We can even call multiple functions with different conventions and different saved registers
865865
unsafe { core::arch::asm!("call {}", "mov ecx, eax", "call {}", sym foo, sym bar, out("rax") z, clobber_abi("C")); }
@@ -1016,6 +1016,7 @@ fn main() -> !{
10161016
// We can use an instruction to trap execution inside of a noreturn block
10171017
unsafe { core::arch::asm!("ud2", options(noreturn)); }
10181018
# }
1019+
# #[cfg(not(target_arch = "x86_64"))] panic!("no return");
10191020
}
10201021
```
10211022

0 commit comments

Comments
 (0)