[patch, fortran] Fix PR 30235

Brooks Moses brooks.moses@codesourcery.com
Mon Dec 18 23:29:00 GMT 2006


Steve Kargl wrote:
> It's my understanding the "dg-do compile" in the gfortran
> testsuite should only run once.  It is normally used to 
> test the (non)fix of a parser bug where code generation and
> execution is irrelevant.  For example, if the testsuite contains
> 
>   start: do 
>      .....
>   end do     ! { dg-error "missing label" }
> 
> this only needs to run once.

Janis just emailed me to also point out that this is intentional, and 
quoted the relevant code in gfortran-dg.exp:

> 	# look if this is dg-do-run test, in which case
> 	# we cycle through the option list, otherwise we don't
> 	if [expr [search_for $test "dg-do run"]] {
> 	    set option_list $TORTURE_OPTIONS
> 	} else {
> 	    set option_list [list { -O } ]
> 	}

I note that, for the "dg-do link" and "dg-do assemble" directives, this 
also only cycles through once rather than using $TORTURE_OPTIONS.  That 
  seems likely to be the wrong thing to do, since in those cases we do 
presumably care about code generation.  However, since currently we only 
have one of each of those sorts of tests [1] in the whole testsuite, is 
it worth fixing?  Or should we just say that all fortran tests that 
require assembling the code at various optimization levels should use 
"dg-do run"?

- Brooks


[1] char_result_11.f90 and same_name_1.f90, to be specific.



More information about the Fortran mailing list