OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [random_3.f90] - Blame information for rev 827

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do run }
2
! { dg-require-effective-target fortran_large_real }
3
! Check that the random_seed for real(10) or real(16) exists and that
4
! real(8) and real(10) or real(16) random number generators
5
! return the same sequence of values.
6
! Mostly copied from random_2.f90
7
program random_4
8
  integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1)
9
 
10
  integer, dimension(:), allocatable :: seed
11
  real(kind=8), dimension(10) :: r8
12
  real(kind=k), dimension(10) :: r10
13
  real, parameter :: delta = 1.d-10
14
  integer n
15
 
16
  call random_seed (size=n)
17
  allocate (seed(n))
18
  call random_seed (get=seed)
19
  ! Test both array valued and scalar routines.
20
  call random_number(r8)
21
  call random_number (r8(10))
22
 
23
  ! Reset the seed and get the real(8) values.
24
  call random_seed (put=seed)
25
  call random_number(r10)
26
  call random_number (r10(10))
27
 
28
  if (any ((r8 - r10) .gt. delta)) call abort
29
end program random_4

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.