[testsuite] Avoid assuming argc != 0

Richard Sandiford rdsandiford@googlemail.com
Tue Jan 24 19:24:00 GMT 2012


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.

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.};



More information about the Gcc-patches mailing list