@@ -36,6 +36,16 @@ struct Huge {
3636 e : i32 ,
3737}
3838
39+ #[ derive( Clone , Copy , Debug , PartialEq ) ]
40+ #[ repr( C ) ]
41+ struct Huge64 {
42+ a : i64 ,
43+ b : i64 ,
44+ c : i64 ,
45+ d : i64 ,
46+ e : i64 ,
47+ }
48+
3949#[ derive( Clone , Copy , Debug , PartialEq ) ]
4050#[ repr( C ) ]
4151struct FloatPoint {
@@ -79,6 +89,8 @@ extern "C" {
7989
8090 fn byval_rect_with_many_huge ( a : Huge , b : Huge , c : Huge , d : Huge , e : Huge , f : Huge , g : Rect ) ;
8191
92+ fn byval_rect_with_many_huge64 ( a : Huge64 , b : Huge64 , c : Huge64 , d : Huge64 , e : Huge64 , f : Huge64 , g : Rect ) ;
93+
8294 fn split_rect ( a : i32 , b : i32 , s : Rect ) ;
8395
8496 fn split_rect_floats ( a : f32 , b : f32 , s : FloatRect ) ;
@@ -95,6 +107,8 @@ extern "C" {
95107
96108 fn huge_struct ( s : Huge ) -> Huge ;
97109
110+ fn huge64_struct ( s : Huge64 ) -> Huge64 ;
111+
98112 fn float_point ( p : FloatPoint ) -> FloatPoint ;
99113
100114 fn float_one ( f : FloatOne ) -> FloatOne ;
@@ -107,6 +121,7 @@ fn main() {
107121 let t = BiggerRect { s : s, a : 27834 , b : 7657 } ;
108122 let u = FloatRect { a : 3489 , b : 3490 , c : 8. } ;
109123 let v = Huge { a : 5647 , b : 5648 , c : 5649 , d : 5650 , e : 5651 } ;
124+ let w = Huge64 { a : 1234 , b : 1335 , c : 1436 , d : 1537 , e : 1638 } ;
110125 let p = FloatPoint { x : 5. , y : -3. } ;
111126 let f1 = FloatOne { x : 7. } ;
112127 let i = IntOdd { a : 1 , b : 2 , c : 3 } ;
@@ -117,12 +132,14 @@ fn main() {
117132 byval_rect_floats ( 1. , 2. , 3. , 4. , 5. , 6. , 7. , s, u) ;
118133 byval_rect_with_float ( 1 , 2 , 3.0 , 4 , 5 , 6 , s) ;
119134 byval_rect_with_many_huge ( v, v, v, v, v, v, Rect { a : 123 , b : 456 , c : 789 , d : 420 } ) ;
135+ byval_rect_with_many_huge64 ( w, w, w, w, w, w, Rect { a : 1234 , b : 4567 , c : 7890 , d : 4209 } ) ;
120136 split_rect ( 1 , 2 , s) ;
121137 split_rect_floats ( 1. , 2. , u) ;
122138 split_rect_with_floats ( 1 , 2 , 3.0 , 4 , 5.0 , 6 , s) ;
123139 split_and_byval_rect ( 1 , 2 , 3 , s, s) ;
124140 split_rect ( 1 , 2 , s) ;
125141 assert_eq ! ( huge_struct( v) , v) ;
142+ assert_eq ! ( huge64_struct( w) , w) ;
126143 assert_eq ! ( split_ret_byval_struct( 1 , 2 , s) , s) ;
127144 assert_eq ! ( sret_byval_struct( 1 , 2 , 3 , 4 , s) , t) ;
128145 assert_eq ! ( sret_split_struct( 1 , 2 , s) , t) ;
0 commit comments