blob: 88668f74e61baf6f686370a0c83eed5a63c93f9a (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
/*
bug1464657.c
*/
#include <testfwk.h>
static void f1(void)
{
}
static short f2(void)
{
return 0;
}
static unsigned char f3(unsigned char a)
{
return a+5;
}
unsigned char var;
void f()
{
switch (var) {
case 0:
f1();
break;
case 1:
f1();
break;
case 2:
var++;
f1();
break;
case 4:
f1();
break;
case 5:
break;
case 7:
f1();
break;
case 6:
f1();
break;
case 8:
f1();
break;
case 9:
f1();
break;
case 12:
{
unsigned char nc;
unsigned short b = f2();
unsigned char nb = f3(b);
var = f3(b);
nc = f3(nb);
}
break;
}
}
void test_Peephole251(void)
{
var = 12;
f();
ASSERT (var==5);
}
|