summaryrefslogtreecommitdiff
path: root/libbindgen/tests
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-12-30 09:48:30 -0800
committerGitHub <noreply@github.com>2016-12-30 09:48:30 -0800
commit6940219984b9131e67688e78116dda4352164dfc (patch)
tree9ea988e4e947feb12ba702a8964e0e3cf4f6b913 /libbindgen/tests
parent889361ad3bb266ddee6edf30ba4df458a9c44022 (diff)
parent50b5845c239e2a9ae8b9594bcbedf91174460e84 (diff)
Auto merge of #374 - fitzgen:derive-debug-with-array-too-big, r=emilio
Derive debug with array too big See the first commit's message for details, second commit is just `rustfmt`. r? @emilio Not quite sure whether the `Opaque` struct is fully motivated... it seems like it would be useful later on in codegen, but might not be pulling its own weight without more usage...
Diffstat (limited to 'libbindgen/tests')
-rw-r--r--libbindgen/tests/expectations/tests/issue-372.rs63
-rw-r--r--libbindgen/tests/headers/issue-372.hpp16
2 files changed, 79 insertions, 0 deletions
diff --git a/libbindgen/tests/expectations/tests/issue-372.rs b/libbindgen/tests/expectations/tests/issue-372.rs
new file mode 100644
index 00000000..c6d9209e
--- /dev/null
+++ b/libbindgen/tests/expectations/tests/issue-372.rs
@@ -0,0 +1,63 @@
+/* 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 d {
+ pub m: root::i,
+ }
+ #[test]
+ fn bindgen_test_layout_d() {
+ assert_eq!(::std::mem::size_of::<d>() , 24usize);
+ assert_eq!(::std::mem::align_of::<d>() , 8usize);
+ }
+ impl Clone for d {
+ fn clone(&self) -> Self { *self }
+ }
+ #[repr(C)]
+ #[derive(Debug, Copy)]
+ pub struct i {
+ pub j: *mut root::i,
+ pub k: *mut root::i,
+ pub l: bool,
+ }
+ #[test]
+ fn bindgen_test_layout_i() {
+ assert_eq!(::std::mem::size_of::<i>() , 24usize);
+ assert_eq!(::std::mem::align_of::<i>() , 8usize);
+ }
+ impl Clone for i {
+ fn clone(&self) -> Self { *self }
+ }
+ #[repr(u32)]
+ #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+ pub enum n {
+ o = 0,
+ p = 1,
+ q = 2,
+ r = 3,
+ s = 4,
+ t = 5,
+ b = 6,
+ ae = 7,
+ e = 8,
+ ag = 9,
+ ah = 10,
+ ai = 11,
+ }
+ #[repr(C)]
+ pub struct F {
+ pub w: [u64; 33usize],
+ }
+ #[test]
+ fn bindgen_test_layout_F() {
+ assert_eq!(::std::mem::size_of::<F>() , 264usize);
+ assert_eq!(::std::mem::align_of::<F>() , 8usize);
+ }
+}
diff --git a/libbindgen/tests/headers/issue-372.hpp b/libbindgen/tests/headers/issue-372.hpp
new file mode 100644
index 00000000..a072f061
--- /dev/null
+++ b/libbindgen/tests/headers/issue-372.hpp
@@ -0,0 +1,16 @@
+// bindgen-flags: --enable-cxx-namespaces
+template <typename a, int b> class c { a e[b]; };
+class d;
+template <typename g, g f> class C { c<d, f> h; };
+class i {
+ i *j;
+ i *k;
+ bool l;
+};
+class d {
+ i m;
+};
+enum n { o, p, q, r, s, t, b, ae, e, ag, ah, ai };
+class F {
+ C<n, ai> w;
+};