From ce6a6ae17520d9b0fb88e5cb9b9789f93062c16f Mon Sep 17 00:00:00 2001 From: "Balaji V. Iyer" Date: Tue, 4 Jun 2013 16:44:22 +0000 Subject: [PATCH] Fix Cilk Plus tests for simulators. 2013-06-04 Balaji V. Iyer * 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. From-SVN: r199661 --- gcc/testsuite/ChangeLog | 43 +++++++++++++++++++ .../c-c++-common/cilk-plus/AN/array_test1.c | 18 +++----- .../c-c++-common/cilk-plus/AN/array_test2.c | 18 +++----- .../c-c++-common/cilk-plus/AN/array_test_ND.c | 23 ++++------ .../cilk-plus/AN/builtin_fn_custom.c | 2 +- .../cilk-plus/AN/builtin_fn_mutating.c | 2 +- .../cilk-plus/AN/builtin_func_double.c | 2 +- .../cilk-plus/AN/builtin_func_double2.c | 4 +- .../c-c++-common/cilk-plus/AN/comma_exp.c | 21 ++++----- .../c-c++-common/cilk-plus/AN/conditional.c | 4 +- .../c-c++-common/cilk-plus/AN/exec-once.c | 2 +- .../c-c++-common/cilk-plus/AN/exec-once2.c | 6 ++- .../c-c++-common/cilk-plus/AN/fn_ptr.c | 3 +- .../cilk-plus/AN/fp_triplet_values.c | 17 +------- .../cilk-plus/AN/gather-scatter-errors.c | 4 +- .../cilk-plus/AN/gather_scatter.c | 2 +- .../c-c++-common/cilk-plus/AN/if_test.c | 22 ++++------ .../c-c++-common/cilk-plus/AN/misc.c | 2 +- .../c-c++-common/cilk-plus/AN/parser_errors.c | 2 +- .../cilk-plus/AN/parser_errors2.c | 2 +- .../cilk-plus/AN/parser_errors3.c | 2 +- .../cilk-plus/AN/parser_errors4.c | 2 +- .../cilk-plus/AN/rank_mismatch2.c | 4 +- .../c-c++-common/cilk-plus/AN/sec_implicit.c | 17 +------- .../c-c++-common/cilk-plus/AN/sec_implicit2.c | 20 ++------- .../cilk-plus/AN/sec_implicit_ex.c | 2 +- .../cilk-plus/AN/sec_reduce_max_min_ind.c | 17 +------- .../cilk-plus/AN/sec_reduce_return.c | 6 ++- .../cilk-plus/AN/test_builtin_return.c | 4 +- gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c | 4 +- 30 files changed, 122 insertions(+), 155 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 451a488fc4e..d0b4700db3f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,46 @@ +2013-06-04 Balaji V. Iyer + + * 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. + 2013-06-04 Ian Bolton * gcc.target/aarch64/movi_1.c: New test. 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 bdd271a7730..e4f1ea8a73a 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 -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 bd7a4ad2b62..60f2de2834a 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 -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 1431c22b261..e89bbab268b 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 -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 8bdf1fd3ca1..c5d3d7c7530 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 34cbd2c4cc3..66355650920 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 c6b518e6229..0c05994ee30 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 */ /* 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 c8a3ed7880f..7337a5106d9 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 #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 bcb3e1b1612..845d916ab96 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 -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 0be99b2102b..07c50173bfb 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 -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 4b2a09f48b0..00b018a2c85 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 8d208b92c8f..d9f39dd66a8 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 1010920b3aa..024a1589994 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 cb504f309ed..b2ac7bcc85a 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 f4283dbf11f..f425fbec0f5 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 67e1c19d6cc..b11a40ed325 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 #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 53ceeecb75d..5544d4550aa 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 #endif #include -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 891e1dc5559..35eb11537d1 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 7b1aa89517f..a0a3742f5df 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 8bf2282088e..2e86b4f92da 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 824e18660fd..34dfa16dd81 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 25a8a8fb62c..eba28a81ce3 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 74fece4d172..4a4882dbae6 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 fe66cf87be0..bacbf350566 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 29f8c32d4a0..0aef0c29aca 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 c5f7cdf18e7..c22b818434a 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 4bd6030a61d..9652e1594b4 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 a72cfafba1c..034017146f3 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 0df324a80d4..b9f9f8d6507 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 038ae482df8..843745e384f 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." } */