This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer tests] Factor out CMake logic for compiling sanitizer tests
ClosedPublic

Authored by george.karpenkov on Jul 25 2017, 5:43 PM.

Details

Summary

Currently there's a large amount of CMake logic duplication for compiling sanitizer tests.
If we add more sanitizers, the duplication will get even worse.

This change factors out common compilation commands into a macro available to all sanitizers.

NB: I haven't figured out how to run msan/xray tests.
There are no ninja check-msan or ninja check-xray commands, which is also inconsistent with lib/tsan/check_cmake.sh.
I'm currently running ninja check-all to test that.

Diff Detail

Event Timeline

kcc edited edge metadata.Jul 25 2017, 5:45 PM

check-msan is only available on platforms that support msan (i.e. Linux).
I *think* the same it true about xray

@kcc right, tests for both msan and xray successfully pass on Linux.

vitalybuka added inline comments.Jul 27 2017, 1:19 PM
lib/asan/tests/CMakeLists.txt
212

This looks unusual
Can you avoid using ";" and keep style as before?

OK, added extra parameter. Seems more preferable than relying on ${ARGN} everywhere.

vitalybuka accepted this revision.Jul 27 2017, 9:26 PM
This revision is now accepted and ready to land.Jul 27 2017, 9:26 PM