c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr47054_2.f90
blob3b7c4aaf8158aa3f97c5ab730d4deae7b61b0097
1 ! { dg-do compile }
2 ! { dg-options "-fcray-pointer" }
3 ! PR fortran/47054
4 ! Code contributed by Deji Akingunola <deji_aking at yahoo dot ca>
5 subroutine host_sub(F_su,F_nk)
6 implicit none
8 integer :: F_nk
9 real,dimension(F_nk) :: F_su
10 integer G_ni, G_nj
11 real*8 G_xg_8, G_yg_8
12 pointer (paxg_8, G_xg_8(G_ni))
13 pointer (payg_8, G_yg_8(G_nj))
14 common / G_p / paxg_8,payg_8
15 common / G / G_ni, G_nj
17 call internal_sub(F_su,F_nk)
18 return
19 contains
21 subroutine internal_sub(F_su,F_nk)
22 implicit none
23 integer G_ni, G_nj
24 real*8 G_xg_8, G_yg_8
25 pointer (paxg_8, G_xg_8(G_ni))
26 pointer (payg_8, G_yg_8(G_nj))
27 common / G_p / paxg_8,payg_8
28 common / G / G_ni, G_nj
30 integer :: F_nk
31 real,dimension(F_nk) :: F_su
32 integer k,k2
34 k2 = 0
35 do k = 1, F_nk, 2
36 k2 = k2+1
37 F_su(k) = F_su(k) + 1.0
38 enddo
39 return
40 end subroutine internal_sub
41 end subroutine host_sub