]> git.proxmox.com Git - rustc.git/blobdiff - src/test/codegen/loads.rs
New upstream version 1.13.0+dfsg1
[rustc.git] / src / test / codegen / loads.rs
index a65a3e1bb66fe52a446bb25cf4fda9a497ca612f..def5269e07a02b1c345a897e5677c65ba9fa9276 100644 (file)
@@ -11,7 +11,6 @@
 // compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-#![feature(rustc_attrs)]
 
 pub struct Bytes {
   a: u8,
@@ -22,15 +21,14 @@ pub struct Bytes {
 
 // CHECK-LABEL: @borrow
 #[no_mangle]
-#[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn borrow(x: &i32) -> &i32 {
 // CHECK: load {{(i32\*, )?}}i32** %x{{.*}}, !nonnull
+    &x; // keep variable in an alloca
     x
 }
 
 // CHECK-LABEL: @_box
 #[no_mangle]
-#[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn _box(x: Box<i32>) -> i32 {
 // CHECK: load {{(i32\*, )?}}i32** %x{{.*}}, !nonnull
     *x