[LLVMdev] Does llvm-lit support type substitution (macro)?

Joey Gouly joey.gouly at gmail.com
Wed Sep 10 09:11:43 PDT 2014


Can't you just use C macros?
On 10 Sep 2014 16:05, "lyh.kernel" <lyh.kernel at gmail.com> wrote:

> Hello all,
>
> 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:
>
> // RUN: %clang_cc1 -fsyntax-only
> func (int a) {
>   a = 3;
> }
>
> // RUN: %clang_cc1 -fsyntax-only
> func (char a) {
>   a = 3;
> }
>
> // RUN: %clang_cc1 -fsyntax-only
> func (unsigned a) {
>   a = 3;
> }
>
> 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:
>
> // RUN: %clang_cc1 -fsyntax-only
> func (TYPE a) {
>   a = 3;
> }
>
> // TYPE config
> TYPE = {int, char, unsigned}
>
> Many thanks
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140910/f9091cfd/attachment.html>


More information about the llvm-dev mailing list