diff --git a/tests/expectations/mangle.both.c b/tests/expectations/mangle.both.c index c0f77503e..71408c821 100644 --- a/tests/expectations/mangle.both.c +++ b/tests/expectations/mangle.both.c @@ -3,10 +3,15 @@ #include #include +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); diff --git a/tests/expectations/mangle.both.compat.c b/tests/expectations/mangle.both.compat.c index b5766da57..ceefcc8f0 100644 --- a/tests/expectations/mangle.both.compat.c +++ b/tests/expectations/mangle.both.compat.c @@ -3,6 +3,11 @@ #include #include +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" diff --git a/tests/expectations/mangle.c b/tests/expectations/mangle.c index 4da70822c..ccd811771 100644 --- a/tests/expectations/mangle.c +++ b/tests/expectations/mangle.c @@ -3,10 +3,15 @@ #include #include +typedef enum { + BarSome, + BarThing, +} Bar; + typedef struct { uint8_t a; } FooU8; typedef FooU8 Boo; -void root(Boo x); +void root(Boo x, Bar y); diff --git a/tests/expectations/mangle.compat.c b/tests/expectations/mangle.compat.c index fe1a74d79..2bfe97a8b 100644 --- a/tests/expectations/mangle.compat.c +++ b/tests/expectations/mangle.compat.c @@ -3,6 +3,11 @@ #include #include +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" diff --git a/tests/expectations/mangle.cpp b/tests/expectations/mangle.cpp index 3b8f4d4c0..95224c9bd 100644 --- a/tests/expectations/mangle.cpp +++ b/tests/expectations/mangle.cpp @@ -4,6 +4,11 @@ #include #include +enum class Bar { + BarSome, + BarThing, +}; + template struct Foo { T a; @@ -13,6 +18,6 @@ using Boo = Foo; extern "C" { -void root(Boo x); +void root(Boo x, Bar y); } // extern "C" diff --git a/tests/expectations/mangle.pyx b/tests/expectations/mangle.pyx index 742235923..ddb1977b7 100644 --- a/tests/expectations/mangle.pyx +++ b/tests/expectations/mangle.pyx @@ -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); diff --git a/tests/expectations/mangle.tag.c b/tests/expectations/mangle.tag.c index 616511057..caa759c46 100644 --- a/tests/expectations/mangle.tag.c +++ b/tests/expectations/mangle.tag.c @@ -3,10 +3,15 @@ #include #include +enum Bar { + BarSome, + BarThing, +}; + struct FooU8 { uint8_t a; }; typedef struct FooU8 Boo; -void root(Boo x); +void root(Boo x, enum Bar y); diff --git a/tests/expectations/mangle.tag.compat.c b/tests/expectations/mangle.tag.compat.c index 3b94dfa7e..7d7e99269 100644 --- a/tests/expectations/mangle.tag.compat.c +++ b/tests/expectations/mangle.tag.compat.c @@ -3,6 +3,11 @@ #include #include +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" diff --git a/tests/expectations/mangle.tag.pyx b/tests/expectations/mangle.tag.pyx index d362ca88f..4a54cc845 100644 --- a/tests/expectations/mangle.tag.pyx +++ b/tests/expectations/mangle.tag.pyx @@ -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); diff --git a/tests/rust/mangle.rs b/tests/rust/mangle.rs index b4aa46df5..1ac7e1336 100644 --- a/tests/rust/mangle.rs +++ b/tests/rust/mangle.rs @@ -5,7 +5,15 @@ pub struct Foo { pub type Boo = Foo; +/// cbindgen:prefix-with-name=true +#[repr(C)] +pub enum Bar { + Some, + Thing, +} + #[no_mangle] pub extern "C" fn root( x: Boo, + y: Bar, ) { }