<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">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 class=""><br class=""></div><div class="">- 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 class="">- You can specify multiple check-prefixes with FileCheck. A typical pattern would be:</div><div class=""><br class=""></div><div class="">RUN: ... flags for variant1 | FileCheck %s --check-prefix=CHECK --check-prefix=VARIANT1</div><div class="">RUN: ... flags for variant2 | FileCheck %s --check-prefix=CHECK --check-prefix=VARIANT2</div><div class=""><br class=""></div><div class="">CHECK: check this for all variants</div><div class="">VARIANT1: ...</div><div class="">VARIANT2: ...</div><div class="">...</div><div class=""><br class=""></div><div class="">In general the best way to learn how to write good tests is spending some time looking into the existing ones.</div><div class=""><br class=""></div><div class="">- Matthias</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Apr 13, 2016, at 1:55 PM, <Alexander G. Riccio> via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">How can I platform-conditionally compile/check sections of code with lit? Can I rely on preprocessor defines like _WIN32?<div class=""><br class=""></div><div class="">Specifically, I'm adding new tests to existing lit tests, but the new tests should only be compiled and run on Windows.<br class=""><div class=""><br class=""></div><div class=""><br clear="all" class=""><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><span style="font-size:12.8000001907349px" class="">Sincerely,</span><br style="font-size:12.8000001907349px" class=""><span style="font-size:12.8000001907349px" class="">Alexander Riccio</span><br style="font-size:12.8000001907349px" class=""><span style="font-size:12.8000001907349px" class="">--</span><br style="font-size:12.8000001907349px" class=""><span style="font-size:12.8000001907349px" class="">"Change the world or go home."</span><div style="font-size:12.8000001907349px" class=""><a href="http://about.me/ariccio" target="_blank" class="">about.me/ariccio</a></div><div style="font-size:12.8000001907349px" class=""><a href="http://about.me/ariccio" target="_blank" class=""><br class=""></a></div><div style="font-size:12.8000001907349px" class="">If left to my own devices, I will build more.</div><div style="font-size:12.8000001907349px" class="">⁂</div></div></div></div></div></div>
</div></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>