[llvm-dev] Using FileCheck in unit tests

Matthias Braun via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 2 15:13:04 PDT 2018


I had similar gripes with unit testing machine function stuff. I personally would have preferred to create more tests based on a tool like llc rather than pushing more on the unit test side. Anyway I tried to push https://reviews.llvm.org/D48850 <https://reviews.llvm.org/D48850> in order to extend llc to be more amenable in the situations we want to test, but it ultimately wasn't accepted.

- Matthias

> On Jul 2, 2018, at 2:35 PM, Aditya Nandakumar via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> 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>)
> 
> Thanks
> Aditya
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

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


More information about the llvm-dev mailing list