]> git.lizzy.rs Git - rust.git/blob - tests/ui/abi/extern/extern-return-TwoU16s.rs
Rollup merge of #105526 - Xiretza:iter-from-generator-derive, r=scottmcm
[rust.git] / tests / ui / abi / extern / extern-return-TwoU16s.rs
1 // run-pass
2 #![allow(improper_ctypes)]
3
4 // ignore-wasm32-bare no libc to test ffi with
5
6 pub struct TwoU16s {
7     one: u16,
8     two: u16,
9 }
10
11 #[link(name = "rust_test_helpers", kind = "static")]
12 extern "C" {
13     pub fn rust_dbg_extern_return_TwoU16s() -> TwoU16s;
14 }
15
16 pub fn main() {
17     unsafe {
18         let y = rust_dbg_extern_return_TwoU16s();
19         assert_eq!(y.one, 10);
20         assert_eq!(y.two, 20);
21     }
22 }