gcc/fortran/
[official-gcc.git] / gcc / testsuite / gfortran.dg / nested_forall_1.f
blob5cb8ee0febf92533c8f27b2e48af40ccfbf5a228
1 ! { dg-do compile }
2 ! { dg-require-visibility "" }
4 ! PR fortran/35820
5 !
6 ! Memory leak(s) while resolving forall constructs.
7 !
8 ! Contributed by Dick Hendrickson <dick.hendrickson@gmail.com>
10 MODULE TESTS
11 INTEGER,PARAMETER,PUBLIC :: I1_KV = KIND(1)
12 INTEGER,PARAMETER,PUBLIC :: R1_KV = KIND(1.0)
13 INTEGER, PRIVATE :: J1,J2
14 INTEGER,PARAMETER,PUBLIC :: S1 = 10, S2 = 9
15 CONTAINS
16 SUBROUTINE SA0136(RDA,IDA,BDA)
17 REAL(R1_KV) RDA(S1)
18 INTEGER(I1_KV) IDA(S1,S2)
19 INTEGER(I1_KV) ICA(S1,S2)
20 REAL(R1_KV) RCA(S1)
21 ! T E S T S T A T E M E N T S
22 FORALL (J1 = 1:S1)
23 RDA(J1) = RCA(J1) + 1.0_R1_KV
24 FORALL (J2 = 1:S2)
25 IDA(J1,J2) = ICA(J1,J2) + 1
26 END FORALL
27 FORALL (J2 = 1:S2)
28 IDA(J1,J2) = ICA(J1,J2)
29 END FORALL
30 ENDFORALL
31 FORALL (J1 = 1:S1)
32 RDA(J1) = RCA(J1)
33 FORALL (J2 = 1:S2)
34 IDA(J1,J2) = ICA(J1,J2)
35 END FORALL
36 END FORALL
37 END SUBROUTINE
38 END MODULE TESTS