annotate gcc/testsuite/gfortran.dg/pr55086_aliasing_dummy_4_tfat.f90 @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 ! { dg-options "-ftest-forall-temp" }
kono
parents:
diff changeset
3 ! This is a copy of aliasing_dummy_4.f90, with an option set to improve
kono
parents:
diff changeset
4 ! test coverage by forcing forall code to use a temporary.
kono
parents:
diff changeset
5 !
kono
parents:
diff changeset
6 program test_f90
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 integer, parameter :: N = 2
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 type test_type
kono
parents:
diff changeset
11 integer a(N, N)
kono
parents:
diff changeset
12 end type
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 type (test_type) s(N, N)
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 forall (l = 1:N, m = 1:N) &
kono
parents:
diff changeset
17 s(l, m)%a(:, :) = reshape ([((i*l + 10*j*m +100, i = 1, N), j = 1, N)], [N, N])
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 call test_sub(s%a(1, 1), 1000) ! Test the original problem.
kono
parents:
diff changeset
20
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
21 if ( any (s(1, 1)%a(:, :) /= reshape ([1111, 112, 121, 122], [2, 2]))) STOP 1
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
22 if ( any (s(1, 2)%a(:, :) /= reshape ([1121, 122, 141, 142], [2, 2]))) STOP 2
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
23 if ( any (s(2, 1)%a(:, :) /= reshape ([1112, 114, 122, 124], [2, 2]))) STOP 3
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
24 if ( any (s(2, 2)%a(:, :) /= reshape ([1122, 124, 142, 144], [2, 2]))) STOP 4
111
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 call test_sub(s(1, 1)%a(:, :), 1000) ! Check "normal" references.
kono
parents:
diff changeset
27
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
28 if ( any (s(1, 1)%a(:, :) /= reshape ([2111,1112,1121,1122], [2, 2]))) STOP 5
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
29 if ( any (s(1, 2)%a(:, :) /= reshape ([1121, 122, 141, 142], [2, 2]))) STOP 6
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
30 if ( any (s(2, 1)%a(:, :) /= reshape ([1112, 114, 122, 124], [2, 2]))) STOP 7
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
31 if ( any (s(2, 2)%a(:, :) /= reshape ([1122, 124, 142, 144], [2, 2]))) STOP 8
111
kono
parents:
diff changeset
32 contains
kono
parents:
diff changeset
33 subroutine test_sub(array, offset)
kono
parents:
diff changeset
34 integer array(:, :), offset
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 forall (i = 1:N, j = 1:N) &
kono
parents:
diff changeset
37 array(i, j) = array(i, j) + offset
kono
parents:
diff changeset
38 end subroutine
kono
parents:
diff changeset
39 end program
kono
parents:
diff changeset
40