Changes to llvm tests to fix Bug 17327

Nick Lewycky nicholas at mxc.ca
Wed Sep 25 11:56:59 PDT 2013


Stephen Checkoway wrote:
>
> On Sep 25, 2013, at 2:16 AM, Thomas O'Dell<thomas_odell at trsolutions.biz>  wrote:
>
>> Hi Stephen,
>>
>> The problem with the test is that QNX's grep (POSIX-compliant) doesn't find the required symbol if the file lacks a newline.
>
> Very bizarre!

Please add a comment in the test explaining this. Anybody in the future 
who didn't read this thread is going to "fix" it and put it back.

Something like "Per POSIX, grep matches lines, so add a newline to 
ensure it has a line to match." ... except correct. I haven't actually 
checked what POSIX says.

Nick

>> The extra step uses echo to ensure there is at least 1 newline in the file. The test then passes.
>
> You could use echo>>  %T/linkagename.gcno to add a newline rather than create a new file, but I suspect it doesn't matter much.
>
>>
>> As Nick pointed out, there was a typo in the change I uploaded. The corrected diff is:
>>
>> Index: test/Transforms/GCOVProfiling/linkagename.ll
>> ===================================================================
>> --- test/Transforms/GCOVProfiling/linkagename.ll (revision 191282)
>> +++ test/Transforms/GCOVProfiling/linkagename.ll (working copy)
>> @@ -1,7 +1,8 @@
>> ; RUN: echo '!9 = metadata !{metadata !"%T/linkagename.ll", metadata !0}'>  %t1
>> ; RUN: cat %s %t1>  %t2
>> ; RUN: opt -insert-gcov-profiling -disable-output<  %t2
>> -; RUN: grep _Z3foov %T/linkagename.gcno
>> +; RUN: echo `cat %T/linkagename.gcno`>%t3
>> +; RUN: grep _Z3foov %t3
>> ; RUN: rm %T/linkagename.gcno
>
> LGTM, but I'm just a list lurker, someone else needs to approve.
>




More information about the llvm-commits mailing list