1 /* { dg-do compile } */
2 /* { dg-options "-Ofast -fdump-tree-ifcvt-stats-blocks-details" } */
3 /* { dg-require-visibility "" } */
4 
5 struct st
6 {
7   int a[1024];
8   int b[1024];
9 };
10 
11 struct st s = {0};
foo(int x)12 int foo (int x)
13 {
14   int i;
15   struct st *p = &s;
16 
17   for (i = 0; i < 1024; i++)
18     {
19       if (x > i)
20 	p->a[i] = p->b[i];
21     }
22 
23   return 0;
24 }
25 /* { dg-final { scan-tree-dump-times "Applying if-conversion" 1 "ifcvt" } } */
26 
27 /* We insert into code
28    if (LOOP_VECTORIZED (...))
29    which is folded by vectorizer.  Both outgoing edges must have probability
30    100% so the resulting profile match after folding.  */
31 /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */
32 /* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */
33 
34