diff mbox

[RFA/testsuite] Update gcc.dg/vshift-*.c tests to use rand and not random

Message ID 4ECA66BD.10105@arm.com
State New
Headers show

Commit Message

Matthew Gretton-Dann Nov. 21, 2011, 2:57 p.m. UTC
All,

[Apologies to those getting this twice - used wrong account to send it 
initially].

The attached patch updates the gcc.dg/vshift-*.c tests to call the 
function rand and not random, as random is not available on all targets, 
but rand should be as it is in the Standard C Library.

Can someone please review the patch?

Thanks,

Matt

gcc/testsuite/ChangeLog:

2011-11-21  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>

	* gcc.dg/vshift-1.c (main): Call rand instead of random.
	* gcc.dg/vshift-3.c (main): Likewise.
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/vshift-1.c b/gcc/testsuite/gcc.dg/vshift-1.c
index 2a237aa..2220ad5 100644
--- a/gcc/testsuite/gcc.dg/vshift-1.c
+++ b/gcc/testsuite/gcc.dg/vshift-1.c
@@ -94,10 +94,10 @@  main ()
   for (i = 0; i < N; i++)
     {
       asm ("");
-      c[i] = (random () << 1) | (random () & 1);
+      c[i] = (rand () << 1) | (rand () & 1);
       b[i] = (i * 85) & (sizeof (TYPE1) * __CHAR_BIT__ - 1);
       a[i] = c[i];
-      d[i] = (random () << 1) | (random () & 1);
+      d[i] = (rand () << 1) | (rand () & 1);
       d[i] |= (unsigned long long) c[i] << 32;
       e[i] = (i * 85) & (sizeof (TYPE2) * __CHAR_BIT__ - 1);
       f[i] = d[i];
diff --git a/gcc/testsuite/gcc.dg/vshift-3.c b/gcc/testsuite/gcc.dg/vshift-3.c
index e62c76b..367e660 100644
--- a/gcc/testsuite/gcc.dg/vshift-3.c
+++ b/gcc/testsuite/gcc.dg/vshift-3.c
@@ -100,9 +100,9 @@  main ()
   for (i = 0; i < N; i++)
     {
       asm ("");
-      c[i] = (random () << 1) | (random () & 1);
+      c[i] = (rand () << 1) | (rand () & 1);
       a[i] = c[i];
-      d[i] = (random () << 1) | (random () & 1);
+      d[i] = (rand () << 1) | (rand () & 1);
       d[i] |= (unsigned long long) c[i] << 32;
       f[i] = d[i];
     }