summaryrefslogtreecommitdiff
path: root/test/example
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-03-18 15:10:11 -0700
committerGitHub <noreply@github.com>2021-03-18 15:10:11 -0700
commite5aaa07844687493e0155dacb6b79bf856a4dd81 (patch)
tree53ebe40500b65a3b5e698400a6a63d6fc3548c02 /test/example
parent647ef50fc4de9b5c49ffad1aec4271e79b171785 (diff)
downloadbinaryen-e5aaa07844687493e0155dacb6b79bf856a4dd81.tar.gz
binaryen-e5aaa07844687493e0155dacb6b79bf856a4dd81.tar.bz2
binaryen-e5aaa07844687493e0155dacb6b79bf856a4dd81.zip
[Wasm GC] Fix MergeBlocks on BrOn (#3702)
The pass was only aware of Break and Switch. Refactor it to use the generic code, so that we can first handle Break, and then if anything remains, note a problem was found. The same path can handle a Switch which we handled before and also a BrOn etc. git diff is not that useful after the refactoring sadly, but basically this just moves the Break code and the Drop code, then adds the BranchUtils::operateOn stuff after them (and we switch to a unified visitor so that we get called for all expressions).
Diffstat (limited to 'test/example')
-rw-r--r--test/example/c-api-kitchen-sink.c4
-rw-r--r--test/example/c-api-relooper-unreachable-if.cpp4
-rw-r--r--test/example/c-api-unused-mem.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 32b6fe6d9..9e6366d36 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -870,7 +870,7 @@ void test_core() {
// Memory. One per module
const char* segments[] = { "hello, world", "I am passive" };
- bool segmentPassive[] = { false, true };
+ bool segmentPassive[] = {false, true};
BinaryenExpressionRef segmentOffsets[] = { BinaryenConst(module, BinaryenLiteralInt32(10)), NULL };
BinaryenIndex segmentSizes[] = { 12, 12 };
BinaryenSetMemory(module, 1, 256, "mem", segments, segmentPassive, segmentOffsets, segmentSizes, 2, 1);
@@ -1367,7 +1367,7 @@ void test_for_each() {
const char* segments[] = { "hello, world", "segment data 2" };
const uint32_t expected_offsets[] = { 10, 125 };
- bool segmentPassive[] = { false, false };
+ bool segmentPassive[] = {false, false};
BinaryenIndex segmentSizes[] = { 12, 14 };
BinaryenExpressionRef segmentOffsets[] = {
diff --git a/test/example/c-api-relooper-unreachable-if.cpp b/test/example/c-api-relooper-unreachable-if.cpp
index 5e93d9d16..babafac5a 100644
--- a/test/example/c-api-relooper-unreachable-if.cpp
+++ b/test/example/c-api-relooper-unreachable-if.cpp
@@ -16,7 +16,7 @@ int main() {
BinaryenModuleAutoDrop(the_module);
{
const char* segments[] = { 0 };
- bool segmentPassive[] = { false };
+ bool segmentPassive[] = {false};
BinaryenExpressionRef segmentOffsets[] = { 0 };
BinaryenIndex segmentSizes[] = { 0 };
BinaryenSetMemory(the_module, 256, 256, "memory", segments, segmentPassive, segmentOffsets, segmentSizes, 0, 0);
@@ -437,7 +437,7 @@ int main() {
{
const char* segments[] = { 0 };
BinaryenExpressionRef segmentOffsets[] = { 0 };
- bool segmentPassive[] = { false };
+ bool segmentPassive[] = {false};
BinaryenIndex segmentSizes[] = { 0 };
BinaryenSetMemory(the_module, 1, 1, NULL, segments, segmentPassive, segmentOffsets, segmentSizes, 0, 0);
}
diff --git a/test/example/c-api-unused-mem.cpp b/test/example/c-api-unused-mem.cpp
index c540d15c1..2121d8bde 100644
--- a/test/example/c-api-unused-mem.cpp
+++ b/test/example/c-api-unused-mem.cpp
@@ -17,7 +17,7 @@ int main() {
BinaryenModuleAutoDrop(the_module);
{
const char* segments[] = { 0 };
- bool segmentPassive[] = { false };
+ bool segmentPassive[] = {false};
BinaryenExpressionRef segmentOffsets[] = { 0 };
BinaryenIndex segmentSizes[] = { 0 };
BinaryenSetMemory(the_module, 256, 256, "memory", segments, segmentPassive, segmentOffsets, segmentSizes, 0, 0);
@@ -60,7 +60,7 @@ int main() {
BinaryenAddFunctionExport(the_module, "main", "main");
{
const char* segments[] = { 0 };
- bool segmentPassive[] = { false };
+ bool segmentPassive[] = {false};
BinaryenExpressionRef segmentOffsets[] = { 0 };
BinaryenIndex segmentSizes[] = { 0 };
BinaryenSetMemory(the_module, 1024, 1024, NULL, segments, segmentPassive, segmentOffsets, segmentSizes, 0, 0);