Debian Codegraph @

gcc/testsuite/rust/compile/inline_asm_illegal_operands.rs

raw
1 #![feature(rustc_attrs)]
2
3 #[rustc_builtin_macro]
4 macro_rules! asm {
5 () => {}
6 }
7
8 fn main() {
9 let mut _x: u64 = 4;
10 unsafe {
11 asm!(
12 "add {x}, {1}",
13 x = in(reg) _x,
14 x = in(reg) _x, // { dg-error {duplicate argument named 'x'} }
15 );
16
17 asm!(
18 "mov {x}, {x}",
19 x = inout("eax") _x, // { dg-error {explicit register arguments cannot have names} }
20 x = inout(reg) _x, // It then proceeds to parse this line, resulting in only 1 error instead of duplication error as well.
21 );
22 }
23 _x = 1;
24 }