Patchwork [testsuite] Avoid assuming argc != 0

login
register
mail settings
Submitter Richard Sandiford
Date Jan. 24, 2012, 7:24 p.m.
Message ID <87y5sw6h0l.fsf@firetop.home>
Download mbox | patch
Permalink /patch/137613/
State New
Headers show

Comments

Richard Sandiford - Jan. 24, 2012, 7:24 p.m.
Mike Stump <mikestump@comcast.net> writes:
> On Jan 23, 2012, at 11:13 AM, Richard Sandiford wrote:
>> One fix is attached.  Another would be to read from a volatile variable
>> that has been initialised to 1.  Other possibilities exist too of course.
>> 
>> Tested on mipsisa64-elf.  OK to install?
>
> Ok.  I have a preference for volatile (clearer intent)...

Yeah, me too.  Here's what I installed after retesting.

Thanks,
Richard


gcc/testsuite/
	* gcc.c-torture/execute/scal-to-vec1.c (one): New volatile variable.
	(main): Use it instead of argc.

Patch

Index: gcc/testsuite/gcc.c-torture/execute/scal-to-vec1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/scal-to-vec1.c	2012-01-24 18:57:39.000000000 +0000
+++ gcc/testsuite/gcc.c-torture/execute/scal-to-vec1.c	2012-01-24 19:08:12.000000000 +0000
@@ -24,13 +24,14 @@  #define veccompare(type, count, v0, v1)
     } \
 } while (0)
 
+volatile int one = 1;
 
 int main (int argc, char *argv[]) {
 #define fvec_2 (vector(4, float)){2., 2., 2., 2.}
 #define dvec_2 (vector(2, double)){2., 2.}
 
 
-    vector(8, short) v0 = {argc, 1,2,3,4,5,6,7};
+    vector(8, short) v0 = {one, 1, 2, 3, 4, 5, 6, 7};
     vector(8, short) v1;
 
     vector(4, float) f0 = {1., 2., 3., 4.};