2016-11-02 11:07:04 +01:00
|
|
|
|
|
|
|
//////////////////////////////
|
2016-12-06 21:45:51 +01:00
|
|
|
// control flow analysis
|
2016-11-02 11:07:04 +01:00
|
|
|
//////////////////////////////
|
|
|
|
|
|
|
|
int buf[2];
|
|
|
|
|
2016-12-06 21:45:51 +01:00
|
|
|
void in_if(int a) {
|
2016-11-04 19:32:42 +01:00
|
|
|
if (a==100)
|
2016-11-02 11:07:04 +01:00
|
|
|
buf[a] = 0; // BUG
|
|
|
|
}
|
|
|
|
|
2016-12-06 21:45:51 +01:00
|
|
|
void before_if(int a) {
|
2016-11-03 20:16:49 +01:00
|
|
|
buf[a] = 0; // WARNING
|
|
|
|
if (a==100) {}
|
2016-11-02 11:07:04 +01:00
|
|
|
}
|
|
|
|
|
2016-12-06 21:45:51 +01:00
|
|
|
void after_if(int a) {
|
2016-11-03 20:16:49 +01:00
|
|
|
if (a==100) {}
|
|
|
|
buf[a] = 0; // WARNING
|
2016-11-02 11:07:04 +01:00
|
|
|
}
|
|
|
|
|
2016-12-06 21:45:51 +01:00
|
|
|
void in_for(void) {
|
2016-11-03 20:16:49 +01:00
|
|
|
int x;
|
|
|
|
for (x = 0; x<100; x++) {
|
|
|
|
buf[x] = 0; // BUG
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-06 21:45:51 +01:00
|
|
|
void after_for(void) {
|
2016-11-03 20:16:49 +01:00
|
|
|
int x;
|
|
|
|
for (x = 0; x<100; x++) {}
|
|
|
|
buf[x] = 0; // BUG
|
|
|
|
}
|
|
|
|
|
2016-12-06 21:45:51 +01:00
|
|
|
void in_switch(int x) {
|
2016-11-02 11:07:04 +01:00
|
|
|
switch (x) {
|
2016-11-03 20:16:49 +01:00
|
|
|
case 100:
|
2016-11-02 11:07:04 +01:00
|
|
|
buf[x] = 0; // BUG
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-06 21:45:51 +01:00
|
|
|
void before_switch(int x) {
|
2016-11-03 20:16:49 +01:00
|
|
|
buf[x] = 0; // WARNING
|
2016-11-02 11:07:04 +01:00
|
|
|
switch (x) {
|
2016-11-03 20:16:49 +01:00
|
|
|
case 100:
|
2016-11-02 11:07:04 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-06 21:45:51 +01:00
|
|
|
void after_switch(int x) {
|
2016-11-03 20:16:49 +01:00
|
|
|
switch (x) {
|
|
|
|
case 100:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
buf[x] = 0; // WARNING
|
2016-11-02 11:07:04 +01:00
|
|
|
}
|
|
|
|
|
2016-12-06 21:45:51 +01:00
|
|
|
void in_while(void) {
|
2016-11-02 11:07:04 +01:00
|
|
|
int x = 0;
|
2016-11-03 20:16:49 +01:00
|
|
|
while (x<100) {
|
2016-11-02 11:07:04 +01:00
|
|
|
buf[x] = 0; // BUG
|
2016-11-04 19:32:42 +01:00
|
|
|
x++;
|
2016-11-02 11:07:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-06 21:45:51 +01:00
|
|
|
void after_while(void) {
|
2016-11-02 11:07:04 +01:00
|
|
|
int x = 0;
|
2016-11-03 20:16:49 +01:00
|
|
|
while (x<100)
|
|
|
|
x++;
|
2016-11-02 11:07:04 +01:00
|
|
|
buf[x] = 0; // BUG
|
|
|
|
}
|