RISC-V: Refactor Dynamic LMUL codes
[official-gcc.git] / gcc / testsuite / gfortran.dg / random_init_4.f90
blobb3a35f93fa181b14a45fd4d1ad904d0559a2869e
1 ! { dg-do run }
2 ! { dg-options "-fcoarray=single" }
3 program rantest
5 implicit none
7 logical, parameter :: debug = .false.
8 character(len=20) name
9 integer fd, i, n
10 integer, allocatable :: n1(:), n2(:), n3(:)
11 real x(4), y(4), z(4)
13 if (debug) then
14 write(name,'(A,I0)') 'dat', this_image()
15 open(newunit=fd, file=name)
16 end if
18 call random_seed(size=n)
19 allocate(n1(n), n2(n), n3(n))
21 call random_init(.true., .false.)
22 call random_seed(get=n1)
23 call random_number(x)
25 call random_init(.true., .false.)
26 call random_seed(get=n2)
27 call random_number(y)
29 call random_init(.true., .false.)
30 call random_seed(get=n3)
31 call random_number(z)
33 if (debug) then
34 write(fd,'(A,4F12.6)') 'x = ', x
35 write(fd,'(A,4F12.6)') 'y = ', y
36 write(fd,'(A,4F12.6)') 'z = ', z
37 write(fd,*)
38 do i = 1, 5
39 write(fd,'(I2,4I13)') i, n1(i), n2(i), n3(i)
40 end do
41 end if
43 end program rantest