diff --git a/tests/expectations/tests/forward_declared_complex_types.rs b/tests/expectations/tests/forward_declared_complex_types.rs new file mode 100644 index 0000000000..055d042e5f --- /dev/null +++ b/tests/expectations/tests/forward_declared_complex_types.rs @@ -0,0 +1,37 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(non_snake_case)] + + +#[repr(C)] +pub struct Foo([u8; 0]); +#[repr(C)] +#[derive(Debug, Copy)] +pub struct Bar { + pub f: *mut Foo, +} +#[test] +fn bindgen_test_layout_Bar() { + assert_eq!(::std::mem::size_of::() , 8usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +impl Clone for Bar { + fn clone(&self) -> Self { *self } +} +extern "C" { + #[link_name = "_Z10baz_structP3Foo"] + pub fn baz_struct(f: *mut Foo); +} +#[repr(C)] +pub struct Union([u8; 0]); +extern "C" { + #[link_name = "_Z9baz_unionP5Union"] + pub fn baz_union(u: *mut Union); +} +#[repr(C)] +pub struct Quux([u8; 0]); +extern "C" { + #[link_name = "_Z9baz_classP4Quux"] + pub fn baz_class(q: *mut Quux); +} diff --git a/tests/headers/forward_declared_complex_types.hpp b/tests/headers/forward_declared_complex_types.hpp new file mode 100644 index 0000000000..47ce6b8885 --- /dev/null +++ b/tests/headers/forward_declared_complex_types.hpp @@ -0,0 +1,15 @@ +struct Foo; + +struct Bar { + Foo *f; +}; + +void baz_struct(Foo* f); + +union Union; + +void baz_union(Union* u); + +class Quux; + +void baz_class(Quux* q);