2014-12-12 17:39:27 -06:00
|
|
|
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
|
2013-10-17 13:24:41 -05:00
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2014-03-21 20:05:05 -05:00
|
|
|
#![feature(asm)]
|
2013-10-21 18:18:57 -05:00
|
|
|
|
2015-01-08 04:54:35 -06:00
|
|
|
fn foo(x: isize) { println!("{}", x); }
|
2013-10-17 13:24:41 -05:00
|
|
|
|
2014-09-24 22:22:57 -05:00
|
|
|
#[cfg(any(target_arch = "x86",
|
|
|
|
target_arch = "x86_64",
|
2014-12-12 17:39:27 -06:00
|
|
|
target_arch = "arm",
|
|
|
|
target_arch = "aarch64"))]
|
2013-10-17 13:24:41 -05:00
|
|
|
pub fn main() {
|
2015-01-08 04:54:35 -06:00
|
|
|
let x: isize;
|
2013-10-17 13:24:41 -05:00
|
|
|
unsafe {
|
2015-02-17 08:48:01 -06:00
|
|
|
asm!("mov $1, $0" : "r"(x) : "r"(5_usize)); //~ ERROR output operand constraint lacks '='
|
2013-10-17 13:24:41 -05:00
|
|
|
}
|
|
|
|
foo(x);
|
|
|
|
}
|
|
|
|
|
2014-12-12 17:39:27 -06:00
|
|
|
#[cfg(not(any(target_arch = "x86",
|
|
|
|
target_arch = "x86_64",
|
|
|
|
target_arch = "arm",
|
|
|
|
target_arch = "aarch64")))]
|
2013-10-17 13:24:41 -05:00
|
|
|
pub fn main() {}
|