summaryrefslogtreecommitdiff
path: root/libbindgen/tests
diff options
context:
space:
mode:
Diffstat (limited to 'libbindgen/tests')
-rw-r--r--libbindgen/tests/expectations/tests/const_bool.rs23
-rw-r--r--libbindgen/tests/headers/const_bool.hpp9
2 files changed, 32 insertions, 0 deletions
diff --git a/libbindgen/tests/expectations/tests/const_bool.rs b/libbindgen/tests/expectations/tests/const_bool.rs
new file mode 100644
index 00000000..8a50a094
--- /dev/null
+++ b/libbindgen/tests/expectations/tests/const_bool.rs
@@ -0,0 +1,23 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(non_snake_case)]
+
+
+pub const k: bool = true;
+#[repr(C)]
+#[derive(Debug, Copy)]
+pub struct A {
+ pub _address: u8,
+}
+pub const A_k: bool = false;
+#[test]
+fn bindgen_test_layout_A() {
+ assert_eq!(::std::mem::size_of::<A>() , 1usize);
+ assert_eq!(::std::mem::align_of::<A>() , 1usize);
+}
+impl Clone for A {
+ fn clone(&self) -> Self { *self }
+}
+pub type foo = bool;
+pub const k2: foo = true;
diff --git a/libbindgen/tests/headers/const_bool.hpp b/libbindgen/tests/headers/const_bool.hpp
new file mode 100644
index 00000000..633a7c90
--- /dev/null
+++ b/libbindgen/tests/headers/const_bool.hpp
@@ -0,0 +1,9 @@
+// bindgen-unstable
+
+const bool k = true;
+struct A {
+ static const bool k = false;
+};
+
+typedef bool foo;
+const foo k2 = true;