rust/tests/ui/abi/extern/extern-crosscrate.rs
2024-04-17 15:08:08 -04:00

18 lines
342 B
Rust

//@ run-pass
//@ aux-build:extern-crosscrate-source.rs
extern crate externcallback;
fn fact(n: u64) -> u64 {
unsafe {
println!("n = {:?}", n);
externcallback::rust_dbg_call(externcallback::cb, n)
}
}
pub fn main() {
let result = fact(10);
println!("result = {}", result);
assert_eq!(result, 3628800);
}