summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/expectations/tests/with_array_pointers_arguments.rs21
-rw-r--r--tests/expectations/tests/without_array_pointers_arguments.rs21
-rw-r--r--tests/headers/with_array_pointers_arguments.h5
-rw-r--r--tests/headers/without_array_pointers_arguments.h4
4 files changed, 51 insertions, 0 deletions
diff --git a/tests/expectations/tests/with_array_pointers_arguments.rs b/tests/expectations/tests/with_array_pointers_arguments.rs
new file mode 100644
index 00000000..eb3300e2
--- /dev/null
+++ b/tests/expectations/tests/with_array_pointers_arguments.rs
@@ -0,0 +1,21 @@
+/* automatically generated by rust-bindgen */
+
+#![allow(
+ dead_code,
+ non_snake_case,
+ non_camel_case_types,
+ non_upper_case_globals
+)]
+
+extern "C" {
+ pub fn test_fn(
+ a: f32,
+ arr: *mut [::std::os::raw::c_int; 20usize],
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ pub fn test_fn2(
+ arr: *const [f32; 20usize],
+ b: ::std::os::raw::c_int,
+ ) -> ::std::os::raw::c_int;
+} \ No newline at end of file
diff --git a/tests/expectations/tests/without_array_pointers_arguments.rs b/tests/expectations/tests/without_array_pointers_arguments.rs
new file mode 100644
index 00000000..a8d9990a
--- /dev/null
+++ b/tests/expectations/tests/without_array_pointers_arguments.rs
@@ -0,0 +1,21 @@
+/* automatically generated by rust-bindgen */
+
+#![allow(
+ dead_code,
+ non_snake_case,
+ non_camel_case_types,
+ non_upper_case_globals
+)]
+
+extern "C" {
+ pub fn test_fn(
+ a: f32,
+ arr: *mut ::std::os::raw::c_int,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ pub fn test_fn2(
+ arr: *const f32,
+ b: ::std::os::raw::c_int,
+ ) -> ::std::os::raw::c_int;
+} \ No newline at end of file
diff --git a/tests/headers/with_array_pointers_arguments.h b/tests/headers/with_array_pointers_arguments.h
new file mode 100644
index 00000000..34f669d0
--- /dev/null
+++ b/tests/headers/with_array_pointers_arguments.h
@@ -0,0 +1,5 @@
+// bindgen-flags: --use-array-pointers-in-arguments
+
+int test_fn(float a, int arr[20]);
+
+int test_fn2(const float arr[20], int b); \ No newline at end of file
diff --git a/tests/headers/without_array_pointers_arguments.h b/tests/headers/without_array_pointers_arguments.h
new file mode 100644
index 00000000..9028c43d
--- /dev/null
+++ b/tests/headers/without_array_pointers_arguments.h
@@ -0,0 +1,4 @@
+
+int test_fn(float a, int arr[20]);
+
+int test_fn2(const float arr[20], int b); \ No newline at end of file