URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [dep_fails.f90] - Rev 695
Compare with Previous | Blame | View Log
! This gives incorrect results when compiled with! the intel and pgf90 compilersProgram StrangeImplicit NoneType LinkInteger, Dimension(2) :: NextEnd Type LinkInteger, Parameter :: N = 2Integer, dimension (2, 4) :: resultsInteger :: i, jType(Link), Dimension(:,:), Pointer :: PermInteger, Dimension(2) :: CurrentAllocate (Perm(N,N))! Print*, 'Spanned by indices'Do i = 1, N**2Perm(mod(i-1,N)+1, (i-1)/N+1)%Next = (/ Mod(i,N) + 1, Mod(i/N+1,N)+1/)! Write(*,100) mod(i-1,N)+1, (i-1)/N+1, Perm(mod(i-1,N)+1, (i-1)/N+1)%Next! Expected output:! Spanned by indices! 1 1---> 2 2! 2 1---> 1 1! 1 2---> 2 1! 2 2---> 1 2End Do! Print*, 'Spanned as a cycle'Current = (/1,1/)Do i = 1, n**2results (:, i) = Perm(Current(1), Current(2))%Next! Write(*,100) Current, Perm(Current(1), Current(2))%Next! Expected output:! 1 1---> 2 2! 2 2---> 1 2! 1 2---> 2 1! 2 1---> 1 1Current = Perm(Current(1), Current(2))%NextEnd Doif (any(results .ne. reshape ((/2,2,1,2,2,1,1,1/), (/2, 4/)))) call abort! 100 Format( 2I3, '--->', 2I3)DeAllocate (Perm)End Program Strange
