<div dir="ltr">The simplest way to run a clang test case that I know of is to clone both llvm and clang repos, run all the tests, then run an individual test.<div><br></div><div>IIRC like so:<br><div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>git clone llvm ......</div></div><div><div>cd llvm/tools</div></div><div><div>git clone clang .....</div></div><div><div>cd ../../</div></div><div><div>mkdir build</div></div><div><div>cd build</div></div><div><div>cmake ../llvm</div></div><div><div>ninja check-clang</div></div><div><div>./bin/llvm-lit -v ./tools/clang/test/<wbr>Sema/asm.c</div></div></blockquote><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 6, 2018 at 7:10 AM, Sedat Dilek via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
while experimenting with llvmlinux on Debian/testing AMD64 I wanted to<br>
run some x86-64 ASM tests.<br>
<br>
I fell over [1] and wanted to run it.<br>
<br>
So, I cloned clang from Git...<br>
<br>
$ git clone <a href="https://github.com/llvm-mirror/clang.git" rel="noreferrer" target="_blank">https://github.com/llvm-<wbr>mirror/clang.git</a><br>
<br>
I looked through some docs where I have seen I need "llvm-lit" or "lit.py".<br>
The Debian package llvm-7-tools from <<a href="http://apt.llvm.org" rel="noreferrer" target="_blank">apt.llvm.org</a>> does ship "lit.py".<br>
Furthermore, I have installed llvm-7 and clang-7 packages.<br>
The version is 1:7~svn330207-1~exp1+0~<wbr>20180417201234.1709~1.<wbr>gbp6fb10d.<br>
<br>
[5,6] have some examples on running a single testcase:<br>
<br>
For example:<br>
<br>
python C:\Tools\llvm\utils\lit\lit.py -sv<br>
--param=build_mode=Win32 --param=build_config=Debug<br>
--param=clang_site_config=C:\<wbr>Tools\build\tools\clang\test\<wbr>lit.site.cfg<br>
C:\Tools\llvm\tools\clang\<wbr>test\Sema\wchar.c<br>
<br>
I transformed this...<br>
<br>
$ python /usr/lib/llvm-7/build/utils/<wbr>lit/lit.py -sv<br>
/home/sdi/src/linux-kernel/<wbr>clang/test/Sema/asm.c<br>
lit.py: /usr/lib/llvm-7/build/utils/<wbr>lit/lit/TestingConfig.py:101:<br>
fatal: unable to parse config file<br>
'/home/sdi/src/linux-kernel/<wbr>clang/test/<a href="http://lit.cfg.py" rel="noreferrer" target="_blank">lit.cfg.py</a>', traceback:<br>
Traceback (most recent call last):<br>
File "/usr/lib/llvm-7/build/utils/<wbr>lit/lit/TestingConfig.py", line<br>
88, in load_from_path<br>
exec(compile(data, path, 'exec'), cfg_globals, None)<br>
File "/home/sdi/src/linux-kernel/<wbr>clang/test/<a href="http://lit.cfg.py" rel="noreferrer" target="_blank">lit.cfg.py</a>", line 25, in <module><br>
config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)<br>
AttributeError: 'NoneType' object has no attribute 'use_lit_shell'<br>
<br>
Yes, I have a <a href="http://lit.cfg.py" rel="noreferrer" target="_blank">lit.cfg.py</a>.<br>
<br>
$ LC_ALL=C ll clang/test/lit.*<br>
-rw-r--r-- 1 sdi sdi 5979 Apr 25 12:14 clang/test/<a href="http://lit.cfg.py" rel="noreferrer" target="_blank">lit.cfg.py</a><br>
-rw-r--r-- 1 sdi sdi 1906 Apr 25 12:14 clang/test/<a href="http://lit.site.cfg.py.in" rel="noreferrer" target="_blank">lit.site.cfg.py.in</a><br>
<br>
How can I create a <a href="http://lit.site.cfg.py" rel="noreferrer" target="_blank">lit.site.cfg.py</a> to pass it as<br>
--param=clang_site_config=/<wbr>path/to/<a href="http://lit.site.cfg.py" rel="noreferrer" target="_blank">lit.site.cfg.py</a>?<br>
<br>
I have attached TestingConfig.py from llvm-7-tools and <a href="http://lit.cfg.py" rel="noreferrer" target="_blank">lit.cfg.py</a> and<br>
<a href="http://lit.site.cfg.py.in" rel="noreferrer" target="_blank">lit.site.cfg.py.in</a> from clang-git.<br>
<br>
What am I missing?<br>
What do I need to run a single clang testcase?<br>
<br>
Thanks in advance.<br>
<br>
Regards,<br>
- Sedat -<br>
<br>
[1] <a href="https://github.com/llvm-mirror/clang/raw/master/test/Sema/asm.c" rel="noreferrer" target="_blank">https://github.com/llvm-<wbr>mirror/clang/raw/master/test/<wbr>Sema/asm.c</a><br>
[2] <a href="https://llvm.org/docs/CommandGuide/lit.html" rel="noreferrer" target="_blank">https://llvm.org/docs/<wbr>CommandGuide/lit.html</a><br>
[3] <a href="https://llvm.org/docs/TestingGuide.html" rel="noreferrer" target="_blank">https://llvm.org/docs/<wbr>TestingGuide.html</a><br>
[4] <a href="https://llvm.org/docs/TestSuiteMakefileGuide.html" rel="noreferrer" target="_blank">https://llvm.org/docs/<wbr>TestSuiteMakefileGuide.html</a><br>
[5] <a href="http://clang.llvm.org/hacking.html" rel="noreferrer" target="_blank">http://clang.llvm.org/hacking.<wbr>html</a><br>
[6] <a href="http://clang.llvm.org/hacking.html#testingCommands" rel="noreferrer" target="_blank">http://clang.llvm.org/hacking.<wbr>html#testingCommands</a><br>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">-Brian</div>
</div>