[cfe-commits] r124741 - in /cfe/trunk: lib/AST/RecordLayoutBuilder.cpp test/CodeGenCXX/non-empty-class-size-zero.cpp

jahanian fjahanian at apple.com
Wed Feb 2 12:57:43 PST 2011


On Feb 2, 2011, at 12:19 PM, Anders Carlsson wrote:

> 
> On Feb 2, 2011, at 11:36 AM, Fariborz Jahanian wrote:
> 
>> Author: fjahanian
>> Date: Wed Feb  2 13:36:18 2011
>> New Revision: 124741
>> 
>> URL
> 
>> Added: cfe/trunk/test/CodeGenCXX/non-empty-class-size-zero.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/non-empty-class-size-zero.cpp?rev=124741&view=auto
>> ==============================================================================
>> --- cfe/trunk/test/CodeGenCXX/non-empty-class-size-zero.cpp (added)
>> +++ cfe/trunk/test/CodeGenCXX/non-empty-class-size-zero.cpp Wed Feb  2 13:36:18 2011
>> @@ -0,0 +1,21 @@
>> +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
>> +// rdar://8945175
>> +
>> +struct X { 
>> +  int array[0]; 
>> +  int array1[0]; 
>> +  int array2[0]; 
>> +  X();
>> +  ~X();
>> +};
>> +
>> +struct Y {
>> +  int first;
>> +  X padding;
>> +  int second;
>> +};
>> +
>> +int main() {
>> +// CHECK: store i32 0, i32* [[RETVAL:%.*]]
>> +  return sizeof(Y) -8 ;
>> +}
> 
> This doesn't need to be a CodeGen test, does it?


Not it doesn't. But it was convenient. I will think of a Sema test.

- Fariborz

> 
> - Anders
> 





More information about the cfe-commits mailing list