]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Darwin, testsuite] Fix isysroot-1.c.
authorIain Sandoe <iain@sandoe.co.uk>
Mon, 16 Sep 2019 00:30:59 +0000 (00:30 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Mon, 16 Sep 2019 00:30:59 +0000 (00:30 +0000)
For the test to succeed there needs to be some header that is to be found in
the 'expected' place i.e. <sysroot>/usr/include/. It's important that it is
not the name of a header for which fixincludes have been applied, since such
headers will be found in the gcc include-fixed dir and, in general, reference
additional headers. The dummy sysroot will prevent the additional headers
from being found, resulting in a failed test. The fix is to use a header name
that isn't expected to be present in a real sysroot.

2019-09-16  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline.
2019-06-24  Iain Sandoe  <iain@sandoe.co.uk>

* gcc.dg/cpp/isysroot-1.c: Use <example.h> as the test header.
* gcc.dg/cpp/usr/include/stdio.h: Rename...
* gcc.dg/cpp/usr/include/example.h: ... to this.

From-SVN: r275742

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/isysroot-1.c
gcc/testsuite/gcc.dg/cpp/usr/include/example.h [moved from gcc/testsuite/gcc.dg/cpp/usr/include/stdio.h with 100% similarity]

index 43e3ead9f7b4dffb692779d87417cb301b4b0ed5..a34be9e5d3631545eaaa3338bf0f5a26592a1853 100644 (file)
@@ -1,3 +1,12 @@
+2019-09-16  Iain Sandoe  <iain@sandoe.co.uk>
+
+       Backport from mainline.
+       2019-06-24  Iain Sandoe  <iain@sandoe.co.uk>
+
+       * gcc.dg/cpp/isysroot-1.c: Use <example.h> as the test header.
+       * gcc.dg/cpp/usr/include/stdio.h: Rename...
+       * gcc.dg/cpp/usr/include/example.h: ... to this.
+
 2019-09-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        Backport from trunk
index 7263ce41544e398fad59b73c8959c20e267a2781..4c54f9e218ad0ea27b2768959bb3ff204d72ab09 100644 (file)
@@ -1,10 +1,17 @@
 /* { dg-options "-isysroot ${srcdir}/gcc.dg/cpp" } */
 /* { dg-do compile  { target *-*-darwin* } } */
 
-#include <stdio.h>
+/* For the test to succeed there needs to be some header that is to be found
+   in the 'expected' place i.e. <sysroot>/usr/include/.  It's important that
+   it is not the name of a header for which fixincludes have been applied,
+   since such headers will be found in the gcc include-fixed dir and, in
+   general, reference additional headers.  The dummy sysroot will prevent the
+   additional headers from being found, resulting in a failed test.  So use
+   a header name we don't expect to see. */
+#include <example.h>
 int main()
 {
-  /* Special stdio.h supplies function foo.  */
+  /* Special example.h supplies function foo.  */
   void (*x)(void) = foo;
   return 0;
 }