libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr32044.c
blob06c27b03fad1d704b0fff269d7353ad77803bf32
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 /* For powerpc, disable doloop IV cand generation in IVOPTs to avoid unexpected
5 division operation for its base setup. */
6 /* { dg-additional-options "-fno-branch-count-reg" { target { powerpc*-*-* } } } */
8 int foo (int n)
10 while (n >= 45)
11 n -= 45;
13 return n;
16 int bar (int n)
18 while (n >= 64)
19 n -= 64;
21 return n;
24 int bla (int n)
26 int i = 0;
28 while (n >= 45)
30 i++;
31 n -= 45;
34 return i;
37 int baz (int n)
39 int i = 0;
41 while (n >= 64)
43 i++;
44 n -= 64;
47 return i;
50 /* The loops computing division/modulo by 64 should be eliminated */
51 /* { dg-final { scan-tree-dump-times "if" 6 "optimized" } } */
53 /* There should be no division/modulo in the final dump (division and modulo
54 by 64 are done using bit operations). */
55 /* { dg-final { scan-tree-dump-times " / " 0 "optimized" } } */
56 /* { dg-final { scan-tree-dump-times " % " 0 "optimized" } } */