1 /* { dg-options "-O2 -fdump-rtl-expand-all" } */
2 int g;
3
foo(int n)4 __attribute__((noinline)) void foo (int n)
5 {
6 switch (n)
7 {
8 case 99:
9 g += 2; break;
10 case 1:
11 g++; break;
12 case 100:
13 g += 1; break;
14 case 4:
15 g += 3; break;
16 case 5:
17 g += 4; break;
18 case 6:
19 g += 5; break;
20 case 7:
21 g += 6; break;
22 case 8:
23 g += 7; break;
24 case 9:
25 g += 8; break;
26 default:
27 g += 8; break;
28 }
29 }
30
main()31 int main ()
32 {
33 int i;
34 for (i = 0; i < 10000; i++)
35 foo ((i * i) % 5);
36 return 0;
37 }
38 /* { dg-final-use { scan-rtl-dump-times ";; basic block\[^\\n\]*count 4000" 2 "expand"} } */
39 /* { dg-final-use { scan-rtl-dump-times ";; basic block\[^\\n\]*count 2000" 1 "expand"} } */
40 /* { dg-final-use { cleanup-rtl-dump "expand" } } */
41