1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-vectorize" } */
3 
4 #define TYPE int
5 #define SIZE 257
6 
7 void __attribute__ ((weak))
f(TYPE * x,TYPE * y,unsigned short n,long m)8 f (TYPE *x, TYPE *y, unsigned short n, long m __attribute__((unused)))
9 {
10   for (int i = 0; i < SIZE; ++i)
11     x[i * n] += y[i * n];
12 }
13 
14 /* { dg-final { scan-assembler {\tld1w\tz[0-9]+} } } */
15 /* { dg-final { scan-assembler {\tst1w\tz[0-9]+} } } */
16 /* { dg-final { scan-assembler {\tldr\tw[0-9]+} } } */
17 /* { dg-final { scan-assembler {\tstr\tw[0-9]+} } } */
18 /* Should use a WAR check that multiplies by (VF-2)*4 rather than
19    an overlap check that multiplies by (257-1)*4.  */
20 /* { dg-final { scan-assembler {\tcntb\t(x[0-9]+)\n.*\tsub\tx[0-9]+, \1, #8\n.*\tmul\tx[0-9]+,[^\n]*\1} } } */
21 /* One range check and a check for n being zero.  */
22 /* { dg-final { scan-assembler-times {\t(?:cmp|tst)\t} 1 } } */
23 /* { dg-final { scan-assembler-times {\tccmp\t} 1 } } */
24