|
| 1 | +extern crate libcc2rs; |
| 2 | +use libcc2rs::*; |
| 3 | +use std::cell::RefCell; |
| 4 | +use std::collections::BTreeMap; |
| 5 | +use std::io::prelude::*; |
| 6 | +use std::io::{Read, Seek, Write}; |
| 7 | +use std::os::fd::AsFd; |
| 8 | +use std::rc::{Rc, Weak}; |
| 9 | +pub fn main() { |
| 10 | + std::process::exit(main_0()); |
| 11 | +} |
| 12 | +fn main_0() -> i32 { |
| 13 | + pub struct anon_0 { |
| 14 | + __bytes: Value<Box<[u8]>>, |
| 15 | + } |
| 16 | + impl anon_0 { |
| 17 | + pub fn p(&self) -> Ptr<Ptr<i32>> { |
| 18 | + (self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast() |
| 19 | + } |
| 20 | + pub fn bits(&self) -> Ptr<u64> { |
| 21 | + (self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast() |
| 22 | + } |
| 23 | + } |
| 24 | + impl Clone for anon_0 { |
| 25 | + fn clone(&self) -> Self { |
| 26 | + anon_0 { |
| 27 | + __bytes: Rc::new(RefCell::new(self.__bytes.borrow().clone())), |
| 28 | + } |
| 29 | + } |
| 30 | + } |
| 31 | + impl Default for anon_0 { |
| 32 | + fn default() -> Self { |
| 33 | + anon_0 { |
| 34 | + __bytes: Rc::new(RefCell::new(Box::from([0u8; 8]))), |
| 35 | + } |
| 36 | + } |
| 37 | + } |
| 38 | + impl ByteRepr for anon_0 { |
| 39 | + fn byte_size() -> usize { |
| 40 | + 8 |
| 41 | + } |
| 42 | + fn to_bytes(&self, buf: &mut [u8]) { |
| 43 | + buf.copy_from_slice(&self.__bytes.borrow()); |
| 44 | + } |
| 45 | + fn from_bytes(buf: &[u8]) -> Self { |
| 46 | + anon_0 { |
| 47 | + __bytes: Rc::new(RefCell::new(Box::from(buf))), |
| 48 | + } |
| 49 | + } |
| 50 | + }; |
| 51 | + let u: Value<anon_0> = <Value<anon_0>>::default(); |
| 52 | + (*u.borrow_mut()).bits().write(0_u64); |
| 53 | + assert!((((((*u.borrow()).p().read()).is_null()) as i32) != 0)); |
| 54 | + let x: Value<i32> = Rc::new(RefCell::new(5)); |
| 55 | + (*u.borrow_mut()).p().write((x.as_pointer())); |
| 56 | + assert!((((((*u.borrow()).bits().read()) != 0_u64) as i32) != 0)); |
| 57 | + (*u.borrow_mut()).bits().write(0_u64); |
| 58 | + assert!((((((*u.borrow()).p().read()).is_null()) as i32) != 0)); |
| 59 | + (*u.borrow_mut()).p().write(Ptr::<i32>::null()); |
| 60 | + assert!((((((*u.borrow()).bits().read()) == 0_u64) as i32) != 0)); |
| 61 | + return 0; |
| 62 | +} |
0 commit comments