@@ -123,55 +123,13 @@ pub struct StructWithProjection(<f32 as Mirror>::It);
123123pub  extern  fn  test_Projection ( _:  StructWithProjection )  -> StructWithProjection  {  loop  { }  } 
124124
125125
126- // The rest of this file tests newtypes around small aggregates on an ABI where small aggregates are 
127- // packed into one register. This is ABI-dependent, so instead we focus on one ABI and supply a 
128- // dummy definition for other ABIs to keep FileCheck happy. 
126+ // All that remains to be tested are aggregates. They are tested in separate files called repr- 
127+ // transparent-*.rs  with `only-*` or `ignore-*` directives, because the expected LLVM IR 
128+ // function signatures vary so much that it's not reasonably possible to cover all of them with a 
129+ // single CHECK line. 
129130// 
130- // Bigger aggregates are tested in separate files called repr-transparent-aggregate-*.rs because 
131- // there, the expected LLVM IR function signatures vary so much that it's not reasonably possible to 
132- // cover all of them with a single CHECK line. Instead we group ABIs by the general "shape" of the 
133- // signature and have a separate test file for each bin. 
134- // 
135- // PS: You may be wondering why we don't just compare the return types and argument types for 
136- // equality with FileCheck regex captures. Well, rustc doesn't perform newtype unwrapping on 
137- // newtypes containing aggregates. This is OK on all ABIs we support, but because LLVM has not 
138- // gotten rid of pointee types yet, the IR function signature will be syntactically different (%Foo* 
139- // vs %FooWrapper*). 
140- 
141- #[ repr( C ) ]  
142- pub  struct  Rgb8  {  r :  u8 ,  g :  u8 ,  b :  u8  } 
143- 
144- #[ repr( transparent) ]  
145- pub  struct  Rgb8Wrap ( Rgb8 ) ; 
146- 
147- // NB: closing parenthesis is missing because sometimes the argument has a name and sometimes not 
148- // CHECK: define i32 @test_Rgb8Wrap(i32 
149- #[ no_mangle]  
150- #[ cfg( all( target_arch="x86_64" ,  target_os="linux" ) ) ]  
151- pub  extern  fn  test_Rgb8Wrap ( _:  Rgb8Wrap )  -> Rgb8Wrap  {  loop  { }  } 
152- 
153- #[ cfg( not( all( target_arch="x86_64" ,  target_os="linux" ) ) ) ]  
154- #[ no_mangle]  
155- pub  extern  fn  test_Rgb8Wrap ( _:  u32 )  -> u32  {  loop  { }  } 
156- 
157- // Same as with the small struct above: ABI-dependent, we only test the interesting case 
158- // (ABIs that pack the aggregate into a scalar) and stub it out on other ABIs 
159- 
160- #[ repr( C ) ]  
161- pub  union  FloatBits  { 
162-     float :  f32 , 
163-     bits :  u32 , 
164- } 
165- 
166- #[ repr( transparent) ]  
167- pub  struct  SmallUnion ( FloatBits ) ; 
168- 
169- // NB: closing parenthesis is missing because sometimes the argument has a name and sometimes not 
170- // CHECK: define i32 @test_SmallUnion(i32 
171- #[ no_mangle]  
172- #[ cfg( all( target_arch="x86_64" ,  target_os="linux" ) ) ]  
173- pub  extern  fn  test_SmallUnion ( _:  SmallUnion )  -> SmallUnion  {  loop  { }  } 
174- 
175- #[ cfg( not( all( target_arch="x86_64" ,  target_os="linux" ) ) ) ]  
176- #[ no_mangle]  
177- pub  extern  fn  test_SmallUnion ( _:  u32 )  -> u32  {  loop  { }  } 
131+ // You may be wondering why we don't just compare the return types and argument types for equality 
132+ // with FileCheck regex captures. Well, rustc doesn't perform newtype unwrapping on newtypes 
133+ // containing aggregates. This is OK on all ABIs we support, but because LLVM has not gotten rid of 
134+ // pointee types yet, the IR function signature will be syntactically different (%Foo* vs 
135+ // %FooWrapper*). 
0 commit comments