summaryrefslogtreecommitdiff
path: root/tests/expectations/tests/struct_containing_forward_declared_struct.rs
blob: 60f1226272224494050337e50aca67e60f421161 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* automatically generated by rust-bindgen */


#![allow(non_snake_case)]


#[repr(C)]
#[derive(Debug, Copy)]
pub struct a {
    pub val_a: *mut a_b,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct a_b {
    pub val_b: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_a_b() {
    assert_eq!(::std::mem::size_of::<a_b>() , 4usize , concat ! (
               "Size of: " , stringify ! ( a_b ) ));
    assert_eq! (::std::mem::align_of::<a_b>() , 4usize , concat ! (
                "Alignment of " , stringify ! ( a_b ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const a_b ) ) . val_b as * const _ as usize } ,
                0usize , concat ! (
                "Alignment of field: " , stringify ! ( a_b ) , "::" ,
                stringify ! ( val_b ) ));
}
impl Clone for a_b {
    fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_a() {
    assert_eq!(::std::mem::size_of::<a>() , 8usize , concat ! (
               "Size of: " , stringify ! ( a ) ));
    assert_eq! (::std::mem::align_of::<a>() , 8usize , concat ! (
                "Alignment of " , stringify ! ( a ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const a ) ) . val_a as * const _ as usize } ,
                0usize , concat ! (
                "Alignment of field: " , stringify ! ( a ) , "::" , stringify
                ! ( val_a ) ));
}
impl Clone for a {
    fn clone(&self) -> Self { *self }
}