re PR libfortran/15149 (problem computing Pi)

PR fortran/15149
        * gfortran.fortran-torture/execute/random_init.f90: New test.
        * libgfortan.h,intrinsics/random.c: Made random_seed visible.
        * runtime/main.c(init): Call random_seed as part of MAIN init.

From-SVN: r81836
This commit is contained in:
Bud Davis 2004-05-14 12:21:22 +00:00 committed by Bud Davis
parent 084c663c99
commit abdef81151
6 changed files with 30 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2004-05-14 Bud Davis <bdavis9659@comcast.net>
PR fortran/15149
* gfortran.fortran-torture/execute/random_init.f90: New test.
2004-05-13 Paul Brook <paul@codesourcery.com>
PR fortran/15314

View file

@ -0,0 +1,11 @@
! pr 15149
! verify the random number generator is functional
program test_random
implicit none
real :: r(5) = 0.0
call random_number(r)
if (all (r .eq. 0)) call abort
end program

View file

@ -1,3 +1,9 @@
2004-05-14 Bud Davis <bdavis9659@comcast.net>
PR fortran/15149
* libgfortan.h,intrinsics/random.c: Made random_seed visible.
* runtime/main.c(init): Call random_seed as part of MAIN init.
2004-05-13 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
* io/format.c: (parse_format_list): No comma is required after

View file

@ -70,7 +70,6 @@ static unsigned int seed[N];
/* This is the routine which handles the seeding of the generator,
and also reading and writing of the seed. */
#define random_seed prefix(random_seed)
void
random_seed (GFC_INTEGER_4 * size, const gfc_array_i4 * put,
const gfc_array_i4 * get)

View file

@ -396,5 +396,11 @@ void internal_unpack_8 (gfc_array_i8 *, const GFC_INTEGER_8 *);
GFC_INTEGER_4 compare_string (GFC_INTEGER_4, const char *,
GFC_INTEGER_4, const char *);
/* random.c */
#define random_seed prefix(random_seed)
void random_seed (GFC_INTEGER_4 * size, const gfc_array_i4 * put,
const gfc_array_i4 * get);
#endif

View file

@ -100,6 +100,8 @@ init (void)
#endif
memory_init ();
random_seed(NULL,NULL,NULL);
}