1 /* { dg-require-effective-target vect_int } */ 2 3 #include <stdarg.h> 4 #include "tree-vect.h" 5 6 #define N 128 7 8 int c[N]; 9 10 /* Vectorization of reduction using loop-aware SLP. */ 11 12 __attribute__ ((noinline)) main1(int n,int res0,int res1)13int main1 (int n, int res0, int res1) 14 { 15 int i; 16 int max0 = -100, max1 = -313; 17 18 for (i = 0; i < n; i++) { 19 max1 = max1 < c[2*i+1] ? c[2*i+1] : max1; 20 max0 = max0 < c[2*i] ? c[2*i] : max0; 21 } 22 23 /* Check results: */ 24 if (max0 != res0 25 || max1 != res1) 26 abort (); 27 28 return 0; 29 } 30 main(void)31int main (void) 32 { 33 int i; 34 35 check_vect (); 36 37 for (i = 0; i < N; i++) 38 c[i] = (i+3) * -1; 39 40 c[0] = c[1] = -100; 41 main1 (N/2, -5, -6); 42 return 0; 43 } 44 45 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail vect_no_int_min_max } } } */ 46 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_int_min_max } } } */ 47 48