OSDN Git Service

2010-04-24 Kai Tietz <kai.tietz@onevision.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / array_reference_1.f90
1 ! { dg-do run }
2 ! Tests the fix for PR31994, aka 31867, in which the offset
3 ! of 'a' in both subroutines was being evaluated incorrectly.
4 ! The testcase for PR31867 is char_length_5.f90
5 !
6 ! Contributed by Elizabeth Yip <elizabeth.l.yip@boeing.com>
7 !            and Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
8 !
9 program main
10   call PR31994
11   call PR31994_comment6
12 contains
13   subroutine PR31994\r
14     implicit none\r
15     complex (kind=4), dimension(2,2) :: a, b, c\r
16     a(1,1) = (1.,1.)\r
17     a(2,1) = (2.,2.)\r
18     a(1,2) = (3.,3.)\r
19     a(2,2) = (4.,4.)\r
20     b=conjg (transpose (a))\r
21     c=transpose (a)\r
22     c=conjg (c)\r
23     if (any (b .ne. c)) call abort ()
24   end subroutine PR31994
25   subroutine PR31994_comment6
26     implicit none\r
27     real ,dimension(2,2)::a
28     integer ,dimension(2,2) :: b, c
29     a = reshape ((/1.,2.,3.,4./), (/2,2/))
30     b=int (transpose(a))
31     c = int (a)
32     c = transpose (c)
33     if (any (b .ne. c)) call abort ()
34   end subroutine PR31994_comment6\r
35 END program main\r