annotate gcc/testsuite/gfortran.dg/array_constructor_8.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! Like array_constructor_6.f90, but check constructors that mix iterators
kono
parents:
diff changeset
2 ! and individual scalar elements.
kono
parents:
diff changeset
3 ! { dg-do run }
kono
parents:
diff changeset
4 program main
kono
parents:
diff changeset
5 implicit none
kono
parents:
diff changeset
6 call build (42)
kono
parents:
diff changeset
7 contains
kono
parents:
diff changeset
8 subroutine build (order)
kono
parents:
diff changeset
9 integer :: order, i
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 call test (order, 8, 5, (/ ((/ 1, 2, 3, 4, 5, 6, 7, 8 /), i = 1, order), &
kono
parents:
diff changeset
12 100, 200, 300, 400, 500 /))
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 call test (order, 2, 3, (/ ((/ 1, 2 /), i = 1, order), &
kono
parents:
diff changeset
15 100, 200, 300 /))
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 call test (order, 3, 5, (/ ((/ 1, 2, 3 /), i = 1, order), &
kono
parents:
diff changeset
18 100, 200, 300, 400, 500 /))
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 call test (order, 6, 1, (/ ((/ 1, 2, 3, 4, 5, 6 /), i = 1, order), &
kono
parents:
diff changeset
21 100 /))
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 call test (order, 5, 0, (/ ((/ 1, 2, 3, 4, 5 /), i = 1, order) /))
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 call test (order, 0, 4, (/ 100, 200, 300, 400 /))
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 call test (11, 5, 2, (/ ((/ 1, 2, 3, 4, 5 /), i = 1, 11), &
kono
parents:
diff changeset
28 100, 200 /))
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 call test (6, 2, order, (/ ((/ 1, 2 /), i = 1, 6), &
kono
parents:
diff changeset
31 (i * 100, i = 1, order) /))
kono
parents:
diff changeset
32 end subroutine build
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 subroutine test (order, repeat, trail, values)
kono
parents:
diff changeset
35 integer, dimension (:) :: values
kono
parents:
diff changeset
36 integer :: order, repeat, trail, i
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 if (size (values, dim = 1) .ne. order * repeat + trail) call abort
kono
parents:
diff changeset
39 do i = 1, order * repeat
kono
parents:
diff changeset
40 if (values (i) .ne. mod (i - 1, repeat) + 1) call abort
kono
parents:
diff changeset
41 end do
kono
parents:
diff changeset
42 do i = 1, trail
kono
parents:
diff changeset
43 if (values (i + order * repeat) .ne. i * 100) call abort
kono
parents:
diff changeset
44 end do
kono
parents:
diff changeset
45 end subroutine test
kono
parents:
diff changeset
46 end program main