libstdc++: Make std::type_info::operator== always_inline for C++23 [PR110572]
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-dom-thread-7.c
blob47b8fdfa29a585c68f398b7bcfe8f566be211ddf
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-dom2-stats -fdump-tree-thread2-stats -fdump-tree-dom3-stats -fno-guess-branch-probability" } */
4 /* { dg-final { scan-tree-dump-not "Jumps threaded" "dom2" } } */
6 /* We were previously checking for no threads in vrp-thread2, but now
7 that we have merged the post and pre threaders, we get a dozen
8 threads before VRP2. */
10 /* aarch64 has the highest CASE_VALUES_THRESHOLD in GCC. It's high enough
11 to change decisions in switch expansion which in turn can expose new
12 jump threading opportunities. Skip the later tests on aarch64. */
13 /* { dg-final { scan-tree-dump-not "Jumps threaded" "dom3" { target { ! aarch64*-*-* } } } } */
14 /* { dg-final { scan-tree-dump "Jumps threaded: 9" "thread2" { target { ! aarch64*-*-* } } } } */
15 /* { dg-final { scan-tree-dump "Jumps threaded: 18" "thread2" { target { aarch64*-*-* } } } } */
17 enum STATE {
18 S0=0,
19 SI,
20 S1,
21 S2,
22 S3,
23 S4,
24 S5,
28 int bar (enum STATE s);
30 enum STATE foo (unsigned char **y, unsigned *c)
32 unsigned char *x = *y;
33 unsigned char n;
34 enum STATE s = S0;
36 for( ; *x && s != SI; x++ )
38 n = *x;
39 if (n == 'x')
41 x++;
42 break;
44 switch(s)
46 case S0:
47 if(bar(n))
48 s = S3;
49 else if( n == 'a' || n == 'b' )
50 s = S1;
51 else if( n == 'c' )
52 s = S4;
53 else
55 s = SI;
56 c[SI]++;
58 c[S0]++;
59 break;
60 case S1:
61 if(bar(n))
63 s = S3;
64 c[S1]++;
66 else if( n == 'c' )
68 s = S4;
69 c[S1]++;
71 else
73 s = SI;
74 c[S1]++;
76 break;
77 case S3:
78 if( n == 'c' )
80 s = S4;
81 c[S3]++;
83 else if(!bar(n))
85 s = SI;
86 c[S3]++;
88 break;
89 case S4:
90 if( n == 'E' || n == 'e' )
92 s = S2;
93 c[S4]++;
95 else if(!bar(n))
97 s = SI;
98 c[S4]++;
100 break;
101 case S2:
102 if( n == 'a' || n == 'b' )
104 s = S5;
105 c[S2]++;
107 else
109 s = SI;
110 c[S2]++;
112 break;
113 case S5:
114 if(bar(n))
116 s = S6;
117 c[S5]++;
119 else
121 s = SI;
122 c[S5]++;
124 break;
125 case S6:
126 if(!bar(n))
128 s = SI;
129 c[SI]++;
131 break;
132 default:
133 break;
136 *y=x;
137 return s;