[Testsuite patch]: new fortran tests

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Fri Nov 11 18:16:00 GMT 2005


Uttam Pawar wrote:
> Resubmitting few fortran (gfortran.dg) tests (for cpu_time intrinsic
> function and 'pure' construct) along with 2 new tests for DO construct.
> 
> Any feedback is appreciated.

First of all, thanks for doing this.  A validation suite is something that
makes a lot of sense.  I have looked over your testcases, and they look ok to
me, but I have one remark:

> +! { dg-do run }
> +! Test REAL type iterators in DO loops
> +program real_do_2
> +  double precision y
> +  integer n
> +
> +  n = 0
> +  do y = 1.0, 0.1 ! { dg-warning "Obsolete: REAL DO loop iterator" ""}
> +    n = n + 1
> +  end do
> +end program

You should not only verify that the compiler compiles the testcase and creates
a testcase, but also that it produces correct code, e.g. something like

! { dg-do run }
integer n
double precision y
n = 0
do y = 0.0,10.0,1.0
   n = n + 1
end do
if (n .ne. 55) call abort ()
end

You may also want to add similar code which uses a real*4 variable.  (Steve
already pointed out that there is an existing testcase for this, also your
testcase looks wrong as in it might take a very long time to finish given your
loop condition.)

- Tobi



More information about the Fortran mailing list