rust/tests/mir-opt/const_prop/reify_fn_ptr.rs
2023-12-24 20:08:57 +00:00

11 lines
381 B
Rust

// unit-test: GVN
// EMIT_MIR reify_fn_ptr.main.GVN.diff
fn main() {
// CHECK-LABEL: fn main(
// CHECK: [[ptr:_.*]] = main as fn() (PointerCoercion(ReifyFnPointer));
// CHECK: [[addr:_.*]] = move [[ptr]] as usize (PointerExposeAddress);
// CHECK: [[back:_.*]] = move [[addr]] as *const fn() (PointerFromExposedAddress);
let _ = main as usize as *const fn();
}