diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-01-16 20:03:30 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-01-16 20:04:18 +0100 |
commit | d021caab5ea0180395cb790eb8ecafa8f66dc7b6 (patch) | |
tree | ffe5b5e678a8bfb632dc31b04abd237c8e5f0e6e /libbindgen/tests | |
parent | b570ce853e33bfcfa05dd339bf432377c4a2fab8 (diff) |
ir: Unify function checks so they apply to non-methods.
Diffstat (limited to 'libbindgen/tests')
-rw-r--r-- | libbindgen/tests/expectations/tests/inline-function.rs | 7 | ||||
-rw-r--r-- | libbindgen/tests/expectations/tests/namespace.rs | 13 | ||||
-rw-r--r-- | libbindgen/tests/headers/inline-function.h | 6 |
3 files changed, 26 insertions, 0 deletions
diff --git a/libbindgen/tests/expectations/tests/inline-function.rs b/libbindgen/tests/expectations/tests/inline-function.rs new file mode 100644 index 00000000..b4b7b2bc --- /dev/null +++ b/libbindgen/tests/expectations/tests/inline-function.rs @@ -0,0 +1,7 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(non_snake_case)] + + + diff --git a/libbindgen/tests/expectations/tests/namespace.rs b/libbindgen/tests/expectations/tests/namespace.rs index 3d6e5974..ece4e341 100644 --- a/libbindgen/tests/expectations/tests/namespace.rs +++ b/libbindgen/tests/expectations/tests/namespace.rs @@ -37,9 +37,22 @@ pub mod root { assert_eq!(::std::mem::size_of::<A>() , 4usize); assert_eq!(::std::mem::align_of::<A>() , 4usize); } + extern "C" { + #[link_name = "_ZN12_GLOBAL__N_11A20lets_hope_this_worksEv"] + pub fn A_lets_hope_this_works(this: + *mut root::_bindgen_mod_id_13::A) + -> ::std::os::raw::c_int; + } impl Clone for A { fn clone(&self) -> Self { *self } } + impl A { + #[inline] + pub unsafe fn lets_hope_this_works(&mut self) + -> ::std::os::raw::c_int { + A_lets_hope_this_works(&mut *self) + } + } } #[repr(C)] #[derive(Debug)] diff --git a/libbindgen/tests/headers/inline-function.h b/libbindgen/tests/headers/inline-function.h new file mode 100644 index 00000000..02cb7c08 --- /dev/null +++ b/libbindgen/tests/headers/inline-function.h @@ -0,0 +1,6 @@ +// bindgen-unstable + +/** The point of this test is to _not_ generate these functions. */ + +inline static int myadd(const int x, const int y) { return x + y; } +static int mysub(const int x, const int y) { return x - y; } |