OSDN Git Service

PR tree-optimization/35982
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-vect-iv-3.c
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_int } */
3
4 #include <stdarg.h>
5 #include "tree-vect.h"
6
7 #define N 26
8  
9 __attribute__ ((noinline))
10 unsigned int main1 ()
11 {  
12   unsigned short i;
13   unsigned int intsum = 0;
14
15   /* vectorization of reduction with induction, and widenning sum: 
16      sum shorts into int. 
17      Need -fno-tree-scev-cprop or else the loop is eliminated.  */
18   for (i = 0; i < N; i++)
19     {
20       intsum += i;
21     } 
22
23   return intsum;
24 }
25
26 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_sum_hi_to_si } } } */
27 /* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" { target vect_widen_sum_hi_to_si } } } */
28 /* { dg-final { cleanup-tree-dump "vect" } } */