]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/asm-in-bad-modifier.rs
Imported Upstream version 1.0.0~beta
[rustc.git] / src / test / compile-fail / asm-in-bad-modifier.rs
CommitLineData
1a4d82fc
JJ
1// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
11#![feature(asm)]
12
13fn 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"))]
19pub fn main() {
20 let x: isize;
21 let y: isize;
22 unsafe {
c34b1796
AL
23 asm!("mov $1, $0" : "=r"(x) : "=r"(5)); //~ ERROR operand constraint contains '='
24 asm!("mov $1, $0" : "=r"(y) : "+r"(5)); //~ ERROR operand constraint contains '+'
1a4d82fc
JJ
25 }
26 foo(x);
27 foo(y);
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() {}