projects
/
libfirm
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Some small test cases for partial condition evaluation
[libfirm]
/
ir
/
be
/
test
/
condeval.c
1
#if 1
2
int f(int x)
3
{
4
if (x < 23) x = 23;
5
if (x > 42) x = 42;
6
return x;
7
}
8
#endif
9
10
11
#if 1
12
static int g(int x)
13
{
14
return x == 42;
15
}
16
17
extern void y(void);
18
extern void z(void);
19
20
void h(int x)
21
{
22
if (g(x)) {
23
y();
24
} else {
25
z();
26
}
27
}
28
#endif
29
30
31
#if 1
32
int a(void);
33
34
void i(void)
35
{
36
int finish = 0;
37
int x;
38
int y;
39
int z;
40
41
for (x = 0; x < 10 && !finish; x++) {
42
for (y = 0; y < 10 && !finish; y++) {
43
for (z = 0; z < 10 && !finish; z++) {
44
if (a()) finish = 1;
45
}
46
}
47
}
48
}
49
#endif
50
51
52
#if 1
53
int a(void);
54
55
void j(void)
56
{
57
int finish = 0;
58
int x;
59
int y;
60
int z;
61
62
for (x = 0; !finish; x++) {
63
for (y = 0; !finish; y++) {
64
for (z = 0; !finish; z++) {
65
if (a()) finish = 1;
66
}
67
}
68
}
69
}
70
#endif