Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / gen-vect-25.c
blobe7cb925e832e85ac74f19508fc5d058163fef705
1 /* { dg-do run { target vect_cmdline_needed } } */
2 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4 -fdump-tree-vect-stats" } */
3 /* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4 -fdump-tree-vect-stats -mno-sse" { target { i?86-*-* x86_64-*-* } } } */
5 #include <stdlib.h>
7 #define N 128
9 #if __LONG_MAX__ == 2147483647
10 typedef short half_word;
11 #else
12 typedef int half_word;
13 #endif
15 int main_1 (int n, int *p)
17 int i;
18 half_word ib[N];
19 half_word ia[N];
20 int k;
22 for (i = 0; i < N; i++)
24 ia[i] = n;
27 /* check results: */
28 for (i = 0; i < N; i++)
30 if (ia[i] != n)
31 abort ();
34 k = *p;
35 for (i = 0; i < N; i++)
37 ib[i] = k;
40 /* check results: */
41 for (i = 0; i < N; i++)
43 if (ib[i] != k)
44 abort ();
47 return 0;
50 int main (int n)
52 return main_1 (n + 2, &n);
55 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
56 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
57 /* { dg-final { cleanup-tree-dump "vect" } } */