2023-09-20 16:43:33 -05:00
|
|
|
//@ unit-test: GVN
|
2019-09-15 11:03:52 -05:00
|
|
|
//@ compile-flags: -O
|
2023-06-08 02:18:34 -05:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2019-09-15 11:03:52 -05:00
|
|
|
|
2023-02-27 07:07:44 -06:00
|
|
|
#![feature(rustc_attrs, stmt_expr_attributes)]
|
2019-09-15 11:03:52 -05:00
|
|
|
|
2023-02-27 07:07:44 -06:00
|
|
|
// Note: this test verifies that we, in fact, do not const prop `#[rustc_box]`
|
2019-09-15 11:03:52 -05:00
|
|
|
|
2023-09-20 16:43:33 -05:00
|
|
|
// EMIT_MIR boxes.main.GVN.diff
|
2019-09-15 11:03:52 -05:00
|
|
|
fn main() {
|
2023-12-02 14:18:21 -06:00
|
|
|
// CHECK-LABEL: fn main(
|
|
|
|
// CHECK: debug x => [[x:_.*]];
|
|
|
|
// CHECK: (*{{_.*}}) = const 42_i32;
|
|
|
|
// CHECK: [[tmp:_.*]] = (*{{_.*}});
|
2023-03-20 16:37:36 -05:00
|
|
|
// CHECK: [[x]] = [[tmp]];
|
2023-02-27 07:07:44 -06:00
|
|
|
let x = *(#[rustc_box]
|
|
|
|
Box::new(42))
|
|
|
|
+ 0;
|
2019-09-15 11:03:52 -05:00
|
|
|
}
|