]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/asm-foreign.rs
Auto merge of #105716 - chriswailes:ndk-update-redux, r=pietroalbini
[rust.git] / tests / rustdoc / asm-foreign.rs
1 // Make sure rustdoc accepts asm! for a foreign architecture.
2
3 use std::arch::asm;
4
5 // @has asm_foreign/fn.aarch64.html
6 pub unsafe fn aarch64(a: f64, b: f64) -> f64 {
7     let c;
8     asm!("add {:d}, {:d}, d0", out(vreg) c, in(vreg) a, in("d0") {
9         || {};
10         b
11     });
12     c
13 }
14
15 // @has asm_foreign/fn.x86.html
16 pub unsafe fn x86(a: f64, b: f64) -> f64 {
17     let c;
18     asm!("addsd {}, {}, xmm0", out(xmm_reg) c, in(xmm_reg) a, in("xmm0") b);
19     c
20 }