summaryrefslogtreecommitdiff
path: root/test/example/c-api-kitchen-sink.c
diff options
context:
space:
mode:
authorAlon Zakai (kripken) <alonzakai@gmail.com>2017-05-20 14:38:23 -0700
committerAlon Zakai (kripken) <alonzakai@gmail.com>2017-05-20 15:08:50 -0700
commit2f3bcb914b55f469426418fed1d85e00d0e4db1b (patch)
tree4d3997948e7af59b1ff969684f6565726201b2ef /test/example/c-api-kitchen-sink.c
parent1462c0dbfa9980481058e17d2aac317420e45acc (diff)
downloadbinaryen-2f3bcb914b55f469426418fed1d85e00d0e4db1b.tar.gz
binaryen-2f3bcb914b55f469426418fed1d85e00d0e4db1b.tar.bz2
binaryen-2f3bcb914b55f469426418fed1d85e00d0e4db1b.zip
relooper improvements
Diffstat (limited to 'test/example/c-api-kitchen-sink.c')
-rw-r--r--test/example/c-api-kitchen-sink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 5935e9993..b2218993c 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -427,6 +427,9 @@ void test_relooper() {
RelooperRef relooper = RelooperCreate();
BinaryenExpressionRef temp = makeInt32(module, -99);
RelooperBlockRef block0 = RelooperAddBlockWithSwitch(relooper, makeCallCheck(module, 0), temp);
+ // TODO: this example is not very good, the blocks should end in a |return| as otherwise they
+ // fall through to each other. A relooper block should end in something that stops control
+ // flow, if it doesn't have branches going out
RelooperBlockRef block1 = RelooperAddBlock(relooper, makeCallCheck(module, 1));
RelooperBlockRef block2 = RelooperAddBlock(relooper, makeCallCheck(module, 2));
RelooperBlockRef block3 = RelooperAddBlock(relooper, makeCallCheck(module, 3));