summaryrefslogtreecommitdiff
path: root/test/example
diff options
context:
space:
mode:
Diffstat (limited to 'test/example')
-rw-r--r--test/example/module-splitting.txt241
1 files changed, 183 insertions, 58 deletions
diff --git a/test/example/module-splitting.txt b/test/example/module-splitting.txt
index b083e8967..69fabc816 100644
--- a/test/example/module-splitting.txt
+++ b/test/example/module-splitting.txt
@@ -399,14 +399,24 @@ After:
(type $0 (func (param i32) (result i32)))
(import "placeholder" "0" (func $placeholder_0 (type $0) (param i32) (result i32)))
(table $table 1 funcref)
- (elem $0 (i32.const 0) $placeholder_0)
+ (table $0 1 funcref)
+ (elem $0 (table $table) (i32.const 0) func $trampoline_foo)
+ (elem $0_1 (table $0) (i32.const 0) func $placeholder_0)
(export "%table" (table $table))
+ (export "%table_1" (table $0))
+ (func $trampoline_foo (type $0) (param $0 i32) (result i32)
+ (call_indirect $0 (type $0)
+ (local.get $0)
+ (i32.const 0)
+ )
+ )
)
Secondary:
(module
(type $0 (func (param i32) (result i32)))
+ (import "primary" "%table_1" (table $0 1 funcref))
(import "primary" "%table" (table $table 1 funcref))
- (elem $0 (i32.const 0) $foo)
+ (elem $0 (table $0) (i32.const 0) func $foo)
(func $foo (type $0) (param $0 i32) (result i32)
(local.get $0)
)
@@ -427,16 +437,25 @@ After:
(module
(type $0 (func (param i32) (result i32)))
(import "placeholder" "0" (func $placeholder_0 (type $0) (param i32) (result i32)))
- (import "placeholder" "1" (func $placeholder_1 (type $0) (param i32) (result i32)))
(table $table 2 funcref)
- (elem $0 (i32.const 0) $placeholder_0 $placeholder_1)
+ (table $0 1 funcref)
+ (elem $0 (table $table) (i32.const 0) func $trampoline_foo $trampoline_foo)
+ (elem $0_1 (table $0) (i32.const 0) func $placeholder_0)
(export "%table" (table $table))
+ (export "%table_1" (table $0))
+ (func $trampoline_foo (type $0) (param $0 i32) (result i32)
+ (call_indirect $0 (type $0)
+ (local.get $0)
+ (i32.const 0)
+ )
+ )
)
Secondary:
(module
(type $0 (func (param i32) (result i32)))
+ (import "primary" "%table_1" (table $0 1 funcref))
(import "primary" "%table" (table $table 2 funcref))
- (elem $0 (i32.const 0) $foo $foo)
+ (elem $0 (table $0) (i32.const 0) func $foo)
(func $foo (type $0) (param $0 i32) (result i32)
(local.get $0)
)
@@ -457,23 +476,33 @@ Keeping: <none>
After:
(module
(type $0 (func (param i32) (result i32)))
- (import "placeholder" "42" (func $placeholder_42 (type $0) (param i32) (result i32)))
+ (import "placeholder" "0" (func $placeholder_0 (type $0) (param i32) (result i32)))
(table $table 1000 funcref)
- (elem $0 (i32.const 42) $placeholder_42)
+ (table $0 1 funcref)
+ (elem $0 (table $table) (i32.const 42) func $trampoline_foo)
+ (elem $0_1 (table $0) (i32.const 0) func $placeholder_0)
(export "foo" (func $foo))
(export "%table" (table $table))
+ (export "%table_2" (table $0))
(func $foo (type $0) (param $0 i32) (result i32)
- (call_indirect $table (type $0)
+ (call_indirect $0 (type $0)
+ (local.get $0)
+ (i32.const 0)
+ )
+ )
+ (func $trampoline_foo (type $0) (param $0 i32) (result i32)
+ (call_indirect $0 (type $0)
(local.get $0)
- (i32.const 42)
+ (i32.const 0)
)
)
)
Secondary:
(module
(type $0 (func (param i32) (result i32)))
+ (import "primary" "%table_2" (table $0 1 funcref))
(import "primary" "%table" (table $table 1000 funcref))
- (elem $0 (i32.const 42) $foo)
+ (elem $0 (table $0) (i32.const 0) func $foo)
(func $foo (type $0) (param $0 i32) (result i32)
(local.get $0)
)
@@ -498,23 +527,33 @@ After:
(import "env" "base" (global $base i32))
(import "placeholder" "0" (func $placeholder_0 (type $0) (param i32) (result i32)))
(table $table 1000 funcref)
- (elem $0 (global.get $base) $placeholder_0)
+ (table $0 1 funcref)
+ (elem $0 (table $table) (global.get $base) func $trampoline_foo)
+ (elem $0_1 (table $0) (i32.const 0) func $placeholder_0)
(export "foo" (func $foo))
(export "%table" (table $table))
+ (export "%table_2" (table $0))
(export "%global" (global $base))
(func $foo (type $0) (param $0 i32) (result i32)
- (call_indirect $table (type $0)
+ (call_indirect $0 (type $0)
+ (local.get $0)
+ (i32.const 0)
+ )
+ )
+ (func $trampoline_foo (type $0) (param $0 i32) (result i32)
+ (call_indirect $0 (type $0)
(local.get $0)
- (global.get $base)
+ (i32.const 0)
)
)
)
Secondary:
(module
(type $0 (func (param i32) (result i32)))
+ (import "primary" "%table_2" (table $0 1 funcref))
(import "primary" "%table" (table $table 1000 funcref))
(import "primary" "%global" (global $base i32))
- (elem $0 (global.get $base) $foo)
+ (elem $0 (table $0) (i32.const 0) func $foo)
(func $foo (type $0) (param $0 i32) (result i32)
(local.get $0)
)
@@ -538,25 +577,34 @@ After:
(type $0 (func (param i32) (result i32)))
(import "env" "base" (global $base i32))
(import "placeholder" "0" (func $placeholder_0 (type $0) (param i32) (result i32)))
- (import "placeholder" "1" (func $placeholder_1 (type $0) (param i32) (result i32)))
(table $table 1000 funcref)
- (elem $0 (global.get $base) $placeholder_0 $placeholder_1)
+ (table $0 1 funcref)
+ (elem $0 (table $table) (global.get $base) func $trampoline_foo $trampoline_foo)
+ (elem $0_1 (table $0) (i32.const 0) func $placeholder_0)
(export "foo" (func $foo))
(export "%table" (table $table))
+ (export "%table_2" (table $0))
(export "%global" (global $base))
(func $foo (type $0) (param $0 i32) (result i32)
- (call_indirect $table (type $0)
+ (call_indirect $0 (type $0)
(local.get $0)
- (global.get $base)
+ (i32.const 0)
+ )
+ )
+ (func $trampoline_foo (type $0) (param $0 i32) (result i32)
+ (call_indirect $0 (type $0)
+ (local.get $0)
+ (i32.const 0)
)
)
)
Secondary:
(module
(type $0 (func (param i32) (result i32)))
+ (import "primary" "%table_2" (table $0 1 funcref))
(import "primary" "%table" (table $table 1000 funcref))
(import "primary" "%global" (global $base i32))
- (elem $0 (global.get $base) $foo $foo)
+ (elem $0 (table $0) (i32.const 0) func $foo)
(func $foo (type $0) (param $0 i32) (result i32)
(local.get $0)
)
@@ -584,34 +632,38 @@ After:
(type $0 (func (param i32) (result i32)))
(type $1 (func))
(import "env" "base" (global $base i32))
- (import "placeholder" "1" (func $placeholder_1 (type $0) (param i32) (result i32)))
+ (import "placeholder" "0" (func $placeholder_0 (type $0) (param i32) (result i32)))
(table $table 1000 funcref)
- (elem $0 (global.get $base) $null $placeholder_1)
+ (table $0 1 funcref)
+ (elem $0 (table $table) (global.get $base) func $null $trampoline_foo)
+ (elem $0_1 (table $0) (i32.const 0) func $placeholder_0)
(export "foo" (func $foo))
- (export "%null" (func $null))
(export "%table" (table $table))
+ (export "%table_2" (table $0))
(export "%global" (global $base))
(func $null (type $1)
(nop)
)
(func $foo (type $0) (param $0 i32) (result i32)
- (call_indirect $table (type $0)
+ (call_indirect $0 (type $0)
+ (local.get $0)
+ (i32.const 0)
+ )
+ )
+ (func $trampoline_foo (type $0) (param $0 i32) (result i32)
+ (call_indirect $0 (type $0)
(local.get $0)
- (i32.add
- (global.get $base)
- (i32.const 1)
- )
+ (i32.const 0)
)
)
)
Secondary:
(module
(type $0 (func (param i32) (result i32)))
- (type $1 (func))
+ (import "primary" "%table_2" (table $0 1 funcref))
(import "primary" "%table" (table $table 1000 funcref))
(import "primary" "%global" (global $base i32))
- (import "primary" "%null" (func $null (type $1)))
- (elem $0 (global.get $base) $null $foo)
+ (elem $0 (table $0) (i32.const 0) func $foo)
(func $foo (type $0) (param $0 i32) (result i32)
(local.get $0)
)
@@ -799,23 +851,36 @@ After:
(module
(type $0 (func))
(import "placeholder" "0" (func $placeholder_0 (type $0)))
- (import "placeholder" "2" (func $placeholder_2 (type $0)))
+ (import "placeholder" "1" (func $placeholder_1 (type $0)))
(table $table 4 funcref)
- (elem $0 (i32.const 0) $placeholder_0 $bar $placeholder_2 $quux)
+ (table $0 2 funcref)
+ (elem $0 (table $table) (i32.const 0) func $trampoline_foo $bar $trampoline_baz $quux)
+ (elem $0_1 (table $0) (i32.const 0) func $placeholder_0 $placeholder_1)
(export "%table" (table $table))
+ (export "%table_1" (table $0))
(func $bar (type $0)
(nop)
)
(func $quux (type $0)
(nop)
)
+ (func $trampoline_foo (type $0)
+ (call_indirect $0 (type $0)
+ (i32.const 0)
+ )
+ )
+ (func $trampoline_baz (type $0)
+ (call_indirect $0 (type $0)
+ (i32.const 1)
+ )
+ )
)
Secondary:
(module
(type $0 (func))
+ (import "primary" "%table_1" (table $0 2 funcref))
(import "primary" "%table" (table $table 4 funcref))
- (elem $0 (i32.const 0) $foo)
- (elem $1 (i32.const 2) $baz)
+ (elem $0 (table $0) (i32.const 0) func $foo $baz)
(func $baz (type $0)
(nop)
)
@@ -850,11 +915,13 @@ After:
(type $0 (func))
(import "env" "base" (global $base i32))
(import "placeholder" "0" (func $placeholder_0 (type $0)))
- (import "placeholder" "2" (func $placeholder_2 (type $0)))
+ (import "placeholder" "1" (func $placeholder_1 (type $0)))
(table $table 4 funcref)
- (elem $0 (global.get $base) $placeholder_0 $bar $placeholder_2 $quux)
- (export "%bar" (func $bar))
+ (table $0 2 funcref)
+ (elem $0 (table $table) (global.get $base) func $trampoline_foo $bar $trampoline_baz $quux)
+ (elem $0_1 (table $0) (i32.const 0) func $placeholder_0 $placeholder_1)
(export "%table" (table $table))
+ (export "%table_1" (table $0))
(export "%global" (global $base))
(func $bar (type $0)
(nop)
@@ -862,14 +929,24 @@ After:
(func $quux (type $0)
(nop)
)
+ (func $trampoline_foo (type $0)
+ (call_indirect $0 (type $0)
+ (i32.const 0)
+ )
+ )
+ (func $trampoline_baz (type $0)
+ (call_indirect $0 (type $0)
+ (i32.const 1)
+ )
+ )
)
Secondary:
(module
(type $0 (func))
+ (import "primary" "%table_1" (table $0 2 funcref))
(import "primary" "%table" (table $table 4 funcref))
(import "primary" "%global" (global $base i32))
- (import "primary" "%bar" (func $bar (type $0)))
- (elem $0 (global.get $base) $foo $bar $baz)
+ (elem $0 (table $0) (i32.const 0) func $foo $baz)
(func $baz (type $0)
(nop)
)
@@ -903,20 +980,38 @@ After:
(type $0 (func))
(import "placeholder" "0" (func $placeholder_0 (type $0)))
(import "placeholder" "1" (func $placeholder_1 (type $0)))
- (import "placeholder" "3" (func $placeholder_3 (type $0)))
+ (import "placeholder" "2" (func $placeholder_2 (type $0)))
(table $table 4 funcref)
- (elem $0 (i32.const 0) $placeholder_0 $placeholder_1 $baz $placeholder_3)
+ (table $0 3 funcref)
+ (elem $0 (table $table) (i32.const 0) func $trampoline_foo $trampoline_bar $baz $trampoline_quux)
+ (elem $0_1 (table $0) (i32.const 0) func $placeholder_0 $placeholder_1 $placeholder_2)
(export "%table" (table $table))
+ (export "%table_1" (table $0))
(func $baz (type $0)
(nop)
)
+ (func $trampoline_foo (type $0)
+ (call_indirect $0 (type $0)
+ (i32.const 0)
+ )
+ )
+ (func $trampoline_bar (type $0)
+ (call_indirect $0 (type $0)
+ (i32.const 1)
+ )
+ )
+ (func $trampoline_quux (type $0)
+ (call_indirect $0 (type $0)
+ (i32.const 2)
+ )
+ )
)
Secondary:
(module
(type $0 (func))
+ (import "primary" "%table_1" (table $0 3 funcref))
(import "primary" "%table" (table $table 4 funcref))
- (elem $0 (i32.const 0) $foo $bar)
- (elem $1 (i32.const 3) $quux)
+ (elem $0 (table $0) (i32.const 0) func $foo $bar $quux)
(func $bar (type $0)
(nop)
)
@@ -955,23 +1050,40 @@ After:
(import "env" "base" (global $base i32))
(import "placeholder" "0" (func $placeholder_0 (type $0)))
(import "placeholder" "1" (func $placeholder_1 (type $0)))
- (import "placeholder" "3" (func $placeholder_3 (type $0)))
+ (import "placeholder" "2" (func $placeholder_2 (type $0)))
(table $table 4 funcref)
- (elem $0 (global.get $base) $placeholder_0 $placeholder_1 $baz $placeholder_3)
- (export "%baz" (func $baz))
+ (table $0 3 funcref)
+ (elem $0 (table $table) (global.get $base) func $trampoline_foo $trampoline_bar $baz $trampoline_quux)
+ (elem $0_1 (table $0) (i32.const 0) func $placeholder_0 $placeholder_1 $placeholder_2)
(export "%table" (table $table))
+ (export "%table_1" (table $0))
(export "%global" (global $base))
(func $baz (type $0)
(nop)
)
+ (func $trampoline_foo (type $0)
+ (call_indirect $0 (type $0)
+ (i32.const 0)
+ )
+ )
+ (func $trampoline_bar (type $0)
+ (call_indirect $0 (type $0)
+ (i32.const 1)
+ )
+ )
+ (func $trampoline_quux (type $0)
+ (call_indirect $0 (type $0)
+ (i32.const 2)
+ )
+ )
)
Secondary:
(module
(type $0 (func))
+ (import "primary" "%table_1" (table $0 3 funcref))
(import "primary" "%table" (table $table 4 funcref))
(import "primary" "%global" (global $base i32))
- (import "primary" "%baz" (func $baz (type $0)))
- (elem $0 (global.get $base) $foo $bar $baz $quux)
+ (elem $0 (table $0) (i32.const 0) func $foo $bar $quux)
(func $bar (type $0)
(nop)
)
@@ -1002,23 +1114,32 @@ After:
(module
(type $0 (func))
(import "env" "base" (global $base i32))
- (import "placeholder" "1" (func $placeholder_1 (type $0)))
+ (import "placeholder" "0" (func $placeholder_0 (type $0)))
(table $table 2 funcref)
- (elem $0 (global.get $base) $foo $placeholder_1)
+ (table $0 1 funcref)
+ (elem $0 (table $table) (global.get $base) func $foo $trampoline_bar)
+ (elem $0_1 (table $0) (i32.const 0) func $placeholder_0)
(export "%foo" (func $foo))
(export "%table" (table $table))
+ (export "%table_2" (table $0))
(export "%global" (global $base))
(func $foo (type $0)
(nop)
)
+ (func $trampoline_bar (type $0)
+ (call_indirect $0 (type $0)
+ (i32.const 0)
+ )
+ )
)
Secondary:
(module
(type $0 (func))
+ (import "primary" "%table_2" (table $0 1 funcref))
(import "primary" "%table" (table $table 2 funcref))
(import "primary" "%global" (global $base i32))
(import "primary" "%foo" (func $foo (type $0)))
- (elem $0 (global.get $base) $foo $bar)
+ (elem $0 (table $0) (i32.const 0) func $bar)
(func $bar (type $0)
(call $foo)
)
@@ -1045,24 +1166,28 @@ Keeping: foo
After:
(module
(type $0 (func (param i32) (result i32)))
- (import "placeholder" "1" (func $placeholder_1 (type $0) (param i32) (result i32)))
- (table $table 2 2 funcref)
- (elem $0 (i32.const 0) $foo $placeholder_1)
+ (import "placeholder" "0" (func $placeholder_0 (type $0) (param i32) (result i32)))
+ (table $table 1 1 funcref)
+ (table $0 1 funcref)
+ (elem $0 (table $table) (i32.const 0) func $foo)
+ (elem $0_1 (table $0) (i32.const 0) func $placeholder_0)
(export "%foo" (func $foo))
(export "%table" (table $table))
+ (export "%table_2" (table $0))
(func $foo (type $0) (param $0 i32) (result i32)
- (call_indirect $table (type $0)
+ (call_indirect $0 (type $0)
+ (i32.const 0)
(i32.const 0)
- (i32.const 1)
)
)
)
Secondary:
(module
(type $0 (func (param i32) (result i32)))
- (import "primary" "%table" (table $table 2 2 funcref))
+ (import "primary" "%table_2" (table $0 1 funcref))
+ (import "primary" "%table" (table $table 1 1 funcref))
(import "primary" "%foo" (func $foo (type $0) (param i32) (result i32)))
- (elem $0 (i32.const 1) $bar)
+ (elem $0 (table $0) (i32.const 0) func $bar)
(func $bar (type $0) (param $0 i32) (result i32)
(call $foo
(i32.const 1)