Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-early-break-template_1.c

raw
1 #include "tree-vect.h"
2
3 #ifndef N
4 #define N 803
5 #endif
6
7 #ifndef P
8 #define P 0
9 #endif
10
11 unsigned vect_a[N] = {0};
12 unsigned vect_b[N] = {0};
13
14 __attribute__((noipa, noinline))
15 unsigned test4(unsigned x)
16 {
17 unsigned ret = 0;
18 for (int i = 0; i < N; i++)
19 {
20 vect_b[i] = x + i;
21 if (vect_a[i] > x)
22 break;
23 vect_a[i] = x;
24
25 }
26 return ret;
27 }
28
29 extern void abort ();
30
31 int main ()
32 {
33 check_vect ();
34
35 int x = 1;
36 int idx = P;
37 vect_a[idx] = x + 1;
38
39 test4(x);
40
41 if (vect_b[idx] != (x + idx))
42 abort ();
43
44 if (vect_a[idx] != x + 1)
45 abort ();
46
47 if (idx > 0 && vect_a[idx-1] != x)
48 abort ();
49
50 }