db3bc950f5a6ea401d46900996dba4ac42d5b258
[platform/upstream/gcc.git] / gcc / testsuite / gcc.dg / tree-prof / val-prof-1.c
1 /* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */
2 int a[1000];
3 int b = 256;
4 int c = 257;
5 main ()
6 {
7   int i;
8   int n;
9   for (i = 0; i < 1000; i++)
10     {
11       if (i % 17)
12         n = c;
13       else n = b;
14       a[i] /= n;
15     }
16   return 0;
17 }
18 /* { dg-final-use { scan-tree-dump "Div.mod by constant n=257 transformation on insn" "tree_profile"} } */
19 /* { dg-final-use { scan-tree-dump "if \\(n != 257\\)" "optimized"} } */
20 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */