]> git.lizzy.rs Git - rust.git/blob - tests/ui/abi/extern/extern-return-TwoU64s.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / abi / extern / extern-return-TwoU64s.rs
1 // run-pass
2 #![allow(improper_ctypes)]
3
4 // ignore-wasm32-bare no libc to test ffi with
5
6 pub struct TwoU64s {
7     one: u64,
8     two: u64,
9 }
10
11 #[link(name = "rust_test_helpers", kind = "static")]
12 extern "C" {
13     pub fn rust_dbg_extern_return_TwoU64s() -> TwoU64s;
14 }
15
16 pub fn main() {
17     unsafe {
18         let y = rust_dbg_extern_return_TwoU64s();
19         assert_eq!(y.one, 10);
20         assert_eq!(y.two, 20);
21     }
22 }