Add a test for wildcard exports (#499)

This commit is contained in:
Aaron Turner 2019-02-21 02:38:56 -08:00 committed by Daniel Wirtz
parent c2a0a34b4c
commit 11ea78bc13
4 changed files with 68 additions and 0 deletions

1
NOTICE
View File

@ -12,6 +12,7 @@ under the licensing terms detailed in LICENSE:
* Linus Unnebäck <linus@folkdatorn.se> * Linus Unnebäck <linus@folkdatorn.se>
* Joshua Tenner <tenner.joshua@gmail.com> * Joshua Tenner <tenner.joshua@gmail.com>
* Nidin Vinayakan <01@01alchemist.com> * Nidin Vinayakan <01@01alchemist.com>
* Aaron Turner <aaron@aaronthedev.com>
Portions of this software are derived from third-party works licensed under Portions of this software are derived from third-party works licensed under
the following terms: the following terms:

View File

@ -0,0 +1,17 @@
(module
(type $_ (func))
(memory $0 0)
(table $0 1 funcref)
(elem (i32.const 0) $start)
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(export "memory" (memory $0))
(export "table" (table $0))
(export "a" (global $export/a))
(export "renamed_a" (global $export/a))
(export "renamed_b" (global $export/b))
(export "renamed_renamed_b" (global $export/b))
(func $start (; 0 ;) (type $_)
nop
)
)

View File

@ -0,0 +1 @@
export * from './rereexport';

View File

@ -0,0 +1,49 @@
(module
(type $iii (func (param i32 i32) (result i32)))
(type $_ (func))
(memory $0 0)
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(global $export/c i32 (i32.const 3))
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0))
(export "table" (table $0))
(export "a" (global $export/a))
(export "renamed_a" (global $export/a))
(export "renamed_b" (global $export/b))
(export "renamed_renamed_b" (global $export/b))
(start $start)
(func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
i32.add
)
(func $export/mul (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
i32.mul
)
(func $start:reexport (; 2 ;) (type $_)
i32.const 1
i32.const 2
call $export/add
i32.const 3
i32.const 4
call $export/mul
i32.add
drop
)
(func $start:rereexport (; 3 ;) (type $_)
call $start:reexport
)
(func $start:wildcard-export (; 4 ;) (type $_)
call $start:rereexport
)
(func $start (; 5 ;) (type $_)
call $start:wildcard-export
)
(func $null (; 6 ;) (type $_)
)
)