blob: 887d254c6859f53037415b38ec05dc5038495718 (
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
|
#include "Relooper.h"
int main() {
char buffer[10000];
Relooper::SetOutputBuffer(buffer, sizeof(buffer));
printf("\n\n-- If pattern --\n\n");
Block *b_a = new Block("// block A\n");
Block *b_b = new Block("// block B\n"); // never reached
b_b->AddBranchTo(b_b, NULL);
Relooper r;
r.AddBlock(b_a);
r.AddBlock(b_b);
r.Calculate(b_a);
printf("\n\n");
r.Render();
puts(buffer);
printf("I did not crash even though I have dead code with a branch!\n");
}
|