Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gfortran.dg/random_7.f90 @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 ! { dg-do run } | |
2 ! { dg-options "-fdefault-integer-8" } | |
3 ! | |
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 ! In the current xorshift1024* implementation the last seed value is | |
14 ! special | |
15 seed(size) = check(size) | |
16 if (any (seed /= check)) call abort | |
17 contains | |
18 subroutine test_random_seed(size, put, get) | |
19 integer, optional :: size | |
20 integer, dimension(:), optional :: put | |
21 integer, dimension(:), optional :: get | |
22 call random_seed(size, put, get) | |
23 end subroutine test_random_seed | |
24 end program trs |