Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
468d95c8
Commit
468d95c8
authored
Aug 29, 2016
by
Janne Blomqvist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PR fortran/77261 Run random_3 testcase only when real(10) is available.
From-SVN: r239817
parent
78a3bdba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
15 deletions
+27
-15
gcc/testsuite/ChangeLog
+6
-0
gcc/testsuite/gfortran.dg/random_3.f90
+21
-15
No files found.
gcc/testsuite/ChangeLog
View file @
468d95c8
2016-08-29 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/77261
* gfortran.dg/random_3.f90: Run testcase only when real(10) is
available.
2016-08-28 Tom de Vries <tom@codesourcery.com>
PR lto/70955
...
...
gcc/testsuite/gfortran.dg/random_3.f90
View file @
468d95c8
! { dg-do run }
! { dg-require-effective-target fortran_large_real }
! Check that the random_seed for real(10)
or real(16)
exists and that
! real(8) and real(10)
or real(16)
random number generators
! Check that the random_seed for real(10) exists and that
! real(8) and real(10) random number generators
! return the same sequence of values.
! Mostly copied from random_2.f90
program
random_
4
program
random_
3
integer
,
parameter
::
k
=
selected_real_kind
(
precision
(
0.0_8
)
+
1
)
integer
,
dimension
(:),
allocatable
::
seed
...
...
@@ -13,17 +13,23 @@ program random_4
real
,
parameter
::
delta
=
1.d-10
integer
n
call
random_seed
(
size
=
n
)
allocate
(
seed
(
n
))
call
random_seed
(
get
=
seed
)
! Test both array valued and scalar routines.
call
random_number
(
r8
)
call
random_number
(
r8
(
10
))
! Run the test only if real(10) is available. With the current
! xorshift1024* PRNG the real(16) generator uses two uint64_t values
! for every real(16) value generated, and hence the sequences won't
! be the same as with real(4,8,10).
if
(
k
==
10
)
then
call
random_seed
(
size
=
n
)
allocate
(
seed
(
n
))
call
random_seed
(
get
=
seed
)
! Test both array valued and scalar routines.
call
random_number
(
r8
)
call
random_number
(
r8
(
10
))
! Reset the seed and get the real(8) values.
call
random_seed
(
put
=
seed
)
call
random_number
(
r10
)
call
random_number
(
r10
(
10
))
! Reset the seed and get the real(8) values.
call
random_seed
(
put
=
seed
)
call
random_number
(
r10
)
call
random_number
(
r10
(
10
))
if
(
any
((
r8
-
r10
)
.gt.
delta
))
call
abort
end
program
random_4
if
(
any
((
r8
-
r10
)
.gt.
delta
))
call
abort
end
if
end
program
random_3
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment