Patchwork [PR50485,committed] Initialize variable in sse4_1-blendps{,-2}.c with random floats

login
register
mail settings
Submitter Tom de Vries
Date Sept. 28, 2011, 9:01 a.m.
Message ID <4E82E27D.1060109@mentor.com>
Download mbox | patch
Permalink /patch/116724/
State New
Headers show

Comments

Tom de Vries - Sept. 28, 2011, 9:01 a.m.
Committed as obvious.

Thanks,
- Tom

2011-09-28  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/50485
	* gcc.target/i386/sse4_1-blendps.c: Include <stdlib.h>.
	(TEST): Initialize src3 with random floats.
	* gcc.target/i386/sse4_1-blendps-2.c (sse4_1_test): Remove field i from
	union src3.  Initialize src3 with random floats.

Patch

Index: gcc/testsuite/gcc.target/i386/sse4_1-blendps.c
===================================================================
--- gcc/testsuite/gcc.target/i386/sse4_1-blendps.c (revision 179043)
+++ gcc/testsuite/gcc.target/i386/sse4_1-blendps.c (working copy)
@@ -14,6 +14,7 @@ 
 
 #include <smmintrin.h>
 #include <string.h>
+#include <stdlib.h>
 
 #define NUM 20
 
@@ -66,6 +67,9 @@  TEST (void)
 
   init_blendps (src1.f, src2.f);
 
+  for (i = 0; i < 4; i++)
+    src3.f[i] = (int) random ();
+
   /* Check blendps imm8, m128, xmm */
   for (i = 0; i < NUM; i++)
     {
Index: gcc/testsuite/gcc.target/i386/sse4_1-blendps-2.c
===================================================================
--- gcc/testsuite/gcc.target/i386/sse4_1-blendps-2.c (revision 179043)
+++ gcc/testsuite/gcc.target/i386/sse4_1-blendps-2.c (working copy)
@@ -53,14 +53,13 @@  sse4_1_test (void)
     {
       __m128 x;
       float f[4];
-      int i[4];
     } src3;
   int i;
 
   init_blendps (src1.f, src2.f);
 
   for (i = 0; i < 4; i++)
-    src3.i[i] = (int) random ();
+    src3.f[i] = (int) random ();
 
   /* Check blendps imm8, m128, xmm */
   for (i = 0; i < NUM; i++)