PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / array_reference_1.f90
blob246f8ceacaa33687769f437ab31452a24819d85b
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
6 ! Contributed by Elizabeth Yip <elizabeth.l.yip@boeing.com>
7 ! and Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
9 program main
10 call PR31994
11 call PR31994_comment6
12 contains
13 subroutine PR31994
14 implicit none
15 complex (kind=4), dimension(2,2) :: a, b, c
16 a(1,1) = (1.,1.)
17 a(2,1) = (2.,2.)
18 a(1,2) = (3.,3.)
19 a(2,2) = (4.,4.)
20 b=conjg (transpose (a))
21 c=transpose (a)
22 c=conjg (c)
23 if (any (b .ne. c)) STOP 1
24 end subroutine PR31994
25 subroutine PR31994_comment6
26 implicit none
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)) STOP 2
34 end subroutine PR31994_comment6
35 END program main