[PATCH] D34158: For Linux/gnu compatibility, preinclude <stdc-predef.h> if the file is available

Melanie Blower via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 07:36:50 PDT 2017

mibintc added a comment.

In https://reviews.llvm.org/D34158#905637, @mibintc wrote:

> In https://reviews.llvm.org/D34158#905596, @jyknight wrote:
> > I'd still _very_ much like a solution that is acceptable for all libc to use, and have that on by default.
> >
> > However, I guess this is fine.
> >
> > Only concern I have is that it seems odd that so many test-cases needed to be changed. What fails without those test changes?
> Those tests fail because they generate preprocessed output and then check carefully for precise results. Since the preprocessed output is different, the comparison fails. I "fixed" the tests by adding the freestanding option which inhibits the new behavior.  I'll have to check out and rebuild everything so I can show you exactly the failure mode, I expect I can post details tomorrow.

I created a fresh workspace and applied the patch, then I make "check-clang". I saw one test fail. The test that failed is Driver/crash-report.c. (BTW I need to recheck all the tests and make sure the test modifications are still needed, and likewise in the "extra" tests directory which is in the separate patch file).  This is the failure mode for the Driver crash report.  Is this sufficient detail to understand the test issue? If not what else can I provide?
Exit Code: 1

Command Output (stderr):

/site/spt/usr20/mblower/sptel9-ws/llorg/llvm/tools/clang/test/Driver/crash-report.c:20:11: error: expected string not found in input
// CHECK: Preprocessed source(s) and associated run script(s) are located at:


<stdin>:1:1: note: scanning from here
<built-in>:1:10: fatal error: '-fobjc-runtime=gcc' file not found

If I make this change, adding the freestanding option, and rebuild "check-clang", then no tests are failing:
diff --git a/test/Driver/crash-report.c b/test/Driver/crash-report.c
index a3f1f9e..526e4dd 100644

- a/test/Driver/crash-report.c

+++ b/test/Driver/crash-report.c
@@ -2,7 +2,7 @@
 // RUN: mkdir %t
 // RUN: not env TMPDIR=%t TEMP=%t TMP=%t RC_DEBUG_OPTIONS=1              \
 // RUN:  CC_PRINT_HEADERS=1 CC_LOG_DIAGNOSTICS=1                         \
-// RUN:  %clang -fsyntax-only %s                                         \
+// RUN:  %clang -fsyntax-only -ffreestanding %s
 // RUN:  -F/tmp/ -I /tmp/ -idirafter /tmp/ -iquote /tmp/ -isystem /tmp/  \
 // RUN:  -iprefix /the/prefix -iwithprefix /tmp -iwithprefixbefore /tmp/ \
 // RUN:  -Xclang -internal-isystem -Xclang /tmp/                         \


More information about the cfe-commits mailing list