summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/expectations/tests/default-template-parameter.rs30
-rw-r--r--tests/headers/default-template-parameter.hpp7
2 files changed, 37 insertions, 0 deletions
diff --git a/tests/expectations/tests/default-template-parameter.rs b/tests/expectations/tests/default-template-parameter.rs
new file mode 100644
index 00000000..af4616ff
--- /dev/null
+++ b/tests/expectations/tests/default-template-parameter.rs
@@ -0,0 +1,30 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(non_snake_case)]
+
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct Foo<T, U> {
+ pub t: T,
+ pub u: U,
+}
+impl <T, U> Default for Foo<T, U> {
+ fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+}
+#[test]
+fn __bindgen_test_layout_Foo_instantiation_6() {
+ assert_eq!(::std::mem::size_of::<Foo<bool, ::std::os::raw::c_int>>() ,
+ 8usize , concat ! (
+ "Size of template specialization: " , stringify ! (
+ Foo<bool, ::std::os::raw::c_int> ) ));
+ assert_eq!(::std::mem::align_of::<Foo<bool, ::std::os::raw::c_int>>() ,
+ 4usize , concat ! (
+ "Alignment of template specialization: " , stringify ! (
+ Foo<bool, ::std::os::raw::c_int> ) ));
+}
+extern "C" {
+ #[link_name = "_ZL3bar"]
+ pub static mut bar: Foo<bool, ::std::os::raw::c_int>;
+}
diff --git a/tests/headers/default-template-parameter.hpp b/tests/headers/default-template-parameter.hpp
new file mode 100644
index 00000000..4deed834
--- /dev/null
+++ b/tests/headers/default-template-parameter.hpp
@@ -0,0 +1,7 @@
+template <typename T, typename U = int>
+struct Foo {
+ T t;
+ U u;
+};
+
+static Foo<bool> bar;