Mahesh Attarde via llvm-dev
2018-Mar-31 10:45 UTC
[llvm-dev] Writing tests with Filecheck without emitting output to stdin
Hello I have pass operating on bitcode file which produces more than one equivalent representation. 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. I have considered CHECK-LABEL for each. it creates bulky checks. Thanks Mahesh -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180331/284e9e19/attachment.html>
Tim Northover via llvm-dev
2018-Mar-31 11:38 UTC
[llvm-dev] Writing tests with Filecheck without emitting output to stdin
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.
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>
via llvm-dev
2018-Apr-01 18:05 UTC
[llvm-dev] Writing tests with Filecheck without emitting output to stdin
See: http://llvm.org/docs/CommandGuide/FileCheck.html It is not required to pipe output to FileCheck; there is the --input-file option, which allows you to run FileCheck on an existing disk file. Something like this: FileCheck %s --input-file a.rpt --check-prefix=A FileCheck %s --input-file b.rpt --check-prefix=B FileCheck %s --input-file c.rpt --check-prefix=C If there are common parts to each .rpt file that you want to check, you can write those checks with another prefix and use the --check-prefixes option to specify all the ones that are appropriate to each run of FileCheck. I am sure you can find some existing tests with examples of these patterns to give you ideas how to write your test. If you still have questions please feel free to ask them. --paulr From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Mahesh Attarde via llvm-dev Sent: Saturday, March 31, 2018 6:45 AM To: llvm-dev Subject: [llvm-dev] Writing tests with Filecheck without emitting output to stdin Hello I have pass operating on bitcode file which produces more than one equivalent representation. 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. I have considered CHECK-LABEL for each. it creates bulky checks. Thanks Mahesh -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180401/f7f6af4f/attachment.html>
Mahesh Attarde via llvm-dev
2018-Apr-01 18:22 UTC
[llvm-dev] Writing tests with Filecheck without emitting output to stdin
Thanks that helps. I was unclear about term "input-file" used in doc. Now it is clear with ur example. Mahesh On Sun, Apr 1, 2018, 11:35 PM <paul.robinson at sony.com> wrote:> See: http://llvm.org/docs/CommandGuide/FileCheck.html > > > > It is not required to pipe output to FileCheck; there is the --input-file > option, which allows you to run FileCheck on an existing disk file. > Something like this: > > FileCheck %s --input-file a.rpt --check-prefix=A > > FileCheck %s --input-file b.rpt --check-prefix=B > > FileCheck %s --input-file c.rpt --check-prefix=C > > > > If there are common parts to each .rpt file that you want to check, you > can write those checks with another prefix and use the --check-prefixes > option to specify all the ones that are appropriate to each run of > FileCheck. > > > > I am sure you can find some existing tests with examples of these patterns > to give you ideas how to write your test. If you still have questions > please feel free to ask them. > > --paulr > > > > *From:* llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] *On Behalf Of *Mahesh > Attarde via llvm-dev > *Sent:* Saturday, March 31, 2018 6:45 AM > *To:* llvm-dev > *Subject:* [llvm-dev] Writing tests with Filecheck without emitting > output to stdin > > > > Hello > > I have pass operating on bitcode file which produces more than one > equivalent representation. > > 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. > > I have considered CHECK-LABEL for each. it creates bulky checks. > > Thanks > > Mahesh > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180401/ee266d32/attachment.html>
Reasonably Related 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