2 #![allow(improper_ctypes)]
4 // ignore-wasm32-bare no libc to test ffi with
13 #[link(name = "rust_test_helpers", kind = "static")]
15 pub fn get_x(x: S) -> u64;
16 pub fn get_y(x: S) -> u64;
17 pub fn get_z(x: S) -> u64;
21 fn indirect_call(func: unsafe extern "C" fn(s: S) -> u64, s: S) -> u64 {
26 let s = S { x: 1, y: 2, z: 3 };
27 assert_eq!(s.x, indirect_call(get_x, s));
28 assert_eq!(s.y, indirect_call(get_y, s));
29 assert_eq!(s.z, indirect_call(get_z, s));