about summary refs log tree commit diff
path: root/tests/mir-opt/const_prop/reify_fn_ptr.rs
blob: d56f21e586aa884ed05bb1c29ddffdbb922d8a2c (plain)
1
2
3
4
5
6
7
8
9
10
//@ 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();
}