<p dir="ltr">Can't you just use C macros?</p>
<div class="gmail_quote">On 10 Sep 2014 16:05, "lyh.kernel" <<a href="mailto:lyh.kernel@gmail.com">lyh.kernel@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello all,<br><br>I am writing test cases which are dedicated to be executed by llvm-lit. Most of my test cases have the same logic but different types. For example:<br><br>// RUN: %clang_cc1 -fsyntax-only<br>func (int a) {<br> a = 3;<br>}<br><br>// RUN: %clang_cc1 -fsyntax-only<br>func (char a) {<br> a = 3;<br>}<br><br>// RUN: %clang_cc1 -fsyntax-only<br>func (unsigned a) {<br> a = 3;<br>}<br><br>Now I put them in three different test cases but it is hard to maintain. I am wondering whether llvm-lit support writing test cases with macro parameter and a parameter config file:<br><br>// RUN: %clang_cc1 -fsyntax-only<br>func (TYPE a) {<br> a = 3;<br>}<br><br>// TYPE config<br>TYPE = {int, char, unsigned}<br><div><br></div><div>Many thanks</div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div>