aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/loop-ch-profile-1.c
blob: bfb0f17284d7a30a170a5058d11319d59b6c8854 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-ch2-blocks-details -fdump-tree-optimized-blocks-details" } */
void foo ();
void test(int v, int q)
{
	for (int i = 0; i < 10 && v/q; i++)
		foo ();
}
/* { dg-final { scan-tree-dump-not "Invalid sum" "ch2"} } */
/* dom2 optimizes out the redundant test for loop invariant v/q
   which leads to inconsistent profile.  */
/* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */