blob: e5da00b62d6dcfb28e45eba700ed30019bd98510 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-iftoswitch-optimized --param case-values-threshold=5" } */
int global;
int foo ();
int main(int argc, char **argv)
{
if (argc == 1)
foo ();
else if (argc == 2)
{
global += 1;
}
else if (argc == 3)
{
foo ();
foo ();
}
else if (argc == 4)
{
foo ();
}
else if (argc == 5)
{
global = 2;
}
else
global -= 123;
global -= 12;
return 0;
}
/* { dg-final { scan-tree-dump "Condition chain with \[^\n\r]\* BBs transformed into a switch statement." "iftoswitch" } } */
|