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