aboutsummaryrefslogtreecommitdiff
path: root/src/relooper/test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/relooper/test.cpp')
-rw-r--r--src/relooper/test.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/relooper/test.cpp b/src/relooper/test.cpp
index 7da990b5..b2d500d7 100644
--- a/src/relooper/test.cpp
+++ b/src/relooper/test.cpp
@@ -231,5 +231,32 @@ int main() {
puts(buffer);
}
+
+ if (1) {
+ Relooper::SetOutputBuffer(buffer, sizeof(buffer));
+
+ printf("\n\n-- conditional loop --\n\n");
+
+ Block *b_a = new Block("// block A\n");
+ Block *b_b = new Block("// block B\n");
+ Block *b_c = new Block("// block C\n");
+
+ b_a->AddBranchTo(b_b, "shouldLoop()");
+ b_a->AddBranchTo(b_c, NULL);
+
+ b_b->AddBranchTo(b_b, "moarLoop()");
+ b_b->AddBranchTo(b_c, NULL);
+
+ Relooper r;
+ r.AddBlock(b_a);
+ r.AddBlock(b_b);
+ r.AddBlock(b_c);
+
+ r.Calculate(b_a);
+ printf("\n\n");
+ r.Render();
+
+ puts(buffer);
+ }
}