]> git.lizzy.rs Git - rust.git/blob - src/test/ui/asm/asm-out-read-uninit.rs
Auto merge of #71230 - Dylan-DPC:rollup-rofigbv, r=Dylan-DPC
[rust.git] / src / test / ui / asm / asm-out-read-uninit.rs
1 // ignore-s390x
2 // ignore-emscripten
3 // ignore-powerpc
4 // ignore-powerpc64
5 // ignore-powerpc64le
6 // ignore-sparc
7 // ignore-sparc64
8 // ignore-mips
9 // ignore-mips64
10
11 #![feature(llvm_asm)]
12
13 fn foo(x: isize) { println!("{}", x); }
14
15 #[cfg(any(target_arch = "x86",
16           target_arch = "x86_64",
17           target_arch = "arm",
18           target_arch = "aarch64"))]
19 pub fn main() {
20     let x: isize;
21     unsafe {
22         llvm_asm!("mov $1, $0" : "=r"(x) : "r"(x));
23         //~^ ERROR use of possibly-uninitialized variable: `x`
24     }
25     foo(x);
26 }
27
28 #[cfg(not(any(target_arch = "x86",
29               target_arch = "x86_64",
30               target_arch = "arm",
31               target_arch = "aarch64")))]
32 pub fn main() {}