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

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Sat Mar 31 08:47:27 PDT 2018


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.


More information about the llvm-dev mailing list