rust/src/test/run-pass/extern-return-TwoU32s.rs
Brian Anderson 8a6d6dd868 rustc: Fix struct returns on x86 mac for 8-byte structs
Mac appears to follow the same ABI as MSVC. This fixes one case
but leaves others broken, like windows.
2013-04-18 14:14:17 -07:00

26 lines
729 B
Rust

// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
struct TwoU32s {
one: u32, two: u32
}
pub extern {
pub fn rust_dbg_extern_return_TwoU32s() -> TwoU32s;
}
pub fn main() {
unsafe {
let y = rust_dbg_extern_return_TwoU32s();
assert!(y.one == 10);
assert!(y.two == 20);
}
}