]> git.lizzy.rs Git - rust.git/blob - src/test/ui/foreign/foreign-truncated-arguments.rs
Merge commit '5ff7b632a95bac6955611d85040859128902c580' into sync-rustfmt-subtree
[rust.git] / src / test / ui / foreign / foreign-truncated-arguments.rs
1 // run-pass
2 // compile-flags: -O
3 // Regression test for https://github.com/rust-lang/rust/issues/33868
4
5 #[repr(C)]
6 pub struct S {
7     a: u32,
8     b: f32,
9     c: u32
10 }
11
12 #[no_mangle]
13 #[inline(never)]
14 pub extern "C" fn test(s: S) -> u32 {
15     s.c
16 }
17
18 fn main() {
19     assert_eq!(test(S{a: 0, b: 0.0, c: 42}), 42);
20 }