|
| 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::Seek; |
| 7 | +use std::io::{Read, Write}; |
| 8 | +use std::os::fd::AsFd; |
| 9 | +use std::rc::{Rc, Weak}; |
| 10 | +pub fn main() { |
| 11 | + std::process::exit(main_0()); |
| 12 | +} |
| 13 | +fn main_0() -> i32 { |
| 14 | + let special: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal( |
| 15 | + "\x07\x08\t\n\x0b\x0c\r !\"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~", |
| 16 | + ))); |
| 17 | + thread_local!( |
| 18 | + static expected: Value<Box<[u8]>> = Rc::new(RefCell::new(Box::new([ |
| 19 | + 7_u8, 8_u8, 9_u8, 10_u8, 11_u8, 12_u8, 13_u8, 32_u8, 33_u8, 34_u8, 35_u8, 36_u8, 37_u8, |
| 20 | + 38_u8, 39_u8, 40_u8, 41_u8, 42_u8, 43_u8, 44_u8, 45_u8, 46_u8, 47_u8, 58_u8, 59_u8, |
| 21 | + 60_u8, 61_u8, 62_u8, 63_u8, 64_u8, 91_u8, 92_u8, 93_u8, 94_u8, 95_u8, 96_u8, 123_u8, |
| 22 | + 124_u8, 125_u8, 126_u8, |
| 23 | + ]))); |
| 24 | + ); |
| 25 | + let i: Value<i32> = Rc::new(RefCell::new(0)); |
| 26 | + 'loop_: while ((*i.borrow()) |
| 27 | + < ((((::std::mem::size_of::<[u8; 40]>() as u64 as u64) |
| 28 | + .wrapping_div(::std::mem::size_of::<u8>() as u64 as u64)) as u64) as i32)) |
| 29 | + { |
| 30 | + assert!({ |
| 31 | + let _lhs = (((*special.borrow()).offset((*i.borrow()) as isize).read()) as i32); |
| 32 | + _lhs == ((*expected.with(Value::clone).borrow())[(*i.borrow()) as usize] as i32) |
| 33 | + }); |
| 34 | + (*i.borrow_mut()).postfix_inc(); |
| 35 | + } |
| 36 | + return 0; |
| 37 | +} |
0 commit comments