]> git.lizzy.rs Git - rust.git/blobdiff - src/test/incremental/hashes/inline_asm.rs
Merge pull request #2 from rust-lang/master
[rust.git] / src / test / incremental / hashes / inline_asm.rs
index a77123110aeda8517daeb2d87d8bd7e9304c952f..3eaffc440615f73cf1d490f460f32a371404111f 100644 (file)
@@ -11,7 +11,7 @@
 
 #![allow(warnings)]
 #![feature(rustc_attrs)]
-#![feature(asm)]
+#![feature(llvm_asm)]
 #![crate_type="rlib"]
 
 
 pub fn change_template(a: i32) -> i32 {
     let c: i32;
     unsafe {
-        asm!("add 1, $0"
-             : "=r"(c)
-             : "0"(a)
-             :
-             :
-             );
+        llvm_asm!("add 1, $0"
+                  : "=r"(c)
+                  : "0"(a)
+                  :
+                  :
+                  );
     }
     c
 }
 
 #[cfg(not(cfail1))]
-#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
+#[rustc_clean(cfg="cfail2", except="hir_owner_nodes, mir_built, optimized_mir")]
 #[rustc_clean(cfg="cfail3")]
 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
 pub fn change_template(a: i32) -> i32 {
     let c: i32;
     unsafe {
-        asm!("add 2, $0"
-             : "=r"(c)
-             : "0"(a)
-             :
-             :
-             );
+        llvm_asm!("add 2, $0"
+                  : "=r"(c)
+                  : "0"(a)
+                  :
+                  :
+                  );
     }
     c
 }
@@ -58,30 +58,30 @@ pub fn change_output(a: i32) -> i32 {
     let mut _out1: i32 = 0;
     let mut _out2: i32 = 0;
     unsafe {
-        asm!("add 1, $0"
-             : "=r"(_out1)
-             : "0"(a)
-             :
-             :
-             );
+        llvm_asm!("add 1, $0"
+                  : "=r"(_out1)
+                  : "0"(a)
+                  :
+                  :
+                  );
     }
     _out1
 }
 
 #[cfg(not(cfail1))]
-#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
+#[rustc_clean(cfg="cfail2", except="hir_owner_nodes, mir_built, optimized_mir")]
 #[rustc_clean(cfg="cfail3")]
 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
 pub fn change_output(a: i32) -> i32 {
     let mut _out1: i32 = 0;
     let mut _out2: i32 = 0;
     unsafe {
-        asm!("add 1, $0"
-             : "=r"(_out2)
-             : "0"(a)
-             :
-             :
-             );
+        llvm_asm!("add 1, $0"
+                  : "=r"(_out2)
+                  : "0"(a)
+                  :
+                  :
+                  );
     }
     _out1
 }
@@ -94,29 +94,29 @@ pub fn change_output(a: i32) -> i32 {
 pub fn change_input(_a: i32, _b: i32) -> i32 {
     let _out;
     unsafe {
-        asm!("add 1, $0"
-             : "=r"(_out)
-             : "0"(_a)
-             :
-             :
-             );
+        llvm_asm!("add 1, $0"
+                  : "=r"(_out)
+                  : "0"(_a)
+                  :
+                  :
+                  );
     }
     _out
 }
 
 #[cfg(not(cfail1))]
-#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
+#[rustc_clean(cfg="cfail2", except="hir_owner_nodes, mir_built, optimized_mir")]
 #[rustc_clean(cfg="cfail3")]
 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
 pub fn change_input(_a: i32, _b: i32) -> i32 {
     let _out;
     unsafe {
-        asm!("add 1, $0"
-             : "=r"(_out)
-             : "0"(_b)
-             :
-             :
-             );
+        llvm_asm!("add 1, $0"
+                  : "=r"(_out)
+                  : "0"(_b)
+                  :
+                  :
+                  );
     }
     _out
 }
@@ -129,29 +129,29 @@ pub fn change_input(_a: i32, _b: i32) -> i32 {
 pub fn change_input_constraint(_a: i32, _b: i32) -> i32 {
     let _out;
     unsafe {
-        asm!("add 1, $0"
-             : "=r"(_out)
-             : "0"(_a), "r"(_b)
-             :
-             :
-             );
+        llvm_asm!("add 1, $0"
+                  : "=r"(_out)
+                  : "0"(_a), "r"(_b)
+                  :
+                  :
+                  );
     }
     _out
 }
 
 #[cfg(not(cfail1))]
-#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
+#[rustc_clean(cfg="cfail2", except="hir_owner_nodes, mir_built, optimized_mir")]
 #[rustc_clean(cfg="cfail3")]
 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
 pub fn change_input_constraint(_a: i32, _b: i32) -> i32 {
     let _out;
     unsafe {
-        asm!("add 1, $0"
-             : "=r"(_out)
-             : "r"(_a), "0"(_b)
-             :
-             :
-             );
+        llvm_asm!("add 1, $0"
+                  : "=r"(_out)
+                  : "r"(_a), "0"(_b)
+                  :
+                  :
+                  );
     }
     _out
 }
@@ -164,29 +164,29 @@ pub fn change_input_constraint(_a: i32, _b: i32) -> i32 {
 pub fn change_clobber(_a: i32) -> i32 {
     let _out;
     unsafe {
-        asm!("add 1, $0"
-             : "=r"(_out)
-             : "0"(_a)
-             :
-             :
-             );
+        llvm_asm!("add 1, $0"
+                  : "=r"(_out)
+                  : "0"(_a)
+                  :
+                  :
+                  );
     }
     _out
 }
 
 #[cfg(not(cfail1))]
-#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
+#[rustc_clean(cfg="cfail2", except="hir_owner_nodes, mir_built, optimized_mir")]
 #[rustc_clean(cfg="cfail3")]
 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
 pub fn change_clobber(_a: i32) -> i32 {
     let _out;
     unsafe {
-        asm!("add 1, $0"
-             : "=r"(_out)
-             : "0"(_a)
-             : "eax"
-             :
-             );
+        llvm_asm!("add 1, $0"
+                  : "=r"(_out)
+                  : "0"(_a)
+                  : "eax"
+                  :
+                  );
     }
     _out
 }
@@ -199,29 +199,29 @@ pub fn change_clobber(_a: i32) -> i32 {
 pub fn change_options(_a: i32) -> i32 {
     let _out;
     unsafe {
-        asm!("add 1, $0"
-             : "=r"(_out)
-             : "0"(_a)
-             :
-             :
-             );
+        llvm_asm!("add 1, $0"
+                  : "=r"(_out)
+                  : "0"(_a)
+                  :
+                  :
+                  );
     }
     _out
 }
 
 #[cfg(not(cfail1))]
-#[rustc_clean(cfg="cfail2", except="hir_owner_items, mir_built, optimized_mir")]
+#[rustc_clean(cfg="cfail2", except="hir_owner_nodes, mir_built, optimized_mir")]
 #[rustc_clean(cfg="cfail3")]
 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
 pub fn change_options(_a: i32) -> i32 {
     let _out;
     unsafe {
-        asm!("add 1, $0"
-             : "=r"(_out)
-             : "0"(_a)
-             :
-             : "volatile"
-             );
+        llvm_asm!("add 1, $0"
+                  : "=r"(_out)
+                  : "0"(_a)
+                  :
+                  : "volatile"
+                  );
     }
     _out
 }