Direct invocations of lit can now include a --param=freestanding=True flag. This will add all the libcxx lit features that are associated with conforming freestanding environments.
This patch also adds a new feature that isn't yet mentioned in any tests, libcpp-any-freestanding. The intent is to use this feature in UNSUPPORTED statements when a more specific feature isn't available.
The new freestanding parameter intentionally does not include no-rtti or no-exceptions, as RTTI and exceptions are currently required in conforming freestanding implementations. My expectation is the --param=enable-rtti=False and --param=enable-exceptions=False will frequently accompany --param=freestanding=True.
These options are meant to be determined at libc++ configuration time (in CMake). They are not meant to be overriden on the command-line. In other words, a "general" build of libc++ may not support defining these macros like we're doing here.
I believe we should treat libc++ and its test suite as separate entities here. Basically, let's add support for running only the freestanding parts of the test suite, but let's not tie libc++ configuration to it. If you want to a C++ Library implementation against the Freestanding spec, the idea would be:
If we do it that way, this patch wouldn't contain anything specifically related to libc++. What do you think?