Message ID | b56cacc4-21c3-6994-fe2a-ad753d9dce7c@codesourcery.com |
---|---|
State | New |
Headers | show |
Series | gfortran.dg/dg.exp: Add libgfortran as -I flag for ISO*.h [PR101305] (was: [PATCH 3/3] [PR libfortran/101305] Fix ISO_Fortran_binding.h paths in gfortran testsuite) | expand |
On Wed, Jul 28, 2021 at 01:22:53PM +0200, Tobias Burnus wrote: > gfortran.dg/dg.exp: Add libgfortran as -I flag for ISO*.h [PR101305] > > gcc/testsuite/ > PR libfortran/101305 > * gfortran.dg/dg.exp: Add '-I <get_multilibs>/libgfortran' > compile flag. Wouldn't it be better to do that in gcc/testsuite/lib/gfortran.exp to GFORTRAN_UNDER_TEST there next to -B$specpath/libgfortran/ ? So that we don't add it for the installed gfortran testing - there we want to test what installed gfortran will do, and will affect also libgomp testing. Jakub
On Thu, Jul 29, 2021 at 12:56:32AM +0200, Jakub Jelinek wrote: > On Wed, Jul 28, 2021 at 01:22:53PM +0200, Tobias Burnus wrote: > > gfortran.dg/dg.exp: Add libgfortran as -I flag for ISO*.h [PR101305] > > > > gcc/testsuite/ > > PR libfortran/101305 > > * gfortran.dg/dg.exp: Add '-I <get_multilibs>/libgfortran' > > compile flag. > > Wouldn't it be better to do that in gcc/testsuite/lib/gfortran.exp > to GFORTRAN_UNDER_TEST there next to > -B$specpath/libgfortran/ ? > So that we don't add it for the installed gfortran testing - there > we want to test what installed gfortran will do, > and will affect also libgomp testing. Though, I guess we need that mostly for the C FE, so perhaps it needs to go at the start of additional_flags=, whether TEST_ALWAYS_FLAGS is empty or not. Jakub
gfortran.dg/dg.exp: Add libgfortran as -I flag for ISO*.h [PR101305] gcc/testsuite/ PR libfortran/101305 * gfortran.dg/dg.exp: Add '-I <get_multilibs>/libgfortran' compile flag. diff --git a/gcc/testsuite/gfortran.dg/dg.exp b/gcc/testsuite/gfortran.dg/dg.exp index 06689813d07..cb48ed3e7fb 100644 --- a/gcc/testsuite/gfortran.dg/dg.exp +++ b/gcc/testsuite/gfortran.dg/dg.exp @@ -28,6 +28,17 @@ if ![info exists DEFAULT_FFLAGS] then { # Initialize `dg'. dg-init +# Flags for finding libgfortran ISO*.h files. +if [info exists TOOL_OPTIONS] { + set specpath [get_multilibs ${TOOL_OPTIONS}] +} else { + set specpath [get_multilibs] +} +set include_options "-I$specpath/libgfortran" +if [file exists $specpath/libgfortran ] { + set include_options "-I$specpath/libgfortran" +} + global gfortran_test_path global gfortran_aux_module_flags set gfortran_test_path $srcdir/$subdir @@ -55,10 +66,10 @@ proc dg-compile-aux-modules { args } { # Main loop. gfortran-dg-runtest [lsort \ - [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ] ] "" $DEFAULT_FFLAGS + [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ] ] "" "$include_options $DEFAULT_FFLAGS" gfortran-dg-runtest [lsort \ - [glob -nocomplain $srcdir/$subdir/g77/*.\[fF\] ] ] "" $DEFAULT_FFLAGS + [glob -nocomplain $srcdir/$subdir/g77/*.\[fF\] ] ] "" "$include_options $DEFAULT_FFLAGS" # All done.