summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/passes/LowerCase.cpp3
-rw-r--r--test/passes/lower-case.txt12
2 files changed, 8 insertions, 7 deletions
diff --git a/src/passes/LowerCase.cpp b/src/passes/LowerCase.cpp
index a17b97981..f890de411 100644
--- a/src/passes/LowerCase.cpp
+++ b/src/passes/LowerCase.cpp
@@ -92,7 +92,8 @@ struct LowerCase : public WalkerPass<WasmWalker<LowerCase, void>> {
top = next;
}
curr->cases.clear();
- top->name = Name(std::string("forswitch$") + curr->name.str);
+ top->name = curr->name;
+ curr->name = Name();
replaceCurrent(top);
}
};
diff --git a/test/passes/lower-case.txt b/test/passes/lower-case.txt
index 82651da23..8c1ea176f 100644
--- a/test/passes/lower-case.txt
+++ b/test/passes/lower-case.txt
@@ -1,11 +1,11 @@
(module
(memory 0)
(func $switcher (param $x i32) (result i32)
- (block $forswitch$switch$0
+ (block $switch$0
(block $switch-default$3
(block $switch-case$2
(block $switch-case$1
- (tableswitch $switch$0
+ (tableswitch
(i32.sub
(get_local $x)
(i32.const 1)
@@ -23,11 +23,11 @@
)
(nop)
)
- (block $forswitch$switch$4
+ (block $switch$4
(block $switch-default$7
(block $switch-case$6
(block $switch-case$5
- (tableswitch $switch$4
+ (tableswitch
(i32.sub
(get_local $x)
(i32.const 5)
@@ -45,13 +45,13 @@
)
(nop)
)
- (block $forswitch$label$break$Lout
+ (block $label$break$Lout
(block $switch-default$16
(block $switch-case$15
(block $switch-case$12
(block $switch-case$9
(block $switch-case$8
- (tableswitch $label$break$Lout
+ (tableswitch
(i32.sub
(get_local $x)
(i32.const 2)