URL
                    https://opencores.org/ocsvn/openrisc/openrisc/trunk
                
            Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [equiv_init_1.f90] - Rev 695
Compare with Previous | Blame | View Log
! Program to test initialization of equivalence blocks. PR13742.! Some forms are not yet implemented. These are indicated by !!$subroutine test0scharacter*10 :: x = "abcdefghij"character*10 :: yequivalence (x,y)character*10 :: xs(10)character*10 :: ys(10)equivalence (xs,ys)data xs /10*"abcdefghij"/if (y.ne."abcdefghij") call abortif (ys(1).ne."abcdefghij") call abortif (ys(10).ne."abcdefghij") call abortendsubroutine test0integer :: x = 123integer :: yequivalence (x,y)if (y.ne.123) call abortendsubroutine test1integer :: a(3)integer :: x = 1integer :: yinteger :: z = 3equivalence (a(1), x)equivalence (a(3), z)if (x.ne.1) call abortif (z.ne.3) call abortif (a(1).ne.1) call abortif (a(3).ne.3) call abortendsubroutine test2integer :: xinteger :: zinteger :: a(3) = 123equivalence (a(1), x)equivalence (a(3), z)if (x.ne.123) call abortif (z.ne.123) call abortendsubroutine test3integer :: x!!$ integer :: y = 2integer :: zinteger :: a(3)equivalence (a(1),x), (a(2),y), (a(3),z)data a(1) /1/, a(3) /3/if (x.ne.1) call abort!!$ if (y.ne.2) call abortif (z.ne.3) call abortendsubroutine test4integer a(2)integer b(2)integer cequivalence (a(2),b(1)), (b(2),c)data a/1,2/data c/3/if (b(1).ne.2) call abortif (b(2).ne.3) call abortend!!$subroutine test5!!$ integer a(2)!!$ integer b(2)!!$ integer c!!$ equivalence (a(2),b(1)), (b(2),c)!!$ data a(1)/1/!!$ data b(1)/2/!!$ data c/3/!!$ if (a(2).ne.2) call abort!!$ if (b(2).ne.3) call abort!!$ print *, "Passed test5"!!$endprogram maincall test0scall test0call test1call test2call test3call test4!!$ call test5end
