OSDN Git Service

PR fortran/15149
authorbdavis <bdavis@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 May 2004 12:21:22 +0000 (12:21 +0000)
committerbdavis <bdavis@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 May 2004 12:21:22 +0000 (12:21 +0000)
        * 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81836 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.fortran-torture/execute/random_init.f90 [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/intrinsics/random.c
libgfortran/libgfortran.h
libgfortran/runtime/main.c

index 4ac96da..c3a6288 100644 (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
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/random_init.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/random_init.f90
new file mode 100644 (file)
index 0000000..3639458
--- /dev/null
@@ -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
+
+
index 7df9edf..bbf22d4 100644 (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
index b578148..120c951 100644 (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)
index 14a217a..112fd07 100644 (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
 
index 60c032b..e3eaf2b 100644 (file)
@@ -100,6 +100,8 @@ init (void)
 #endif
 
   memory_init ();
+  random_seed(NULL,NULL,NULL);
+
 }