diff options
author | Travis Finkenauer <tmfinken@gmail.com> | 2017-06-16 02:14:17 -0700 |
---|---|---|
committer | Travis Finkenauer <tmfinken@gmail.com> | 2017-06-16 02:14:17 -0700 |
commit | de155b914d97dd382fa17e56ee9555a012469c5e (patch) | |
tree | 5ea5c7db08562f052dc6d2fc9e1e156a26441dc1 | |
parent | 977ec6f7b1cafc14e2550e2ced49eaa584ee1297 (diff) |
Add constified module enum template test
-rw-r--r-- | tests/expectations/tests/constify-module-enums-types.rs | 13 | ||||
-rw-r--r-- | tests/headers/constify-module-enums-types.hpp | 10 |
2 files changed, 22 insertions, 1 deletions
diff --git a/tests/expectations/tests/constify-module-enums-types.rs b/tests/expectations/tests/constify-module-enums-types.rs index 9d806c5c..3effcc12 100644 --- a/tests/expectations/tests/constify-module-enums-types.rs +++ b/tests/expectations/tests/constify-module-enums-types.rs @@ -62,3 +62,16 @@ extern "C" { pub fn func2(arg1: foo_alias1, arg2: *mut foo_alias1, arg3: *mut *mut foo_alias1) -> *mut foo_alias1; } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Thing<T> { + pub thing: T, + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>, +} +impl <T> Default for Thing<T> { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +extern "C" { + #[link_name = "_Z5func35ThingI3fooE"] + pub fn func3(arg1: Thing<foo::Type>) -> foo::Type; +} diff --git a/tests/headers/constify-module-enums-types.hpp b/tests/headers/constify-module-enums-types.hpp index 5a40157f..1570654f 100644 --- a/tests/headers/constify-module-enums-types.hpp +++ b/tests/headers/constify-module-enums-types.hpp @@ -27,4 +27,12 @@ typedef struct bar { } bar; foo *func1(foo arg1, foo *arg2, foo **arg3); -foo_alias1 *func2(foo_alias1 arg1, foo_alias1 *arg2, foo_alias1 **arg3);
\ No newline at end of file +foo_alias1 *func2(foo_alias1 arg1, foo_alias1 *arg2, foo_alias1 **arg3); + +template <class T> +class Thing { + T thing; + T& get_thing(); +}; + +foo func3(Thing<foo> arg1);
\ No newline at end of file |