[LLVMdev] To test an LLVM pass

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Jun 30 10:54:25 PDT 2014


+llvmdev

I've only used LNT.  Someone else might be able to help, but I
notice in the overview from your link:

> This way of interacting with the test-suite is deprecated in
> favor of running the test-suite using LNT

You might not get too far via make.

> On 2014-Jun-27, at 08:10, Rekha R <rekharamapai at nitc.ac.in> wrote:
> 
> Hi Duncan,
> 
>  Thank you for prompt reply.
> Let me elaborate on my situation. 
> 
> I believe there are two ways to test passes using the test-suite: the traditional method of using make and then as you suggested using LNT tool.
> 
> Upon googling, I came across the doc
> http://llvm.org/docs/TestSuiteMakefileGuide.html
> 
> which guides us on how to test programs using make. I could successfully follow the steps mentioned there. 
> 
> But now my problem is I would like to test only mypass (the pass I wrote) on the programs in test-suite - Single Source, Multisource, and then External. That is, view the results of stats written in mypass (and mypass only).
> This somehow I couldn't do and hence my initial question.
> 
> Now you have pointed me to the second method of using LNT tool. Pardon me, but I was thinking of first exhausting all options to test using make and then jump to using LNT.
> Can you guide me on how to use make to test mypass on programs in the test-suite.
> 
> Appreciate the help.
> 
> Regards,
> Rekha
> 
> 
> On Fri, Jun 27, 2014 at 2:57 AM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
> > On 2014-Jun-26, at 05:07, Rekha R <rekharamapai at nitc.ac.in> wrote:
> >
> > Hi,
> >
> >  I wrote a pass in LLVM and would like to test it on the programs in LLVM test-suite.  To be specific, I would like to get the stats upon running my pass on these programs.
> >
> > What are the commands to run my pass on the test suite?
> 
> The test-suite [1][2] runs clang.  If you have an LLVM command-line flag to enable your
> pass, you can use `-mllvm -your-flag` to pass your flag through clang.
> 
> There is some quickstart documentation on running LNT [3].  Have a look at the `--help`
> for the `runtest` command to see how to customize which flags are passed down to clang
> invocations.
> 
> Hope that helps!
> 
> [1]: http://llvm.org/docs/lnt/intro.html
> [2]: http://llvm.org/docs/lnt/tests.html#lnt-based-nt-test-modules
> [3]: http://llvm.org/docs/lnt/quickstart.html
> 
> -- dpnes
> 
> 
> 
> -- 
> Rekha




More information about the llvm-dev mailing list