PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-live-3.c
blob3ffa5166f45e982088d7e66864c9c8df5d56c4dd
1 /* { dg-require-effective-target vect_int } */
3 #include "tree-vect.h"
5 /* Two Statements used outside the loop. SCEV cannot hoist the stmt. */
6 __attribute__ ((noinline)) int
7 liveloop (int start, int n, int *x, int *y)
9 int i = start;
10 int j;
11 int ret;
13 for (j = 0; j < n; ++j)
15 ret = x[j] + y[j];
16 i += 1;
17 x[j] = i;
19 return ret;
22 #define MAX 173
23 #define START 7
25 int
26 main (void)
28 int a[MAX];
29 int b[MAX];
30 int i;
32 check_vect ();
34 for (i=0; i<MAX; i++)
36 __asm__ volatile ("");
37 a[i] = i;
38 b[i] = i * 2;
41 int ret = liveloop (START, MAX, a, b);
43 if (ret != (MAX - 1) * 3)
44 abort ();
46 for (i=0; i<MAX; i++)
48 __asm__ volatile ("");
49 if (a[i] != i+START+1)
50 abort ();
54 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
55 /* { dg-final { scan-tree-dump-times "vec_stmt_relevant_p: stmt live but not relevant" 2 "vect" } } */