[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 04:38:31 PDT 2018


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.


More information about the llvm-dev mailing list