2018-01-16 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-nb-iter-ub-1.c
blob75b210c1a21c56c114f25b354fb368bdbe9462d5
1 /* { dg-additional-options "-fdump-tree-cunroll-details" } */
3 #include "tree-vect.h"
5 int ii[31];
6 char cc[31] =
7 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
8 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 };
10 void __attribute__((noinline,noclone))
11 foo (int s)
13 int i;
14 for (i = 0; i < s; i++)
15 ii[i] = (int) cc[i];
18 int main (int argc, const char **argv)
20 int i;
21 check_vect ();
22 foo (31);
23 for (i = 0; i < 31; i++)
24 if (ii[i] != i)
25 __builtin_abort ();
28 /* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target { i?86-*-* x86_64-*-* } } } } */
29 /* { dg-final { scan-tree-dump "loop turned into non-loop; it never loops" "cunroll" { target { i?86-*-* x86_64-*-* } } } } */
30 /* { dg-final { scan-tree-dump-not "loop with 2 iterations completely unrolled" "cunroll" { target { i?86-*-* x86_64-*-* } } } } */