diff --git a/integration-tests/tests/integration_test.rs b/integration-tests/tests/integration_test.rs index 9d6590023..dfdad73c8 100644 --- a/integration-tests/tests/integration_test.rs +++ b/integration-tests/tests/integration_test.rs @@ -12578,6 +12578,39 @@ fn test_opaque_directive() { ); } +#[test] +fn test_pod_type_alias() { + let hdr = indoc! {" + #include + typedef struct _Bob { + uint32_t a; + uint32_t b; + } Bob; + "}; + let rs = quote! { + let a = ffi::Bob { a: 12, b: 13 }; + let b = ffi::_Bob { a: 12, b:12 }; + }; + run_test("", hdr, rs, &[], &["_Bob", "Bob"]); +} + +#[test] +fn test_split_pod_type_alias() { + let hdr = indoc! {" + #include + struct _Bob { + uint32_t a; + uint32_t b; + }; + typedef struct _Bob Bob; + "}; + let rs = quote! { + let a = ffi::Bob { a: 12, b: 13 }; + let b = ffi::_Bob { a: 12, b:12 }; + }; + run_test("", hdr, rs, &[], &["_Bob", "Bob"]); +} + // Yet to test: // - Ifdef // - Out param pointers