Debian Codegraph @

gcc/testsuite/gfortran.dg/random_seed_3.f90

raw
1 ! { dg-do run }
2 ! Check that array constructors using non-compile-time
3 ! iterators are handled correctly.
4 program main
5 implicit none
6 call init_random_seed
7 contains
8 SUBROUTINE init_random_seed()
9 INTEGER :: i, n, clock
10 INTEGER, DIMENSION(:), ALLOCATABLE :: seed
11
12 CALL RANDOM_SEED(size = n)
13 ALLOCATE(seed(n))
14
15 CALL SYSTEM_CLOCK(COUNT=clock)
16
17 seed = clock + 37 * (/ (i - 1, i = 1, n) /)
18 CALL RANDOM_SEED(PUT = seed)
19
20 DEALLOCATE(seed)
21 END SUBROUTINE init_random_seed
22 end program main