summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/g77/19990218-1.f
blob: 8506e4fe14800ecf8b42bc68fe6a5d3ad05cbc4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
c { dg-do compile }
c
c  g77 used to warn for this case
c 19990218-1.f: In program `test':
c 19990218-1.f:13: 
c             double precision function fun(a,b)
c                                       1
c  19990218-1.f:23: (continued):
c             c=fun(a,b)
c               2
c  Global name `fun' at (2) has different type at (1) [info -f g77 M GLOBALS]
c
        double precision function fun(a,b)
        double precision a,b
        print*,'in sub: a,b=',a,b
        fun=a*b
        print*,'in sub: fun=',fun
        return
        end
        program test
        double precision a,b,c
        data a,b/1.0d-46,1.0d0/
        c=fun(a,b) ! { dg-error "Return type mismatch of function" }
        print*,'in main: fun=',c
        end