]>
git.proxmox.com Git - rustc.git/blob - src/test/run-pass/extern/extern-call-scrub.rs
2 #![allow(unused_must_use)]
3 // This time we're testing repeatedly going up and down both stacks to
4 // make sure the stack pointers are maintained properly in both
7 // ignore-emscripten no threads support
9 #![feature(rustc_private)]
17 #[link(name = "rust_test_helpers", kind = "static")]
19 pub fn rust_dbg_call(cb
: extern "C" fn(libc
::uintptr_t
) -> libc
::uintptr_t
,
20 data
: libc
::uintptr_t
)
25 extern fn cb(data
: libc
::uintptr_t
) -> libc
::uintptr_t
{
29 count(data
- 1) + count(data
- 1)
33 fn count(n
: libc
::uintptr_t
) -> libc
::uintptr_t
{
35 println
!("n = {}", n
);
36 rustrt
::rust_dbg_call(cb
, n
)
41 // Make sure we're on a thread with small Rust stacks (main currently
43 thread
::spawn(move|| {
44 let result
= count(12);
45 println
!("result = {}", result
);
46 assert_eq
!(result
, 2048);