diff options
Diffstat (limited to 'test/example/c-api-relooper-unreachable-if.cpp')
-rw-r--r-- | test/example/c-api-relooper-unreachable-if.cpp | 216 |
1 files changed, 142 insertions, 74 deletions
diff --git a/test/example/c-api-relooper-unreachable-if.cpp b/test/example/c-api-relooper-unreachable-if.cpp index e8bfc43bc..c63ca0204 100644 --- a/test/example/c-api-relooper-unreachable-if.cpp +++ b/test/example/c-api-relooper-unreachable-if.cpp @@ -28,13 +28,20 @@ int main() { segmentOffsets, segmentSizes, 0, - 0); + 0, + "0"); } the_relooper = RelooperCreate(the_module); expressions[1] = BinaryenLocalGet(the_module, 0, BinaryenTypeInt32()); expressions[2] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[3] = BinaryenStore( - the_module, 4, 0, 0, expressions[2], expressions[1], BinaryenTypeInt32()); + expressions[3] = BinaryenStore(the_module, + 4, + 0, + 0, + expressions[2], + expressions[1], + BinaryenTypeInt32(), + "0"); expressions[4] = BinaryenReturn(the_module, expressions[0]); { BinaryenExpressionRef children[] = {expressions[3], expressions[4]}; @@ -43,8 +50,8 @@ int main() { } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[5]); expressions[6] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[7] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[6]); + expressions[7] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[6], "0"); expressions[8] = BinaryenLocalSet(the_module, 0, expressions[7]); relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[8]); RelooperAddBranch( @@ -66,8 +73,14 @@ int main() { the_relooper = RelooperCreate(the_module); expressions[10] = BinaryenLocalGet(the_module, 0, BinaryenTypeInt32()); expressions[11] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[12] = BinaryenStore( - the_module, 4, 0, 0, expressions[11], expressions[10], BinaryenTypeInt32()); + expressions[12] = BinaryenStore(the_module, + 4, + 0, + 0, + expressions[11], + expressions[10], + BinaryenTypeInt32(), + "0"); expressions[13] = BinaryenReturn(the_module, expressions[0]); { BinaryenExpressionRef children[] = {expressions[12], expressions[13]}; @@ -76,8 +89,8 @@ int main() { } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[14]); expressions[15] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[16] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[15]); + expressions[16] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[15], "0"); expressions[17] = BinaryenLocalSet(the_module, 0, expressions[16]); relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[17]); RelooperAddBranch( @@ -115,8 +128,8 @@ int main() { RelooperAddBranch( relooperBlocks[1], relooperBlocks[1], expressions[0], expressions[0]); expressions[21] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[22] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[21]); + expressions[22] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[21], "0"); expressions[23] = BinaryenLocalSet(the_module, 0, expressions[22]); relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[23]); RelooperAddBranch( @@ -139,8 +152,14 @@ int main() { the_relooper = RelooperCreate(the_module); expressions[25] = BinaryenLocalGet(the_module, 0, BinaryenTypeInt32()); expressions[26] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[27] = BinaryenStore( - the_module, 4, 0, 0, expressions[26], expressions[25], BinaryenTypeInt32()); + expressions[27] = BinaryenStore(the_module, + 4, + 0, + 0, + expressions[26], + expressions[25], + BinaryenTypeInt32(), + "0"); expressions[28] = BinaryenReturn(the_module, expressions[0]); { BinaryenExpressionRef children[] = {expressions[27], expressions[28]}; @@ -149,8 +168,8 @@ int main() { } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[29]); expressions[30] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[31] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[30]); + expressions[31] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[30], "0"); expressions[32] = BinaryenLocalSet(the_module, 0, expressions[31]); relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[32]); RelooperAddBranch( @@ -174,8 +193,14 @@ int main() { the_relooper = RelooperCreate(the_module); expressions[34] = BinaryenLocalGet(the_module, 0, BinaryenTypeInt32()); expressions[35] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[36] = BinaryenStore( - the_module, 4, 0, 0, expressions[35], expressions[34], BinaryenTypeInt32()); + expressions[36] = BinaryenStore(the_module, + 4, + 0, + 0, + expressions[35], + expressions[34], + BinaryenTypeInt32(), + "0"); expressions[37] = BinaryenReturn(the_module, expressions[0]); { BinaryenExpressionRef children[] = {expressions[36], expressions[37]}; @@ -184,8 +209,8 @@ int main() { } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[38]); expressions[39] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[40] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[39]); + expressions[40] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[39], "0"); expressions[41] = BinaryenLocalSet(the_module, 0, expressions[40]); relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[41]); RelooperAddBranch( @@ -232,8 +257,14 @@ int main() { relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[49]); expressions[50] = BinaryenLocalGet(the_module, 3, BinaryenTypeInt32()); expressions[51] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[52] = BinaryenStore( - the_module, 4, 0, 0, expressions[51], expressions[50], BinaryenTypeInt32()); + expressions[52] = BinaryenStore(the_module, + 4, + 0, + 0, + expressions[51], + expressions[50], + BinaryenTypeInt32(), + "0"); expressions[53] = BinaryenReturn(the_module, expressions[0]); { BinaryenExpressionRef children[] = {expressions[52], expressions[53]}; @@ -244,8 +275,8 @@ int main() { RelooperAddBranch( relooperBlocks[0], relooperBlocks[1], expressions[0], expressions[0]); expressions[55] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[56] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[55]); + expressions[56] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[55], "0"); expressions[57] = BinaryenLocalSet(the_module, 3, expressions[56]); relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[57]); RelooperAddBranch( @@ -287,20 +318,38 @@ int main() { BinaryenBinary(the_module, 36, expressions[72], expressions[71]); expressions[74] = BinaryenUnary(the_module, 24, expressions[73]); expressions[75] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[76] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[75]); + expressions[76] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[75], "0"); expressions[77] = BinaryenConst(the_module, BinaryenLiteralInt32(128)); expressions[78] = BinaryenBinary(the_module, 1, expressions[76], expressions[77]); expressions[79] = BinaryenLocalTee(the_module, 3, expressions[78], BinaryenTypeInt32()); - expressions[80] = BinaryenStore( - the_module, 4, 0, 0, expressions[75], expressions[79], BinaryenTypeInt32()); + expressions[80] = BinaryenStore(the_module, + 4, + 0, + 0, + expressions[75], + expressions[79], + BinaryenTypeInt32(), + "0"); expressions[81] = BinaryenLocalGet(the_module, 3, BinaryenTypeInt32()); - expressions[82] = BinaryenStore( - the_module, 4, 0, 0, expressions[81], expressions[70], BinaryenTypeInt32()); - expressions[83] = BinaryenStore( - the_module, 4, 4, 0, expressions[81], expressions[74], BinaryenTypeInt32()); + expressions[82] = BinaryenStore(the_module, + 4, + 0, + 0, + expressions[81], + expressions[70], + BinaryenTypeInt32(), + "0"); + expressions[83] = BinaryenStore(the_module, + 4, + 4, + 0, + expressions[81], + expressions[74], + BinaryenTypeInt32(), + "0"); { BinaryenExpressionRef children[] = {expressions[60], expressions[62], @@ -313,8 +362,8 @@ int main() { } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[84]); expressions[85] = BinaryenLocalGet(the_module, 3, BinaryenTypeInt32()); - expressions[86] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[85]); + expressions[86] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[85], "0"); expressions[87] = BinaryenLocalSet(the_module, 1, expressions[86]); expressions[88] = BinaryenLocalGet(the_module, 1, BinaryenTypeInt32()); expressions[89] = BinaryenLocalSet(the_module, 4, expressions[88]); @@ -322,8 +371,14 @@ int main() { expressions[91] = BinaryenLocalSet(the_module, 5, expressions[90]); expressions[92] = BinaryenLocalGet(the_module, 6, BinaryenTypeInt32()); expressions[93] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[94] = BinaryenStore( - the_module, 4, 0, 0, expressions[93], expressions[92], BinaryenTypeInt32()); + expressions[94] = BinaryenStore(the_module, + 4, + 0, + 0, + expressions[93], + expressions[92], + BinaryenTypeInt32(), + "0"); expressions[95] = BinaryenLocalGet(the_module, 5, BinaryenTypeInt32()); expressions[96] = BinaryenReturn(the_module, expressions[95]); { @@ -337,8 +392,8 @@ int main() { } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[97]); expressions[98] = BinaryenLocalGet(the_module, 3, BinaryenTypeInt32()); - expressions[99] = - BinaryenLoad(the_module, 4, 0, 8, 0, BinaryenTypeInt32(), expressions[98]); + expressions[99] = BinaryenLoad( + the_module, 4, 0, 8, 0, BinaryenTypeInt32(), expressions[98], "0"); RelooperAddBranch( relooperBlocks[0], relooperBlocks[1], expressions[99], expressions[0]); expressions[100] = BinaryenUnreachable(the_module); @@ -346,8 +401,8 @@ int main() { RelooperAddBranch( relooperBlocks[0], relooperBlocks[2], expressions[0], expressions[0]); expressions[101] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[102] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[101]); + expressions[102] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[101], "0"); expressions[103] = BinaryenLocalSet(the_module, 6, expressions[102]); relooperBlocks[3] = RelooperAddBlock(the_relooper, expressions[103]); RelooperAddBranch( @@ -403,8 +458,8 @@ int main() { BinaryenBinary(the_module, 36, expressions[119], expressions[118]); expressions[121] = BinaryenUnary(the_module, 24, expressions[120]); expressions[122] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[123] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[122]); + expressions[123] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[122], "0"); expressions[124] = BinaryenConst(the_module, BinaryenLiteralInt32(128)); expressions[125] = BinaryenBinary(the_module, 1, expressions[123], expressions[124]); @@ -416,7 +471,8 @@ int main() { 0, expressions[122], expressions[126], - BinaryenTypeInt32()); + BinaryenTypeInt32(), + "0"); expressions[128] = BinaryenLocalGet(the_module, 5, BinaryenTypeInt32()); expressions[129] = BinaryenStore(the_module, 4, @@ -424,14 +480,16 @@ int main() { 0, expressions[128], expressions[117], - BinaryenTypeInt32()); + BinaryenTypeInt32(), + "0"); expressions[130] = BinaryenStore(the_module, 4, 4, 0, expressions[128], expressions[121], - BinaryenTypeInt32()); + BinaryenTypeInt32(), + "0"); { BinaryenExpressionRef children[] = { expressions[115], expressions[127], expressions[129], expressions[130]}; @@ -440,8 +498,8 @@ int main() { } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[131]); expressions[132] = BinaryenLocalGet(the_module, 5, BinaryenTypeInt32()); - expressions[133] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[132]); + expressions[133] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[132], "0"); expressions[134] = BinaryenLocalSet(the_module, 3, expressions[133]); expressions[135] = BinaryenLocalGet(the_module, 3, BinaryenTypeInt32()); expressions[136] = BinaryenLocalSet(the_module, 6, expressions[135]); @@ -470,7 +528,8 @@ int main() { 0, expressions[145], expressions[144], - BinaryenTypeInt32()); + BinaryenTypeInt32(), + "0"); expressions[147] = BinaryenLocalGet(the_module, 8, BinaryenTypeInt32()); expressions[148] = BinaryenReturn(the_module, expressions[147]); { @@ -483,8 +542,8 @@ int main() { RelooperAddBranch( relooperBlocks[0], relooperBlocks[1], expressions[0], expressions[0]); expressions[150] = BinaryenLocalGet(the_module, 5, BinaryenTypeInt32()); - expressions[151] = - BinaryenLoad(the_module, 4, 0, 8, 0, BinaryenTypeInt32(), expressions[150]); + expressions[151] = BinaryenLoad( + the_module, 4, 0, 8, 0, BinaryenTypeInt32(), expressions[150], "0"); RelooperAddBranch( relooperBlocks[1], relooperBlocks[2], expressions[151], expressions[0]); expressions[152] = BinaryenUnreachable(the_module); @@ -494,8 +553,8 @@ int main() { RelooperAddBranch( relooperBlocks[2], relooperBlocks[3], expressions[0], expressions[0]); expressions[153] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[154] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[153]); + expressions[154] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[153], "0"); expressions[155] = BinaryenLocalSet(the_module, 9, expressions[154]); relooperBlocks[5] = RelooperAddBlock(the_relooper, expressions[155]); RelooperAddBranch( @@ -538,7 +597,8 @@ int main() { segmentOffsets, segmentSizes, 0, - 0); + 0, + "0"); } expressions[157] = BinaryenConst(the_module, BinaryenLiteralInt32(65535)); expressions[158] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); @@ -548,7 +608,8 @@ int main() { 0, expressions[158], expressions[157], - BinaryenTypeInt32()); + BinaryenTypeInt32(), + "0"); expressions[160] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); expressions[161] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { @@ -598,8 +659,8 @@ int main() { BinaryenBinary(the_module, 36, expressions[182], expressions[181]); expressions[184] = BinaryenUnary(the_module, 24, expressions[183]); expressions[185] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[186] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[185]); + expressions[186] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[185], "0"); expressions[187] = BinaryenConst(the_module, BinaryenLiteralInt32(128)); expressions[188] = BinaryenBinary(the_module, 1, expressions[186], expressions[187]); @@ -611,7 +672,8 @@ int main() { 0, expressions[185], expressions[189], - BinaryenTypeInt32()); + BinaryenTypeInt32(), + "0"); expressions[191] = BinaryenLocalGet(the_module, 6, BinaryenTypeInt32()); expressions[192] = BinaryenStore(the_module, 4, @@ -619,14 +681,16 @@ int main() { 0, expressions[191], expressions[180], - BinaryenTypeInt32()); + BinaryenTypeInt32(), + "0"); expressions[193] = BinaryenStore(the_module, 4, 4, 0, expressions[191], expressions[184], - BinaryenTypeInt32()); + BinaryenTypeInt32(), + "0"); { BinaryenExpressionRef children[] = {expressions[166], expressions[168], @@ -641,8 +705,8 @@ int main() { } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[194]); expressions[195] = BinaryenLocalGet(the_module, 6, BinaryenTypeInt32()); - expressions[196] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[195]); + expressions[196] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[195], "0"); expressions[197] = BinaryenLocalSet(the_module, 7, expressions[196]); expressions[198] = BinaryenLocalGet(the_module, 8, BinaryenTypeInt32()); expressions[199] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); @@ -652,7 +716,8 @@ int main() { 0, expressions[199], expressions[198], - BinaryenTypeInt32()); + BinaryenTypeInt32(), + "0"); expressions[201] = BinaryenLocalGet(the_module, 7, BinaryenTypeInt32()); expressions[202] = BinaryenReturn(the_module, expressions[201]); { @@ -663,8 +728,8 @@ int main() { } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[203]); expressions[204] = BinaryenLocalGet(the_module, 6, BinaryenTypeInt32()); - expressions[205] = - BinaryenLoad(the_module, 4, 0, 8, 0, BinaryenTypeInt32(), expressions[204]); + expressions[205] = BinaryenLoad( + the_module, 4, 0, 8, 0, BinaryenTypeInt32(), expressions[204], "0"); RelooperAddBranch( relooperBlocks[0], relooperBlocks[1], expressions[205], expressions[0]); expressions[206] = BinaryenUnreachable(the_module); @@ -672,8 +737,8 @@ int main() { RelooperAddBranch( relooperBlocks[0], relooperBlocks[2], expressions[0], expressions[0]); expressions[207] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[208] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[207]); + expressions[208] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[207], "0"); expressions[209] = BinaryenLocalSet(the_module, 8, expressions[208]); relooperBlocks[3] = RelooperAddBlock(the_relooper, expressions[209]); RelooperAddBranch( @@ -719,7 +784,8 @@ int main() { 0, expressions[219], expressions[218], - BinaryenTypeInt32()); + BinaryenTypeInt32(), + "0"); expressions[221] = BinaryenLocalGet(the_module, 3, BinaryenTypeInt32()); expressions[222] = BinaryenReturn(the_module, expressions[221]); { @@ -733,8 +799,8 @@ int main() { } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[223]); expressions[224] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[225] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[224]); + expressions[225] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[224], "0"); expressions[226] = BinaryenLocalSet(the_module, 4, expressions[225]); relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[226]); RelooperAddBranch( @@ -780,7 +846,8 @@ int main() { 0, expressions[241], expressions[240], - BinaryenTypeInt32()); + BinaryenTypeInt32(), + "0"); expressions[243] = BinaryenLocalGet(the_module, 6, BinaryenTypeInt32()); expressions[244] = BinaryenReturn(the_module, expressions[243]); { @@ -796,8 +863,8 @@ int main() { } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[245]); expressions[246] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[247] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[246]); + expressions[247] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[246], "0"); expressions[248] = BinaryenLocalSet(the_module, 7, expressions[247]); relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[248]); RelooperAddBranch( @@ -848,7 +915,8 @@ int main() { 0, expressions[263], expressions[262], - BinaryenTypeInt64()); + BinaryenTypeInt64(), + "0"); expressions[265] = BinaryenLocalGet(the_module, 6, BinaryenTypeInt32()); expressions[266] = BinaryenReturn(the_module, expressions[265]); { @@ -864,8 +932,8 @@ int main() { } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[267]); expressions[268] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[269] = - BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt64(), expressions[268]); + expressions[269] = BinaryenLoad( + the_module, 4, 0, 0, 0, BinaryenTypeInt64(), expressions[268], "0"); expressions[270] = BinaryenLocalSet(the_module, 7, expressions[269]); relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[270]); RelooperAddBranch( |