]> git.lizzy.rs Git - rust.git/blob - src/test/ui/abi/issue-28676.rs
Merge commit 'e18101137866b79045fee0ef996e696e68c920b4' into clippyup
[rust.git] / src / test / ui / abi / issue-28676.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(improper_ctypes)]
4
5 // ignore-wasm32-bare no libc to test ffi with
6
7 #[derive(Copy, Clone)]
8 pub struct Quad {
9     a: u64,
10     b: u64,
11     c: u64,
12     d: u64,
13 }
14
15 mod rustrt {
16     use super::Quad;
17
18     #[link(name = "rust_test_helpers", kind = "static")]
19     extern "C" {
20         pub fn get_c_many_params(
21             _: *const (),
22             _: *const (),
23             _: *const (),
24             _: *const (),
25             f: Quad,
26         ) -> u64;
27     }
28 }
29
30 fn test() {
31     unsafe {
32         let null = std::ptr::null();
33         let q = Quad { a: 1, b: 2, c: 3, d: 4 };
34         assert_eq!(rustrt::get_c_many_params(null, null, null, null, q), q.c);
35     }
36 }
37
38 pub fn main() {
39     test();
40 }