1 // Test what happens we save incremental compilation state that makes
2 // use of foreign items. This used to ICE (#34991).
7 #![feature(rustc_private)]
11 use std::ffi::CString;
14 use libc::{c_char, c_long, c_longlong};
17 pub fn atol(x: *const c_char) -> c_long;
18 pub fn atoll(x: *const c_char) -> c_longlong;
22 fn atol(s: String) -> isize {
23 let c = CString::new(s).unwrap();
24 unsafe { mlibc::atol(c.as_ptr()) as isize }
27 fn atoll(s: String) -> i64 {
28 let c = CString::new(s).unwrap();
29 unsafe { mlibc::atoll(c.as_ptr()) as i64 }
33 assert_eq!(atol("1024".to_string()) * 10, atol("10240".to_string()));
35 (atoll("11111111111111111".to_string()) * 10),
36 atoll("111111111111111110".to_string())