2013-02-27 21:53:31 -06:00
|
|
|
use core::unstable::run_in_bare_thread;
|
2013-01-11 20:32:46 -06:00
|
|
|
|
|
|
|
extern {
|
|
|
|
pub fn rust_dbg_call(cb: *u8,
|
|
|
|
data: libc::uintptr_t) -> libc::uintptr_t;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
unsafe {
|
|
|
|
do run_in_bare_thread() {
|
|
|
|
unsafe {
|
|
|
|
let i = &100;
|
|
|
|
rust_dbg_call(callback, cast::transmute(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extern fn callback(data: libc::uintptr_t) {
|
|
|
|
unsafe {
|
|
|
|
let data: *int = cast::transmute(data);
|
2013-03-06 15:58:02 -06:00
|
|
|
fail_unless!(*data == 100);
|
2013-01-11 20:32:46 -06:00
|
|
|
}
|
2013-02-14 13:47:00 -06:00
|
|
|
}
|