OSDN Git Service

7c72a085a79660b012913da64f1afd75c6925051
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g77.f-torture / execute / 20010116.f
1 *
2 *  Derived from LAPACK 3.0 routine CHGEQZ
3 *  Fails on i686-pc-cygwin with gcc-2.97 snapshots at -O2 and higher
4 *  PR fortran/1645
5 *
6 *  David Billinghurst, (David.Billinghurst@riotinto.com)
7 *  14 January 2001
8 *  Rewritten by Toon Moene (toon@moene.indiv.nluug.nl)
9 *  15 January 2001
10
11       COMPLEX A(5,5)
12       DATA A/25*(0.0,0.0)/
13       A(4,3) = (0.05,0.2)/3.0E-7
14       A(4,4) = (-0.03,-0.4)
15       A(5,4) = (-2.0E-07,2.0E-07)
16       CALL CHGEQZ( 5, A )
17       END
18       SUBROUTINE CHGEQZ( N, A )
19       COMPLEX   A(N,N), X
20       ABS1( X ) = ABS( REAL( X ) ) + ABS( AIMAG( X ) )
21       DO J = 4, 2, -1
22          I = J
23          TEMP  = ABS1( A(J,J) )
24          TEMP2 = ABS1( A( J+1, J ) )
25          TEMPR = MAX( TEMP, TEMP2 )
26          IF( TEMPR .LT. 1.0 .AND. TEMPR .NE. 0.0 ) THEN
27             TEMP  = TEMP / TEMPR
28             TEMP2 = TEMP2 / TEMPR
29          END IF
30          IF ( ABS1(A(J,J-1))*TEMP2 .LE. TEMP ) GO TO 90
31       END DO
32 c     Should not reach here, but need a statement
33       PRINT*
34   90  IF ( I .NE. 4 ) THEN
35          PRINT*,'I =', I, ' but should be 4'
36          CALL ABORT()
37       END IF
38       END