diff options
author | David Billinghurst <David.Billinghurst@riotinto.com> | 2004-07-08 23:43:13 +0000 |
---|---|---|
committer | David Billinghurst <billingd@gcc.gnu.org> | 2004-07-08 23:43:13 +0000 |
commit | c6db08cd564e877e192e1c499ab51cf04102eaa9 (patch) | |
tree | 1d13a07c1322346e1ae5132922252f556e3ccb7d /gcc | |
parent | 8d05a22ef25d36104f4375f8752bf2f63f737220 (diff) | |
download | gcc-c6db08cd564e877e192e1c499ab51cf04102eaa9.zip gcc-c6db08cd564e877e192e1c499ab51cf04102eaa9.tar.gz gcc-c6db08cd564e877e192e1c499ab51cf04102eaa9.tar.bz2 |
f77-edit-i-in.f: Copy from g77.dg and change X to 1X in format.
2004-07-09 David Billinghurst (David.Billinghurst@riotinto.com)
* gfortran.dg/g77/f77-edit-i-in.f: Copy from g77.dg and
change X to 1X in format.
* gfortran.dg/g77/20010216-1.f: Copy from g77.dg and
add data statements to conform to standard.
From-SVN: r84328
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/g77/20010216-1.f | 52 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/g77/f77-edit-i-in.f | 22 |
3 files changed, 81 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a6ac8bd..3b94ce0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,12 @@ 2004-07-09 David Billinghurst (David.Billinghurst@riotinto.com) + * gfortran.dg/g77/f77-edit-i-in.f: Copy from g77.dg and + change X to 1X in format. + * gfortran.dg/g77/20010216-1.f: Copy from g77.dg and + add data statements to conform to standard. + +2004-07-09 David Billinghurst (David.Billinghurst@riotinto.com) + * gfortran.dg/g77/f77-edit-s-out.f: Copy from g77.dg. XFAIL * gfortran.dg/g77/f77-edit-t-in.f: Likewise * gfortran.dg/g77/f77-edit-x-out.f: Likewise diff --git a/gcc/testsuite/gfortran.dg/g77/20010216-1.f b/gcc/testsuite/gfortran.dg/g77/20010216-1.f new file mode 100644 index 0000000..a125480 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/g77/20010216-1.f @@ -0,0 +1,52 @@ +C Test for bug in reg-stack handling conditional moves. +C Reported by Tim Prince <tprince@computer.org> +C +C { dg-do run { target "i[6789]86-*-*" } } +C { dg-options "-ffast-math -march=pentiumpro" } + + double precision function foo(x, y) + implicit none + double precision x, y + double precision a, b, c, d + if (x /= y) then + if (x * y >= 0) then + a = abs(x) + b = abs(y) + c = max(a, b) + d = min(a, b) + foo = 1 - d/c + else + foo = 1 + end if + else + foo = 0 + end if + end + + program test + implicit none + + integer ntests + parameter (ntests=7) + double precision tolerance + parameter (tolerance=1.0D-6) + +C Each column is a pair of values to feed to foo, +C and its expected return value. + double precision a(ntests), b(ntests), x(ntests) + data a /1, -23, -1, 1, 9, 10, -9/ + data b /1, -23, 12, -12, 10, 9, -10/ + data x /0, 0, 1, 1, 0.1, 0.1, 0.1/ + + double precision foo + double precision result + integer i + + do i = 1, ntests + result = foo(a(i), b(i)) + if (abs(result - x(i)) > tolerance) then + print *, i, a(i), b(i), x(i), result + call abort + end if + end do + end diff --git a/gcc/testsuite/gfortran.dg/g77/f77-edit-i-in.f b/gcc/testsuite/gfortran.dg/g77/f77-edit-i-in.f new file mode 100644 index 0000000..49eb416 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/g77/f77-edit-i-in.f @@ -0,0 +1,22 @@ +C Test Fortran 77 I edit descriptor for input +C (ANSI X3.9-1978 Section 13.5.9.1) +C +C Origin: David Billinghurst <David.Billinghurst@riotinto.com> +C +C { dg-do run } + + integer i,j + character*10 buf + + write(buf,'(A)') '1 -1' + + read(buf,'(I1)') i + if ( i.ne.1 ) call abort() + + read(buf,'(1X,I1)') i + if ( i.ne.0 ) call abort() + + read(buf,'(1X,I1,1X,I2)') i,j + if ( i.ne.0 .and. j.ne.-1 ) call abort() + + end |