libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-thread-backedge.c
blobef9a3e8c22bc0259a07f0d784130ac6bc9836e0d
1 // { dg-do compile }
2 // { dg-options "-O2 -fdisable-tree-ethread -fdisable-tree-thread1 -fdisable-tree-thread2 -fno-tree-dominator-opts -fdump-tree-threadfull2-details" }
4 // Test that we can thread jumps across the backedge of a loop through
5 // the switch statement to a particular case.
6 //
7 // Just in case, we disable all the jump threaders before loop
8 // optimizations to make sure we get a clean stab at this.
10 int foo (unsigned int x, int s)
12 while (s != 999)
14 switch (s)
16 case 0:
17 if (x)
18 s = 1;
19 break;
20 case 1:
21 if (x)
22 s = 999;
23 break;
24 default:
25 break;
27 x++;
29 return s;
32 // { dg-final { scan-tree-dump "Registering jump thread:.*normal \\(back\\)" "threadfull2" } }