blob: 161add7e56a763deb9c127398b48968359f355c5 [file] [log] [blame]
Jeff Vander Stoepad6790c2020-06-24 15:34:31 +02001// ignore-s390x
2// ignore-emscripten
3// ignore-powerpc
4// ignore-powerpc64
5// ignore-powerpc64le
Jeff Vander Stoep983137f2020-09-16 14:50:30 +02006// ignore-riscv64
Jeff Vander Stoepad6790c2020-06-24 15:34:31 +02007// ignore-sparc
8// ignore-sparc64
9// ignore-mips
10// ignore-mips64
11
12#![feature(llvm_asm)]
Chris Wailesbcf972c2021-10-21 11:03:28 -070013#![allow(deprecated)] // llvm_asm!
Jeff Vander Stoepad6790c2020-06-24 15:34:31 +020014
15fn foo(x: isize) { println!("{}", x); }
16
17#[cfg(any(target_arch = "x86",
18 target_arch = "x86_64",
19 target_arch = "arm",
20 target_arch = "aarch64"))]
21pub fn main() {
22 let x: isize;
23 unsafe {
24 llvm_asm!("mov $1, $0" : "=r"(x) : "r"(x));
25 //~^ ERROR use of possibly-uninitialized variable: `x`
26 }
27 foo(x);
28}
29
30#[cfg(not(any(target_arch = "x86",
31 target_arch = "x86_64",
32 target_arch = "arm",
33 target_arch = "aarch64")))]
34pub fn main() {}