repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
re PR fortran/78741 (ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1534)
[official-gcc.git]
/
gcc
/
testsuite
/
gfortran.dg
/
altreturn_3.f90
blob
8da65a373a5b4e934d65e1d4c8200d426b5a1254
1
! { dg-do run }
2
! { dg-options "-std=gnu" }
3
!
4
! Tests the fix for PR30236, which was due to alternate returns
5
! in generic interfaces causing a segfault. They now work
6
! correctly.
7
!
8
! Contributed by Brooks Moses <brooks@gcc.gnu.org>
9
!
10
module
arswitch
11
implicit none
12
interface
gen
13
module
procedure with
14
module
procedure without
15
end interface
16
contains
17
subroutine
with
(
i
,*)
18
integer
i
19
if
(
i
>
0
)
then
20
i
= -
1
21
return
1
22
else
23
i
= -
2
24
return
25
end if
26
end subroutine
27
subroutine
without
()
28
return
29
end subroutine
30
end module
31
32
program
test
33
use
arswitch
34
implicit none
35
integer
::
i
=
0
36
call
gen
(
i
, *
10
)
37
if
(
i
/= -
2
)
STOP
1
38
i
=
2
39
call
gen
(
i
, *
20
)
40
10
continue
41
STOP
2
42
20
continue
43
if
(
i
/= -
1
)
STOP
3
44
end