1
Fork 0

Merge commit 'e4fe941b11' into subtree-update_cg_gcc_2023-10-25

This commit is contained in:
Antoni Boucher 2023-10-26 17:42:02 -04:00
commit c797cccda6
47 changed files with 2659 additions and 502 deletions

View file

@ -0,0 +1,26 @@
// Compiler:
//
// Run-time:
// status: 0
use std::mem::MaybeUninit;
#[derive(Debug)]
struct Struct {
pointer: *const (),
func: unsafe fn(*const ()),
}
fn func(ptr: *const ()) {
}
fn main() {
let mut x = MaybeUninit::<&Struct>::uninit();
x.write(&Struct {
pointer: std::ptr::null(),
func,
});
let x = unsafe { x.assume_init() };
let value = unsafe { (x as *const Struct).read_volatile() };
println!("{:?}", value);
}