rust/tests/mir-opt/const_prop/reify_fn_ptr.rs
2024-09-24 23:12:02 +02:00

11 lines
400 B
Rust

//@ test-mir-pass: GVN
// EMIT_MIR reify_fn_ptr.main.GVN.diff
fn main() {
// CHECK-LABEL: fn main(
// CHECK: [[ptr:_.*]] = main as fn() (PointerCoercion(ReifyFnPointer, AsCast));
// CHECK: [[addr:_.*]] = move [[ptr]] as usize (PointerExposeProvenance);
// CHECK: [[back:_.*]] = move [[addr]] as *const fn() (PointerWithExposedProvenance);
let _ = main as usize as *const fn();
}