3 ! Like imperfect2.f90, but adds bindings to the blocks.
13 integer :: ccount(3), dcount(3)
21 ccount(x
%i
) = ccount(x
%i
) + 1
26 dcount(x
%i
) = dcount(x
%i
) + 1
33 integer :: f1count(3), f2count(3), g1count(3), g2count(3)
51 ! All intervening code at the same depth must be executed the same
53 if (f1count(1) /= f2count(1)) error
stop 101
54 if (f1count(2) /= f2count(2)) error
stop 102
55 if (f1count(3) /= f2count(3)) error
stop 103
56 if (g1count(1) /= f1count(1)) error
stop 104
57 if (g2count(1) /= f1count(1)) error
stop 105
58 if (g1count(2) /= f1count(2)) error
stop 106
59 if (g2count(2) /= f1count(2)) error
stop 107
60 if (g1count(3) /= f1count(3)) error
stop 108
61 if (g2count(3) /= f1count(3)) error
stop 109
63 ! Intervening code must be executed at least as many times as the loop
65 if (f1count(1) < 3) error
stop 111
66 if (f1count(2) < 3 * 4) error
stop 112
68 ! Intervening code must not be executed more times than the number
69 ! of logical iterations.
70 if (f1count(1) > 3 * 4 * 5) error
stop 121
71 if (f1count(2) > 3 * 4 * 5) error
stop 122
73 ! Check that the innermost loop body is executed exactly the number
74 ! of logical iterations expected.
75 if (f1count(3) /= 3 * 4 * 5) error
stop 131
77 ! Check that constructors and destructors are called equal number of times.
78 if (ccount(1) /= dcount(1)) error
stop 141
79 if (ccount(2) /= dcount(2)) error
stop 142
80 if (ccount(3) /= dcount(3)) error
stop 143
84 subroutine f1 (depth
, iter
)
85 integer :: depth
, iter
86 f1count(depth
) = f1count(depth
) + 1
89 subroutine f2 (depth
, iter
)
90 integer :: depth
, iter
91 f2count(depth
) = f2count(depth
) + 1
94 subroutine g1 (depth
, iter
)
95 integer :: depth
, iter
96 g1count(depth
) = g1count(depth
) + 1
99 subroutine g2 (depth
, iter
)
100 integer :: depth
, iter
101 g2count(depth
) = g2count(depth
) + 1
104 subroutine s1 (a1
, a2
, a3
)
105 integer :: a1
, a2
, a3
113 call init (local1
, 1)
114 call g1 (local1
%i
, i
)
119 call init (local2
, 2)
120 call g1 (local2
%i
, j
)
125 call init (local3
, 3)
126 call g1 (local3
%i
, k
)
127 call g2 (local3
%i
, k
)
131 call g2 (local2
%i
, j
)
135 call g2 (local1
%i
, i
)