diff --git a/tests/expectations/both/cell.c b/tests/expectations/both/cell.c new file mode 100644 index 0000000..60c9ff7 --- /dev/null +++ b/tests/expectations/both/cell.c @@ -0,0 +1,14 @@ +#include +#include +#include +#include + +typedef struct NotReprC_RefCell_i32 NotReprC_RefCell_i32; + +typedef NotReprC_RefCell_i32 Foo; + +typedef struct MyStruct { + int32_t number; +} MyStruct; + +void root(const Foo *a, const MyStruct *with_cell); diff --git a/tests/expectations/both/cell.compat.c b/tests/expectations/both/cell.compat.c new file mode 100644 index 0000000..8a82644 --- /dev/null +++ b/tests/expectations/both/cell.compat.c @@ -0,0 +1,22 @@ +#include +#include +#include +#include + +typedef struct NotReprC_RefCell_i32 NotReprC_RefCell_i32; + +typedef NotReprC_RefCell_i32 Foo; + +typedef struct MyStruct { + int32_t number; +} MyStruct; + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +void root(const Foo *a, const MyStruct *with_cell); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus diff --git a/tests/expectations/cell.c b/tests/expectations/cell.c new file mode 100644 index 0000000..a3ac531 --- /dev/null +++ b/tests/expectations/cell.c @@ -0,0 +1,14 @@ +#include +#include +#include +#include + +typedef struct NotReprC_RefCell_i32 NotReprC_RefCell_i32; + +typedef NotReprC_RefCell_i32 Foo; + +typedef struct { + int32_t number; +} MyStruct; + +void root(const Foo *a, const MyStruct *with_cell); diff --git a/tests/expectations/cell.compat.c b/tests/expectations/cell.compat.c new file mode 100644 index 0000000..f2fbb8b --- /dev/null +++ b/tests/expectations/cell.compat.c @@ -0,0 +1,22 @@ +#include +#include +#include +#include + +typedef struct NotReprC_RefCell_i32 NotReprC_RefCell_i32; + +typedef NotReprC_RefCell_i32 Foo; + +typedef struct { + int32_t number; +} MyStruct; + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +void root(const Foo *a, const MyStruct *with_cell); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus diff --git a/tests/expectations/cell.cpp b/tests/expectations/cell.cpp new file mode 100644 index 0000000..2c16e26 --- /dev/null +++ b/tests/expectations/cell.cpp @@ -0,0 +1,22 @@ +#include +#include +#include +#include + +template +struct NotReprC; + +template +struct RefCell; + +using Foo = NotReprC>; + +struct MyStruct { + int32_t number; +}; + +extern "C" { + +void root(const Foo *a, const MyStruct *with_cell); + +} // extern "C" diff --git a/tests/expectations/tag/cell.c b/tests/expectations/tag/cell.c new file mode 100644 index 0000000..0e39870 --- /dev/null +++ b/tests/expectations/tag/cell.c @@ -0,0 +1,14 @@ +#include +#include +#include +#include + +struct NotReprC_RefCell_i32; + +typedef struct NotReprC_RefCell_i32 Foo; + +struct MyStruct { + int32_t number; +}; + +void root(const Foo *a, const struct MyStruct *with_cell); diff --git a/tests/expectations/tag/cell.compat.c b/tests/expectations/tag/cell.compat.c new file mode 100644 index 0000000..9e73b0d --- /dev/null +++ b/tests/expectations/tag/cell.compat.c @@ -0,0 +1,22 @@ +#include +#include +#include +#include + +struct NotReprC_RefCell_i32; + +typedef struct NotReprC_RefCell_i32 Foo; + +struct MyStruct { + int32_t number; +}; + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +void root(const Foo *a, const struct MyStruct *with_cell); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus diff --git a/tests/rust/cell.rs b/tests/rust/cell.rs new file mode 100644 index 0000000..5f16dbb --- /dev/null +++ b/tests/rust/cell.rs @@ -0,0 +1,11 @@ +#[repr(C)] +pub struct MyStruct { + number: std::cell::Cell, +} + +pub struct NotReprC { inner: T } + +pub type Foo = NotReprC>; + +#[no_mangle] +pub extern "C" fn root(a: &Foo, with_cell: &MyStruct) {}