[PATCH] InstrProf: Add initial compiler-rt test
samsonov at google.com
Fri Mar 28 09:02:42 PDT 2014
On Fri, Mar 28, 2014 at 8:21 AM, Kostya Serebryany <kcc at google.com> wrote:
> On Fri, Mar 28, 2014 at 3:39 AM, Duncan P. N. Exon Smith <
> dexonsmith at apple.com> wrote:
>> This patch adds the infrastructure for compiler-rt tests for instrumented
>> It also adds a single very simple test.
>> I’m a little lost with lit and cmake; could someone who knows better have
>> a look to
>> make sure I have the right magic?
>> I copied and modified the logic from the test/asan/ directory.
>> There are two things that don’t (or probably don’t) work.
>> 1. You cannot call:
>> $ cd llvm/projects/compiler-rt
>> $ path/to/llvm-lit test/profile
>> The other compiler-rt tests seem to have the same defect, and I’m not
>> sure how
>> to fix it.
>> Nevertheless, using cmake+ninja, you can call:
>> $ ninja check-profile
>> 2. I didn’t do anything with configure+make, since the other tests in
>> didn’t have a model I could copy. So the tests probably aren’t
>> Thanks for any pointers!
Could you please use phabricator (http://llvm.org/docs/Phabricator.html)
for sending patches?
A few comments:
+# Tests need to run generated executables.
+if config.host_triple != config.target_triple:
+ config.unsupported = True
This is not needed - if tests target different
platform, COMPILER_RT_CAN_EXECUTE_TESTS should be OFF,
and the test suite wouldn't be added.
^^ Looks like this is not used. Please delete.
+ list(APPEND PROFILE_TEST_DEPS profile)
You also need to add dependency on clang, and likely clang-headers and
+# Add clang substitutions.
+config.substitutions.append( ("%clang ", config.clang + " ") )
+config.substitutions.append( ("%clang_profgen ", config.clang + "
-fprofile-instr-generate ") )
+config.substitutions.append( ("%clang_profuse=", config.clang + "
I think it would be easier for now to have only %clang substitution and use
verbatim flags in lit tests
(%clang -fprofile-instr-use=%t ...).
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits