From: Iain Sandoe Date: Sun, 4 Aug 2019 12:52:31 +0000 (+0000) Subject: Darwin, testsuite - backport fix for cpp/isysroot-1.c. X-Git-Tag: releases/gcc-9.2.0~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=653561962e93276854ffd85f866cc97045d1ba9f;p=thirdparty%2Fgcc.git Darwin, testsuite - backport fix for cpp/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. /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-08-04 Iain Sandoe Backport from mainline. 2019-06-24 Iain Sandoe * gcc.dg/cpp/isysroot-1.c: Use as the test header. * gcc.dg/cpp/usr/include/stdio.h: Rename... * gcc.dg/cpp/usr/include/example.h: ... to this. From-SVN: r274086 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aa7c3f4cc772..37746a6585a3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2019-08-04 Iain Sandoe + + Backport from mainline. + 2019-06-24 Iain Sandoe + + * gcc.dg/cpp/isysroot-1.c: Use as the test header. + * gcc.dg/cpp/usr/include/stdio.h: Rename... + * gcc.dg/cpp/usr/include/example.h: ... to this. + 2019-08-04 Iain Sandoe Backport from mainline. diff --git a/gcc/testsuite/gcc.dg/cpp/isysroot-1.c b/gcc/testsuite/gcc.dg/cpp/isysroot-1.c index 7263ce41544e..4c54f9e218ad 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 +/* For the test to succeed there needs to be some header that is to be found + in the 'expected' place i.e. /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 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 similarity index 100% rename from gcc/testsuite/gcc.dg/cpp/usr/include/stdio.h rename to gcc/testsuite/gcc.dg/cpp/usr/include/example.h