[llvm-dev] Writing tests with Filecheck without emitting output to stdin
Mahesh Attarde via llvm-dev
llvm-dev at lists.llvm.org
Sat Mar 31 08:25:44 PDT 2018
Oops. My bad. I mean to write match-file being my match pattern. and a.rpt
being file generated by opt.
;RUN: FileCheck <match-file>a.rpt.gold --input-file=a.rpt.
mahesh
On Sat, Mar 31, 2018 at 6:57 PM, Mahesh Attarde <coder.mahesh at gmail.com>
wrote:
> That works. Thanks.
>
> One more followup question though.
> Once i run opt on bitcode, there is not useful output/transform on
> bitcode. this rpt files are extra.
> I am hoping to do something like this,
>
> ; RUN: FileCheck --input-file=a.rpt.gold --check-prefix=CHECK-A < a.rpt
> ; RUN: FileCheck --input-file=b.rpt.gold --check-prefix=CHECK-B < b.rpt
>
> i did not find much examples in tests hence question.
> does this have any potential issue in matching.
>
> ~Mahesh
>
>
> On Sat, Mar 31, 2018 at 5:08 PM, Tim Northover <t.p.northover at gmail.com>
> wrote:
>
>> Hi Mahesh,
>>
>> On 31 March 2018 at 11:45, Mahesh Attarde via llvm-dev
>> <llvm-dev at lists.llvm.org> wrote:
>> > opt --my-pass <%s | Filecheck %s
>> >
>> > --my-pass generates files a.rpt b.rpt c.rpt . How do i write test
>> without
>> > writing all 3 files to stdin.
>>
>> You can run FileCheck over them on separate RUN lines assuming you
>> know the filename (which I assume you do since you'd be completely
>> screwed without it).
>>
>> ; RUN: FileCheck %s --check-prefix=CHECK-A < a.rpt
>> ; RUN: FileCheck %s --check-prefix=CHECK-B < b.rpt
>> ; RUN: FileCheck %s --check-prefix=CHECK-C < c.rpt
>>
>> Cheers.
>>
>> Tim.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180331/21500be4/attachment.html>
More information about the llvm-dev
mailing list