<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="font-size:12.8px">If the new tests should not be run together with the old tests just consider creating a new file. In general mixing tests is of course possible:</div></blockquote><div><br></div><div>Maybe I should just create a new file. That said, I'd still like to know how to mix tests, for future reference.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="font-size:12.8px">- Specify a target triple in the RUN: line to force output for a specific system, this works regardless of your host system. (However make sure that the target you specify is actually available by placing the test in a directory with lit.local.cfg set apropriately).</div><div style="font-size:12.8px">- You can specify multiple check-prefixes with FileCheck. A typical pattern would be:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">RUN: ... flags for variant1 | FileCheck %s --check-prefix=CHECK --check-prefix=VARIANT1</div><div style="font-size:12.8px">RUN: ... flags for variant2 | FileCheck %s --check-prefix=CHECK --check-prefix=VARIANT2</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">CHECK: check this for all variants</div><div style="font-size:12.8px">VARIANT1: ...</div><div style="font-size:12.8px">VARIANT2: ...</div><div style="font-size:12.8px">...</div></blockquote><div><br></div><div>It looks like FileCheck is mainly for assembly/IR level. I'm trying to test some static-analyzer level things, and I need to skip some test functions.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="font-size:12.8px">In general the best way to learn how to write good tests is spending some time looking into the existing ones.</div></blockquote><div><br></div><div>Slowly, I will. I'm still quite new to the LLVM testing infrastructure. Sorry!</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8000001907349px">Sincerely,</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Alexander Riccio</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">--</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">"Change the world or go home."</span><div style="font-size:12.8000001907349px"><a href="http://about.me/ariccio" target="_blank">about.me/ariccio</a></div><div style="font-size:12.8000001907349px"><a href="http://about.me/ariccio" target="_blank"><br></a></div><div style="font-size:12.8000001907349px">If left to my own devices, I will build more.</div><div style="font-size:12.8000001907349px">⁂</div></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Apr 13, 2016 at 7:44 PM, Matthias Braun <span dir="ltr"><<a href="mailto:mbraun@apple.com" target="_blank">mbraun@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>If the new tests should not be run together with the old tests just consider creating a new file. In general mixing tests is of course possible:</div><div><br></div><div>- Specify a target triple in the RUN: line to force output for a specific system, this works regardless of your host system. (However make sure that the target you specify is actually available by placing the test in a directory with lit.local.cfg set apropriately).</div><div>- You can specify multiple check-prefixes with FileCheck. A typical pattern would be:</div><div><br></div><div>RUN: ... flags for variant1 | FileCheck %s --check-prefix=CHECK --check-prefix=VARIANT1</div><div>RUN: ... flags for variant2 | FileCheck %s --check-prefix=CHECK --check-prefix=VARIANT2</div><div><br></div><div>CHECK: check this for all variants</div><div>VARIANT1: ...</div><div>VARIANT2: ...</div><div>...</div><div><br></div><div>In general the best way to learn how to write good tests is spending some time looking into the existing ones.</div><div><br></div><div>- Matthias</div><div><br></div><div><blockquote type="cite"><div><div class="h5"><div>On Apr 13, 2016, at 1:55 PM, <Alexander G. Riccio> via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br></div></div><div><div><div class="h5"><div dir="ltr">How can I platform-conditionally compile/check sections of code with lit? Can I rely on preprocessor defines like _WIN32?<div><br></div><div>Specifically, I'm adding new tests to existing lit tests, but the new tests should only be compiled and run on Windows.<br><div><br></div><div><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8000001907349px">Sincerely,</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Alexander Riccio</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">--</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">"Change the world or go home."</span><div style="font-size:12.8000001907349px"><a href="http://about.me/ariccio" target="_blank">about.me/ariccio</a></div><div style="font-size:12.8000001907349px"><a href="http://about.me/ariccio" target="_blank"><br></a></div><div style="font-size:12.8000001907349px">If left to my own devices, I will build more.</div><div style="font-size:12.8000001907349px">⁂</div></div></div></div></div></div>
</div></div></div></div></div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br></div></blockquote></div><br></div></blockquote></div><br></div>