]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/tree-ssa/if-to-switch-11.c
Fix profile update in tree_transform_and_unroll_loop
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / if-to-switch-11.c
CommitLineData
57424087
XL
1/* { dg-do compile } */
2/* { dg-options "-O2 -fdump-tree-iftoswitch-optimized" } */
3
4struct f {
5 int len;
6 int arr[4];
7};
8
9int
10test (struct f const *const f)
11{
12 if (f->arr[3] == 1) {
13 return 12;
14 } else if (f->arr[3] == 2) {
15 return 27;
16 } else if (f->arr[3] == 3) {
17 return 38;
18 } else if (f->arr[3] == 4) {
19 return 18;
20 } else if (f->arr[3] == 5) {
21 return 58;
22 } else if (f->arr[3] == 6) {
23 return 68;
24 }
25 return 0;
26}
27
28/* { dg-final { scan-tree-dump "Canonical GIMPLE case clusters: 1 2 3 4 5 6" "iftoswitch" } } */