summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/parens_3.f90
blob: 47bb75e401d6d3d32c2c0b8867da56b3df51f38b (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
! PR 14771
! { dg-do run }
! Originally contributed by Walt Brainerd, modified for the testsuite
      PROGRAM fc107

! Submitted by Walt Brainerd, The Fortran Company
! GNU Fortran 95 (GCC 4.1.0 20050322 (experimental))
! Windows XP

! Return value should be 3

      INTEGER I, J, M(2), N(2)
      integer, pointer :: k
      integer, target :: l
      INTEGER TRYME

      interface
        FUNCTION TRYyou(RTNME,HITME)
          INTEGER RTNME(2),HITME(2), tryyou(2)
        END function tryyou
      end interface

      m = 7
      l = 5
      I = 3
      k => l

      j = tryme((i),i)
      if (j .ne. 3) call abort ()

      j = tryme((k),k)
      if (j .ne. 5) call abort ()

      n = tryyou((m),m)
      if (any(n .ne. 7)) call abort ()
      END

      INTEGER FUNCTION TRYME(RTNME,HITME)
      INTEGER RTNME,HITME
      HITME = 999
      TRYME = RTNME
      END

      FUNCTION TRYyou(RTNME,HITME)
      INTEGER RTNME(2),HITME(2), tryyou(2)
      HITME = 999
      TRYyou = RTNME
      END