tests: Add a test for #708
This commit is contained in:
@@ -3,10 +3,15 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef enum Bar {
|
||||
BarSome,
|
||||
BarThing,
|
||||
} Bar;
|
||||
|
||||
typedef struct FooU8 {
|
||||
uint8_t a;
|
||||
} FooU8;
|
||||
|
||||
typedef struct FooU8 Boo;
|
||||
|
||||
void root(Boo x);
|
||||
void root(Boo x, enum Bar y);
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef enum Bar {
|
||||
BarSome,
|
||||
BarThing,
|
||||
} Bar;
|
||||
|
||||
typedef struct FooU8 {
|
||||
uint8_t a;
|
||||
} FooU8;
|
||||
@@ -13,7 +18,7 @@ typedef struct FooU8 Boo;
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
void root(Boo x);
|
||||
void root(Boo x, enum Bar y);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
@@ -3,10 +3,15 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef enum {
|
||||
BarSome,
|
||||
BarThing,
|
||||
} Bar;
|
||||
|
||||
typedef struct {
|
||||
uint8_t a;
|
||||
} FooU8;
|
||||
|
||||
typedef FooU8 Boo;
|
||||
|
||||
void root(Boo x);
|
||||
void root(Boo x, Bar y);
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef enum {
|
||||
BarSome,
|
||||
BarThing,
|
||||
} Bar;
|
||||
|
||||
typedef struct {
|
||||
uint8_t a;
|
||||
} FooU8;
|
||||
@@ -13,7 +18,7 @@ typedef FooU8 Boo;
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
void root(Boo x);
|
||||
void root(Boo x, Bar y);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
#include <ostream>
|
||||
#include <new>
|
||||
|
||||
enum class Bar {
|
||||
BarSome,
|
||||
BarThing,
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct Foo {
|
||||
T a;
|
||||
@@ -13,6 +18,6 @@ using Boo = Foo<uint8_t>;
|
||||
|
||||
extern "C" {
|
||||
|
||||
void root(Boo x);
|
||||
void root(Boo x, Bar y);
|
||||
|
||||
} // extern "C"
|
||||
|
||||
@@ -6,9 +6,13 @@ cdef extern from *:
|
||||
|
||||
cdef extern from *:
|
||||
|
||||
ctypedef enum Bar:
|
||||
BarSome,
|
||||
BarThing,
|
||||
|
||||
ctypedef struct FooU8:
|
||||
uint8_t a;
|
||||
|
||||
ctypedef FooU8 Boo;
|
||||
|
||||
void root(Boo x);
|
||||
void root(Boo x, Bar y);
|
||||
|
||||
@@ -3,10 +3,15 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
enum Bar {
|
||||
BarSome,
|
||||
BarThing,
|
||||
};
|
||||
|
||||
struct FooU8 {
|
||||
uint8_t a;
|
||||
};
|
||||
|
||||
typedef struct FooU8 Boo;
|
||||
|
||||
void root(Boo x);
|
||||
void root(Boo x, enum Bar y);
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
enum Bar {
|
||||
BarSome,
|
||||
BarThing,
|
||||
};
|
||||
|
||||
struct FooU8 {
|
||||
uint8_t a;
|
||||
};
|
||||
@@ -13,7 +18,7 @@ typedef struct FooU8 Boo;
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
void root(Boo x);
|
||||
void root(Boo x, enum Bar y);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
@@ -6,9 +6,13 @@ cdef extern from *:
|
||||
|
||||
cdef extern from *:
|
||||
|
||||
cdef enum Bar:
|
||||
BarSome,
|
||||
BarThing,
|
||||
|
||||
cdef struct FooU8:
|
||||
uint8_t a;
|
||||
|
||||
ctypedef FooU8 Boo;
|
||||
|
||||
void root(Boo x);
|
||||
void root(Boo x, Bar y);
|
||||
|
||||
@@ -5,7 +5,15 @@ pub struct Foo<T> {
|
||||
|
||||
pub type Boo = Foo<u8>;
|
||||
|
||||
/// cbindgen:prefix-with-name=true
|
||||
#[repr(C)]
|
||||
pub enum Bar {
|
||||
Some,
|
||||
Thing,
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn root(
|
||||
x: Boo,
|
||||
y: Bar,
|
||||
) { }
|
||||
|
||||
Reference in New Issue
Block a user