This patch is a work in progress. Is this even something we think will be useful?
These lit tests are meant to be for correctness of the environment not of the implementations necessarily.
I just realized I should use CMAKE_C_COMPILER in lit.site.cfg.py.in instead of just using clang, I will do that in the next round.
This one also fails currently because <linux/errno.h> is not found because %clang_libc compiles with -nostdinc
This test is erroneous because it is linking against glibc's __assert_fail not ours. Which is surprising because __assert_fail is in libllvmlibc.a. I'm not sure why ld is not linking against libllvmlibc.a's __assert_fail.
Just answering the question in the "Summary": Yes, something like this is useful to check the integrity of llvmlibc.a and the public header files. But, I have not spent time to convince myself that llvm-lit is the best way to do it.