PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr80815-3.c
blob50392ab1a417de2af81af6473bf0a85bd9eb7279
1 /* { dg-require-effective-target vect_int } */
3 #include "tree-vect.h"
4 int arr[2048];
5 int res[100] = { 2148, 2146, 2144, 2142, 2140, 2138, 2136, 2134, 2132, 2130,
6 2128, 2126, 2124, 2122, 2120, 2118, 2116, 2114, 2112, 2110,
7 2108, 2106, 2104, 2102, 2100, 2098, 2096, 2094, 2092, 2090,
8 2088, 2086, 2084, 2082, 2080, 2078, 2076, 2074, 2072, 2070,
9 2068, 2066, 2064, 2062, 2060, 2058, 2056, 2054, 3078, 2050};
11 __attribute__ ((noinline)) int
12 foo (int *a, int *b, int len)
14 int i;
15 int *a1 = a;
16 int *a0 = a1 - 4;
17 for (i = 0; i < len; i++)
19 *b = *a0 + *a1;
20 b--;
21 a0++;
22 a1++;
24 return 0;
27 int main (void)
29 int *a = &arr[1027];
30 int *b = &arr[1024];
32 int i;
33 for (i = 0; i < 2048; i++)
34 arr[i] = i;
36 foo (a, b, 50);
38 for (i = 975; i < 1025; i++)
39 if (arr[i] != res[i - 975])
40 abort ();
42 return 0;
45 /* { dg-final { scan-tree-dump "improved number of alias checks from \[0-9\]* to 1" "vect" { target vect_perm } } } */