Debian Codegraph @

gcc/testsuite/gcc.dg/vect/pr97678.c

raw
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_int_mult } */
3 /* { dg-require-effective-target vect_pack_trunc } */
4 /* { dg-additional-options "-mavx2" { target avx2_runtime } } */
5
6 #include "tree-vect.h"
7
8 int
9 main ()
10 {
11 unsigned int i = 0;
12 unsigned short b[158 * 2];
13
14 check_vect ();
15
16 for (i = 0; i < 158; i++)
17 {
18 b[i * 2] = i * 7;
19 b[i * 2 + 1] = i * 8;
20 }
21
22 #pragma GCC novector
23 for (i = 0; i < 158; ++i)
24 if (b[i*2] != (unsigned short)(i*7)
25 || b[i*2+1] != (unsigned short)(i*8))
26 abort ();
27
28 return 0;
29 }
30
31 /* The init loop should be vectorized with SLP. */
32 /* We don't yet support SLP inductions for variable length vectors. */
33 /* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "vect" { xfail vect_variable_length } } } */