[llvm-commits] [llvm] r137845 - /llvm/trunk/test/FrontendC++/2010-02-17-DbgArtificialArg.cpp

Devang Patel dpatel at apple.com
Wed Aug 17 12:56:53 PDT 2011


On Aug 17, 2011, at 12:39 PM, Eric Christopher wrote:

> 
> On Aug 17, 2011, at 11:38 AM, Devang Patel wrote:
> 
>> Author: dpatel
>> Date: Wed Aug 17 13:38:44 2011
>> New Revision: 137845
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=137845&view=rev
>> Log:
>> Robustify test.
>> 
>> Modified:
>>   llvm/trunk/test/FrontendC++/2010-02-17-DbgArtificialArg.cpp
>> 
>> Modified: llvm/trunk/test/FrontendC++/2010-02-17-DbgArtificialArg.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2010-02-17-DbgArtificialArg.cpp?rev=137845&r1=137844&r2=137845&view=diff
>> ==============================================================================
>> --- llvm/trunk/test/FrontendC++/2010-02-17-DbgArtificialArg.cpp (original)
>> +++ llvm/trunk/test/FrontendC++/2010-02-17-DbgArtificialArg.cpp Wed Aug 17 13:38:44 2011
>> @@ -1,5 +1,4 @@
>> -// RUN: %llvmgcc -g -S %s -o - | FileCheck %s
>> -// Here, second to last argument "i32 64" indicates that artificial type is set.                                               
>> +// RUN: %llvmgcc -g -S %s -dA -fverbose-asm -o - | %llc -asm-verbose | FileCheck %s
>> // Test to artificial attribute attahed to "this" pointer type.
>> // Radar 7655792 and 7655002
>> 
>> @@ -10,7 +9,12 @@
>> 
>> int foo() {
>>  A a;
>> -  // Matching "i32 64, metadata !<number>} ; [ DW_TAG_pointer_type ]"
>> -  // CHECK: i32 64, metadata {{![0-9]+\} ; \[ DW_TAG_pointer_type \]}}
>> +//CHECK:        .ascii   "this"                 ## DW_AT_name
>> +//CHECK-NEXT:        .byte   0
>> +//CHECK-NEXT:        ## DW_AT_decl_file
>> +//CHECK-NEXT:        ## DW_AT_decl_line
>> +//CHECK-NEXT:        ## DW_AT_type
>> +//CHECK-NEXT:        ## DW_AT_artificial
>> +
>>  return a.fn1(1);
>> }
>> 
> 
> What, in particular, are you trying to test with this test? I.e. can you break it up into backend portions when you already have the front end emitting what you want and test the front end separately to make sure it's emitting what you want?
> 
> I say this because I'm getting rid of all these tests and a run line this complicated puts it at the top of my "delete this test" line instead of the "try to figure out how to migrate this test" line.
> 

The test was originally written for a FE bug fix. Checking an metadata element value to be non-zero is fragile when metadata node structure changes. However, checking output assembly ensures that "this" is marked artificial.

-
Devang



More information about the llvm-commits mailing list