Mahesh Attarde via llvm-dev
2018-Mar-31 13:27 UTC
[llvm-dev] Writing tests with Filecheck without emitting output to stdin
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/58c9f35e/attachment.html>
Tim Northover via llvm-dev
2018-Mar-31 15:01 UTC
[llvm-dev] Writing tests with Filecheck without emitting output to stdin
Hi Mahesh, On 31 March 2018 at 14:27, Mahesh Attarde <coder.mahesh at gmail.com> wrote:> I am hoping to do something like this, > > ; RUN: FileCheck --input-file=a.rpt.gold --check-prefix=CHECK-A < a.rptI'm afraid I don't understand. What is "a.rpt.gold" expected to contain? Is it something you'll write or something generated by opt? Cheers. Tim.
Mahesh Attarde via llvm-dev
2018-Mar-31 15:25 UTC
[llvm-dev] Writing tests with Filecheck without emitting output to stdin
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>
Tim Northover via llvm-dev
2018-Mar-31 15:47 UTC
[llvm-dev] Writing tests with Filecheck without emitting output to stdin
On 31 March 2018 at 16:25, Mahesh Attarde <coder.mahesh at gmail.com> wrote:> 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.I still don't get it. FileCheck takes its inputs from 2 sources: + The actual command-line filename is where knows what it has to look for (%s in my original example). This file should contain "CHECK-WHATEVER" lines + Stdin is the data it's trying to verify matches what's expected (which is redirected from a.rpt in my example). Its output is an exit status of 0 if the test passes, and hopefully some useful diagnostic if it fails. There's no room for a 3rd input like your "a.rpt.gold"; there's nothing more FileCheck needs to do its job. Cheers. Tim.
Possibly Parallel Threads
- Writing tests with Filecheck without emitting output to stdin
- Writing tests with Filecheck without emitting output to stdin
- Writing tests with Filecheck without emitting output to stdin
- Writing tests with Filecheck without emitting output to stdin
- About LLVM Pass dependency