[llvm-dev] LLVM-LIT config documentation?

677 views
Skip to first unread message

Kevin Hu via llvm-dev

unread,
Jan 14, 2016, 5:57:50 PM1/14/16
to llvm-dev
Dear all,

Recently I've considering using LIT for my benchmark testing framework, and the only reference for LLVM-LIT is the man page and some READMEs. I don't find any documentations on config, which seems to be quite important to the tool. If I use lit outside LLVM source tree and use on my own test files, LIT marks them as 'unresolved'.

So are there any documentations I can find about using LIT for my own benchmarks? Thanks in advance.

Regards,
Kevin

Roel Jordans via llvm-dev

unread,
Jan 15, 2016, 5:03:16 AM1/15/16
to llvm...@lists.llvm.org
Hi Kevin,

I ran into a similar problem a while ago and fixed it mostly by taking
bits from the existing lit.cfg and some info from the LIT command guide [1].

From this I found that this is a somewhat minimal lit.cfg could look like:
---------------------------------------------------------------
import lit.formats

# Lit configuration
config.name = "FOO"
config.test_format = lit.formats.ShTest("0")
config.suffixes = {".c"}
config.target_triple = ""
---------------------------------------------------------------

I hope this will get you going.

Cheers,
Roel

[1] http://llvm.org/docs/CommandGuide/lit.html#test-suites

> _______________________________________________
> LLVM Developers mailing list
> llvm...@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

serge guelton via llvm-dev

unread,
Jan 15, 2016, 5:09:06 AM1/15/16
to Roel Jordans, llvm...@lists.llvm.org
On Fri, Jan 15, 2016 at 11:03:07AM +0100, Roel Jordans via llvm-dev wrote:
> Hi Kevin,
>
> I ran into a similar problem a while ago and fixed it mostly by taking bits
> from the existing lit.cfg and some info from the LIT command guide [1].
>
> From this I found that this is a somewhat minimal lit.cfg could look like:
> ---------------------------------------------------------------
> import lit.formats
>
> # Lit configuration
> config.name = "FOO"
> config.test_format = lit.formats.ShTest("0")
> config.suffixes = {".c"}
> config.target_triple = ""
> ---------------------------------------------------------------

You can have a look to the lit config we setup for our llvm dev tutorial last year:

https://github.com/quarkslab/llvm-dev-meeting-tutorial-2015/blob/master/Tests/lit.cfg.in

It's slightly more complicated than the one above, but there's a decent
ratio of comments in it too ;-)

Dan Liew via llvm-dev

unread,
Jan 15, 2016, 11:41:55 AM1/15/16
to Kevin Hu, llvm-dev
Hi Kevin,


> So are there any documentations I can find about using LIT for my own
> benchmarks? Thanks in advance.

I use lit for several non LLVM projects. Hopefully these will be useful to you.

https://github.com/symbooglix/symbooglix/tree/master/test_programs

https://github.com/boogie-org/boogie/blob/master/Test/lit.site.cfg

and also for KLEE

https://github.com/klee/klee/tree/master/test

You can also take a look at lit's own test cases too

https://github.com/llvm-mirror/llvm/tree/master/utils/lit/tests

I wish I had time to write good documentation for it because its a
fantastic tool but alas I dont.

HTH,
Dan.

Kevin Hu via llvm-dev

unread,
Jan 15, 2016, 6:49:23 PM1/15/16
to Dan Liew, llvm-dev
Dear all,

Thanks very much for the pointers. This is very helpful and I'll keep researching them.

Regards,
Kevin
Reply all
Reply to author
Forward
0 new messages