mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
22 lines
464 B
Rust
22 lines
464 B
Rust
// run-pass
|
|
// aux-build:extern-crosscrate-source.rs
|
|
// ignore-wasm32-bare no libc to test ffi with
|
|
|
|
#![feature(rustc_private)]
|
|
|
|
extern crate externcallback;
|
|
extern crate libc;
|
|
|
|
fn fact(n: libc::uintptr_t) -> libc::uintptr_t {
|
|
unsafe {
|
|
println!("n = {}", n);
|
|
externcallback::rustrt::rust_dbg_call(externcallback::cb, n)
|
|
}
|
|
}
|
|
|
|
pub fn main() {
|
|
let result = fact(10);
|
|
println!("result = {}", result);
|
|
assert_eq!(result, 3628800);
|
|
}
|