RISC-V: Refactor Dynamic LMUL codes
[official-gcc.git] / gcc / testsuite / gfortran.dg / array_constructor_10.f90
bloba1e55384c5c3ef6fd2ffdca39c929ee1293155e5
1 ! Like array_constructor_6.f90, but check constructors that apply
2 ! an elemental function to an array.
3 ! { dg-do run }
4 program main
5 implicit none
6 call build (200)
7 contains
8 subroutine build (order)
9 integer :: order, i
11 call test (order, (/ (abs ((/ i, -i, -i * 2 /)), i = 1, order) /))
12 call test (order, abs ((/ ((/ -i, -i, i * 2 /), i = 1, order) /)))
13 call test (order, (/ abs ((/ ((/ i, i, -i * 2 /), i = 1, order) /)) /))
14 end subroutine build
16 subroutine test (order, values)
17 integer, dimension (3:) :: values
18 integer :: order, i
20 if (size (values, dim = 1) .ne. order * 3) STOP 1
21 do i = 1, order
22 if (values (i * 3) .ne. i) STOP 2
23 if (values (i * 3 + 1) .ne. i) STOP 3
24 if (values (i * 3 + 2) .ne. i * 2) STOP 4
25 end do
26 end subroutine test
27 end program main