Remove outermost loop parameter.
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / vect / slp-reduc-4.c
blobb7b97a710e4837dd9146b241920929cf3acadb11
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include <stdio.h>
5 #include "tree-vect.h"
7 #define N 128
9 unsigned int uc[N];
11 /* Vectorization of reduction using loop-aware SLP. */
13 __attribute__ ((noinline))
14 int main1 (int n, int res0, int res1, int res2, int res3, int res4, int res5, int res6, int res7)
16 int i;
17 unsigned int max0 = 5, max1 = 10, max2 = 20, max3 = 30, max4 = 2, max5 = 13, max6 = 7, max7 = 313;
19 for (i = 0; i < n; i++) {
20 max2 = max2 < uc[8*i+2] ? uc[8*i+2] : max2;
21 max3 = max3 < uc[8*i+3] ? uc[8*i+3] : max3;
22 max1 = max1 < uc[8*i+1] ? uc[8*i+1] : max1;
23 max7 = max7 < uc[8*i+7] ? uc[8*i+7] : max7;
24 max6 = max6 < uc[8*i+6] ? uc[8*i+6] : max6;
25 max0 = max0 < uc[8*i] ? uc[8*i] : max0;
26 max4 = max4 < uc[8*i+4] ? uc[8*i+4] : max4;
27 max5 = max5 < uc[8*i+5] ? uc[8*i+5] : max5;
30 /* Check results: */
31 if (max0 != res0
32 || max1 != res1
33 || max2 != res2
34 || max3 != res3
35 || max4 != res4
36 || max5 != res5
37 || max6 != res6
38 || max7 != res7)
39 abort ();
41 return 0;
44 int main (void)
46 int i;
48 check_vect ();
50 for (i = 0; i < N; i++)
52 uc[i] = i+3;
53 __asm__ volatile ("");
56 main1 (N/8, 123, 124, 125, 126, 127, 128, 129, 313);
57 return 0;
60 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_int_max } } } */
61 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_int_max } } } */
62 /* { dg-final { cleanup-tree-dump "vect" } } */