c++/modules: export using across namespace [PR114683]
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr77445-2.c
blobb3db1bca6173d58620a4307fa5fdcf4231761775
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdisable-tree-evrp -fdump-tree-thread-details-blocks-stats -fdump-tree-threadfull1-blocks-stats -fdump-tree-threadfull2-blocks-stats" } */
3 typedef enum STATES {
4 START=0,
5 INVALID,
6 S1,
7 S2,
8 INT,
9 FLOAT ,
10 EXPONENT,
11 SCIENTIFIC,
12 NUM_STATES
13 } state_e ;
15 typedef unsigned char u8;
16 typedef unsigned int u32;
18 static u8 is_digit(u8 c) {
19 return (u8)((c>='0') & (c<='9')) ? 1 : 0;
22 enum STATES FMS( u8 **in , u32 *transitions) {
23 u8 *str = *in;
24 u8 NEXT_SYMBOL;
25 enum STATES state=START;
26 for( ; *str && state != INVALID; str++ ) {
27 NEXT_SYMBOL = *str;
28 if (NEXT_SYMBOL==',') /* end of this input */ {
29 transitions[state]++;
30 str++;
31 break;
33 switch(state) {
34 case START:
35 if(is_digit(NEXT_SYMBOL)) {
36 state = INT;
38 else if( NEXT_SYMBOL == '+' || NEXT_SYMBOL == '-' ) {
39 state = S1;
41 else if( NEXT_SYMBOL == '.' ) {
42 state = FLOAT ;
44 else {
45 state = INVALID;
47 transitions[START]++;
48 break;
49 case S1:
50 if(is_digit(NEXT_SYMBOL)) {
51 state = INT;
52 transitions[S1]++;
54 else if( NEXT_SYMBOL == '.' ) {
55 state = FLOAT ;
56 transitions[S1]++;
58 else {
59 state = INVALID;
60 transitions[S1]++;
62 break;
63 case INT:
64 if( NEXT_SYMBOL == '.' ) {
65 state = FLOAT ;
66 transitions[INT]++;
68 else if(!is_digit(NEXT_SYMBOL)) {
69 state = INVALID;
70 transitions[INT]++;
72 break;
73 case FLOAT :
74 if( NEXT_SYMBOL == 'E' || NEXT_SYMBOL == 'e' ) {
75 state = S2;
76 transitions[FLOAT ]++;
78 else if(!is_digit(NEXT_SYMBOL)) {
79 state = INVALID;
80 transitions[FLOAT ]++;
82 break;
83 case S2:
84 if( NEXT_SYMBOL == '+' || NEXT_SYMBOL == '-' ) {
85 state = EXPONENT;
86 transitions[S2]++;
88 else {
89 state = INVALID;
90 transitions[S2]++;
92 break;
93 case EXPONENT:
94 if(is_digit(NEXT_SYMBOL)) {
95 state = SCIENTIFIC;
96 transitions[EXPONENT]++;
98 else {
99 state = INVALID;
100 transitions[EXPONENT]++;
102 break;
103 case SCIENTIFIC:
104 if(!is_digit(NEXT_SYMBOL)) {
105 state = INVALID;
107 break;
108 default:
109 break;
112 if (state==INVALID)
113 transitions[INVALID]++;
115 *in = str;
116 return state;
119 /* The profile is not updated perfectly because it is inconsitent from
120 profile estimation stage. But the number of inconsistencies should not
121 increase much.
123 aarch64 has the highest CASE_VALUES_THRESHOLD in GCC. It's high enough
124 to change decisions in switch expansion which in turn can expose new
125 jump threading opportunities. Skip the later tests on aarch64. */
126 /* { dg-final { scan-tree-dump "Jumps threaded: \[7-9\]" "thread1" } } */
127 /* { dg-final { scan-tree-dump-not "optimizing for size" "thread1" } } */
128 /* { dg-final { scan-tree-dump-not "optimizing for size" "threadfull1" } } */
129 /* { dg-final { scan-tree-dump-not "optimizing for size" "thread2" { target { ! aarch64*-*-* } } } } */
130 /* { dg-final { scan-tree-dump-not "optimizing for size" "threadfull2" { target { ! aarch64*-*-* } } } } */