Some functions of asan depends on `Atexit()` handlers. On Windows, this
is implemented in ad3ec82bb1c7217b0187a1e16bb22642e194ce94 to queue the
handlers in a vector then register them with `atexit()` only after the
CRT is fully initialized. However, this is broken on MinGW with
asan_dynamic runtime due to different initialization order. This change
fixes the issue by making sure that `Atexit()` can call `atexit()`
directly past the pre-initialization phase.
This fixes two asan test cases on MinGW.
Differential Revision: https://reviews.llvm.org/D147413
After this change, `check-asan-dynamic` should pass on x86_64 MinGW
target, using the llvm-mingw toolchain.
The following is a list of issues fixed:
* `asan_str_test.cpp`: Exclude unintercepted functions on MinGW.
* `asan_test.cpp`: Work around regex limitation of gtest on Windows,
which only affects MinGW target because `long double` has different
size to `double`.
* `TestCases/Windows/report_after_syminitialize.cpp`: Added build
command specifically for MinGW.
* Other tests: Mark XFAIL for various reasons. Some of them need
further investigation.
Differential Revision: https://reviews.llvm.org/D147059
A few testcases are still using deprecated options.
warning: argument '-fsanitize-coverage=[func|bb|edge]' is deprecated,
use '-fsanitize-coverage=[func|bb|edge],[trace-pc-guard|trace-pc]'
instead [-Wdeprecated]
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D79741