10 //[mir]compile-flags: -Z borrowck=mir
14 #[cfg(any(target_arch = "x86",
15 target_arch = "x86_64",
17 target_arch = "aarch64",
19 target_arch = "mips64"))]
25 asm!("nop" : : "r"(x));
27 let z = x; //[ast]~ ERROR use of moved value: `x`
28 //[mir]~^ ERROR use of moved value: `x`
35 asm!("nop" : : "r"(x)); //[ast]~ ERROR cannot use
36 //[mir]~^ ERROR cannot use
44 asm!("nop" : "=r"(x)); //[ast]~ ERROR cannot assign twice
45 //[mir]~^ ERROR cannot assign twice
50 asm!("nop" : "=r"(a)); //[ast]~ ERROR cannot assign to `a` because it is borrowed
51 // No MIR error, this is a shallow write.
60 asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign twice
61 //[mir]~^ ERROR cannot assign twice
65 fn indirect_is_not_init() {
68 asm!("nop" : "=*r"(x)); //[ast]~ ERROR use of possibly uninitialized variable
69 //[mir]~^ ERROR use of possibly uninitialized variable
77 asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign to `x` because it is borrowed
78 //[mir]~^ ERROR cannot assign to `x` because it is borrowed
86 asm!("nop" : : "r"(x), "r"(x) ); //[ast]~ ERROR use of moved value
87 //[mir]~^ ERROR use of moved value