Skip to content

Commit c6f5f16

Browse files
authored
Regenerate lld test inputs (#2502)
1 parent a28343a commit c6f5f16

18 files changed

Lines changed: 185 additions & 831 deletions

scripts/test/generate_lld_tests.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import os
2020
import sys
2121

22-
from . import shared
23-
from . import support
22+
import shared
23+
import support
2424

2525

2626
def files_with_extensions(path, extensions):
@@ -67,6 +67,7 @@ def generate_wast_files(llvm_bin, emscripten_root):
6767
obj_path, '-o', wasm_path,
6868
'--allow-undefined',
6969
'--export', '__wasm_call_ctors',
70+
'--export', '__data_end',
7071
'--global-base=568',
7172
]
7273
if is_shared:

test/lld/em_asm.wast

Lines changed: 17 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,21 @@
22
(type $0 (func (param i32 i32 i32) (result i32)))
33
(type $1 (func))
44
(type $2 (func (result i32)))
5-
(type $3 (func (param i32 i32 i32)))
6-
(type $4 (func (param i32 i32)))
7-
(type $5 (func (param i32) (result i32)))
8-
(type $6 (func (param i32 i32) (result i32)))
5+
(type $3 (func (param i32 i32) (result i32)))
96
(import "env" "emscripten_asm_const_int" (func $emscripten_asm_const_int (param i32 i32 i32) (result i32)))
107
(memory $0 2)
11-
(data (i32.const 568) "{ Module.print(\"Hello world\"); }\00{ return $0 + $1; }\00{ Module.print(\"Got \" + $0); }\00")
8+
(data (i32.const 568) "{ Module.print(\"Hello world\"); }\00\00{ return $0 + $1; }\00ii\00{ Module.print(\"Got \" + $0); }\00i\00")
129
(table $0 1 1 funcref)
13-
(global $global$0 (mut i32) (i32.const 66192))
14-
(global $global$1 i32 (i32.const 66192))
15-
(global $global$2 i32 (i32.const 652))
10+
(global $global$0 (mut i32) (i32.const 66208))
11+
(global $global$1 i32 (i32.const 658))
1612
(export "memory" (memory $0))
1713
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
18-
(export "__heap_base" (global $global$1))
19-
(export "__data_end" (global $global$2))
2014
(export "main" (func $main))
15+
(export "__data_end" (global $global$1))
2116
(func $__wasm_call_ctors (; 1 ;) (type $1)
2217
)
2318
(func $__original_main (; 2 ;) (type $2) (result i32)
2419
(local $0 i32)
25-
(local $1 i32)
2620
(global.set $global$0
2721
(local.tee $0
2822
(i32.sub
@@ -31,163 +25,46 @@
3125
)
3226
)
3327
)
34-
(i32.store8 offset=24
35-
(local.get $0)
36-
(call $__em_asm_sig_builder::inner<>\20const\20__em_asm_sig_builder::__em_asm_sig<>\28\29)
37-
)
3828
(drop
3929
(call $emscripten_asm_const_int
4030
(i32.const 568)
41-
(i32.add
42-
(local.get $0)
43-
(i32.const 24)
44-
)
31+
(i32.const 601)
4532
(i32.const 0)
4633
)
4734
)
48-
(call $__em_asm_sig_builder::inner<int\2c\20int>\20const\20__em_asm_sig_builder::__em_asm_sig<int\2c\20int>\28int\2c\20int\29
49-
(i32.add
50-
(local.get $0)
51-
(i32.const 24)
52-
)
53-
(i32.const 13)
54-
(i32.const 27)
55-
)
5635
(i64.store offset=16
5736
(local.get $0)
5837
(i64.const 115964117005)
5938
)
60-
(call $__em_asm_sig_builder::inner<int>\20const\20__em_asm_sig_builder::__em_asm_sig<int>\28int\29
61-
(i32.add
62-
(local.get $0)
63-
(i32.const 24)
64-
)
65-
(local.tee $1
66-
(call $emscripten_asm_const_int
67-
(i32.const 601)
68-
(i32.add
69-
(local.get $0)
70-
(i32.const 24)
71-
)
72-
(i32.add
73-
(local.get $0)
74-
(i32.const 16)
75-
)
76-
)
77-
)
78-
)
7939
(i32.store
8040
(local.get $0)
81-
(local.get $1)
82-
)
83-
(drop
8441
(call $emscripten_asm_const_int
85-
(i32.const 621)
42+
(i32.const 602)
43+
(i32.const 622)
8644
(i32.add
8745
(local.get $0)
88-
(i32.const 24)
89-
)
90-
(local.get $0)
91-
)
92-
)
93-
(global.set $global$0
94-
(i32.add
95-
(local.get $0)
96-
(i32.const 32)
97-
)
98-
)
99-
(i32.const 0)
100-
)
101-
(func $__em_asm_sig_builder::inner<>\20const\20__em_asm_sig_builder::__em_asm_sig<>\28\29 (; 3 ;) (type $2) (result i32)
102-
(i32.const 0)
103-
)
104-
(func $__em_asm_sig_builder::inner<int\2c\20int>\20const\20__em_asm_sig_builder::__em_asm_sig<int\2c\20int>\28int\2c\20int\29 (; 4 ;) (type $3) (param $0 i32) (param $1 i32) (param $2 i32)
105-
(local $3 i32)
106-
(global.set $global$0
107-
(local.tee $3
108-
(i32.sub
109-
(global.get $global$0)
11046
(i32.const 16)
11147
)
11248
)
11349
)
114-
(i32.store8 offset=13
115-
(local.get $3)
116-
(call $__em_asm_sig_builder::sig_char\28int\29
117-
(local.get $1)
118-
)
119-
)
120-
(local.set $2
121-
(call $__em_asm_sig_builder::sig_char\28int\29
122-
(local.get $2)
123-
)
124-
)
125-
(i32.store8
126-
(i32.add
50+
(drop
51+
(call $emscripten_asm_const_int
52+
(i32.const 625)
53+
(i32.const 656)
12754
(local.get $0)
128-
(i32.const 2)
129-
)
130-
(i32.const 0)
131-
)
132-
(i32.store8 offset=14
133-
(local.get $3)
134-
(local.get $2)
135-
)
136-
(i32.store16 align=1
137-
(local.get $0)
138-
(i32.load16_u offset=13 align=1
139-
(local.get $3)
140-
)
141-
)
142-
(global.set $global$0
143-
(i32.add
144-
(local.get $3)
145-
(i32.const 16)
146-
)
147-
)
148-
)
149-
(func $__em_asm_sig_builder::inner<int>\20const\20__em_asm_sig_builder::__em_asm_sig<int>\28int\29 (; 5 ;) (type $4) (param $0 i32) (param $1 i32)
150-
(local $2 i32)
151-
(global.set $global$0
152-
(local.tee $2
153-
(i32.sub
154-
(global.get $global$0)
155-
(i32.const 16)
156-
)
157-
)
158-
)
159-
(local.set $1
160-
(call $__em_asm_sig_builder::sig_char\28int\29
161-
(local.get $1)
162-
)
163-
)
164-
(i32.store8 offset=15
165-
(local.get $2)
166-
(i32.const 0)
167-
)
168-
(i32.store8 offset=14
169-
(local.get $2)
170-
(local.get $1)
171-
)
172-
(i32.store16 align=1
173-
(local.get $0)
174-
(i32.load16_u offset=14
175-
(local.get $2)
17655
)
17756
)
17857
(global.set $global$0
17958
(i32.add
180-
(local.get $2)
181-
(i32.const 16)
59+
(local.get $0)
60+
(i32.const 32)
18261
)
18362
)
63+
(i32.const 0)
18464
)
185-
(func $__em_asm_sig_builder::sig_char\28int\29 (; 6 ;) (type $5) (param $0 i32) (result i32)
186-
(i32.const 105)
187-
)
188-
(func $main (; 7 ;) (type $6) (param $0 i32) (param $1 i32) (result i32)
65+
(func $main (; 3 ;) (type $3) (param $0 i32) (param $1 i32) (result i32)
18966
(call $__original_main)
19067
)
191-
;; custom section "producers", size 111
68+
;; custom section "producers", size 112
19269
)
19370

test/lld/em_asm.wast.mem.mem

6 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)