Skip to content

Commit 11ea78b

Browse files
torch2424dcodeIO
authored andcommitted
Add a test for wildcard exports (#499)
1 parent c2a0a34 commit 11ea78b

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

NOTICE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ under the licensing terms detailed in LICENSE:
1212
* Linus Unnebäck <[email protected]>
1313
* Joshua Tenner <[email protected]>
1414
* Nidin Vinayakan <[email protected]>
15+
* Aaron Turner <[email protected]>
1516

1617
Portions of this software are derived from third-party works licensed under
1718
the following terms:
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
(module
2+
(type $_ (func))
3+
(memory $0 0)
4+
(table $0 1 funcref)
5+
(elem (i32.const 0) $start)
6+
(global $export/a i32 (i32.const 1))
7+
(global $export/b i32 (i32.const 2))
8+
(export "memory" (memory $0))
9+
(export "table" (table $0))
10+
(export "a" (global $export/a))
11+
(export "renamed_a" (global $export/a))
12+
(export "renamed_b" (global $export/b))
13+
(export "renamed_renamed_b" (global $export/b))
14+
(func $start (; 0 ;) (type $_)
15+
nop
16+
)
17+
)

tests/compiler/wildcard-export.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './rereexport';
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
(module
2+
(type $iii (func (param i32 i32) (result i32)))
3+
(type $_ (func))
4+
(memory $0 0)
5+
(table $0 1 funcref)
6+
(elem (i32.const 0) $null)
7+
(global $export/a i32 (i32.const 1))
8+
(global $export/b i32 (i32.const 2))
9+
(global $export/c i32 (i32.const 3))
10+
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
11+
(export "memory" (memory $0))
12+
(export "table" (table $0))
13+
(export "a" (global $export/a))
14+
(export "renamed_a" (global $export/a))
15+
(export "renamed_b" (global $export/b))
16+
(export "renamed_renamed_b" (global $export/b))
17+
(start $start)
18+
(func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
19+
local.get $0
20+
local.get $1
21+
i32.add
22+
)
23+
(func $export/mul (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
24+
local.get $0
25+
local.get $1
26+
i32.mul
27+
)
28+
(func $start:reexport (; 2 ;) (type $_)
29+
i32.const 1
30+
i32.const 2
31+
call $export/add
32+
i32.const 3
33+
i32.const 4
34+
call $export/mul
35+
i32.add
36+
drop
37+
)
38+
(func $start:rereexport (; 3 ;) (type $_)
39+
call $start:reexport
40+
)
41+
(func $start:wildcard-export (; 4 ;) (type $_)
42+
call $start:rereexport
43+
)
44+
(func $start (; 5 ;) (type $_)
45+
call $start:wildcard-export
46+
)
47+
(func $null (; 6 ;) (type $_)
48+
)
49+
)

0 commit comments

Comments
 (0)