summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/emcc_O2_hello_world.wast96
-rw-r--r--test/emcc_hello_world.wast66
-rw-r--r--test/unit.wast2
3 files changed, 130 insertions, 34 deletions
diff --git a/test/emcc_O2_hello_world.wast b/test/emcc_O2_hello_world.wast
index 101af84a6..48bacdafd 100644
--- a/test/emcc_O2_hello_world.wast
+++ b/test/emcc_O2_hello_world.wast
@@ -21,7 +21,7 @@
(export "dynCall_ii" $dynCall_ii)
(export "dynCall_iiii" $dynCall_iiii)
(export "dynCall_vi" $dynCall_vi)
- (table $b0 $___stdio_close $___stdout_write $___stdio_seek $_cleanup_418 $___stdio_write $b1 $b1)
+ (table $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2)
(func $_malloc (param $i1 i32) (result i32)
(local $i2 i32)
(local $i3 i32)
@@ -10509,11 +10509,17 @@
(block
(set_local $i8
(call_indirect $FUNCSIG$iiii
- (i32.load align=4
- (i32.add
- (get_local $i3)
- (i32.const 36)
+ (i32.add
+ (i32.and
+ (i32.load align=4
+ (i32.add
+ (get_local $i3)
+ (i32.const 36)
+ )
+ )
+ (i32.const 7)
)
+ (i32.const 2)
)
(get_local $i3)
(get_local $i1)
@@ -10596,11 +10602,17 @@
(i32.lt_u
(i32.shr_u
(call_indirect $FUNCSIG$iiii
- (i32.load align=4
- (i32.add
- (get_local $i3)
- (i32.const 36)
+ (i32.add
+ (i32.and
+ (i32.load align=4
+ (i32.add
+ (get_local $i3)
+ (i32.const 36)
+ )
+ )
+ (i32.const 7)
)
+ (i32.const 2)
)
(get_local $i3)
(get_local $i1)
@@ -11244,11 +11256,17 @@
(if_else
(i32.eq
(call_indirect $FUNCSIG$iiii
- (i32.load align=4
- (i32.add
- (get_local $i1)
- (i32.const 36)
+ (i32.add
+ (i32.and
+ (i32.load align=4
+ (i32.add
+ (get_local $i1)
+ (i32.const 36)
+ )
+ )
+ (i32.const 7)
)
+ (i32.const 2)
)
(get_local $i1)
(get_local $i4)
@@ -11314,11 +11332,17 @@
)
(block
(call_indirect $FUNCSIG$iiii
- (i32.load align=4
- (i32.add
- (get_local $i1)
- (i32.const 36)
+ (i32.add
+ (i32.and
+ (i32.load align=4
+ (i32.add
+ (get_local $i1)
+ (i32.const 36)
+ )
+ )
+ (i32.const 7)
)
+ (i32.const 2)
)
(get_local $i1)
(i32.const 0)
@@ -11371,11 +11395,17 @@
)
)
(call_indirect $FUNCSIG$iiii
- (i32.load align=4
- (i32.add
- (get_local $i1)
- (i32.const 40)
+ (i32.add
+ (i32.and
+ (i32.load align=4
+ (i32.add
+ (get_local $i1)
+ (i32.const 40)
+ )
+ )
+ (i32.const 7)
)
+ (i32.const 2)
)
(get_local $i1)
(i32.sub
@@ -12496,7 +12526,13 @@
)
(func $dynCall_iiii (param $i1 i32) (param $i2 i32) (param $i3 i32) (param $i4 i32) (result i32)
(call_indirect $FUNCSIG$iiii
- (get_local $i1)
+ (i32.add
+ (i32.and
+ (get_local $i1)
+ (i32.const 7)
+ )
+ (i32.const 2)
+ )
(get_local $i2)
(get_local $i3)
(get_local $i4)
@@ -12594,7 +12630,13 @@
)
(func $dynCall_ii (param $i1 i32) (param $i2 i32) (result i32)
(call_indirect $FUNCSIG$ii
- (get_local $i1)
+ (i32.add
+ (i32.and
+ (get_local $i1)
+ (i32.const 1)
+ )
+ (i32.const 0)
+ )
(get_local $i2)
)
)
@@ -12632,7 +12674,13 @@
)
(func $dynCall_vi (param $i1 i32) (param $i2 i32)
(call_indirect $FUNCSIG$vi
- (get_local $i1)
+ (i32.add
+ (i32.and
+ (get_local $i1)
+ (i32.const 7)
+ )
+ (i32.const 10)
+ )
(get_local $i2)
)
)
diff --git a/test/emcc_hello_world.wast b/test/emcc_hello_world.wast
index d3fa7e4a9..4cba6cdd8 100644
--- a/test/emcc_hello_world.wast
+++ b/test/emcc_hello_world.wast
@@ -25,7 +25,7 @@
(export "dynCall_ii" $dynCall_ii)
(export "dynCall_iiii" $dynCall_iiii)
(export "dynCall_vi" $dynCall_vi)
- (table $b0 $___stdio_close $___stdout_write $___stdio_seek $___stdio_write $_cleanup $b1 $b1)
+ (table $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2)
(func $stackAlloc (param $size i32) (result i32)
(local $ret i32)
(block $topmost
@@ -2632,7 +2632,13 @@
)
)
(call_indirect $FUNCSIG$iiii
- (get_local $$5)
+ (i32.add
+ (i32.and
+ (get_local $$5)
+ (i32.const 7)
+ )
+ (i32.const 2)
+ )
(get_local $$f)
(i32.const 0)
(i32.const 0)
@@ -2925,7 +2931,13 @@
)
(set_local $$call4
(call_indirect $FUNCSIG$iiii
- (get_local $$5)
+ (i32.add
+ (i32.and
+ (get_local $$5)
+ (i32.const 7)
+ )
+ (i32.const 2)
+ )
(get_local $$f)
(get_local $$s)
(get_local $$l)
@@ -3052,7 +3064,13 @@
)
(set_local $$call16
(call_indirect $FUNCSIG$iiii
- (get_local $$8)
+ (i32.add
+ (i32.and
+ (get_local $$8)
+ (i32.const 7)
+ )
+ (i32.const 2)
+ )
(get_local $$f)
(get_local $$s)
(get_local $$i$0$lcssa36)
@@ -4578,7 +4596,13 @@
)
)
(call_indirect $FUNCSIG$iiii
- (get_local $$2)
+ (i32.add
+ (i32.and
+ (get_local $$2)
+ (i32.const 7)
+ )
+ (i32.const 2)
+ )
(get_local $$f)
(i32.const 0)
(i32.const 0)
@@ -4675,7 +4699,13 @@
)
)
(call_indirect $FUNCSIG$iiii
- (get_local $$6)
+ (i32.add
+ (i32.and
+ (get_local $$6)
+ (i32.const 7)
+ )
+ (i32.const 2)
+ )
(get_local $$f)
(get_local $$sub$ptr$sub)
(i32.const 1)
@@ -34174,13 +34204,25 @@
)
(func $dynCall_ii (param $index i32) (param $a1 i32) (result i32)
(call_indirect $FUNCSIG$ii
- (get_local $index)
+ (i32.add
+ (i32.and
+ (get_local $index)
+ (i32.const 1)
+ )
+ (i32.const 0)
+ )
(get_local $a1)
)
)
(func $dynCall_iiii (param $index i32) (param $a1 i32) (param $a2 i32) (param $a3 i32) (result i32)
(call_indirect $FUNCSIG$iiii
- (get_local $index)
+ (i32.add
+ (i32.and
+ (get_local $index)
+ (i32.const 7)
+ )
+ (i32.const 2)
+ )
(get_local $a1)
(get_local $a2)
(get_local $a3)
@@ -34188,7 +34230,13 @@
)
(func $dynCall_vi (param $index i32) (param $a1 i32)
(call_indirect $FUNCSIG$vi
- (get_local $index)
+ (i32.add
+ (i32.and
+ (get_local $index)
+ (i32.const 7)
+ )
+ (i32.const 10)
+ )
(get_local $a1)
)
)
diff --git a/test/unit.wast b/test/unit.wast
index 2e053fd73..34f8a9d50 100644
--- a/test/unit.wast
+++ b/test/unit.wast
@@ -2,7 +2,7 @@
(memory 16777216 16777216)
(import $f64-rem "asm2wasm" "f64-rem" (param f64 f64) (result f64))
(export "big_negative" $big_negative)
- (table $z $big_negative $importedDoubles $z)
+ (table $z $big_negative $z $z $w $w $importedDoubles $w)
(func $big_negative
(local $temp f64)
(block