diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/autopar/reduc-6.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/autopar/reduc-6.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-6.c b/gcc/testsuite/gcc.dg/autopar/reduc-6.c index f6d503c9be4..fface8fed35 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-6.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-6.c @@ -4,19 +4,26 @@ #include <stdarg.h> #include <stdlib.h> -#define N 16 -#define DIFF 242 +#define N 1600 +#define DIFF 2558402 + __attribute__ ((noinline)) int main1 (float x, float max_result) { int i; - float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + float b[N]; + float c[N]; float diff = 2; float max = x; float min = 10; + for (i=0; i<N; i++) + { + b[i] = i * 3; + c[i] = i; + } + for (i = 0; i < N; i++) { diff += (b[i] - c[i]); } @@ -42,14 +49,15 @@ int main1 (float x, float max_result) int main (void) { - main1 (100 ,100); - main1 (0, 15); + main1 (2000, 2000); + main1 (0, 1599); return 0; } + /* need -ffast-math to parallelize these loops. */ /* { dg-final { scan-tree-dump-times "Detected reduction" 0 "parloops" } } */ -/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */ +/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */ /* { dg-final { scan-tree-dump-times "FAILED: it is not a part of reduction" 3 "parloops" } } */ /* { dg-final { cleanup-tree-dump "parloops" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ |