Debian Codegraph @

gcc/testsuite/gcc.dg/vect/no-scevccp-outer-19.c

raw
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 64
7
8 unsigned short a[N];
9 unsigned int b[N];
10
11 __attribute__ ((noinline)) int
12 foo (){
13 unsigned short i,j;
14 unsigned short sum;
15
16 for (i = 0; i < N; i++) {
17 sum = 0;
18 for (j = 0; j < N; j++) {
19 sum += j;
20 }
21 a[i] = sum;
22 b[i] = (unsigned int)sum;
23 }
24 }
25
26 int main (void)
27 {
28 int i,j;
29 short sum;
30
31 check_vect ();
32
33 for (i=0; i<N; i++)
34 a[i] = i;
35
36 foo ();
37
38 /* check results: */
39 #pragma GCC novector
40 for (i=0; i<N; i++)
41 {
42 sum = 0;
43 for (j = 0; j < N; j++)
44 sum += j;
45 if (a[i] != sum || b[i] != (unsigned int)sum)
46 abort();
47 }
48
49 return 0;
50 }
51
52 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { ! {vect_unpack } } } } } */