1212#![ crate_type = "lib" ]
1313#![ no_core]
1414
15- #[ lang="sized" ]
16- trait Sized { }
17- #[ lang="freeze" ]
18- trait Freeze { }
19- #[ lang="copy" ]
20- trait Copy { }
21-
22-
15+ #[ lang = "sized" ]
16+ trait Sized { }
17+ #[ lang = "freeze" ]
18+ trait Freeze { }
19+ #[ lang = "copy" ]
20+ trait Copy { }
2321
2422// Passed as `[i64 x 2]`, since it's an aggregate with size <= 128 bits, align < 128 bits.
2523#[ repr( C ) ]
@@ -31,7 +29,7 @@ pub struct Align8 {
3129// repr(transparent), so same as above.
3230#[ repr( transparent) ]
3331pub struct Transparent8 {
34- a : Align8
32+ a : Align8 ,
3533}
3634
3735// Passed as `[i64 x 2]`, since it's an aggregate with size <= 128 bits, align < 128 bits.
@@ -47,8 +45,6 @@ extern "C" {
4745 fn test_8 ( a : Align8 , b : Transparent8 , c : Wrapped8 ) ;
4846}
4947
50-
51-
5248// Passed as `i128`, since it's an aggregate with size <= 128 bits, align = 128 bits.
5349// EXCEPT on Linux, where there's a special case to use its unadjusted alignment,
5450// making it the same as `Align8`, so it's be passed as `[i64 x 2]`.
@@ -62,7 +58,7 @@ pub struct Align16 {
6258// repr(transparent), so same as above.
6359#[ repr( transparent) ]
6460pub struct Transparent16 {
65- a : Align16
61+ a : Align16 ,
6662}
6763
6864// Passed as `i128`, since it's an aggregate with size <= 128 bits, align = 128 bits.
@@ -79,8 +75,6 @@ extern "C" {
7975 fn test_16 ( a : Align16 , b : Transparent16 , c : Wrapped16 ) ;
8076}
8177
82-
83-
8478// Passed as `i128`, since it's an aggregate with size <= 128 bits, align = 128 bits.
8579#[ repr( C ) ]
8680pub struct I128 {
@@ -90,13 +84,13 @@ pub struct I128 {
9084// repr(transparent), so same as above.
9185#[ repr( transparent) ]
9286pub struct TransparentI128 {
93- a : I128
87+ a : I128 ,
9488}
9589
9690// Passed as `i128`, since it's an aggregate with size <= 128 bits, align = 128 bits.
9791#[ repr( C ) ]
9892pub struct WrappedI128 {
99- pub a : I128
93+ pub a : I128 ,
10094}
10195
10296extern "C" {
@@ -106,8 +100,6 @@ extern "C" {
106100 fn test_i128 ( a : I128 , b : TransparentI128 , c : WrappedI128 ) ;
107101}
108102
109-
110-
111103// Passed as `[2 x i64]`, since it's an aggregate with size <= 128 bits, align < 128 bits.
112104// Note that the Linux special case does not apply, because packing is not considered "adjustment".
113105#[ repr( C ) ]
@@ -119,13 +111,13 @@ pub struct Packed {
119111// repr(transparent), so same as above.
120112#[ repr( transparent) ]
121113pub struct TransparentPacked {
122- a : Packed
114+ a : Packed ,
123115}
124116
125117// Passed as `[2 x i64]`, since it's an aggregate with size <= 128 bits, align < 128 bits.
126118#[ repr( C ) ]
127119pub struct WrappedPacked {
128- pub a : Packed
120+ pub a : Packed ,
129121}
130122
131123extern "C" {
@@ -135,13 +127,19 @@ extern "C" {
135127 fn test_packed ( a : Packed , b : TransparentPacked , c : WrappedPacked ) ;
136128}
137129
138-
139-
140130pub unsafe fn main (
141- a1 : Align8 , a2 : Transparent8 , a3 : Wrapped8 ,
142- b1 : Align16 , b2 : Transparent16 , b3 : Wrapped16 ,
143- c1 : I128 , c2 : TransparentI128 , c3 : WrappedI128 ,
144- d1 : Packed , d2 : TransparentPacked , d3 : WrappedPacked ,
131+ a1 : Align8 ,
132+ a2 : Transparent8 ,
133+ a3 : Wrapped8 ,
134+ b1 : Align16 ,
135+ b2 : Transparent16 ,
136+ b3 : Wrapped16 ,
137+ c1 : I128 ,
138+ c2 : TransparentI128 ,
139+ c3 : WrappedI128 ,
140+ d1 : Packed ,
141+ d2 : TransparentPacked ,
142+ d3 : WrappedPacked ,
145143) {
146144 test_8 ( a1, a2, a3) ;
147145 test_16 ( b1, b2, b3) ;
0 commit comments