2 // ignore-wasm32-bare no libc to test with
5 #![feature(rustc_private)]
12 use libc::{c_char, c_long, c_longlong};
15 pub fn atol(x: *const c_char) -> c_long;
16 pub fn atoll(x: *const c_char) -> c_longlong;
20 fn atol(s: String) -> isize {
21 let c = CString::new(s).unwrap();
22 unsafe { mlibc::atol(c.as_ptr()) as isize }
25 fn atoll(s: String) -> i64 {
26 let c = CString::new(s).unwrap();
27 unsafe { mlibc::atoll(c.as_ptr()) as i64 }
31 assert_eq!(atol("1024".to_string()) * 10, atol("10240".to_string()));
32 assert_eq!((atoll("11111111111111111".to_string()) * 10),
33 atoll("111111111111111110".to_string()));