[cfe-dev] Link external libraries to Clang lit tests

Eric Christopher echristo at apple.com
Thu Dec 15 14:37:40 PST 2011


On Dec 15, 2011, at 1:30 PM, Murali, Sriram wrote:

> Hello,
> I need to link Clang, and a test case (added as the clang lit test) using an external library. I could do it by manually adding the options in the lit test.
> 
> For instance:
> 
> // RUN: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<PATH_TO_LIB>
> // RUN: %clang -o %t %s -L<PATH_TO_LIB> -l<libname> -lstdc++
> // RUN: %t > %t.out
> 
> <<C++ Source>>
> 
> Is there a way to add the library path in the lit test configuration, and use it on my test case? I know that I cannot expect a similar test that links with external libraries in the clang test suite. But it would be helpful if someone can share their experience trying to accomplish something.

We really don't want executable tests in that test suite. Things that _must_ execute should go in projects/test-suite from the main llvm project. If you think you must have a testcase to test something you should probably think of a different way to test it.

-eric



More information about the cfe-dev mailing list