2016-01-15 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / parens_3.f90
blob47bb75e401d6d3d32c2c0b8867da56b3df51f38b
1 ! PR 14771
2 ! { dg-do run }
3 ! Originally contributed by Walt Brainerd, modified for the testsuite
4 PROGRAM fc107
6 ! Submitted by Walt Brainerd, The Fortran Company
7 ! GNU Fortran 95 (GCC 4.1.0 20050322 (experimental))
8 ! Windows XP
10 ! Return value should be 3
12 INTEGER I, J, M(2), N(2)
13 integer, pointer :: k
14 integer, target :: l
15 INTEGER TRYME
17 interface
18 FUNCTION TRYyou(RTNME,HITME)
19 INTEGER RTNME(2),HITME(2), tryyou(2)
20 END function tryyou
21 end interface
23 m = 7
24 l = 5
25 I = 3
26 k => l
28 j = tryme((i),i)
29 if (j .ne. 3) call abort ()
31 j = tryme((k),k)
32 if (j .ne. 5) call abort ()
34 n = tryyou((m),m)
35 if (any(n .ne. 7)) call abort ()
36 END
38 INTEGER FUNCTION TRYME(RTNME,HITME)
39 INTEGER RTNME,HITME
40 HITME = 999
41 TRYME = RTNME
42 END
44 FUNCTION TRYyou(RTNME,HITME)
45 INTEGER RTNME(2),HITME(2), tryyou(2)
46 HITME = 999
47 TRYyou = RTNME
48 END