diff options
author | iains <iains@138bc75d-0d04-0410-961f-82ee72b054a4> | 2019-09-16 00:30:59 +0000 |
---|---|---|
committer | iains <iains@138bc75d-0d04-0410-961f-82ee72b054a4> | 2019-09-16 00:30:59 +0000 |
commit | 224850c73e8f4e7ce289e8738ed3eb1d073f81df (patch) | |
tree | 6328758885fb2d80ee3e8ae31032c388f33aedd1 | |
parent | 62a6f06e452a879eab3254663a975e5c253c62f8 (diff) |
[Darwin, testsuite] Fix isysroot-1.c.
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@275742 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/isysroot-1.c | 11 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/usr/include/example.h (renamed from gcc/testsuite/gcc.dg/cpp/usr/include/stdio.h) | 0 |
3 files changed, 18 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 43e3ead9f7b..a34be9e5d36 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/gcc.dg/cpp/isysroot-1.c b/gcc/testsuite/gcc.dg/cpp/isysroot-1.c index 7263ce41544..4c54f9e218a 100644 --- a/gcc/testsuite/gcc.dg/cpp/isysroot-1.c +++ b/gcc/testsuite/gcc.dg/cpp/isysroot-1.c @@ -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; } diff --git a/gcc/testsuite/gcc.dg/cpp/usr/include/stdio.h b/gcc/testsuite/gcc.dg/cpp/usr/include/example.h index c674e89f7ef..c674e89f7ef 100644 --- a/gcc/testsuite/gcc.dg/cpp/usr/include/stdio.h +++ b/gcc/testsuite/gcc.dg/cpp/usr/include/example.h |