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

20 lines
485 B
Rust
Raw Normal View History

2023-09-20 21:43:33 +00:00
// unit-test: GVN
2019-09-15 12:03:52 -04:00
// compile-flags: -O
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
2019-09-15 12:03:52 -04:00
#![feature(rustc_attrs, stmt_expr_attributes)]
2019-09-15 12:03:52 -04: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]];
let x = *(#[rustc_box]
Box::new(42))
+ 0;
2019-09-15 12:03:52 -04:00
}