rust/tests/mir-opt/const_prop/boxes.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
376 B
Rust
Raw Normal View History

2022-07-26 12:04:27 -05:00
// unit-test: ConstProp
2019-09-15 11:03:52 -05:00
// compile-flags: -O
// ignore-emscripten compiled with panic=abort by default
// ignore-wasm32
// ignore-wasm64
#![feature(rustc_attrs, stmt_expr_attributes)]
2019-09-15 11:03:52 -05:00
// Note: this test verifies that we, in fact, do not const prop `#[rustc_box]`
2019-09-15 11:03:52 -05:00
2020-07-27 14:22:43 -05:00
// EMIT_MIR boxes.main.ConstProp.diff
2019-09-15 11:03:52 -05:00
fn main() {
let x = *(#[rustc_box]
Box::new(42))
+ 0;
2019-09-15 11:03:52 -05:00
}