D56913 introduced the _LIBCPP_FREESTANDING macro and implemented it as:
#ifndef __STDC_HOSTED__ # define _LIBCPP_FREESTANDING #endif
However, __STDC_HOSTED__ is defined as 0 in freestanding implementations instead of undefined (according to https://github.com/llvm/llvm-project/blob/cd2139a527f2d829bdde7877c992215f598e927b/clang/lib/Frontend/InitPreprocessor.cpp#L356-L362 and https://en.cppreference.com/w/cpp/preprocessor/replace).
This patch corrects the above as:
#if __STDC_HOSTED__ == 0 # define _LIBCPP_FREESTANDING #endif
Did you run this test? I don't think we can use FileCheck in the libcxx tests yet, can we?
I had a patch lying somewhere that enabled FileCheck in the libc++ test suite, but I had shelved it when it became a lot more complicated than expected. Perhaps it's now time to revive it?