]> git.lizzy.rs Git - rust.git/blobdiff - src/test/codegen/loads.rs
Auto merge of #69030 - Dylan-DPC:rollup-t9uk7vc, r=Dylan-DPC
[rust.git] / src / test / codegen / loads.rs
index a65a3e1bb66fe52a446bb25cf4fda9a497ca612f..e164f5115fffdca30c01d3479d0bf9a0d9f58ada 100644 (file)
@@ -1,17 +1,6 @@
-// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
-// 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.
-
 // compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
-#![feature(rustc_attrs)]
 
 pub struct Bytes {
   a: u8,
@@ -22,15 +11,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