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

Eric Christopher echristo at apple.com
Fri Dec 16 11:42:22 PST 2011


It'll autodetect it if you have clang checked out into your build directory.

-eric

On Dec 16, 2011, at 11:32 AM, Murali, Sriram wrote:

> Thanks for the comments Eric. I noticed that the test-suite works off llvm-gcc. Is there a way to use clang instead?
> 
> -----Original Message-----
> From: Eric Christopher [mailto:echristo at apple.com] 
> Sent: Thursday, December 15, 2011 5:38 PM
> To: Murali, Sriram
> Cc: cfe-dev at cs.uiuc.edu
> Subject: Re: [cfe-dev] Link external libraries to Clang lit tests
> 
> 
> 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