Patchwork [testsuite,cilk] Fix cilk tests for simulators

login
register
mail settings
Submitter Iyer, Balaji V
Date June 4, 2013, 4:30 p.m.
Message ID <BF230D13CA30DD48930C31D4099330003A42AC2A@FMSMSX101.amr.corp.intel.com>
Download mbox | patch
Permalink /patch/248711/
State New
Headers show

Comments

Iyer, Balaji V - June 4, 2013, 4:30 p.m.
> -----Original Message-----
> From: Steve Ellcey [mailto:sellcey@mips.com]
> Sent: Monday, June 03, 2013 6:31 PM
> To: Jeff Law
> Cc: Iyer, Balaji V; gcc-patches@gcc.gnu.org
> Subject: Re: [patch, testsuite, cilk] Fix cilk tests for simulators
> 
> On Mon, 2013-06-03 at 13:47 -0600, Jeff Law wrote:
> > On 06/03/2013 01:27 PM, Iyer, Balaji V wrote:
> > >
> > > I am OK with Steve's changes in most cases. In a few cases, I am
> > > using it as a parameter to pass into tests. On a top-level, the main
> > > reason why I used argc, and argv is that, I want to make sure the
> > > compiler will never do things like constant propagation, and it will
> > > pass it as a variable.
> > So use Jakub's trick, or define non-inlinable functions which return
> > suitable tables.
> >
> > We simply can't use argc/argv in the manner in which those tests do
> > and I'd rather clean up the test to avoid argc/argv than support two
> > paths through the test, one with argc/argv, one without.
> >
> > jeff
> 
> I'll leave fixing the tests to Balaji then instead of doing it myself since that way
> he can be sure that they are testing what he wants to test.

Attached, please find a patch that will remove the cilk plus array notation test's dependency on argc and argv of main function. Here is the changelog entry.

2013-06-04  Balaji V. Iyer  <balaji.v.iyer@intel.com>

        * c-c++-common/cilk-plus/AN/array_test1.c (main): Replaced argc, argv
        parameters with void.
        (main2): Removed argc parameter.
        * c-c++-common/cilk-plus/AN/array_test2.c (main2): Likewise.
        (main): Replaced argc, argv parameters with void.
        * c-c++-common/cilk-plus/AN/array_test_ND.c (main): Likewise.
        (main2): Removed argc parameter.
        * c-c++-common/cilk-plus/AN/builtin_fn_custom.c (main): Replaced argc
        argv parameters with void.  Added __asm volatile to avoid optimization
        on argc, if necessary.
        * c-c++-common/cilk-plus/AN/builtin_fn_mutating (main): Likewise.
        * c-c++-common/cilk-plus/AN/builtin_func_double.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/builtin_func_double2.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/conditional.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/exec-once.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/exec-once2.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/fn_ptr.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/gather-scatter-errors.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/gather_scatter.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/misc.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/parser_errors.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/parser_errors2.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/parser_errors3.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/parser_errors4.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/rank_mismatch2.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/sec_implicit_ex.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/sec_reduce_return.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/test_builtin_return.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/vla.c (main): Likewise.
        * c-c++-common/cilk-plus/AN/comma-exp.c (main): Replaced argc, argv
        parameters with void.
        (main2): Removed argc parameter.
        * c-c++-common/cilk-plus/AN/if_test.c (main2): Likewise.
        (main): Replaced argc, argv parameters with void.
        * c-c++-common/cilk-plus/AN/fp_triplet_values (main2): Replace argc,
        argv parameters with void.  Also renamed this function as main, and
        delete the existing main.
        * c-c++-common/cilk-plus/AN/sec_implicit.c (main2): Likewise.
        * c-c++-common/cilk-plus/AN/sec_implicit2.c (main2): Likewise.
        * c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c (main2): Likewise.


So, is it Ok for trunk?

Thanks,

Balaji V. Iyer.


> 
> Steve Ellcey
> sellcey@mips.com
>
Jeff Law - June 4, 2013, 4:35 p.m.
On 06/04/2013 10:30 AM, Iyer, Balaji V wrote:
>> -----Original Message-----
>> From: Steve Ellcey [mailto:sellcey@mips.com]
>> Sent: Monday, June 03, 2013 6:31 PM
>> To: Jeff Law
>> Cc: Iyer, Balaji V; gcc-patches@gcc.gnu.org
>> Subject: Re: [patch, testsuite, cilk] Fix cilk tests for simulators
>>
>> On Mon, 2013-06-03 at 13:47 -0600, Jeff Law wrote:
>>> On 06/03/2013 01:27 PM, Iyer, Balaji V wrote:
>>>>
>>>> I am OK with Steve's changes in most cases. In a few cases, I am
>>>> using it as a parameter to pass into tests. On a top-level, the main
>>>> reason why I used argc, and argv is that, I want to make sure the
>>>> compiler will never do things like constant propagation, and it will
>>>> pass it as a variable.
>>> So use Jakub's trick, or define non-inlinable functions which return
>>> suitable tables.
>>>
>>> We simply can't use argc/argv in the manner in which those tests do
>>> and I'd rather clean up the test to avoid argc/argv than support two
>>> paths through the test, one with argc/argv, one without.
>>>
>>> jeff
>>
>> I'll leave fixing the tests to Balaji then instead of doing it myself since that way
>> he can be sure that they are testing what he wants to test.
>
> Attached, please find a patch that will remove the cilk plus array notation test's dependency on argc and argv of main function. Here is the changelog entry.
>
> 2013-06-04  Balaji V. Iyer  <balaji.v.iyer@intel.com>
>
>          * c-c++-common/cilk-plus/AN/array_test1.c (main): Replaced argc, argv
>          parameters with void.
>          (main2): Removed argc parameter.
>          * c-c++-common/cilk-plus/AN/array_test2.c (main2): Likewise.
>          (main): Replaced argc, argv parameters with void.
>          * c-c++-common/cilk-plus/AN/array_test_ND.c (main): Likewise.
>          (main2): Removed argc parameter.
>          * c-c++-common/cilk-plus/AN/builtin_fn_custom.c (main): Replaced argc
>          argv parameters with void.  Added __asm volatile to avoid optimization
>          on argc, if necessary.
>          * c-c++-common/cilk-plus/AN/builtin_fn_mutating (main): Likewise.
>          * c-c++-common/cilk-plus/AN/builtin_func_double.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/builtin_func_double2.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/conditional.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/exec-once.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/exec-once2.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/fn_ptr.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/gather-scatter-errors.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/gather_scatter.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/misc.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/parser_errors.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/parser_errors2.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/parser_errors3.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/parser_errors4.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/rank_mismatch2.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/sec_implicit_ex.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/sec_reduce_return.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/test_builtin_return.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/vla.c (main): Likewise.
>          * c-c++-common/cilk-plus/AN/comma-exp.c (main): Replaced argc, argv
>          parameters with void.
>          (main2): Removed argc parameter.
>          * c-c++-common/cilk-plus/AN/if_test.c (main2): Likewise.
>          (main): Replaced argc, argv parameters with void.
>          * c-c++-common/cilk-plus/AN/fp_triplet_values (main2): Replace argc,
>          argv parameters with void.  Also renamed this function as main, and
>          delete the existing main.
>          * c-c++-common/cilk-plus/AN/sec_implicit.c (main2): Likewise.
>          * c-c++-common/cilk-plus/AN/sec_implicit2.c (main2): Likewise.
>          * c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c (main2): Likewise.
>
>
> So, is it Ok for trunk?
Yes.  This is fine for the trunk.

Funny, it looks like we were both waiting on Steve's feedback from your 
updated test.

Jeff

Patch

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
old mode 100644
new mode 100755
index e0f75fd..5a2f360
Binary files a/gcc/testsuite/ChangeLog and b/gcc/testsuite/ChangeLog differ
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test1.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test1.c
index bdd271a..e4f1ea8 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test1.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test1.c
@@ -3,23 +3,17 @@ 
 
 #include <stdlib.h>
 
-int main2 (int argc, char **argv);
+int main2 (char **argv);
 
-int main(int argc, char **argv)
+int main(void)
 {
-  int x = 0;
-  if (argc == 1)
-    {
-      const char *array[] = {"a.out", "5"};	     
-      x = main2 (2, (char **)array);
-    }
-  else
-    x = main2 (argc, argv);
-      
+  int x = 0; 
+  const char *array[] = {"a.out", "5"};	     
+  x = main2 ((char **)array);
   return x;
 }
 
-int main2 (int argc, char **argv)
+int main2 (char **argv)
 {
   int array[10], ii = 0, x = 2, z= 0 , y = 0 ;
   for (ii = 0; ii < 10; ii++)
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test2.c
index bd7a4ad..60f2de2 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test2.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test2.c
@@ -2,23 +2,17 @@ 
 /* { dg-options "-fcilkplus" } */
 
 #include <stdlib.h>
-int main2(int argc, char **argv);
-int main(int argc, char **argv)
+int main2 (char **argv);
+int main(void)
 {
-  int x = 0;
-  if (argc == 1)
-    {
-      const char *array[] = {"a.out", "5"};	     
-      x = main2 (2, (char **)array);
-    }
-  else
-    x = main2 (argc, argv);
-      
+  int x = 0; 
+  const char *array[] = {"a.out", "5"};	     
+  x = main2 ((char **)array);
   return x;
 }
 
 
-int main2(int argc, char **argv)
+int main2(char **argv)
 {
   int array[10], array2[10], ii = 0, x = 2, z= 0 , y = 0 ;
 
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test_ND.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test_ND.c
index 1431c22..e89bbab 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test_ND.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test_ND.c
@@ -2,28 +2,21 @@ 
 /* { dg-options "-fcilkplus" } */
 
 #include <stdlib.h>
-int main2(int argc, char **argv);
-int main(int argc, char **argv)
+int main2(char **argv);
+int main(void)
 {
-  int x = 0;
-  if (argc == 1)
-    {
-      const char *array[] = {"a.out", "10", "15"};	     
-      x = main2 (3, (char **)array);
-    }
-  else if (argc == 3)
-    x = main2 (argc, argv);
-  else
-    return 1;
-      
+  int x = 0; 
+  const char *array[] = {"a.out", "10", "15"};	     
+  x = main2 ((char **)array);
   return x;
 }
 
-int main2(int argc, char **argv)
+int main2(char **argv)
 {  
   int array[10][15], ii = 0, jj = 0,x = 0, z= 1 , y = 10 ;
   int array_2[10][15];
- 
+  int argc = 3;
+  __asm volatile ("" : "+r" (argc));
 
   for (ii = 0; ii < 10; ii++) {
     for (jj = 0; jj< 15; jj++) {
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_custom.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_custom.c
index 8bdf1fd..c5d3d7c 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_custom.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_custom.c
@@ -16,7 +16,7 @@  double my_func (double x, double y)
 
 
 /* char __sec_reduce_add (int *); */
-int main(int argc, char **argv)
+int main(void)
 {
   int ii,array[10], y = 0, y_int = 0, array2[10];
   double x, yy, array3[10], array4[10];
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_mutating.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_mutating.c
index 34cbd2c..6635565 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_mutating.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_mutating.c
@@ -13,7 +13,7 @@  void my_func (double *x, double y)
 }
 
 
-int main(int argc, char **argv)
+int main(void)
 {
   int ii,array[10], y = 0, y_int = 0, array2[10];
   double x = 0.000, yy, array3[10], array4[10];
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double.c
index c6b518e..0c05994 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double.c
@@ -4,7 +4,7 @@ 
 /* #include <stdlib.h> */
 
 /* char __sec_reduce_add (int *); */
-int main(int argc, char **argv)
+int main(void)
 {
   int ii,array[10], y = 0, y_int = 0, array2[10];
   double x, yy, array3[10], array4[10];
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double2.c
index c8a3ed7..7337a51 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double2.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double2.c
@@ -5,8 +5,9 @@ 
 #include <stdio.h>
 #endif
 
-int main(int argc, char **argv)
+int main(void)
 {
+  int argc = 1;
   int ii,array[10], y = 0, y_int = 0, array2[10], y_int2=0, y2=0;
   double x, yy, array3[10], array4[10];
   int all_zero, all_nonzero, any_zero, any_nonzero;
@@ -20,6 +21,7 @@  int main(int argc, char **argv)
 	array3[ii] = (double) ii + 0.00;
       array4[ii] = (double) (1.00000/ (double)(ii+1));
     }
+  __asm volatile ("" : "+r" (argc));
   y_int = __sec_reduce_any_nonzero (array3[:] + array[4]); 
   y_int2 = __sec_reduce_any_zero (array3[:] + array[4]); 
   y = __sec_reduce_all_nonzero ((array3[:] + array4[:]) * (argc-1)); 
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/comma_exp.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/comma_exp.c
index bcb3e1b..845d916 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/comma_exp.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/comma_exp.c
@@ -3,25 +3,20 @@ 
 
 #include <stdlib.h>
 
-int main2 (int argc, char **argv);
-int main(int argc, char **argv)
+int main2 (char **argv);
+int main(void)
 {
-  int x = 0;
-  if (argc == 1)
-    {
-      const char *array[] = {"a.out", "5"};	     
-      x = main2 (2, (char **)array);
-    }
-  else
-    x = main2 (argc, argv);
-      
+  int x = 0; 
+  const char *array[] = {"a.out", "5"};	     
+  x = main2 ((char **)array);
   return x;
 }
 
-int main2 (int argc, char **argv)
+int main2 (char **argv)
 {
+  int argc = 2;
   int array[10], array2[10], ii = 0, x = 2, z= 0 , y = 0 ;
-
+  __asm volatile ("" : "+r" (argc));
   for (ii = 0; ii < 10; ii++)
     array[ii] = 10;
 
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/conditional.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/conditional.c
index 0be99b2..07c5017 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/conditional.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/conditional.c
@@ -2,10 +2,12 @@ 
 /* { dg-options "-fcilkplus" } */
 
 #include <stdlib.h>
-int main(int argc, char **argv)
+int main(void)
 {
+  int argc = 1;
   short array[1000], array2[1000], *array3, cond[1000], ii = 0;
 
+  __asm volatile ("" : "+r" (argc));
   for (ii = 0; ii < 1000; ii++) {
     cond[ii] = 1;
     array[ii] = 1000;
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once.c
index 4b2a09f..00b018a 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once.c
@@ -17,7 +17,7 @@  int func (int *x)
 #endif
    return *x;
 }
-int main (int argc, char **argv)
+int main (void)
 {
   char array[NUMBER], array2[NUMBER];
   int ii, d = 2;
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once2.c
index 8d208b9..d9f39dd 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once2.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once2.c
@@ -35,11 +35,13 @@  int func4(int x)
 
 
 /* This program makes an assumption that argc == 1.  */
-int main (int argc, char **argv)
+int main (void)
 {
-
+  int argc = 1;
   int array[2500];
 
+  /* This is done to make sure the compiler does not optimize out argc.  */
+  __asm volatile ("" : "+r" (argc));
   /* This should set array[0->999] to 5.  */
   array[argc-1:func2(++argc):1] = 5;
   array[1000:500:1] = 10; /* set all variables in array[1000-->1499] to 10.  */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr.c
index 1010920..024a158 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr.c
@@ -2,12 +2,13 @@ 
 
 typedef int (*foo)(int);
 
-int main(int argc, char **argv)
+int main(void)
 {
   int array[10], array2[10][10];
   foo func_array[10];
   foo func_array2[10][10];
   foo ***func_array_ptr;
+  int argc = 5;
 
   array[:] =  func_array[:](10); /* { dg-error "array notations cannot be used with function pointer arrays" } */
   func_array[0:5](10); /* { dg-error "array notations cannot be used with function pointer arrays" } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/fp_triplet_values.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/fp_triplet_values.c
index cb504f3..b2ac7bc 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/fp_triplet_values.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/fp_triplet_values.c
@@ -3,27 +3,12 @@ 
 
 float q;
 
-int main2 (int argc, char **argv);
-int main (int argc, char **argv)
-{
-  int x = 0;
-  if (argc == 1)
-    {
-      const char *array[] = {"a.out", "5"};
-      x = main2 (2, (char **)array);
-    }
-  else
-    x = main2 (argc, argv);
-
-  return x;
-}
-
 void func (int *x)
 {
   *x = 5;
 }
 
-int main2 (int argc, char **argv)
+int main (void)
 {
   int array[10], array2[10];
   array2[:] = array[1.5:2]; /* { dg-error "start-index of array notation triplet is not an integer" } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c
index f4283db..f425fbe 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c
@@ -1,10 +1,10 @@ 
 /* { dg-options "-fcilkplus" } */
 
-int main (int argc, char **argv)
+int main (void)
 {
   extern int func (int);
   int array[10][10], array2[10];
-
+  int argc = 1;
   array2[array[:][:]] = 5; /* { dg-error "rank of the array's index is greater than 1" } */
 
   array2[array[:][:]] = 5; /* { dg-error "rank of the array's index is greater than 1" } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/gather_scatter.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/gather_scatter.c
index 67e1c19..b11a40e 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/gather_scatter.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/gather_scatter.c
@@ -5,7 +5,7 @@ 
 #include <stdio.h>
 #endif
 
-int main(int argc, char **argv)
+int main(void)
 {
   int array[10][10], array2[10], array3[10], x = 0, y;
   int x_correct, y_correct, ii, jj = 0;
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test.c
index 53ceeec..5544d45 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test.c
@@ -5,31 +5,25 @@ 
 #include <stdio.h>
 #endif
 #include <stdlib.h>
-int main2 (int argc, char **argv);
+int main2 (char **argv);
 int main(int argc, char **argv)
 {
-  int x = 0;
-  if (argc == 1)
-    {
-      const char *array[] = {"a.out", "10", "15"};	     
-      x = main2 (3, (char **) array);
-    }
-  else if (argc == 3)
-    x = main2 (argc, argv);
-  else
-    return 1;
- 
+  int x = 0; 
+  const char *array[] = {"a.out", "10", "15"};	     
+  x = main2 ((char **) array);
   return x;
 }
 
 
-int main2 (int argc, char **argv)
+int main2 (char **argv)
 {
   int x = 3, y, z, array[10], array2[10], TwodArray[10][10], jj,kk,ll ;
   int array2_check[10], array2d_check[10][10], array2d[10][10];
   int FourDArray[10][10][10][10], array4[10][10][10][10];
   int array4_check[10][10][10][10];
-  int ii = 0; 
+  int ii = 0, argc = 3; 
+    
+  __asm volatile ("" : "+r" (argc));
 
   for (ii = 0; ii < 10; ii++)
     {
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/misc.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/misc.c
index 891e1dc..35eb115 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/misc.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/misc.c
@@ -1,7 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-options "-fcilkplus" } */
 
-int main (int argc, char **argv)
+int main (void)
 {
   int array[10], array2[10][10];
   int x, ii, jj ;
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors.c
index 7b1aa89..a0a3742 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors.c
@@ -1,7 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-options "-fcilkplus" } */
 
-int main (int argc, char **argv)
+int main (void)
 {
   int array[10][10], array2[10];
   
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors2.c
index 8bf2282..2e86b4f 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors2.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors2.c
@@ -1,7 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-options "-fcilkplus" } */
 
-int main (int argc, char **argv)
+int main (void)
 {
   int array[10][10], array2[10];
   
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors3.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors3.c
index 824e186..34dfa16 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors3.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors3.c
@@ -1,7 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-options "-fcilkplus" } */
 
-int main (int argc, char **argv)
+int main (void)
 {
   int array[10][10], array2[10];
   
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors4.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors4.c
index 25a8a8f..eba28a8 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors4.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors4.c
@@ -1,7 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-options "-fcilkplus" } */
 
-int main (int argc, char **argv)
+int main (void)
 {
   int array[10][10], array2[10];
   
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch2.c
index 74fece4..4a4882d 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch2.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch2.c
@@ -7,10 +7,10 @@  int function_call (int x)
   return x;
 }
 
-int main(int argc, char **argv)
+int main (void)
 {
   int array[100], array2[100][100];
-
+  int argc = 4;
   array[:] = array[:] + array2[:][:]; /* { dg-error "rank mismatch between" } */
 
   if (array[:] + array2[:][:]) /* { dg-error "rank mismatch between" } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit.c
index fe66cf8..bacbf35 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit.c
@@ -1,22 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-options "-fcilkplus" } */
 
-int main2 (int argc, char **argv);
-int main (int argc, char **argv)
-{
-  int x = 0;
-  if (argc == 1)
-    {
-      const char *array[] = {"a.out", "5"};
-      x = main2 (2, (char **)array);
-    }
-  else
-    x = main2 (argc, argv);
-
-  return x;
-}
-
-int main2 (int argc, char **argv)
+int main (void)
 {
   int array[10][10], array2[10];
 
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit2.c
index 29f8c32..0aef0c2 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit2.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit2.c
@@ -1,25 +1,11 @@ 
 /* { dg-do compile } */
 /* { dg-options "-fcilkplus" } */
 
-int main2 (int argc, char **argv);
-int main (int argc, char **argv)
-{
-  int x = 0;
-  if (argc == 1)
-    {
-      const char *array[] = {"a.out", "5"};
-      x = main2 (2, (char**)array);
-    }
-  else
-    x = main2 (argc, argv);
-
-  return x;
-}
-
-int main2 (int argc, char **argv)
+int main (void)
 {
+  int argc = 2;
   int array[10][10], array2[10];
-
+  __asm volatile ("" : "+r" (argc));
   array[:][:] = __sec_implicit_index(argc) + array[:][:]; /* { dg-error "__sec_implicit_index parameter" } */
   return 0;
 }
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit_ex.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit_ex.c
index c5f7cdf..c22b818 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit_ex.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit_ex.c
@@ -5,7 +5,7 @@  void abort (void);
 void exit  (int);
 
 
-int main(int argc, char **argv)
+int main(void)
 {
   int jj, kk, array_3C[10][10][10];
   int ii,array[10], y = 0, y_int = 0, array2[10], array_3[10][10][10];
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c
index 4bd6030..9652e15 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c
@@ -1,22 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-options "-fcilkplus" } */
 
-int main2 (int argc, char **argv);
-int main (int argc, char **argv)
-{
-  int x = 0;
-  if (argc == 1)
-    {
-      const char *array[] = {"a.out", "5"};
-      x = main2 (2, (char **)array);
-    }
-  else
-    x = main2 (argc, argv);
-
-  return x;
-}
-
-int main2 (int argc, char **argv)
+int main (void)
 {
   int array[10][10], array2[10];
   int x, y;
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_return.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_return.c
index a72cfaf..0340171 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_return.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_return.c
@@ -11,10 +11,12 @@  int mult_all (int *my_array, int size)
   return __sec_reduce_mul (my_array[0:size]);
 }
 
-int main (int argc, char **argv)
+int main (void)
 {
+  int argc = 1;
   int array[10000];
-
+  
+  __asm volatile ("" : "+r" (argc));
   array[:] = argc; /* All elements should be one.  */
 
   if (add_all (array, 10000) != 10000)
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/test_builtin_return.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/test_builtin_return.c
index 0df324a..b9f9f8d 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/test_builtin_return.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/test_builtin_return.c
@@ -28,11 +28,13 @@  int func4 (int *a1, int *a2)
 {
   return a1[NUMBER-1] * (__sec_reduce_add (a1[0:NUMBER] * a2[0:NUMBER]) + a2[0] + a2[1] + a2[3])/a1[NUMBER-2];
 }
-int main(int argc, char **argv)
+int main(void)
 {
   int array[NUMBER], array2[NUMBER];
   int return_value = 0;
   int ii = 0;
+  int argc = 1;
+  __asm volatile ("" : "+r" (argc));
   for (ii = 0; ii < NUMBER; ii++)
     {
       array[ii] = argc; /* This should calculate to 1.  */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c
index 038ae48..843745e 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c
@@ -5,8 +5,10 @@  int func (int x)
 {
   return x++;
 }
-int main(int argc, char **argv)
+int main(void)
 {
+  int argc = 1;
+  __asm volatile ("" : "+r" (argc));
   int array[argc];
 
   array[:] = 5; /* { dg-error "start-index and length fields necessary for using array notations in variable-length arrays." }  */