From d446a4f6f14e14eea61e14e45f4559701f1e2fd5 Mon Sep 17 00:00:00 2001 From: Audrius Date: Mon, 24 Aug 2020 21:50:18 +0300 Subject: [PATCH] Added expectation test files for clang 3.9 and 4 --- .../libclang-3.9/wasm-constructor-returns.rs | 37 +++++++++++++++++++ .../libclang-4/wasm-constructor-returns.rs | 37 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 tests/expectations/tests/libclang-3.9/wasm-constructor-returns.rs create mode 100644 tests/expectations/tests/libclang-4/wasm-constructor-returns.rs diff --git a/tests/expectations/tests/libclang-3.9/wasm-constructor-returns.rs b/tests/expectations/tests/libclang-3.9/wasm-constructor-returns.rs new file mode 100644 index 0000000000..f207d0d8e1 --- /dev/null +++ b/tests/expectations/tests/libclang-3.9/wasm-constructor-returns.rs @@ -0,0 +1,37 @@ +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] + +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct Foo { + pub _address: u8, +} +#[test] +fn bindgen_test_layout_Foo() { + assert_eq!( + ::std::mem::size_of::(), + 1usize, + concat!("Size of: ", stringify!(Foo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(Foo)) + ); +} +extern "C" { + #[link_name = "\u{1}_ZN3FooC1Ei"] + pub fn Foo_Foo(this: *mut Foo, var: ::std::os::raw::c_int); +} +impl Foo { + #[inline] + pub unsafe fn new(var: ::std::os::raw::c_int) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Foo_Foo(__bindgen_tmp.as_mut_ptr(), var); + __bindgen_tmp.assume_init() + } +} diff --git a/tests/expectations/tests/libclang-4/wasm-constructor-returns.rs b/tests/expectations/tests/libclang-4/wasm-constructor-returns.rs new file mode 100644 index 0000000000..f207d0d8e1 --- /dev/null +++ b/tests/expectations/tests/libclang-4/wasm-constructor-returns.rs @@ -0,0 +1,37 @@ +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] + +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct Foo { + pub _address: u8, +} +#[test] +fn bindgen_test_layout_Foo() { + assert_eq!( + ::std::mem::size_of::(), + 1usize, + concat!("Size of: ", stringify!(Foo)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(Foo)) + ); +} +extern "C" { + #[link_name = "\u{1}_ZN3FooC1Ei"] + pub fn Foo_Foo(this: *mut Foo, var: ::std::os::raw::c_int); +} +impl Foo { + #[inline] + pub unsafe fn new(var: ::std::os::raw::c_int) -> Self { + let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); + Foo_Foo(__bindgen_tmp.as_mut_ptr(), var); + __bindgen_tmp.assume_init() + } +}