diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index f586e05772b76..3c6cc9d924522 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -866,6 +866,16 @@ rust_dbg_extern_identity_TwoU64s(TwoU64s u) { return u; } +struct TwoDoubles { + double one; + double two; +}; + +extern "C" CDECL TwoDoubles +rust_dbg_extern_identity_TwoDoubles(TwoDoubles u) { + return u; +} + extern "C" CDECL double rust_dbg_extern_identity_double(double u) { return u; diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index 59fd8991622c6..73dbe661d3f86 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -199,6 +199,7 @@ rust_opendir rust_dbg_extern_identity_u32 rust_dbg_extern_identity_u64 rust_dbg_extern_identity_TwoU64s +rust_dbg_extern_identity_TwoDoubles rust_dbg_extern_identity_double rust_dbg_extern_identity_u8 rust_get_rt_env diff --git a/src/test/run-pass/issue-5754.rs b/src/test/run-pass/issue-5754.rs index 003701b7a20cb..c440fe525eef9 100644 --- a/src/test/run-pass/issue-5754.rs +++ b/src/test/run-pass/issue-5754.rs @@ -8,12 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct S { - r: float +struct TwoDoubles { + r: float, + i: float } extern "C" { - fn rust_dbg_extern_identity_double(arg1: S) -> float; + fn rust_dbg_extern_identity_TwoDoubles(arg1: TwoDoubles) -> TwoDoubles; } pub fn main() {}