As reported in llvm bugzilla 32377.
Here’s a patch to add preinclude of stdc-predef.h for gcc on Linux.
The gcc documentation says “On GNU/Linux, <stdc-predef.h> is pre-included.” See https://gcc.gnu.org/gcc-4.8/porting_to.html; James pointed out that this is not limited merely to Linux/gnu, so I changed the title.
The preinclude is inhibited with –ffreestanding.
Basically I fixed the failing test cases by adding either –ffreestanding or –nostdinc which inhibits this behavior. Some of the tests didn't support -ffreestanding but they did accept -nostdinc.
I fixed all the failing tests, including some in extra/test, there's a separate patch for that which is linked here