On May 22, 2012, at 2:08 PM, "Robinson, Paul" <[email protected]> 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 _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
