From: Tobias Burnus Date: Mon, 9 Aug 2021 10:35:23 +0000 (+0200) Subject: testsuite/lib/gfortran.exp: Add -I for ISO*.h [PR101305, PR101660] X-Git-Tag: upstream/12.2.0~5889 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=527a1cf32c27a3fbeaf6be7596241570d864cc4c;p=platform%2Fupstream%2Fgcc.git testsuite/lib/gfortran.exp: Add -I for ISO*.h [PR101305, PR101660] This patch adds -I$specdir/libgfortran to GFORTRAN_UNDER_TEST, when set by proc gfortran_init. As the $specdir depends on the multilib setting, it has to be re-set for a different multilib; hence, we track whether a previous call to gfortran_init set that var or whether it was set differently. gcc/testsuite/ PR libfortran/101305 PR fortran/101660 * lib/gfortran.exp (gfortran_init): Add -I $specdir/libgfortran to GFORTRAN_UNDER_TEST; update it when set by previous gfortran_init call. * gfortran.dg/ISO_Fortran_binding_1.c: Use <...> not "..." for ISO_Fortran_binding.h's #include. * gfortran.dg/ISO_Fortran_binding_10.c: Likewise. * gfortran.dg/ISO_Fortran_binding_11.c: Likewise. * gfortran.dg/ISO_Fortran_binding_12.c: Likewise. * gfortran.dg/ISO_Fortran_binding_15.c: Likewise. * gfortran.dg/ISO_Fortran_binding_16.c: Likewise. * gfortran.dg/ISO_Fortran_binding_17.c: Likewise. * gfortran.dg/ISO_Fortran_binding_18.c: Likewise. * gfortran.dg/ISO_Fortran_binding_3.c: Likewise. * gfortran.dg/ISO_Fortran_binding_5.c: Likewise. * gfortran.dg/ISO_Fortran_binding_6.c: Likewise. * gfortran.dg/ISO_Fortran_binding_7.c: Likewise. * gfortran.dg/ISO_Fortran_binding_8.c: Likewise. * gfortran.dg/ISO_Fortran_binding_9.c: Likewise. * gfortran.dg/PR94327.c: Likewise. * gfortran.dg/PR94331.c: Likewise. * gfortran.dg/bind_c_array_params_3_aux.c: Likewise. * gfortran.dg/iso_fortran_binding_uint8_array_driver.c: Likewise. * gfortran.dg/pr93524.c: Likewise. --- diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c index bb56ca0..d0d036a 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c @@ -1,6 +1,6 @@ /* Test F2008 18.5: ISO_Fortran_binding.h functions. */ -#include "ISO_Fortran_binding.h" +#include #include #include #include diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_10.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_10.c index c3954e4..91222ff 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_10.c +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_10.c @@ -2,7 +2,7 @@ /* Contributed by Reinhold Bader */ -#include "ISO_Fortran_binding.h" +#include #include #include #include diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_11.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_11.c index c2d4e11..e013011 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_11.c +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_11.c @@ -5,7 +5,7 @@ Contributed by Reinhold Bader #include */ #include #include #include -#include "ISO_Fortran_binding.h" +#include typedef struct { diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_12.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_12.c index 078c5de..0a41576 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_12.c +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_12.c @@ -2,7 +2,7 @@ #include #include -#include "ISO_Fortran_binding.h" +#include /* Contributed by Reinhold Bader */ diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_15.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_15.c index 622f2de..fc70da4 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_15.c +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_15.c @@ -4,7 +4,7 @@ #include #include -#include "ISO_Fortran_binding.h" +#include // Prototype for Fortran functions extern void Fsub(CFI_cdesc_t *); diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_16.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_16.c index 50b92ec..915b6e7 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_16.c +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_16.c @@ -1,6 +1,6 @@ /* Test the fix for PR92142. */ -#include "ISO_Fortran_binding.h" +#include #include diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.c index b0893cc..fa75268 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.c +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.c @@ -2,7 +2,7 @@ #include #include -#include "ISO_Fortran_binding.h" +#include void Csub(const CFI_cdesc_t *, size_t, CFI_index_t invalid); diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_18.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_18.c index ef40134..5a3952c 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_18.c +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_18.c @@ -1,6 +1,6 @@ #include #include -#include "ISO_Fortran_binding.h" +#include extern int do_loop(CFI_cdesc_t* array); diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_3.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_3.c index 9f35b0d..33d1bc3 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_3.c +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_3.c @@ -1,4 +1,4 @@ -#include "ISO_Fortran_binding.h" +#include #include #include diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_5.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_5.c index 116f548..b18a899 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_5.c +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_5.c @@ -4,7 +4,7 @@ #include #include -#include "ISO_Fortran_binding.h" +#include typedef struct { int i; diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_6.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_6.c index 704b27c..c7981c5 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_6.c +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_6.c @@ -4,7 +4,7 @@ #include #include -#include "ISO_Fortran_binding.h" +#include #define DEBUG 0 diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_7.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_7.c index 26b4ab5..8162451 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_7.c +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_7.c @@ -2,7 +2,7 @@ /* Contributed by Reinhold Bader */ -#include "ISO_Fortran_binding.h" +#include #include #include #include diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_8.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_8.c index a0d1bdc..d3dce3a 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_8.c +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_8.c @@ -2,7 +2,7 @@ /* Contributed by Reinhold Bader */ -#include "ISO_Fortran_binding.h" +#include #include float Cxgl[] = { 1.1, 2.3, 5.1, 4.2 }; diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_9.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_9.c index 632604f..cb17077 100644 --- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_9.c +++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_9.c @@ -2,7 +2,7 @@ /* Contributed by Gilles Gouaillardet */ -#include "ISO_Fortran_binding.h" +#include #include int cdesc_c(CFI_cdesc_t* x, long *expected) diff --git a/gcc/testsuite/gfortran.dg/PR94327.c b/gcc/testsuite/gfortran.dg/PR94327.c index 4ce408d..9d22681 100644 --- a/gcc/testsuite/gfortran.dg/PR94327.c +++ b/gcc/testsuite/gfortran.dg/PR94327.c @@ -4,7 +4,7 @@ #include #include -#include "ISO_Fortran_binding.h" +#include bool c_vrfy (const CFI_cdesc_t *restrict); diff --git a/gcc/testsuite/gfortran.dg/PR94331.c b/gcc/testsuite/gfortran.dg/PR94331.c index 2fbfe0e..df571c7 100644 --- a/gcc/testsuite/gfortran.dg/PR94331.c +++ b/gcc/testsuite/gfortran.dg/PR94331.c @@ -4,7 +4,7 @@ #include #include -#include "ISO_Fortran_binding.h" +#include bool c_vrfy (const CFI_cdesc_t *restrict); diff --git a/gcc/testsuite/gfortran.dg/bind_c_array_params_3_aux.c b/gcc/testsuite/gfortran.dg/bind_c_array_params_3_aux.c index 5176d8b..4594185 100644 --- a/gcc/testsuite/gfortran.dg/bind_c_array_params_3_aux.c +++ b/gcc/testsuite/gfortran.dg/bind_c_array_params_3_aux.c @@ -5,7 +5,7 @@ #include #include -#include "ISO_Fortran_binding.h" +#include void arr_set_c(CFI_cdesc_t*); diff --git a/gcc/testsuite/gfortran.dg/iso_fortran_binding_uint8_array_driver.c b/gcc/testsuite/gfortran.dg/iso_fortran_binding_uint8_array_driver.c index bfd567b..9c2b5fb 100644 --- a/gcc/testsuite/gfortran.dg/iso_fortran_binding_uint8_array_driver.c +++ b/gcc/testsuite/gfortran.dg/iso_fortran_binding_uint8_array_driver.c @@ -1,7 +1,7 @@ #include #include #include -#include "ISO_Fortran_binding.h" +#include extern void fsub(CFI_cdesc_t *); diff --git a/gcc/testsuite/gfortran.dg/pr93524.c b/gcc/testsuite/gfortran.dg/pr93524.c index ba40d00..8a6c066 100644 --- a/gcc/testsuite/gfortran.dg/pr93524.c +++ b/gcc/testsuite/gfortran.dg/pr93524.c @@ -2,7 +2,7 @@ sm incorrectly for dimensions > 2. */ #include // For size_t -#include "ISO_Fortran_binding.h" +#include void my_fortran_sub_1 (CFI_cdesc_t *dv); void my_fortran_sub_2 (CFI_cdesc_t *dv); diff --git a/gcc/testsuite/lib/gfortran.exp b/gcc/testsuite/lib/gfortran.exp index 1e7da11..cae6738 100644 --- a/gcc/testsuite/lib/gfortran.exp +++ b/gcc/testsuite/lib/gfortran.exp @@ -151,6 +151,7 @@ proc gfortran_init { args } { global gcc_warning_prefix global gcc_error_prefix global TEST_ALWAYS_FLAGS + global gfortran_init_set_GFORTRAN_UNDER_TEST # We set LC_ALL and LANG to C so that we get the same error messages as expected. setenv LC_ALL C @@ -166,7 +167,11 @@ proc gfortran_init { args } { setenv LANG C.ASCII } - if ![info exists GFORTRAN_UNDER_TEST] then { + # GFORTRAN_UNDER_TEST as set below contains $specpath, which depends on + # the used multilib config. Thus, its value may need to be reset; + # that's tracked via gfortran_init_set_GFORTRAN_UNDER_TEST. + if { ![info exists GFORTRAN_UNDER_TEST] + || [info exists gfortran_init_set_GFORTRAN_UNDER_TEST] } then { if [info exists TOOL_EXECUTABLE] { set GFORTRAN_UNDER_TEST $TOOL_EXECUTABLE } else { @@ -178,7 +183,8 @@ proc gfortran_init { args } { } else { set specpath [get_multilibs] } - set GFORTRAN_UNDER_TEST [findfile $base_dir/../../gfortran "$base_dir/../../gfortran -B$base_dir/../../ -B$specpath/libgfortran/" [findfile $base_dir/gfortran "$base_dir/gfortran -B$base_dir/" [transform gfortran]]] + set gfortran_init_set_GFORTRAN_UNDER_TEST 1 + set GFORTRAN_UNDER_TEST [findfile $base_dir/../../gfortran "$base_dir/../../gfortran -B$base_dir/../../ -B$specpath/libgfortran/ -I$specpath/libgfortran" [findfile $base_dir/gfortran "$base_dir/gfortran -B$base_dir/" [transform gfortran]]] } } }