]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/asm/x86_64/bad-reg.rs
2 // compile-flags: -C target-feature=+avx2
10 // Bad register/register class
12 asm
!("{}", in(foo
) foo
);
13 //~^ ERROR invalid register class `foo`: unknown register class
14 asm
!("", in("foo") foo
);
15 //~^ ERROR invalid register `foo`: unknown register
16 asm
!("{:z}", in(reg
) foo
);
17 //~^ ERROR invalid asm template modifier for this register class
18 asm
!("{:r}", in(xmm_reg
) foo
);
19 //~^ ERROR invalid asm template modifier for this register class
20 asm
!("{:a}", const 0);
21 //~^ ERROR asm template modifiers are not allowed for `const` arguments
22 asm
!("{:a}", sym main
);
23 //~^ ERROR asm template modifiers are not allowed for `sym` arguments
24 asm
!("", in("ebp") foo
);
25 //~^ ERROR invalid register `ebp`: the frame pointer cannot be used as an operand
26 asm
!("", in("rsp") foo
);
27 //~^ ERROR invalid register `rsp`: the stack pointer cannot be used as an operand
28 asm
!("", in("ip") foo
);
29 //~^ ERROR invalid register `ip`: the instruction pointer cannot be used as an operand
30 asm
!("", in("k0") foo
);
31 //~^ ERROR invalid register `k0`: the k0 AVX mask register cannot be used as an operand
32 asm
!("", in("ah") foo
);
33 //~^ ERROR invalid register `ah`: high byte registers cannot be used as an operand
35 asm
!("", in("st(2)") foo
);
36 //~^ ERROR register class `x87_reg` can only be used as a clobber, not as an input or output
37 asm
!("", in("mm0") foo
);
38 //~^ ERROR register class `mmx_reg` can only be used as a clobber, not as an input or output
39 asm
!("", out("st(2)") _
);
40 asm
!("", out("mm0") _
);
41 asm
!("{}", in(x87_reg
) foo
);
42 //~^ ERROR register class `x87_reg` can only be used as a clobber, not as an input or output
43 asm
!("{}", in(mmx_reg
) foo
);
44 //~^ ERROR register class `mmx_reg` can only be used as a clobber, not as an input or output
45 asm
!("{}", out(x87_reg
) _
);
46 //~^ ERROR register class `x87_reg` can only be used as a clobber, not as an input or output
47 asm
!("{}", out(mmx_reg
) _
);
48 //~^ ERROR register class `mmx_reg` can only be used as a clobber, not as an input or output
50 // Explicit register conflicts
51 // (except in/lateout which don't conflict)
53 asm
!("", in("eax") foo
, in("al") bar
);
54 //~^ ERROR register `al` conflicts with register `ax`
55 asm
!("", in("rax") foo
, out("rax") bar
);
56 //~^ ERROR register `ax` conflicts with register `ax`
57 asm
!("", in("al") foo
, lateout("al") bar
);
58 asm
!("", in("xmm0") foo
, in("ymm0") bar
);
59 //~^ ERROR register `ymm0` conflicts with register `xmm0`
60 asm
!("", in("xmm0") foo
, out("ymm0") bar
);
61 //~^ ERROR register `ymm0` conflicts with register `xmm0`
62 asm
!("", in("xmm0") foo
, lateout("ymm0") bar
);