libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / if-to-switch-10.c
blob7b21c99313cfe6c5ea7ad05ec611d10523b33d1c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-iftoswitch-optimized --param case-values-threshold=5" } */
4 int global;
5 int foo ();
7 int main(int argc, char **argv)
9 if (argc != 1)
11 if (argc != 2)
13 if (argc == 3)
15 foo ();
16 foo ();
18 else if (argc == 4)
20 foo ();
22 else if (argc == 5)
24 global = 2;
26 else
27 global -= 123;
29 else
31 global += 1;
34 else
35 foo ();
38 global -= 12;
39 return 0;
42 /* { dg-final { scan-tree-dump "Canonical GIMPLE case clusters: 1 2 3 4 5" "iftoswitch" } } */
43 /* { dg-final { scan-tree-dump "Condition chain with \[^\n\r]\* BBs transformed into a switch statement." "iftoswitch" } } */