Add failing regression test for #1973.

This commit is contained in:
Corey Farwell 2021-01-30 09:33:17 -05:00 committed by Emilio Cobos Álvarez
parent e0f06c7fb2
commit c509ef12ac
3 changed files with 24 additions and 0 deletions

View File

@ -135,3 +135,12 @@ Seventh::assert(bool first,
int my_prefixed_function_name() {
return 4;
}
Coord coord(double x, double y, double z, double t) {
Coord res;
res.v[0] = x;
res.v[1] = y;
res.v[2] = z;
res.v[3] = t;
return res;
}

View File

@ -226,3 +226,9 @@ struct my_prefixed_templated_foo {
my_prefixed_templated_foo<my_prefixed_baz> TEMPLATED_CONST_VALUE;
void my_prefixed_function_to_remove();
typedef union {
double v[4];
} Coord;
Coord coord(double x, double y, double z, double t);

View File

@ -259,3 +259,12 @@ fn test_macro_customintkind_path() {
let v: &std::any::Any = &bindings::TESTMACRO_CUSTOMINTKIND_PATH;
assert!(v.is::<MacroInteger>())
}
// https://github.com/rust-lang/rust-bindgen/issues/1973
#[test]
fn test_homogeneous_aggregate_float_union() {
unsafe {
let coord = &bindings::coord(1., 2., 3., 4.);
assert_eq!([1., 2., 3., 4.], coord.v)
}
}