Debian Codegraph @

gcc/testsuite/gfortran.dg/random_4.f90

raw
1 ! { dg-do run }
2 !
3 program trs
4 implicit none
5 integer :: size, ierr
6 integer, allocatable, dimension(:) :: seed, check
7 call test_random_seed(size)
8 allocate(seed(size),check(size))
9 seed = 42
10 call test_random_seed(put=seed)
11 call test_random_seed(get=check)
12 ! With xorshift1024* the last seed value is special
13 seed(size) = check(size)
14 if (any (seed /= check)) STOP 1
15 contains
16 subroutine test_random_seed(size, put, get)
17 integer, optional :: size
18 integer, dimension(:), optional :: put
19 integer, dimension(:), optional :: get
20 call random_seed(size, put, get)
21 end subroutine test_random_seed
22 end program trs