summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/expectations/tests/mangling-linux32.rs28
-rw-r--r--tests/expectations/tests/mangling-linux64.rs28
-rw-r--r--tests/expectations/tests/mangling-macos.rs19
-rw-r--r--tests/expectations/tests/mangling-win32.rs19
-rw-r--r--tests/expectations/tests/mangling-win64.rs28
-rw-r--r--tests/headers/mangling-linux32.hpp7
-rw-r--r--tests/headers/mangling-linux64.hpp7
-rw-r--r--tests/headers/mangling-macos.h3
-rw-r--r--tests/headers/mangling-macos.hpp7
-rw-r--r--tests/headers/mangling-win32.h3
-rw-r--r--tests/headers/mangling-win32.hpp7
-rw-r--r--tests/headers/mangling-win64.hpp7
12 files changed, 157 insertions, 6 deletions
diff --git a/tests/expectations/tests/mangling-linux32.rs b/tests/expectations/tests/mangling-linux32.rs
new file mode 100644
index 00000000..5aa7bd55
--- /dev/null
+++ b/tests/expectations/tests/mangling-linux32.rs
@@ -0,0 +1,28 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+extern "C" {
+ pub fn foo();
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy)]
+pub struct Foo {
+ pub _address: u8,
+}
+extern "C" {
+ #[link_name = "_ZN3Foo4sBarE"]
+ pub static mut Foo_sBar: bool;
+}
+#[test]
+fn bindgen_test_layout_Foo() {
+ assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! (
+ "Size of: " , stringify ! ( Foo ) ));
+ assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! (
+ "Alignment of " , stringify ! ( Foo ) ));
+}
+impl Clone for Foo {
+ fn clone(&self) -> Self { *self }
+}
diff --git a/tests/expectations/tests/mangling-linux64.rs b/tests/expectations/tests/mangling-linux64.rs
new file mode 100644
index 00000000..5aa7bd55
--- /dev/null
+++ b/tests/expectations/tests/mangling-linux64.rs
@@ -0,0 +1,28 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+extern "C" {
+ pub fn foo();
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy)]
+pub struct Foo {
+ pub _address: u8,
+}
+extern "C" {
+ #[link_name = "_ZN3Foo4sBarE"]
+ pub static mut Foo_sBar: bool;
+}
+#[test]
+fn bindgen_test_layout_Foo() {
+ assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! (
+ "Size of: " , stringify ! ( Foo ) ));
+ assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! (
+ "Alignment of " , stringify ! ( Foo ) ));
+}
+impl Clone for Foo {
+ fn clone(&self) -> Self { *self }
+}
diff --git a/tests/expectations/tests/mangling-macos.rs b/tests/expectations/tests/mangling-macos.rs
index 87df5e4a..5aa7bd55 100644
--- a/tests/expectations/tests/mangling-macos.rs
+++ b/tests/expectations/tests/mangling-macos.rs
@@ -7,3 +7,22 @@
extern "C" {
pub fn foo();
}
+#[repr(C)]
+#[derive(Debug, Default, Copy)]
+pub struct Foo {
+ pub _address: u8,
+}
+extern "C" {
+ #[link_name = "_ZN3Foo4sBarE"]
+ pub static mut Foo_sBar: bool;
+}
+#[test]
+fn bindgen_test_layout_Foo() {
+ assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! (
+ "Size of: " , stringify ! ( Foo ) ));
+ assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! (
+ "Alignment of " , stringify ! ( Foo ) ));
+}
+impl Clone for Foo {
+ fn clone(&self) -> Self { *self }
+}
diff --git a/tests/expectations/tests/mangling-win32.rs b/tests/expectations/tests/mangling-win32.rs
index 87df5e4a..ffaf52cf 100644
--- a/tests/expectations/tests/mangling-win32.rs
+++ b/tests/expectations/tests/mangling-win32.rs
@@ -7,3 +7,22 @@
extern "C" {
pub fn foo();
}
+#[repr(C)]
+#[derive(Debug, Default, Copy)]
+pub struct Foo {
+ pub _address: u8,
+}
+extern "C" {
+ #[link_name = "\u{1}?sBar@Foo@@2_NA"]
+ pub static mut Foo_sBar: bool;
+}
+#[test]
+fn bindgen_test_layout_Foo() {
+ assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! (
+ "Size of: " , stringify ! ( Foo ) ));
+ assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! (
+ "Alignment of " , stringify ! ( Foo ) ));
+}
+impl Clone for Foo {
+ fn clone(&self) -> Self { *self }
+}
diff --git a/tests/expectations/tests/mangling-win64.rs b/tests/expectations/tests/mangling-win64.rs
new file mode 100644
index 00000000..ae5cc9cc
--- /dev/null
+++ b/tests/expectations/tests/mangling-win64.rs
@@ -0,0 +1,28 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+extern "C" {
+ pub fn foo();
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy)]
+pub struct Foo {
+ pub _address: u8,
+}
+extern "C" {
+ #[link_name = "?sBar@Foo@@2_NA"]
+ pub static mut Foo_sBar: bool;
+}
+#[test]
+fn bindgen_test_layout_Foo() {
+ assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! (
+ "Size of: " , stringify ! ( Foo ) ));
+ assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! (
+ "Alignment of " , stringify ! ( Foo ) ));
+}
+impl Clone for Foo {
+ fn clone(&self) -> Self { *self }
+}
diff --git a/tests/headers/mangling-linux32.hpp b/tests/headers/mangling-linux32.hpp
new file mode 100644
index 00000000..450c91d7
--- /dev/null
+++ b/tests/headers/mangling-linux32.hpp
@@ -0,0 +1,7 @@
+// bindgen-flags: -- --target=i586-unknown-linux
+
+extern "C" void foo();
+
+struct Foo {
+ static bool sBar;
+};
diff --git a/tests/headers/mangling-linux64.hpp b/tests/headers/mangling-linux64.hpp
new file mode 100644
index 00000000..36dda913
--- /dev/null
+++ b/tests/headers/mangling-linux64.hpp
@@ -0,0 +1,7 @@
+// bindgen-flags: -- --target=x86_64-unknown-linux
+
+extern "C" void foo();
+
+struct Foo {
+ static bool sBar;
+};
diff --git a/tests/headers/mangling-macos.h b/tests/headers/mangling-macos.h
deleted file mode 100644
index 230f938b..00000000
--- a/tests/headers/mangling-macos.h
+++ /dev/null
@@ -1,3 +0,0 @@
-// bindgen-flags: -- --target=x86_64-apple-darwin
-
-void foo();
diff --git a/tests/headers/mangling-macos.hpp b/tests/headers/mangling-macos.hpp
new file mode 100644
index 00000000..94b16202
--- /dev/null
+++ b/tests/headers/mangling-macos.hpp
@@ -0,0 +1,7 @@
+// bindgen-flags: -- --target=x86_64-apple-darwin
+
+extern "C" void foo();
+
+struct Foo {
+ static bool sBar;
+};
diff --git a/tests/headers/mangling-win32.h b/tests/headers/mangling-win32.h
deleted file mode 100644
index 897aeb42..00000000
--- a/tests/headers/mangling-win32.h
+++ /dev/null
@@ -1,3 +0,0 @@
-// bindgen-flags: -- --target=i686-pc-win32
-
-void foo();
diff --git a/tests/headers/mangling-win32.hpp b/tests/headers/mangling-win32.hpp
new file mode 100644
index 00000000..50beea5a
--- /dev/null
+++ b/tests/headers/mangling-win32.hpp
@@ -0,0 +1,7 @@
+// bindgen-flags: -- --target=i686-pc-win32
+
+extern "C" void foo();
+
+struct Foo {
+ static bool sBar;
+};
diff --git a/tests/headers/mangling-win64.hpp b/tests/headers/mangling-win64.hpp
new file mode 100644
index 00000000..8882d7dd
--- /dev/null
+++ b/tests/headers/mangling-win64.hpp
@@ -0,0 +1,7 @@
+// bindgen-flags: -- --target=x86_64-pc-win32
+
+extern "C" void foo();
+
+struct Foo {
+ static bool sBar;
+};