[llvm-dev] Writing tests with Filecheck without emitting output to stdin

via llvm-dev llvm-dev at lists.llvm.org
Sun Apr 1 11:05:28 PDT 2018


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>


More information about the llvm-dev mailing list