[libc++] Harden the test suite for running against older libc++ versions (#214820)

When running against older libc++ versions, the test suite had problems
when sniffing carve-out macros. Since we changed from e.g.
_LIBCPP_HAS_NO_LOCALIZATION to _LIBCPP_HAS_LOCALIZATION == 0|1, we would
mis-detect the absence of _LIBCPP_HAS_NO_LOCALIZATION being defined for
localization being supported.

Fix this by explicitly handling checks for older versions. Note that
this also simplifies how we deal with the C++03 frozen headers, since in
most cases the same handling covers both the frozen headers and older
versions of the library.

Also, move the detection of Lit features for carve-outs from ad-hoc
Python checks to using <test_macros.h> directly, since that centralizes
the logic in a single place. This requires making "test_macros.h"
available to libunwind tests, which previously didn't have the proper
include path.

GitOrigin-RevId: 223ccaa185a036d08de1222b270bc2f132ca8ab6
9 files changed
tree: d153a0dce73902087b2cbe62baa3ca1efb1cbe49
  1. cmake/
  2. docs/
  3. include/
  4. src/
  5. test/
  6. .clang-format
  7. CMakeLists.txt
  8. LICENSE.TXT