PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gfortran.dg / parens_3.f90
blob0dd82c5be605cd9545d6b02bf88d7f45654e17ee
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) STOP 1
31 j = tryme((k),k)
32 if (j .ne. 5) STOP 2
34 n = tryyou((m),m)
35 if (any(n .ne. 7)) STOP 3
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