[llvm-dev] Using FileCheck in unit tests

Aditya Nandakumar via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 2 14:35:17 PDT 2018

When writing MachineFunction unit tests, I find it quite tedious to verify correctness in C++. I would like to use FileCheck in UnitTests because FileCheck is extremely convenient/robust to verify correctness. In order to do so, I moved most of FileCheck’s implementation into a header (Support/FileCheck.h) and updated FileCheck.cpp to use this.

I ran into this while writing some target agnostic Legalization code in GISel where it’s not possible or extremely inconvenient to use llc.
What do others think of this? I would think there might be non GISel uses for FileCheck in unit tests, but I’m not sure.

Here’s a quick patch for this (https://reviews.llvm.org/D48850 <https://reviews.llvm.org/D48850>)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180702/bb167af5/attachment.html>

More information about the llvm-dev mailing list