|
| 1 | +extern crate libc; |
| 2 | +use libc::*; |
| 3 | +extern crate libcc2rs; |
| 4 | +use libcc2rs::*; |
| 5 | +use std::collections::BTreeMap; |
| 6 | +use std::io::{Read, Seek, Write}; |
| 7 | +use std::os::fd::{AsFd, FromRawFd, IntoRawFd}; |
| 8 | +use std::rc::Rc; |
| 9 | +pub static mut s_0: std::cell::LazyCell<i32> = std::cell::LazyCell::new(|| unsafe { 55 }); |
| 10 | +#[repr(C)] |
| 11 | +#[derive(Copy, Clone, VaArg, Default)] |
| 12 | +pub struct Static_int_ {} |
| 13 | +pub static mut s_1: std::cell::LazyCell<libc::c_char> = |
| 14 | + std::cell::LazyCell::new(|| unsafe { (55 as libc::c_char) }); |
| 15 | +#[repr(C)] |
| 16 | +#[derive(Copy, Clone, VaArg, Default)] |
| 17 | +pub struct Static_char_ {} |
| 18 | +pub static mut s_2: std::cell::LazyCell<i64> = std::cell::LazyCell::new(|| unsafe { 55_i64 }); |
| 19 | +#[repr(C)] |
| 20 | +#[derive(Copy, Clone, VaArg, Default)] |
| 21 | +pub struct Static_long_ {} |
| 22 | +pub fn main() { |
| 23 | + unsafe { |
| 24 | + __cpp2rust_init_globals(); |
| 25 | + std::process::exit(main_0() as i32); |
| 26 | + } |
| 27 | +} |
| 28 | +unsafe fn main_0() -> i32 { |
| 29 | + (*std::cell::LazyCell::force_mut(&mut *&raw mut s_0)) = 22; |
| 30 | + (*std::cell::LazyCell::force_mut(&mut *&raw mut s_1)) = (33 as libc::c_char); |
| 31 | + assert!(((*std::cell::LazyCell::force_mut(&mut *&raw mut s_0)) == (22))); |
| 32 | + assert!((((*std::cell::LazyCell::force_mut(&mut *&raw mut s_1)) as i32) == (33))); |
| 33 | + assert!(((*std::cell::LazyCell::force_mut(&mut *&raw mut s_2)) == (55_i64))); |
| 34 | + return 0; |
| 35 | +} |
| 36 | +pub unsafe fn __cpp2rust_init_globals() { |
| 37 | + std::cell::LazyCell::force(&*&raw const s_0); |
| 38 | + std::cell::LazyCell::force(&*&raw const s_1); |
| 39 | + std::cell::LazyCell::force(&*&raw const s_2); |
| 40 | +} |
0 commit comments