libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-early-break_80.c
blob7f563b788ac7037adc7c629fb708e9a6885a6e93
1 /* { dg-add-options vect_early_break } */
2 /* { dg-require-effective-target vect_early_break_hw } */
3 /* { dg-require-effective-target vect_int } */
5 /* { dg-additional-options "-Ofast" } */
7 /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
9 #include "tree-vect.h"
11 extern void abort ();
13 int x;
14 __attribute__ ((noinline, noipa))
15 void foo (int *a, int *b)
17 int local_x = x;
18 for (int i = 0; i < 1024; ++i)
20 if (i + local_x == 13)
21 break;
22 a[i] = 2 * b[i];
26 int main ()
29 check_vect ();
31 int a[1024] = {0};
32 int b[1024] = {0};
34 for (int i = 0; i < 1024; i++)
35 b[i] = i;
37 x = -512;
38 foo (a, b);
40 if (a[524] != 1048)
41 abort ();
43 if (a[525] != 0)
44 abort ();
46 if (a[1023] != 0)
47 abort ();
48 return 0;