summary refs log tree commit diff
path: root/src/test/run-pass/x86stdcall.rs
blob: 3185080103410b4552554db05bd40335b9780504 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// GetLastError doesn't seem to work with stack switching
// xfail-test

#[cfg(target_os = "win32")]
extern "stdcall" mod kernel32 {
    fn SetLastError(err: uint);
    fn GetLastError() -> uint;
}


#[cfg(target_os = "win32")]
fn main() {
    let expected = 1234u;
    kernel32::SetLastError(expected);
    let actual = kernel32::GetLastError();
    log(error, actual);
    assert (expected == actual);
}

#[cfg(target_os = "macos")]
#[cfg(target_os = "linux")]
#[cfg(target_os = "freebsd")]
fn main() { }