PageRenderTime 72ms CodeModel.GetById 69ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-pass/issue-506.rs

http://github.com/jruderman/rust
Rust | 19 lines | 10 code | 3 blank | 6 comment | 0 complexity | b2a2a63bea302b66f643bcdc7910a0f2 MD5 | raw file
 1// xfail-test
 2/*
 3  A reduced test case for Issue #506, provided by Rob Arnold.
 4
 5  Testing spawning foreign functions
 6*/
 7
 8use std;
 9import task;
10
11#[abi = "cdecl"]
12extern mod rustrt {
13    fn get_task_id() -> libc::intptr_t;
14}
15
16fn main() {
17    let f: fn() -> libc::intptr_t = rustrt::get_task_id;
18    task::spawn(unsafe { unsafe::reinterpret_cast(f) });
19}