]> git.lizzy.rs Git - rust.git/blob - src/test/ui/asm/x86_64/issue-82869.rs
Rollup merge of #91122 - dtolnay:not, r=m-ou-se
[rust.git] / src / test / ui / asm / x86_64 / issue-82869.rs
1 // only-x86_64
2 // Make sure rustc doesn't ICE on asm! for a foreign architecture.
3
4 #![crate_type = "rlib"]
5
6 use std::arch::asm;
7
8 pub unsafe fn aarch64(a: f64, b: f64) -> f64 {
9     let c;
10     asm!("add {:d}, {:d}, d0", out(vreg) c, in(vreg) a, in("d0") {
11         || {};
12         b
13     });
14     //~^^^^ invalid register class
15     //~^^^^^ invalid register class
16     //~^^^^^^ invalid register
17     c
18 }
19
20 pub unsafe fn x86(a: f64, b: f64) -> f64 {
21     let c;
22     asm!("addsd {}, {}, xmm0", out(xmm_reg) c, in(xmm_reg) a, in("xmm0") b);
23     c
24 }