annotate gcc/testsuite/gfortran.dg/elemental_subroutine_7.f90 @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 !
kono
parents:
diff changeset
3 ! PR fortran/38669
kono
parents:
diff changeset
4 ! Loop bounds temporaries used before being defined for elemental subroutines
kono
parents:
diff changeset
5 !
kono
parents:
diff changeset
6 ! Original testcase by Harald Anlauf <anlauf@gmx.de>
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 program gfcbu84_main
kono
parents:
diff changeset
9 implicit none
kono
parents:
diff changeset
10 integer :: jplev, k_lev
kono
parents:
diff changeset
11 integer :: p(42)
kono
parents:
diff changeset
12 real :: r(42)
kono
parents:
diff changeset
13 integer, pointer :: q(:)
kono
parents:
diff changeset
14 jplev = 42
kono
parents:
diff changeset
15 k_lev = 1
kono
parents:
diff changeset
16 call random_number (r)
kono
parents:
diff changeset
17 p = 41 * r + 1
kono
parents:
diff changeset
18 allocate (q(jplev))
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 q = 0
kono
parents:
diff changeset
21 call tq_tvgh (q(k_lev:), p(k_lev:))
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
22 if (any (p /= q)) STOP 1
111
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 q = 0
kono
parents:
diff changeset
25 call tq_tvgh (q(k_lev:), (p(k_lev:)))
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
26 if (any (p /= q)) STOP 2
111
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 q = 0
kono
parents:
diff changeset
29 call tq_tvgh (q(k_lev:), (p(p(k_lev:))))
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
30 if (any (p(p) /= q)) STOP 3
111
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 deallocate (q)
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 contains
kono
parents:
diff changeset
35 elemental subroutine tq_tvgh (t, p)
kono
parents:
diff changeset
36 integer ,intent (out) :: t
kono
parents:
diff changeset
37 integer ,intent (in) :: p
kono
parents:
diff changeset
38 t=p
kono
parents:
diff changeset
39 end subroutine tq_tvgh
kono
parents:
diff changeset
40 end program gfcbu84_main