[cfe-commits] r157269 - /cfe/trunk/test/CodeGenCXX/debug-info-vla-range.cpp

Eric Christopher echristo at apple.com
Tue May 22 14:18:34 PDT 2012


On May 22, 2012, at 2:08 PM, "Robinson, Paul" <Paul.Robinson at am.sony.com> wrote:

>> Author: echristo
>> Date: Tue May 22 13:04:48 2012
>> New Revision: 157269
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=157269&view=rev
>> Log:
>> Test that we emit a subrange type for vlas.
>> 
>> Part of rdar://11457152
>> 
>> Added:
>>   cfe/trunk/test/CodeGenCXX/debug-info-vla-range.cpp
>> 
>> Added: cfe/trunk/test/CodeGenCXX/debug-info-vla-range.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-vla-range.cpp?rev=157269&view=auto
>> ==============================================================================
>> --- cfe/trunk/test/CodeGenCXX/debug-info-vla-range.cpp (added)
>> +++ cfe/trunk/test/CodeGenCXX/debug-info-vla-range.cpp Tue May 22 13:04:48 2012
>> @@ -0,0 +1,9 @@
>> +// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o -
> | FileCheck %s
>> +
>> +// CHECK: DW_TAG_subrange_type
>> +
>> +struct StructName {
>> +  int member[];
>> +};
>> +
>> +struct StructName SN;
> 
> The log says VLA, but the test code is actually a flex array member.
> To be a complete test for flex array member, I suggest adding
> 
> // CHECK-NOT: DW_AT_upper_bound
> 
> A VLA would be something like this:
> 
> void foo (int bound) {
>  int vla[bound];
> }
> 
> and the DW_TAG_subrange_type should have a DW_AT_upper_bound
> that is a reference to the DW_TAG_formal_parameter for "bound".
> Or, hm, actually an expression that evaluates to (bound - 1).

*nod* In this case I was happy it was emitting anything, but yes you are correct.

Thanks :)

-eric



More information about the cfe-commits mailing list