libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr112774.c
blob2ada33b410e62240ee85c7ed9840c11894cdac10
1 /* PR tree-optimization/112774 */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target vect_int } */
4 /* { dg-additional-options "-O2 -ftree-vectorize" } */
6 int A[1024 * 2];
8 int foo (unsigned offset, unsigned N)
10 int sum = 0;
12 for (unsigned i = 0; i < N; i++)
13 sum += A[i + offset];
15 return sum;
18 /* Loop can be vectorized by referring "i + offset" is nonwrapping from array. */
19 /* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target { ! { avr-*-* msp430-*-* pru-*-* } } } } } */