Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / val-prof-2.c
blob66b0614c5efb489958084a60bb737ab91d1688bb
1 /* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */
2 unsigned int a[1000];
3 unsigned int b = 256;
4 unsigned int c = 1024;
5 unsigned int d = 17;
6 main ()
8 int i;
9 unsigned int n;
10 for (i = 0; i < 1000; i++)
12 a[i]=100*i;
14 for (i = 0; i < 1000; i++)
16 if (i % 2)
17 n = b;
18 else if (i % 3)
19 n = c;
20 else
21 n = d;
22 a[i] %= n;
24 return 0;
26 /* { dg-final-use { scan-tree-dump "Mod power of 2 transformation on insn" "tree_profile"} } */
27 /* This is part of code checking that n is power of 2, so we are sure that the transformation
28 didn't get optimized out. */
29 /* { dg-final-use { scan-tree-dump "n \\+ 0xffff" "optimized"} } */
30 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
31 /* { dg-final-use { cleanup-tree-dump "optimized" } } */
32 /* { dg-final-use { cleanup-tree-dump "tree_profile" } } */