summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/s2wasm.h19
-rw-r--r--test/llvm_autogenerated/cfg-stackify.s2
-rw-r--r--test/llvm_autogenerated/switch.s4
-rw-r--r--test/revision2
-rw-r--r--test/torture-s/20011109-1.c.s2
-rw-r--r--test/torture-s/20011219-1.c.s2
-rw-r--r--test/torture-s/20020402-3.c.s2
-rw-r--r--test/torture-s/20030903-1.c.s2
-rw-r--r--test/torture-s/20071018-1.c.s6
-rw-r--r--test/torture-s/20071120-1.c.s2
-rw-r--r--test/torture-s/930614-1.c.s2
-rw-r--r--test/torture-s/930921-1.c.s38
-rw-r--r--test/torture-s/950621-1.c.s2
-rw-r--r--test/torture-s/990527-1.c.s2
-rw-r--r--test/torture-s/ashrdi-1.c.s2
-rw-r--r--test/torture-s/conversion.c.s4
-rw-r--r--test/torture-s/pr20527-1.c.s2
-rw-r--r--test/torture-s/pr40668.c.s2
-rw-r--r--test/torture-s/pr48809.c.s2
-rw-r--r--test/torture-s/pr49419.c.s131
-rw-r--r--test/torture-s/pr58574.c.s2
-rw-r--r--test/torture-s/ptr-arith-1.c.s2
-rw-r--r--test/torture-s/stdarg-4.c.s2
-rw-r--r--test/torture-s/switch-1.c.s2
-rw-r--r--test/torture-s/vfprintf-1.c.s2
-rw-r--r--test/torture-s/vfprintf-chk-1.c.s2
-rw-r--r--test/torture-s/vprintf-1.c.s2
-rw-r--r--test/torture-s/vprintf-chk-1.c.s2
28 files changed, 122 insertions, 124 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h
index 16b1125e8..b1c5f7c54 100644
--- a/src/s2wasm.h
+++ b/src/s2wasm.h
@@ -957,6 +957,16 @@ class S2WasmBuilder {
} else if (match("end_loop")) {
bstack.pop_back();
bstack.pop_back();
+ } else if (match("br_table")) {
+ auto curr = allocator.alloc<Switch>();
+ curr->condition = getInput();
+ while (skipComma()) {
+ curr->targets.push_back(getBranchLabel(getInt()));
+ }
+ assert(curr->targets.size() > 0);
+ curr->default_ = curr->targets.back();
+ curr->targets.pop_back();
+ addToBlock(curr);
} else if (match("br")) {
auto curr = allocator.alloc<Break>();
bool hasCondition = false;
@@ -991,15 +1001,6 @@ class S2WasmBuilder {
curr->value = getInput();
}
addToBlock(curr);
- } else if (match("tableswitch")) {
- auto curr = allocator.alloc<Switch>();
- curr->condition = getInput();
- skipComma();
- curr->default_ = getBranchLabel(getInt());
- while (skipComma()) {
- curr->targets.push_back(getBranchLabel(getInt()));
- }
- addToBlock(curr);
} else if (match("unreachable")) {
addToBlock(allocator.alloc<Unreachable>());
} else if (match("memory_size")) {
diff --git a/test/llvm_autogenerated/cfg-stackify.s b/test/llvm_autogenerated/cfg-stackify.s
index 13e69f38c..ab05279a6 100644
--- a/test/llvm_autogenerated/cfg-stackify.s
+++ b/test/llvm_autogenerated/cfg-stackify.s
@@ -597,7 +597,7 @@ test10:
i32.gt_u $push0=, $2, $pop1
br_if 5, $pop0
copy_local $4=, $3
- tableswitch $2, 0, 0, 1, 5, 2, 4
+ br_table $2, 0, 1, 5, 2, 4, 0
.LBB19_5:
end_loop
end_loop
diff --git a/test/llvm_autogenerated/switch.s b/test/llvm_autogenerated/switch.s
index 16a06486a..4bacc6e78 100644
--- a/test/llvm_autogenerated/switch.s
+++ b/test/llvm_autogenerated/switch.s
@@ -14,7 +14,7 @@ bar32:
block
block
block
- tableswitch $0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 4, 5
+ br_table $0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 4, 5, 0
.LBB0_2:
end_block
call foo0@FUNCTION
@@ -60,7 +60,7 @@ bar64:
block
block
i32.wrap/i64 $push0=, $0
- tableswitch $pop0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 4, 5
+ br_table $pop0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 4, 5, 0
.LBB1_2:
end_block
call foo0@FUNCTION
diff --git a/test/revision b/test/revision
index dcdbd2468..f8d3a97e5 100644
--- a/test/revision
+++ b/test/revision
@@ -1 +1 @@
-3450
+3943
diff --git a/test/torture-s/20011109-1.c.s b/test/torture-s/20011109-1.c.s
index ceb59f6c7..99dd7822b 100644
--- a/test/torture-s/20011109-1.c.s
+++ b/test/torture-s/20011109-1.c.s
@@ -68,7 +68,7 @@ foo: # @foo
block
block
block
- tableswitch $0, 2, 2, 3, 3, 3, 3, 3, 4, 0, 5, 1, 1, 1 # 2: down to label3
+ br_table $0, 2, 3, 3, 3, 3, 3, 4, 0, 5, 1, 1, 1, 2 # 2: down to label3
# 3: down to label2
# 4: down to label1
# 0: down to label5
diff --git a/test/torture-s/20011219-1.c.s b/test/torture-s/20011219-1.c.s
index 3cf18631f..4420d2d5f 100644
--- a/test/torture-s/20011219-1.c.s
+++ b/test/torture-s/20011219-1.c.s
@@ -31,7 +31,7 @@ foo: # @foo
br_if 0, $pop2 # 0: down to label0
# BB#1: # %entry
block
- tableswitch $0, 0, 0, 0, 0, 0, 0 # 0: down to label1
+ br_table $0, 0, 0, 0, 0, 0, 0 # 0: down to label1
.LBB1_2: # %sw.bb4
end_block # label1:
i32.load $2=, 0($1)
diff --git a/test/torture-s/20020402-3.c.s b/test/torture-s/20020402-3.c.s
index 07907e506..bea768cf9 100644
--- a/test/torture-s/20020402-3.c.s
+++ b/test/torture-s/20020402-3.c.s
@@ -57,7 +57,7 @@ blockvector_for_pc_sect: # @blockvector_for_pc_sect
end_block # label1:
i32.const $push11=, 2
i32.shl $push12=, $4, $pop11
- i32.add $push13=, $pop12, $5
+ i32.add $push13=, $5, $pop12
i32.const $push14=, 4
i32.add $1=, $pop13, $pop14
i32.const $push24=, 1
diff --git a/test/torture-s/20030903-1.c.s b/test/torture-s/20030903-1.c.s
index f6f40d432..5f57fcf2c 100644
--- a/test/torture-s/20030903-1.c.s
+++ b/test/torture-s/20030903-1.c.s
@@ -23,7 +23,7 @@ main: # @main
.LBB0_2: # %entry
end_block # label0:
block
- tableswitch $0, 0, 0, 0, 0, 0 # 0: down to label1
+ br_table $0, 0, 0, 0, 0, 0 # 0: down to label1
.LBB0_3: # %sw.bb3
end_block # label1:
call y@FUNCTION
diff --git a/test/torture-s/20071018-1.c.s b/test/torture-s/20071018-1.c.s
index d30f423a7..7c5ee0348 100644
--- a/test/torture-s/20071018-1.c.s
+++ b/test/torture-s/20071018-1.c.s
@@ -23,11 +23,11 @@ foo: # @foo
.param i32
.result i32
# BB#0: # %entry
- i32.const $push2=, 5
- i32.shl $push3=, $0, $pop2
i32.const $push0=, 16
i32.call $push1=, __builtin_malloc@FUNCTION, $pop0
- i32.add $push4=, $pop3, $pop1
+ i32.const $push2=, 5
+ i32.shl $push3=, $0, $pop2
+ i32.add $push4=, $pop1, $pop3
i32.const $push5=, -20
i32.add $push9=, $pop4, $pop5
tee_local $push8=, $0=, $pop9
diff --git a/test/torture-s/20071120-1.c.s b/test/torture-s/20071120-1.c.s
index 30307a412..489448e68 100644
--- a/test/torture-s/20071120-1.c.s
+++ b/test/torture-s/20071120-1.c.s
@@ -71,7 +71,7 @@ pop_to_parent_deferring_access_checks: # @pop_to_parent_deferring_access_checks
# BB#5: # %VEC_deferred_access_base_last.exit29
i32.const $push5=, 3
i32.shl $push6=, $1, $pop5
- i32.add $push7=, $pop6, $0
+ i32.add $push7=, $0, $pop6
i32.const $push8=, -8
i32.add $push9=, $pop7, $pop8
i32.load $push10=, 0($pop9)
diff --git a/test/torture-s/930614-1.c.s b/test/torture-s/930614-1.c.s
index cc992045a..1ee86b495 100644
--- a/test/torture-s/930614-1.c.s
+++ b/test/torture-s/930614-1.c.s
@@ -21,7 +21,7 @@ f: # @f
.type main,@function
main: # @main
.result i32
-# BB#0: # %if.end
+# BB#0: # %if.end4
i32.const $push0=, 0
call exit@FUNCTION, $pop0
unreachable
diff --git a/test/torture-s/930921-1.c.s b/test/torture-s/930921-1.c.s
index a4c5adf50..3933abe89 100644
--- a/test/torture-s/930921-1.c.s
+++ b/test/torture-s/930921-1.c.s
@@ -25,34 +25,34 @@ f: # @f
.type main,@function
main: # @main
.result i32
- .local i32
+ .local i64, i32
# BB#0: # %entry
- i32.const $0=, 0
+ i64.const $0=, 0
+ i32.const $1=, 0
.LBB1_1: # %for.body
# =>This Inner Loop Header: Depth=1
block
loop # label1:
- i64.extend_u/i32 $push0=, $0
- i64.const $push12=, 2863311531
- i64.mul $push1=, $pop0, $pop12
- i64.const $push11=, 33
- i64.shr_u $push2=, $pop1, $pop11
- i32.wrap/i64 $push3=, $pop2
- i32.const $push10=, 3
- i32.div_u $push4=, $0, $pop10
- i32.ne $push5=, $pop3, $pop4
- br_if 2, $pop5 # 2: down to label0
+ i64.const $push10=, 33
+ i64.shr_u $push0=, $0, $pop10
+ i32.wrap/i64 $push1=, $pop0
+ i32.const $push9=, 3
+ i32.div_u $push2=, $1, $pop9
+ i32.ne $push3=, $pop1, $pop2
+ br_if 2, $pop3 # 2: down to label0
# BB#2: # %for.cond
# in Loop: Header=BB1_1 Depth=1
- i32.const $push9=, 1
- i32.add $0=, $0, $pop9
- i32.const $push8=, 9999
- i32.le_u $push6=, $0, $pop8
- br_if 0, $pop6 # 0: up to label1
+ i32.const $push8=, 1
+ i32.add $1=, $1, $pop8
+ i64.const $push7=, 2863311531
+ i64.add $0=, $0, $pop7
+ i32.const $push6=, 9999
+ i32.le_u $push4=, $1, $pop6
+ br_if 0, $pop4 # 0: up to label1
# BB#3: # %for.end
end_loop # label2:
- i32.const $push7=, 0
- call exit@FUNCTION, $pop7
+ i32.const $push5=, 0
+ call exit@FUNCTION, $pop5
unreachable
.LBB1_4: # %if.then
end_block # label0:
diff --git a/test/torture-s/950621-1.c.s b/test/torture-s/950621-1.c.s
index 3da3af2a6..eec1a4486 100644
--- a/test/torture-s/950621-1.c.s
+++ b/test/torture-s/950621-1.c.s
@@ -36,7 +36,7 @@ f: # @f
.type main,@function
main: # @main
.result i32
-# BB#0: # %f.exit
+# BB#0: # %if.end
i32.const $push0=, 0
call exit@FUNCTION, $pop0
unreachable
diff --git a/test/torture-s/990527-1.c.s b/test/torture-s/990527-1.c.s
index a46a5c9a3..89ea6de15 100644
--- a/test/torture-s/990527-1.c.s
+++ b/test/torture-s/990527-1.c.s
@@ -27,7 +27,7 @@ f: # @f
i32.const $push0=, 0
i32.const $push5=, 0
i32.load $push1=, sum($pop5)
- i32.add $push2=, $0, $pop1
+ i32.add $push2=, $pop1, $0
i32.const $push3=, 81
i32.add $push4=, $pop2, $pop3
i32.store $discard=, sum($pop0), $pop4
diff --git a/test/torture-s/ashrdi-1.c.s b/test/torture-s/ashrdi-1.c.s
index 895eb87dc..597559250 100644
--- a/test/torture-s/ashrdi-1.c.s
+++ b/test/torture-s/ashrdi-1.c.s
@@ -189,7 +189,7 @@ constant_shift: # @constant_shift
block
block
block
- tableswitch $1, 1, 1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 # 1: down to label74
+ br_table $1, 1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 1 # 1: down to label74
# 0: down to label75
# 2: down to label73
# 3: down to label72
diff --git a/test/torture-s/conversion.c.s b/test/torture-s/conversion.c.s
index 17889e09f..f3a0ca1c7 100644
--- a/test/torture-s/conversion.c.s
+++ b/test/torture-s/conversion.c.s
@@ -237,7 +237,7 @@ ldnear: # @ldnear
test_integer_to_float: # @test_integer_to_float
.result i32
.local i32
-# BB#0: # %fnear.exit178
+# BB#0: # %if.end103
return $0
.endfunc
.Lfunc_end9:
@@ -370,7 +370,7 @@ sll2ld: # @sll2ld
test_longlong_integer_to_float: # @test_longlong_integer_to_float
.result i32
.local i32
-# BB#0: # %fnear.exit
+# BB#0: # %if.end96
return $0
.endfunc
.Lfunc_end16:
diff --git a/test/torture-s/pr20527-1.c.s b/test/torture-s/pr20527-1.c.s
index 1c01cdd1f..9b2d318d4 100644
--- a/test/torture-s/pr20527-1.c.s
+++ b/test/torture-s/pr20527-1.c.s
@@ -18,7 +18,7 @@ f: # @f
i32.add $0=, $0, $pop11
i32.const $push10=, -1
i32.add $4=, $2, $pop10
- i32.add $push2=, $5, $1
+ i32.add $push2=, $1, $5
i32.const $push9=, 4
i32.add $2=, $pop2, $pop9
i32.const $1=, 0
diff --git a/test/torture-s/pr40668.c.s b/test/torture-s/pr40668.c.s
index 1de2c70b4..1b97d6aab 100644
--- a/test/torture-s/pr40668.c.s
+++ b/test/torture-s/pr40668.c.s
@@ -19,7 +19,7 @@ bar: # @bar
block
block
block
- tableswitch $0, 0, 0, 4, 4, 4, 4, 4, 1, 2, 3 # 0: down to label4
+ br_table $0, 0, 4, 4, 4, 4, 4, 1, 2, 3, 0 # 0: down to label4
# 4: down to label0
# 1: down to label3
# 2: down to label2
diff --git a/test/torture-s/pr48809.c.s b/test/torture-s/pr48809.c.s
index 6a1f6c245..8d0ceba50 100644
--- a/test/torture-s/pr48809.c.s
+++ b/test/torture-s/pr48809.c.s
@@ -46,7 +46,7 @@ foo: # @foo
br_if 0, $pop1 # 0: down to label31
# BB#1: # %entry
block
- tableswitch $0, 0, 0, 4, 3, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 3, 20, 21, 22, 23, 24, 25, 32, 26, 27, 28, 29, 30, 31 # 0: down to label32
+ br_table $0, 0, 4, 3, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 3, 20, 21, 22, 23, 24, 25, 32, 26, 27, 28, 29, 30, 31, 0 # 0: down to label32
# 4: down to label28
# 3: down to label29
# 2: down to label30
diff --git a/test/torture-s/pr49419.c.s b/test/torture-s/pr49419.c.s
index c9d8e0c7f..6bdc35b3a 100644
--- a/test/torture-s/pr49419.c.s
+++ b/test/torture-s/pr49419.c.s
@@ -107,26 +107,26 @@ foo: # @foo
.type main,@function
main: # @main
.result i32
- .local i32, i32, i32, i32, i32, i32, i32
+ .local i32, i32, i32, i32, i32, i32
# BB#0: # %for.body.i.preheader
- i32.const $push47=, __stack_pointer
- i32.load $push48=, 0($pop47)
- i32.const $push49=, 48
- i32.sub $6=, $pop48, $pop49
- i32.const $push50=, __stack_pointer
- i32.store $discard=, 0($pop50), $6
+ i32.const $push46=, __stack_pointer
+ i32.load $push47=, 0($pop46)
+ i32.const $push48=, 48
+ i32.sub $5=, $pop47, $pop48
+ i32.const $push49=, __stack_pointer
+ i32.store $discard=, 0($pop49), $5
i32.const $2=, 0
- i32.const $push30=, 0
+ i32.const $push29=, 0
i32.const $push1=, 36
- i32.call $discard=, memset@FUNCTION, $6, $pop30, $pop1
+ i32.call $discard=, memset@FUNCTION, $5, $pop29, $pop1
i32.const $push0=, 1
- i32.store $push2=, 0($6):p2align=4, $pop0
- i32.store $0=, 4($6), $pop2
- i32.load $1=, 12($6)
+ i32.store $push2=, 0($5):p2align=4, $pop0
+ i32.store $0=, 4($5), $pop2
+ i32.load $1=, 12($5)
i32.const $push3=, 2
- i32.store $3=, 8($6):p2align=3, $pop3
- i32.const $push29=, 0
- i32.store $discard=, t($pop29), $6
+ i32.store $3=, 8($5):p2align=3, $pop3
+ i32.const $push28=, 0
+ i32.store $discard=, t($pop28), $5
block
block
i32.ne $push4=, $1, $0
@@ -135,22 +135,22 @@ main: # @main
# =>This Inner Loop Header: Depth=1
loop # label10:
i32.add $1=, $2, $3
- i32.const $push31=, 1
- i32.add $2=, $2, $pop31
+ i32.const $push30=, 1
+ i32.add $2=, $2, $pop30
i32.gt_s $push10=, $1, $3
br_if 3, $pop10 # 3: down to label8
# BB#2: # %for.body.i.for.body.i_crit_edge
# in Loop: Header=BB1_1 Depth=1
- i32.const $push34=, 12
- i32.mul $push6=, $0, $pop34
- i32.add $push7=, $6, $pop6
- i32.load $0=, 4($pop7)
i32.const $push33=, 12
- i32.mul $push8=, $0, $pop33
- i32.add $push9=, $6, $pop8
+ i32.mul $push6=, $0, $pop33
+ i32.add $push7=, $5, $pop6
+ i32.load $0=, 4($pop7)
+ i32.const $push32=, 12
+ i32.mul $push8=, $0, $pop32
+ i32.add $push9=, $5, $pop8
i32.load $push5=, 0($pop9)
- i32.const $push32=, 1
- i32.eq $push11=, $pop5, $pop32
+ i32.const $push31=, 1
+ i32.eq $push11=, $pop5, $pop31
br_if 0, $pop11 # 0: up to label10
br 3 # 3: down to label8
.LBB1_3:
@@ -166,75 +166,72 @@ main: # @main
i32.eq $push13=, $1, $pop12
br_if 0, $pop13 # 0: down to label14
# BB#5: # %if.end7.i
- i32.const $push35=, 0
- i32.lt_s $push14=, $2, $pop35
+ i32.const $push34=, 0
+ i32.lt_s $push14=, $2, $pop34
br_if 1, $pop14 # 1: down to label13
# BB#6: # %for.body10.i.preheader
i32.const $3=, 1
i32.const $push15=, 2
- i32.shl $push38=, $1, $pop15
- tee_local $push37=, $0=, $pop38
+ i32.shl $push16=, $1, $pop15
i32.const $4=, 36
- i32.add $4=, $6, $4
+ i32.add $4=, $5, $4
block
- i32.add $push16=, $4, $pop37
- i32.const $push36=, 2
- i32.store $push17=, 0($pop16), $pop36
+ i32.add $push37=, $4, $pop16
+ tee_local $push36=, $0=, $pop37
+ i32.const $push35=, 2
+ i32.store $push17=, 0($pop36), $pop35
i32.lt_s $push18=, $1, $pop17
br_if 0, $pop18 # 0: down to label15
# BB#7: # %for.body10.i.for.body10.i_crit_edge.preheader
- i32.const $5=, 36
- i32.add $5=, $6, $5
- i32.add $push19=, $0, $5
- i32.const $push39=, -4
- i32.add $0=, $pop19, $pop39
+ i32.const $push38=, -4
+ i32.add $0=, $0, $pop38
i32.const $3=, 1
.LBB1_8: # %for.body10.i.for.body10.i_crit_edge
# =>This Inner Loop Header: Depth=1
loop # label16:
- i32.const $push46=, 12
- i32.mul $push20=, $3, $pop46
- i32.add $push45=, $6, $pop20
- tee_local $push44=, $3=, $pop45
- i32.load $push21=, 8($pop44)
- i32.store $discard=, 0($0), $pop21
+ i32.const $push45=, 12
+ i32.mul $push19=, $3, $pop45
+ i32.add $push44=, $5, $pop19
+ tee_local $push43=, $3=, $pop44
+ i32.load $push20=, 8($pop43)
+ i32.store $discard=, 0($0), $pop20
i32.load $3=, 4($3)
- i32.const $push43=, -1
- i32.add $1=, $1, $pop43
- i32.const $push42=, -4
- i32.add $0=, $0, $pop42
- i32.const $push41=, 1
- i32.gt_s $push22=, $1, $pop41
- br_if 0, $pop22 # 0: up to label16
+ i32.const $push42=, -1
+ i32.add $1=, $1, $pop42
+ i32.const $push41=, -4
+ i32.add $0=, $0, $pop41
+ i32.const $push40=, 1
+ i32.gt_s $push21=, $1, $pop40
+ br_if 0, $pop21 # 0: up to label16
.LBB1_9: # %foo.exit
end_loop # label17:
end_block # label15:
- i32.store $1=, 36($6), $3
+ i32.store $1=, 36($5), $3
br_if 2, $2 # 2: down to label12
# BB#10: # %if.end
- i32.const $push23=, 1
- i32.ne $push24=, $1, $pop23
- br_if 2, $pop24 # 2: down to label12
+ i32.const $push22=, 1
+ i32.ne $push23=, $1, $pop22
+ br_if 2, $pop23 # 2: down to label12
# BB#11: # %lor.lhs.false
- i32.load $push25=, 40($6)
- i32.const $push26=, 2
- i32.ne $push27=, $pop25, $pop26
- br_if 2, $pop27 # 2: down to label12
+ i32.load $push24=, 40($5)
+ i32.const $push25=, 2
+ i32.ne $push26=, $pop24, $pop25
+ br_if 2, $pop26 # 2: down to label12
# BB#12: # %if.end6
- i32.const $push28=, 0
- i32.const $push51=, 48
- i32.add $6=, $6, $pop51
- i32.const $push52=, __stack_pointer
- i32.store $discard=, 0($pop52), $6
- return $pop28
+ i32.const $push27=, 0
+ i32.const $push50=, 48
+ i32.add $5=, $5, $pop50
+ i32.const $push51=, __stack_pointer
+ i32.store $discard=, 0($pop51), $5
+ return $pop27
.LBB1_13: # %if.then6.i
end_block # label14:
call abort@FUNCTION
unreachable
.LBB1_14: # %foo.exit.thread
end_block # label13:
- i32.const $push40=, 0
- i32.store $discard=, 36($6), $pop40
+ i32.const $push39=, 0
+ i32.store $discard=, 36($5), $pop39
.LBB1_15: # %if.then5
end_block # label12:
call abort@FUNCTION
diff --git a/test/torture-s/pr58574.c.s b/test/torture-s/pr58574.c.s
index fe0f8a6fb..c8e5d6cd9 100644
--- a/test/torture-s/pr58574.c.s
+++ b/test/torture-s/pr58574.c.s
@@ -81,7 +81,7 @@ foo: # @foo
block
block
block
- tableswitch $2, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 64, 64, 64, 27, 64, 64, 64, 64, 64, 64, 64, 64, 64, 28, 64, 64, 64, 64, 64, 64, 64, 64, 64, 29, 64, 64, 64, 64, 64, 64, 64, 64, 64, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 # 0: down to label64
+ br_table $2, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 64, 64, 64, 27, 64, 64, 64, 64, 64, 64, 64, 64, 64, 28, 64, 64, 64, 64, 64, 64, 64, 64, 64, 29, 64, 64, 64, 64, 64, 64, 64, 64, 64, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0 # 0: down to label64
# 1: down to label63
# 2: down to label62
# 3: down to label61
diff --git a/test/torture-s/ptr-arith-1.c.s b/test/torture-s/ptr-arith-1.c.s
index 5bf0ec8ea..06b9d934e 100644
--- a/test/torture-s/ptr-arith-1.c.s
+++ b/test/torture-s/ptr-arith-1.c.s
@@ -8,7 +8,7 @@ f: # @f
.param i32, i32
.result i32
# BB#0: # %entry
- i32.add $push0=, $1, $0
+ i32.add $push0=, $0, $1
i32.const $push1=, 2
i32.add $push2=, $pop0, $pop1
return $pop2
diff --git a/test/torture-s/stdarg-4.c.s b/test/torture-s/stdarg-4.c.s
index e4a104dc4..ba6a92366 100644
--- a/test/torture-s/stdarg-4.c.s
+++ b/test/torture-s/stdarg-4.c.s
@@ -212,7 +212,7 @@ f3: # @f3
block
block
block
- tableswitch $0, 4, 4, 0, 1, 3, 2 # 4: down to label1
+ br_table $0, 4, 0, 1, 3, 2, 4 # 4: down to label1
# 0: down to label5
# 1: down to label4
# 3: down to label2
diff --git a/test/torture-s/switch-1.c.s b/test/torture-s/switch-1.c.s
index 8460c6f0e..de1f523b2 100644
--- a/test/torture-s/switch-1.c.s
+++ b/test/torture-s/switch-1.c.s
@@ -72,7 +72,7 @@ main: # @main
# BB#4: # %foo.exit
# in Loop: Header=BB1_1 Depth=1
block
- tableswitch $4, 0, 0, 1, 2, 1, 1, 3, 1, 4 # 0: down to label14
+ br_table $4, 0, 1, 2, 1, 1, 3, 1, 4, 0 # 0: down to label14
# 1: down to label13
# 2: down to label12
# 3: down to label11
diff --git a/test/torture-s/vfprintf-1.c.s b/test/torture-s/vfprintf-1.c.s
index 0780c1149..0a6aa45f4 100644
--- a/test/torture-s/vfprintf-1.c.s
+++ b/test/torture-s/vfprintf-1.c.s
@@ -34,7 +34,7 @@ inner: # @inner
block
block
block
- tableswitch $0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 11, 8, 9 # 0: down to label13
+ br_table $0, 0, 1, 2, 3, 4, 5, 6, 7, 11, 8, 9, 0 # 0: down to label13
# 1: down to label12
# 2: down to label11
# 3: down to label10
diff --git a/test/torture-s/vfprintf-chk-1.c.s b/test/torture-s/vfprintf-chk-1.c.s
index 6ecb87587..6efe16957 100644
--- a/test/torture-s/vfprintf-chk-1.c.s
+++ b/test/torture-s/vfprintf-chk-1.c.s
@@ -59,7 +59,7 @@ inner: # @inner
block
block
block
- tableswitch $0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 # 0: down to label13
+ br_table $0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0 # 0: down to label13
# 1: down to label12
# 2: down to label11
# 3: down to label10
diff --git a/test/torture-s/vprintf-1.c.s b/test/torture-s/vprintf-1.c.s
index 2fa197cce..de16bbda3 100644
--- a/test/torture-s/vprintf-1.c.s
+++ b/test/torture-s/vprintf-1.c.s
@@ -34,7 +34,7 @@ inner: # @inner
block
block
block
- tableswitch $0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 11, 8, 9 # 0: down to label13
+ br_table $0, 0, 1, 2, 3, 4, 5, 6, 7, 11, 8, 9, 0 # 0: down to label13
# 1: down to label12
# 2: down to label11
# 3: down to label10
diff --git a/test/torture-s/vprintf-chk-1.c.s b/test/torture-s/vprintf-chk-1.c.s
index 8a23a914b..f1aac42ae 100644
--- a/test/torture-s/vprintf-chk-1.c.s
+++ b/test/torture-s/vprintf-chk-1.c.s
@@ -61,7 +61,7 @@ inner: # @inner
block
block
block
- tableswitch $0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 # 0: down to label13
+ br_table $0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0 # 0: down to label13
# 1: down to label12
# 2: down to label11
# 3: down to label10