Add the ability to suppress UBSan reports for files/functions/modules
at runtime. The user can now pass UBSAN_OPTIONS=suppressions=supp.txt
with the contents of the form:
signed-integer-overflow:file-with-known-overflow.cpp
alignment:function_doing_unaligned_access
vptr:shared_object_with_vptr_failures.so
Suppression categories match the arguments passed to -fsanitize=
flag (although, see below). There is no overhead if suppressions are
not provided. Otherwise there is extra overhead for symbolization.
Limitations:
- sometimes suppressions need debug info / symbol table to function properly (although sometimes frontend generates enough info to do the match).
- it's only possible to suppress recoverable UB kinds - if you've built the code with -fno-sanitize-recover=undefined, suppressions will not work.
- categories are fine-grained check kinds, not groups like "undefined" or "integer", so you can't write "undefined:file_with_ub.cc".
This test fails on Windows. I tried to debug, but the usual way to run tests seems to not work with compiler-rt:
C:\src\chrome\src\third_party\llvm-bootstrap>python bin\llvm-lit.py ..\llvm\projects\compiler-rt\test\ubsan\TestCases\In
teger\suppressions.cpp -v
llvm-lit.py: discovery.py:113: warning: unable to find test suite for '..\\llvm\\projects\\compiler-rt\\test\\ubsan\\Tes
tCases\\Integer\\suppressions.cpp'
llvm-lit.py: discovery.py:224: warning: input '..\\llvm\\projects\\compiler-rt\\test\\ubsan\\TestCases\\Integer\\suppres
sions.cpp' contained no tests
How do I run individual compiler-rt tests? (They run fine as part of ninja check-all, but that takes very long)