summaryrefslogtreecommitdiff
path: root/libbindgen/tests
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2017-01-18 14:40:49 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2017-01-18 14:42:27 +0100
commitb743ab0d5fa222c8d4e7a59a7d3952d042eb2e5d (patch)
treef93f403cad4df8c08263e23c243723870c0ed4e4 /libbindgen/tests
parentf103d8a66d4c736f97d7e98c3698b5542e38d28c (diff)
codegen: Don't implement variadic methods.
Fixes #402
Diffstat (limited to 'libbindgen/tests')
-rw-r--r--libbindgen/tests/expectations/tests/variadic-method.rs27
-rw-r--r--libbindgen/tests/headers/variadic-method.hpp6
2 files changed, 33 insertions, 0 deletions
diff --git a/libbindgen/tests/expectations/tests/variadic-method.rs b/libbindgen/tests/expectations/tests/variadic-method.rs
new file mode 100644
index 00000000..34301069
--- /dev/null
+++ b/libbindgen/tests/expectations/tests/variadic-method.rs
@@ -0,0 +1,27 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(non_snake_case)]
+
+
+extern "C" {
+ #[link_name = "_Z3fooPKcz"]
+ pub fn foo(fmt: *const ::std::os::raw::c_char, ...);
+}
+#[repr(C)]
+#[derive(Debug, Copy)]
+pub struct Bar {
+ pub _address: u8,
+}
+#[test]
+fn bindgen_test_layout_Bar() {
+ assert_eq!(::std::mem::size_of::<Bar>() , 1usize);
+ assert_eq!(::std::mem::align_of::<Bar>() , 1usize);
+}
+extern "C" {
+ #[link_name = "_ZN3Bar3fooEPKcz"]
+ pub fn Bar_foo(this: *mut Bar, fmt: *const ::std::os::raw::c_char, ...);
+}
+impl Clone for Bar {
+ fn clone(&self) -> Self { *self }
+}
diff --git a/libbindgen/tests/headers/variadic-method.hpp b/libbindgen/tests/headers/variadic-method.hpp
new file mode 100644
index 00000000..78a8eb45
--- /dev/null
+++ b/libbindgen/tests/headers/variadic-method.hpp
@@ -0,0 +1,6 @@
+
+void foo(const char* fmt, ...);
+
+struct Bar {
+ void foo(const char* fmt, ...);
+};