about summary refs log tree commit diff
path: root/tests/mir-opt/const_prop/boxes.rs
blob: a192d6b4133a216e43801fee26e35a0ce9936796 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ test-mir-pass: GVN
//@ compile-flags: -O
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY

#![feature(rustc_attrs, liballoc_internals)]

// Note: this test verifies that we, in fact, do not const prop `#[rustc_box]`

// EMIT_MIR boxes.main.GVN.diff
fn main() {
    // CHECK-LABEL: fn main(
    // CHECK: debug x => [[x:_.*]];
    // CHECK: (*{{_.*}}) = const 42_i32;
    // CHECK: [[tmp:_.*]] = copy (*{{_.*}});
    // CHECK: [[x]] = copy [[tmp]];
    let x = *(std::boxed::box_new(42)) + 0;
}