diff options
| author | Amanieu d'Antras <amanieu@gmail.com> | 2021-03-06 19:00:04 +0000 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2021-03-13 20:49:32 +0000 |
| commit | fa3694fada38ba1d1b0657a739736b314904ec20 (patch) | |
| tree | 19edaa8ff0996b1e20a3093fe01ee79cc03e3001 /src | |
| parent | 56f74c52c1bb627ada01992787116054bf1e66e9 (diff) | |
| download | rust-fa3694fada38ba1d1b0657a739736b314904ec20.tar.gz rust-fa3694fada38ba1d1b0657a739736b314904ec20.zip | |
Always lower asm! to valid HIR
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/rustdoc-ui/asm-foreign.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/asm-foreign.rs b/src/test/rustdoc-ui/asm-foreign.rs new file mode 100644 index 00000000000..dfd73147417 --- /dev/null +++ b/src/test/rustdoc-ui/asm-foreign.rs @@ -0,0 +1,19 @@ +// check-pass +// Make sure rustdoc accepts asm! for a foreign architecture. + +#![feature(asm)] + +pub unsafe fn aarch64(a: f64, b: f64) { + let c; + asm!("add {:d}, {:d}, d0", out(vreg) c, in(vreg) a, in("d0") { + || {}; + b + }); + c +} + +pub unsafe fn x86(a: f64, b: f64) { + let c; + asm!("addsd {}, {}, xmm0", out(xmm_reg) c, in(xmm_reg) a, in("xmm0") b); + c +} |
