annotate gcc/testsuite/gfortran.dg/contained_3.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 ! Tests the fix for PR33897, in which gfortran missed that the
kono
parents:
diff changeset
3 ! declaration of 'setbd' in 'nxtstg2' made it external. Also
kono
parents:
diff changeset
4 ! the ENTRY 'setbd' would conflict with the external 'setbd'.
kono
parents:
diff changeset
5 !
kono
parents:
diff changeset
6 ! Contributed by Michael Richmond <michael.a.richmond@nasa.gov>
kono
parents:
diff changeset
7 !
kono
parents:
diff changeset
8 MODULE ksbin1_aux_mod
kono
parents:
diff changeset
9 CONTAINS
kono
parents:
diff changeset
10 SUBROUTINE nxtstg1()
kono
parents:
diff changeset
11 INTEGER :: i
kono
parents:
diff changeset
12 i = setbd() ! available by host association.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
13 if (setbd () .ne. 99 ) STOP 1
111
kono
parents:
diff changeset
14 END SUBROUTINE nxtstg1
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 SUBROUTINE nxtstg2()
kono
parents:
diff changeset
17 INTEGER :: i
kono
parents:
diff changeset
18 integer :: setbd ! makes it external.
kono
parents:
diff changeset
19 i = setbd() ! this is the PR
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
20 if (setbd () .ne. 42 ) STOP 2
111
kono
parents:
diff changeset
21 END SUBROUTINE nxtstg2
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 FUNCTION binden()
kono
parents:
diff changeset
24 INTEGER :: binden
kono
parents:
diff changeset
25 INTEGER :: setbd
kono
parents:
diff changeset
26 binden = 0
kono
parents:
diff changeset
27 ENTRY setbd()
kono
parents:
diff changeset
28 setbd = 99
kono
parents:
diff changeset
29 END FUNCTION binden
kono
parents:
diff changeset
30 END MODULE ksbin1_aux_mod
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 PROGRAM test
kono
parents:
diff changeset
33 USE ksbin1_aux_mod, only : nxtstg1, nxtstg2
kono
parents:
diff changeset
34 integer setbd ! setbd is external, since not use assoc.
kono
parents:
diff changeset
35 CALL nxtstg1()
kono
parents:
diff changeset
36 CALL nxtstg2()
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
37 if (setbd () .ne. 42 ) STOP 3
111
kono
parents:
diff changeset
38 call foo
kono
parents:
diff changeset
39 contains
kono
parents:
diff changeset
40 subroutine foo
kono
parents:
diff changeset
41 USE ksbin1_aux_mod ! module setbd is available
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
42 if (setbd () .ne. 99 ) STOP 4
111
kono
parents:
diff changeset
43 end subroutine
kono
parents:
diff changeset
44 END PROGRAM test
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 INTEGER FUNCTION setbd()
kono
parents:
diff changeset
47 setbd=42
kono
parents:
diff changeset
48 END FUNCTION setbd