summaryrefslogtreecommitdiff
path: root/libbindgen/tests
diff options
context:
space:
mode:
Diffstat (limited to 'libbindgen/tests')
-rw-r--r--libbindgen/tests/expectations/tests/issue_311.rs38
-rw-r--r--libbindgen/tests/headers/issue_311.hpp5
2 files changed, 43 insertions, 0 deletions
diff --git a/libbindgen/tests/expectations/tests/issue_311.rs b/libbindgen/tests/expectations/tests/issue_311.rs
new file mode 100644
index 00000000..f01a9d93
--- /dev/null
+++ b/libbindgen/tests/expectations/tests/issue_311.rs
@@ -0,0 +1,38 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(non_snake_case)]
+
+
+pub mod root {
+ #[allow(unused_imports)]
+ use self::super::root;
+ #[repr(C)]
+ #[derive(Debug, Copy)]
+ pub struct jsval_layout {
+ pub __bindgen_anon_1: root::jsval_layout__bindgen_ty_1,
+ }
+ #[repr(C)]
+ #[derive(Debug, Copy)]
+ pub struct jsval_layout__bindgen_ty_1 {
+ pub _address: u8,
+ }
+ #[test]
+ fn bindgen_test_layout_jsval_layout__bindgen_ty_1() {
+ assert_eq!(::std::mem::size_of::<jsval_layout__bindgen_ty_1>() ,
+ 1usize);
+ assert_eq!(::std::mem::align_of::<jsval_layout__bindgen_ty_1>() ,
+ 1usize);
+ }
+ impl Clone for jsval_layout__bindgen_ty_1 {
+ fn clone(&self) -> Self { *self }
+ }
+ #[test]
+ fn bindgen_test_layout_jsval_layout() {
+ assert_eq!(::std::mem::size_of::<jsval_layout>() , 1usize);
+ assert_eq!(::std::mem::align_of::<jsval_layout>() , 1usize);
+ }
+ impl Clone for jsval_layout {
+ fn clone(&self) -> Self { *self }
+ }
+}
diff --git a/libbindgen/tests/headers/issue_311.hpp b/libbindgen/tests/headers/issue_311.hpp
new file mode 100644
index 00000000..a8d7fd99
--- /dev/null
+++ b/libbindgen/tests/headers/issue_311.hpp
@@ -0,0 +1,5 @@
+// bindgen-flags: --enable-cxx-namespaces
+
+struct jsval_layout {
+ struct {};
+};