This is an archive of the discontinued LLVM Phabricator instance.

Add new lit argument: --exec-feature=FEATURE
Needs ReviewPublic

Authored by samsonov on Feb 15 2013, 6:57 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This patch adds a new option for lit test runner: --exec-feature=<feature>
This option allows to specify test execution mode and can be used in REQUIRES:
and XFAIL: lines. Particular use case: we are running LLVM/Clang tests under
AddressSanitizer to find memory errors, and there are some "known" buganized
failures like http://llvm.org/bugs/show_bug.cgi?id=15130. With this patch applied,
we can mark these tests "XFAIL: asan", specify LLVM_LIT_ARGS="--exec-feature=asan"
at configuration time, and keep the build clean.

Diff Detail

Event Timeline

Hi Alexey,

This shouldn't require adding a new lit option.

Ideally, I would propose the right way to handle this would be to have some
way to detect that the compile is done with ASAN support enabled (if the
support is enabled with a configure flag, just set a new build variable).
For example, see how "llvm_use_intel_jit" gets added to the lit features
for LLVM. This way things will "just work" if people build with ASAN
enabled.

Is there a reason that approach doesn't work here? If not, then I still
would prefer using the single existing lit mechanism --param to pass in the
parameter.

  • Daniel

Daniel, thanks for the pointer. It should work for us.

We can detect asan-ized build (either by searching through cflags, or by a compile+link+objdump+grep __asan_init configuration test).

Hi Daniel,

Thanks for pointing out at llvm_use_intel_jitevents! I think we can benefit from adding a build configuration options that would tell
the build system to build LLVM/Clang under ASan/MSan/whatever. Then we can setup the correct compile flags, alter llvm-lit options
etc.

Still, I think this is somewhat orthogonal to this patch: we want to mark certain tests as "xfailing" under ASan, not "unsupported".
It's also good if we have per-test granularity instead of per-directory offered by lit.site.cfg (which is far less discoverable).

Probably, there is another way to achieve the goal - specify "asan" in --param flag, but this would also require untrivial
changes to lit to make it respect --param values in XFAIL: lines.

P.S. One more random crazy idea: we can later pull --vg and --vg-leak under --exec-feature flag :)

ddunbar resigned from this revision.Sep 1 2016, 8:21 PM
ddunbar removed a reviewer: ddunbar.