Add __builtion_unreachable to vector::size(), vector::capacity()
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-30.c
blob31c066a543c1adecb8693492fafcf55d0784e1f5
1 /* { dg-require-effective-target vect_float } */
2 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 16
9 float b[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
10 float a[N];
11 float c[N];
13 __attribute__ ((noinline))
14 int main1 (int n)
16 int i=0;
18 /* Vectorized: unknown loop bound. */
19 while (n--) {
20 a[i] = b[i];
21 i++;
24 /* check results: */
25 #pragma GCC novector
26 for (i = 0; i < n; i++)
28 if (a[i] != b[i])
29 abort ();
32 return 0;
35 __attribute__ ((noinline))
36 int main2 (unsigned int n)
38 int i=0;
39 int nn = n;
41 /* Vectorized: unknown loop bound. */
42 while (n--) {
43 c[i] = b[i];
44 i++;
47 /* check results: */
48 #pragma GCC novector
49 for (i = 0; i < nn; i++)
51 if (c[i] != b[i])
52 abort ();
55 return 0;
58 int main (void)
60 check_vect ();
62 main1 (N);
63 main2 (N);
64 return 0;
67 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
68 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */