Merge aosp-toolchain/gcc/gcc-4_9 changes.
[official-gcc.git] / gcc-4_9 / gcc / testsuite / gfortran.dg / random_7.f90
blob6435a34cf58944a95c3f37c1492d9dad1f8f62b4
1 ! { dg-do run }
2 ! { dg-options "-fdefault-integer-8" }
4 program trs
5 implicit none
6 integer :: size, ierr
7 integer, allocatable, dimension(:) :: seed, check
8 call test_random_seed(size)
9 allocate(seed(size),check(size))
10 seed(:) = huge(seed) / 17
11 call test_random_seed(put=seed)
12 call test_random_seed(get=check)
13 print *, seed
14 print *, check
15 if (any (seed /= check)) call abort
16 contains
17 subroutine test_random_seed(size, put, get)
18 integer, optional :: size
19 integer, dimension(:), optional :: put
20 integer, dimension(:), optional :: get
21 call random_seed(size, put, get)
22 end subroutine test_random_seed
23 end program trs