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

lyh.kernel lyh.kernel at gmail.com
Wed Sep 10 07:48:09 PDT 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140910/669295fe/attachment.html>


More information about the llvm-dev mailing list