From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- .../execute/equiv_init_1.f90 | 94 ++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/equiv_init_1.f90 (limited to 'gcc/testsuite/gfortran.fortran-torture/execute/equiv_init_1.f90') diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/equiv_init_1.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/equiv_init_1.f90 new file mode 100644 index 000000000..d918097c5 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/execute/equiv_init_1.f90 @@ -0,0 +1,94 @@ +! Program to test initialization of equivalence blocks. PR13742. +! Some forms are not yet implemented. These are indicated by !!$ + +subroutine test0s + character*10 :: x = "abcdefghij" + character*10 :: y + equivalence (x,y) + + character*10 :: xs(10) + character*10 :: ys(10) + equivalence (xs,ys) + data xs /10*"abcdefghij"/ + + if (y.ne."abcdefghij") call abort + if (ys(1).ne."abcdefghij") call abort + if (ys(10).ne."abcdefghij") call abort +end + +subroutine test0 + integer :: x = 123 + integer :: y + equivalence (x,y) + if (y.ne.123) call abort +end + +subroutine test1 + integer :: a(3) + integer :: x = 1 + integer :: y + integer :: z = 3 + equivalence (a(1), x) + equivalence (a(3), z) + if (x.ne.1) call abort + if (z.ne.3) call abort + if (a(1).ne.1) call abort + if (a(3).ne.3) call abort +end + +subroutine test2 + integer :: x + integer :: z + integer :: a(3) = 123 + equivalence (a(1), x) + equivalence (a(3), z) + if (x.ne.123) call abort + if (z.ne.123) call abort +end + +subroutine test3 + integer :: x +!!$ integer :: y = 2 + integer :: z + integer :: 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 abort + if (z.ne.3) call abort +end + +subroutine test4 + integer a(2) + integer b(2) + integer c + equivalence (a(2),b(1)), (b(2),c) + data a/1,2/ + data c/3/ + if (b(1).ne.2) call abort + if (b(2).ne.3) call abort +end + +!!$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" +!!$end + +program main + call test0s + call test0 + call test1 + call test2 + call test3 + call test4 +!!$ call test5 +end + -- cgit v1.2.3