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