summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/spec/spec/local_tee.wast.js
blob: c02e2044e7df7b868b4ebcc419384107ca700d7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
/* Copyright 2021 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// ./test/core/local_tee.wast

// ./test/core/local_tee.wast:3
let $0 = instantiate(`(module
  ;; Typing

  (func (export "type-local-i32") (result i32) (local i32) (local.tee 0 (i32.const 0)))
  (func (export "type-local-i64") (result i64) (local i64) (local.tee 0 (i64.const 0)))
  (func (export "type-local-f32") (result f32) (local f32) (local.tee 0 (f32.const 0)))
  (func (export "type-local-f64") (result f64) (local f64) (local.tee 0 (f64.const 0)))

  (func (export "type-param-i32") (param i32) (result i32) (local.tee 0 (i32.const 10)))
  (func (export "type-param-i64") (param i64) (result i64) (local.tee 0 (i64.const 11)))
  (func (export "type-param-f32") (param f32) (result f32) (local.tee 0 (f32.const 11.1)))
  (func (export "type-param-f64") (param f64) (result f64) (local.tee 0 (f64.const 12.2)))

  (func (export "type-mixed") (param i64 f32 f64 i32 i32) (local f32 i64 i64 f64)
    (drop (i64.eqz (local.tee 0 (i64.const 0))))
    (drop (f32.neg (local.tee 1 (f32.const 0))))
    (drop (f64.neg (local.tee 2 (f64.const 0))))
    (drop (i32.eqz (local.tee 3 (i32.const 0))))
    (drop (i32.eqz (local.tee 4 (i32.const 0))))
    (drop (f32.neg (local.tee 5 (f32.const 0))))
    (drop (i64.eqz (local.tee 6 (i64.const 0))))
    (drop (i64.eqz (local.tee 7 (i64.const 0))))
    (drop (f64.neg (local.tee 8 (f64.const 0))))
  )

  ;; Writing

  (func (export "write") (param i64 f32 f64 i32 i32) (result i64) (local f32 i64 i64 f64)
    (drop (local.tee 1 (f32.const -0.3)))
    (drop (local.tee 3 (i32.const 40)))
    (drop (local.tee 4 (i32.const -7)))
    (drop (local.tee 5 (f32.const 5.5)))
    (drop (local.tee 6 (i64.const 6)))
    (drop (local.tee 8 (f64.const 8)))
    (i64.trunc_f64_s
      (f64.add
        (f64.convert_i64_u (local.get 0))
        (f64.add
          (f64.promote_f32 (local.get 1))
          (f64.add
            (local.get 2)
            (f64.add
              (f64.convert_i32_u (local.get 3))
              (f64.add
                (f64.convert_i32_s (local.get 4))
                (f64.add
                  (f64.promote_f32 (local.get 5))
                  (f64.add
                    (f64.convert_i64_u (local.get 6))
                    (f64.add
                      (f64.convert_i64_u (local.get 7))
                      (local.get 8)
                    )
                  )
                )
              )
            )
          )
        )
      )
    )
  )

  ;; Result

  (func (export "result") (param i64 f32 f64 i32 i32) (result f64)
    (local f32 i64 i64 f64)
    (f64.add
      (f64.convert_i64_u (local.tee 0 (i64.const 1)))
      (f64.add
        (f64.promote_f32 (local.tee 1 (f32.const 2)))
        (f64.add
          (local.tee 2 (f64.const 3.3))
          (f64.add
            (f64.convert_i32_u (local.tee 3 (i32.const 4)))
            (f64.add
              (f64.convert_i32_s (local.tee 4 (i32.const 5)))
              (f64.add
                (f64.promote_f32 (local.tee 5 (f32.const 5.5)))
                (f64.add
                  (f64.convert_i64_u (local.tee 6 (i64.const 6)))
                  (f64.add
                    (f64.convert_i64_u (local.tee 7 (i64.const 0)))
                    (local.tee 8 (f64.const 8))
                  )
                )
              )
            )
          )
        )
      )
    )
  )

  (func $$dummy)

  (func (export "as-block-first") (param i32) (result i32)
    (block (result i32) (local.tee 0 (i32.const 1)) (call $$dummy))
  )
  (func (export "as-block-mid") (param i32) (result i32)
    (block (result i32) (call $$dummy) (local.tee 0 (i32.const 1)) (call $$dummy))
  )
  (func (export "as-block-last") (param i32) (result i32)
    (block (result i32) (call $$dummy) (call $$dummy) (local.tee 0 (i32.const 1)))
  )

  (func (export "as-loop-first") (param i32) (result i32)
    (loop (result i32) (local.tee 0 (i32.const 3)) (call $$dummy))
  )
  (func (export "as-loop-mid") (param i32) (result i32)
    (loop (result i32) (call $$dummy) (local.tee 0 (i32.const 4)) (call $$dummy))
  )
  (func (export "as-loop-last") (param i32) (result i32)
    (loop (result i32) (call $$dummy) (call $$dummy) (local.tee 0 (i32.const 5)))
  )

  (func (export "as-br-value") (param i32) (result i32)
    (block (result i32) (br 0 (local.tee 0 (i32.const 9))))
  )

  (func (export "as-br_if-cond") (param i32)
    (block (br_if 0 (local.tee 0 (i32.const 1))))
  )
  (func (export "as-br_if-value") (param i32) (result i32)
    (block (result i32)
      (drop (br_if 0 (local.tee 0 (i32.const 8)) (i32.const 1))) (i32.const 7)
    )
  )
  (func (export "as-br_if-value-cond") (param i32) (result i32)
    (block (result i32)
      (drop (br_if 0 (i32.const 6) (local.tee 0 (i32.const 9)))) (i32.const 7)
    )
  )

  (func (export "as-br_table-index") (param i32)
    (block (br_table 0 0 0 (local.tee 0 (i32.const 0))))
  )
  (func (export "as-br_table-value") (param i32) (result i32)
    (block (result i32)
      (br_table 0 0 0 (local.tee 0 (i32.const 10)) (i32.const 1)) (i32.const 7)
    )
  )
  (func (export "as-br_table-value-index") (param i32) (result i32)
    (block (result i32)
      (br_table 0 0 (i32.const 6) (local.tee 0 (i32.const 11))) (i32.const 7)
    )
  )

  (func (export "as-return-value") (param i32) (result i32)
    (return (local.tee 0 (i32.const 7)))
  )

  (func (export "as-if-cond") (param i32) (result i32)
    (if (result i32) (local.tee 0 (i32.const 2))
      (then (i32.const 0)) (else (i32.const 1))
    )
  )
  (func (export "as-if-then") (param i32) (result i32)
    (if (result i32) (local.get 0)
      (then (local.tee 0 (i32.const 3))) (else (local.get 0))
    )
  )
  (func (export "as-if-else") (param i32) (result i32)
    (if (result i32) (local.get 0)
      (then (local.get 0)) (else (local.tee 0 (i32.const 4)))
    )
  )

  (func (export "as-select-first") (param i32 i32) (result i32)
    (select (local.tee 0 (i32.const 5)) (local.get 0) (local.get 1))
  )
  (func (export "as-select-second") (param i32 i32) (result i32)
    (select (local.get 0) (local.tee 0 (i32.const 6)) (local.get 1))
  )
  (func (export "as-select-cond") (param i32) (result i32)
    (select (i32.const 0) (i32.const 1) (local.tee 0 (i32.const 7)))
  )

  (func $$f (param i32 i32 i32) (result i32) (i32.const -1))
  (func (export "as-call-first") (param i32) (result i32)
    (call $$f (local.tee 0 (i32.const 12)) (i32.const 2) (i32.const 3))
  )
  (func (export "as-call-mid") (param i32) (result i32)
    (call $$f (i32.const 1) (local.tee 0 (i32.const 13)) (i32.const 3))
  )
  (func (export "as-call-last") (param i32) (result i32)
    (call $$f (i32.const 1) (i32.const 2) (local.tee 0 (i32.const 14)))
  )

  (type $$sig (func (param i32 i32 i32) (result i32)))
  (table funcref (elem $$f))
  (func (export "as-call_indirect-first") (param i32) (result i32)
    (call_indirect (type $$sig)
      (local.tee 0 (i32.const 1)) (i32.const 2) (i32.const 3) (i32.const 0)
    )
  )
  (func (export "as-call_indirect-mid") (param i32) (result i32)
    (call_indirect (type $$sig)
      (i32.const 1) (local.tee 0 (i32.const 2)) (i32.const 3) (i32.const 0)
    )
  )
  (func (export "as-call_indirect-last") (param i32) (result i32)
    (call_indirect (type $$sig)
      (i32.const 1) (i32.const 2) (local.tee 0 (i32.const 3)) (i32.const 0)
    )
  )
  (func (export "as-call_indirect-index") (param i32) (result i32)
    (call_indirect (type $$sig)
      (i32.const 1) (i32.const 2) (i32.const 3) (local.tee 0 (i32.const 0))
    )
  )

  (func (export "as-local.set-value") (local i32)
    (local.set 0 (local.tee 0 (i32.const 1)))
  )
  (func (export "as-local.tee-value") (param i32) (result i32)
    (local.tee 0 (local.tee 0 (i32.const 1)))
  )
  (global $$g (mut i32) (i32.const 0))
  (func (export "as-global.set-value") (local i32)
    (global.set $$g (local.tee 0 (i32.const 1)))
  )

  (memory 1)
  (func (export "as-load-address") (param i32) (result i32)
    (i32.load (local.tee 0 (i32.const 1)))
  )
  (func (export "as-loadN-address") (param i32) (result i32)
    (i32.load8_s (local.tee 0 (i32.const 3)))
  )

  (func (export "as-store-address") (param i32)
    (i32.store (local.tee 0 (i32.const 30)) (i32.const 7))
  )
  (func (export "as-store-value") (param i32)
    (i32.store (i32.const 2) (local.tee 0 (i32.const 1)))
  )

  (func (export "as-storeN-address") (param i32)
    (i32.store8 (local.tee 0 (i32.const 1)) (i32.const 7))
  )
  (func (export "as-storeN-value") (param i32)
    (i32.store16 (i32.const 2) (local.tee 0 (i32.const 1)))
  )

  (func (export "as-unary-operand") (param f32) (result f32)
    (f32.neg (local.tee 0 (f32.const nan:0x0f1e2)))
  )

  (func (export "as-binary-left") (param i32) (result i32)
    (i32.add (local.tee 0 (i32.const 3)) (i32.const 10))
  )
  (func (export "as-binary-right") (param i32) (result i32)
    (i32.sub (i32.const 10) (local.tee 0 (i32.const 4)))
  )

  (func (export "as-test-operand") (param i32) (result i32)
    (i32.eqz (local.tee 0 (i32.const 0)))
  )

  (func (export "as-compare-left") (param i32) (result i32)
    (i32.le_s (local.tee 0 (i32.const 43)) (i32.const 10))
  )
  (func (export "as-compare-right") (param i32) (result i32)
    (i32.ne (i32.const 10) (local.tee 0 (i32.const 42)))
  )

  (func (export "as-convert-operand") (param i64) (result i32)
    (i32.wrap_i64 (local.tee 0 (i64.const 41)))
  )

  (func (export "as-memory.grow-size") (param i32) (result i32)
    (memory.grow (local.tee 0 (i32.const 40)))
  )

)`);

// ./test/core/local_tee.wast:280
assert_return(() => invoke($0, `type-local-i32`, []), [value("i32", 0)]);

// ./test/core/local_tee.wast:281
assert_return(() => invoke($0, `type-local-i64`, []), [value("i64", 0n)]);

// ./test/core/local_tee.wast:282
assert_return(() => invoke($0, `type-local-f32`, []), [value("f32", 0)]);

// ./test/core/local_tee.wast:283
assert_return(() => invoke($0, `type-local-f64`, []), [value("f64", 0)]);

// ./test/core/local_tee.wast:285
assert_return(() => invoke($0, `type-param-i32`, [2]), [value("i32", 10)]);

// ./test/core/local_tee.wast:286
assert_return(() => invoke($0, `type-param-i64`, [3n]), [value("i64", 11n)]);

// ./test/core/local_tee.wast:287
assert_return(() => invoke($0, `type-param-f32`, [value("f32", 4.4)]), [value("f32", 11.1)]);

// ./test/core/local_tee.wast:288
assert_return(() => invoke($0, `type-param-f64`, [value("f64", 5.5)]), [value("f64", 12.2)]);

// ./test/core/local_tee.wast:290
assert_return(() => invoke($0, `as-block-first`, [0]), [value("i32", 1)]);

// ./test/core/local_tee.wast:291
assert_return(() => invoke($0, `as-block-mid`, [0]), [value("i32", 1)]);

// ./test/core/local_tee.wast:292
assert_return(() => invoke($0, `as-block-last`, [0]), [value("i32", 1)]);

// ./test/core/local_tee.wast:294
assert_return(() => invoke($0, `as-loop-first`, [0]), [value("i32", 3)]);

// ./test/core/local_tee.wast:295
assert_return(() => invoke($0, `as-loop-mid`, [0]), [value("i32", 4)]);

// ./test/core/local_tee.wast:296
assert_return(() => invoke($0, `as-loop-last`, [0]), [value("i32", 5)]);

// ./test/core/local_tee.wast:298
assert_return(() => invoke($0, `as-br-value`, [0]), [value("i32", 9)]);

// ./test/core/local_tee.wast:300
assert_return(() => invoke($0, `as-br_if-cond`, [0]), []);

// ./test/core/local_tee.wast:301
assert_return(() => invoke($0, `as-br_if-value`, [0]), [value("i32", 8)]);

// ./test/core/local_tee.wast:302
assert_return(() => invoke($0, `as-br_if-value-cond`, [0]), [value("i32", 6)]);

// ./test/core/local_tee.wast:304
assert_return(() => invoke($0, `as-br_table-index`, [0]), []);

// ./test/core/local_tee.wast:305
assert_return(() => invoke($0, `as-br_table-value`, [0]), [value("i32", 10)]);

// ./test/core/local_tee.wast:306
assert_return(() => invoke($0, `as-br_table-value-index`, [0]), [value("i32", 6)]);

// ./test/core/local_tee.wast:308
assert_return(() => invoke($0, `as-return-value`, [0]), [value("i32", 7)]);

// ./test/core/local_tee.wast:310
assert_return(() => invoke($0, `as-if-cond`, [0]), [value("i32", 0)]);

// ./test/core/local_tee.wast:311
assert_return(() => invoke($0, `as-if-then`, [1]), [value("i32", 3)]);

// ./test/core/local_tee.wast:312
assert_return(() => invoke($0, `as-if-else`, [0]), [value("i32", 4)]);

// ./test/core/local_tee.wast:314
assert_return(() => invoke($0, `as-select-first`, [0, 1]), [value("i32", 5)]);

// ./test/core/local_tee.wast:315
assert_return(() => invoke($0, `as-select-second`, [0, 0]), [value("i32", 6)]);

// ./test/core/local_tee.wast:316
assert_return(() => invoke($0, `as-select-cond`, [0]), [value("i32", 0)]);

// ./test/core/local_tee.wast:318
assert_return(() => invoke($0, `as-call-first`, [0]), [value("i32", -1)]);

// ./test/core/local_tee.wast:319
assert_return(() => invoke($0, `as-call-mid`, [0]), [value("i32", -1)]);

// ./test/core/local_tee.wast:320
assert_return(() => invoke($0, `as-call-last`, [0]), [value("i32", -1)]);

// ./test/core/local_tee.wast:322
assert_return(() => invoke($0, `as-call_indirect-first`, [0]), [value("i32", -1)]);

// ./test/core/local_tee.wast:323
assert_return(() => invoke($0, `as-call_indirect-mid`, [0]), [value("i32", -1)]);

// ./test/core/local_tee.wast:324
assert_return(() => invoke($0, `as-call_indirect-last`, [0]), [value("i32", -1)]);

// ./test/core/local_tee.wast:325
assert_return(() => invoke($0, `as-call_indirect-index`, [0]), [value("i32", -1)]);

// ./test/core/local_tee.wast:327
assert_return(() => invoke($0, `as-local.set-value`, []), []);

// ./test/core/local_tee.wast:328
assert_return(() => invoke($0, `as-local.tee-value`, [0]), [value("i32", 1)]);

// ./test/core/local_tee.wast:329
assert_return(() => invoke($0, `as-global.set-value`, []), []);

// ./test/core/local_tee.wast:331
assert_return(() => invoke($0, `as-load-address`, [0]), [value("i32", 0)]);

// ./test/core/local_tee.wast:332
assert_return(() => invoke($0, `as-loadN-address`, [0]), [value("i32", 0)]);

// ./test/core/local_tee.wast:333
assert_return(() => invoke($0, `as-store-address`, [0]), []);

// ./test/core/local_tee.wast:334
assert_return(() => invoke($0, `as-store-value`, [0]), []);

// ./test/core/local_tee.wast:335
assert_return(() => invoke($0, `as-storeN-address`, [0]), []);

// ./test/core/local_tee.wast:336
assert_return(() => invoke($0, `as-storeN-value`, [0]), []);

// ./test/core/local_tee.wast:338
assert_return(
  () => invoke($0, `as-unary-operand`, [value("f32", 0)]),
  [bytes("f32", [0xe2, 0xf1, 0x80, 0xff])],
);

// ./test/core/local_tee.wast:339
assert_return(() => invoke($0, `as-binary-left`, [0]), [value("i32", 13)]);

// ./test/core/local_tee.wast:340
assert_return(() => invoke($0, `as-binary-right`, [0]), [value("i32", 6)]);

// ./test/core/local_tee.wast:341
assert_return(() => invoke($0, `as-test-operand`, [0]), [value("i32", 1)]);

// ./test/core/local_tee.wast:342
assert_return(() => invoke($0, `as-compare-left`, [0]), [value("i32", 0)]);

// ./test/core/local_tee.wast:343
assert_return(() => invoke($0, `as-compare-right`, [0]), [value("i32", 1)]);

// ./test/core/local_tee.wast:344
assert_return(() => invoke($0, `as-convert-operand`, [0n]), [value("i32", 41)]);

// ./test/core/local_tee.wast:345
assert_return(() => invoke($0, `as-memory.grow-size`, [0]), [value("i32", 1)]);

// ./test/core/local_tee.wast:347
assert_return(() => invoke($0, `type-mixed`, [1n, value("f32", 2.2), value("f64", 3.3), 4, 5]), []);

// ./test/core/local_tee.wast:353
assert_return(
  () => invoke($0, `write`, [1n, value("f32", 2), value("f64", 3.3), 4, 5]),
  [value("i64", 56n)],
);

// ./test/core/local_tee.wast:360
assert_return(
  () => invoke($0, `result`, [-1n, value("f32", -2), value("f64", -3.3), -4, -5]),
  [value("f64", 34.8)],
);

// ./test/core/local_tee.wast:370
assert_invalid(
  () => instantiate(`(module (func $$type-local-num-vs-num (result i64) (local i32) (local.tee 0 (i32.const 0))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:374
assert_invalid(
  () => instantiate(`(module (func $$type-local-num-vs-num (local f32) (i32.eqz (local.tee 0 (f32.const 0)))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:378
assert_invalid(
  () => instantiate(`(module (func $$type-local-num-vs-num (local f64 i64) (f64.neg (local.tee 1 (i64.const 0)))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:383
assert_invalid(
  () => instantiate(`(module (func $$type-local-arg-void-vs-num (local i32) (local.tee 0 (nop))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:387
assert_invalid(
  () => instantiate(`(module (func $$type-local-arg-num-vs-num (local i32) (local.tee 0 (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:391
assert_invalid(
  () => instantiate(`(module (func $$type-local-arg-num-vs-num (local f32) (local.tee 0 (f64.const 0))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:395
assert_invalid(
  () => instantiate(`(module (func $$type-local-arg-num-vs-num (local f64 i64) (local.tee 1 (f64.const 0))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:403
assert_invalid(
  () => instantiate(`(module (func $$type-param-num-vs-num (param i32) (result i64) (local.get 0)))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:407
assert_invalid(
  () => instantiate(`(module (func $$type-param-num-vs-num (param f32) (i32.eqz (local.get 0))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:411
assert_invalid(
  () => instantiate(`(module (func $$type-param-num-vs-num (param f64 i64) (f64.neg (local.get 1))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:416
assert_invalid(
  () => instantiate(`(module (func $$type-param-arg-void-vs-num (param i32) (local.tee 0 (nop))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:420
assert_invalid(
  () => instantiate(`(module (func $$type-param-arg-num-vs-num (param i32) (local.tee 0 (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:424
assert_invalid(
  () => instantiate(`(module (func $$type-param-arg-num-vs-num (param f32) (local.tee 0 (f64.const 0))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:428
assert_invalid(
  () => instantiate(`(module (func $$type-param-arg-num-vs-num (param f64 i64) (local.tee 1 (f64.const 0))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:433
assert_invalid(
  () => instantiate(`(module
    (func $$type-param-arg-empty-vs-num (param i32)
      (local.tee 0) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:441
assert_invalid(
  () => instantiate(`(module
    (func $$type-param-arg-empty-vs-num-in-block (param i32)
      (i32.const 0)
      (block (local.tee 0) (drop))
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:450
assert_invalid(
  () => instantiate(`(module
    (func $$type-param-arg-empty-vs-num-in-loop (param i32)
      (i32.const 0)
      (loop (local.tee 0) (drop))
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:459
assert_invalid(
  () => instantiate(`(module
    (func $$type-param-arg-empty-vs-num-in-then (param i32)
      (i32.const 0) (i32.const 0)
      (if (then (local.tee 0) (drop)))
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:468
assert_invalid(
  () => instantiate(`(module
    (func $$type-param-arg-empty-vs-num-in-else (param i32)
      (i32.const 0) (i32.const 0)
      (if (result i32) (then (i32.const 0)) (else (local.tee 0))) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:477
assert_invalid(
  () => instantiate(`(module
    (func $$type-param-arg-empty-vs-num-in-br (param i32)
      (i32.const 0)
      (block (br 0 (local.tee 0)) (drop))
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:486
assert_invalid(
  () => instantiate(`(module
    (func $$type-param-arg-empty-vs-num-in-br_if (param i32)
      (i32.const 0)
      (block (br_if 0 (local.tee 0) (i32.const 1)) (drop))
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:495
assert_invalid(
  () => instantiate(`(module
    (func $$type-param-arg-empty-vs-num-in-br_table (param i32)
      (i32.const 0)
      (block (br_table 0 (local.tee 0)) (drop))
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:504
assert_invalid(
  () => instantiate(`(module
    (func $$type-param-arg-empty-vs-num-in-return (param i32)
      (return (local.tee 0)) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:512
assert_invalid(
  () => instantiate(`(module
    (func $$type-param-arg-empty-vs-num-in-select (param i32)
      (select (local.tee 0) (i32.const 1) (i32.const 2)) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:520
assert_invalid(
  () => instantiate(`(module
    (func $$type-param-arg-empty-vs-num-in-call (param i32)
      (call 1 (local.tee 0)) (drop)
    )
    (func (param i32) (result i32) (local.get 0))
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:529
assert_invalid(
  () => instantiate(`(module
    (func $$f (param i32) (result i32) (local.get 0))
    (type $$sig (func (param i32) (result i32)))
    (table funcref (elem $$f))
    (func $$type-param-arg-empty-vs-num-in-call_indirect (param i32)
      (block (result i32)
        (call_indirect (type $$sig)
          (local.tee 0) (i32.const 0)
        )
        (drop)
      )
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:545
assert_invalid(
  () => instantiate(`(module
    (func $$type-param-arg-empty-vs-num-in-local.set (param i32)
      (local.set 0 (local.tee 0)) (local.get 0) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:553
assert_invalid(
  () => instantiate(`(module
    (func $$type-param-arg-empty-vs-num-in-local.tee (param i32)
      (local.tee 0 (local.tee 0)) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:561
assert_invalid(
  () => instantiate(`(module
    (global $$x (mut i32) (i32.const 0))
    (func $$type-param-arg-empty-vs-num-in-global.set (param i32)
      (global.set $$x (local.tee 0)) (global.get $$x) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:570
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-param-arg-empty-vs-num-in-memory.grow (param i32)
      (memory.grow (local.tee 0)) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:579
assert_invalid(
  () => instantiate(`(module
    (memory 0)
    (func $$type-param-arg-empty-vs-num-in-load (param i32)
      (i32.load (local.tee 0)) (drop)
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:588
assert_invalid(
  () => instantiate(`(module
    (memory 1)
    (func $$type-param-arg-empty-vs-num-in-store (param i32)
      (i32.store (local.tee 0) (i32.const 1))
    )
  )`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:598
assert_invalid(
  () => instantiate(`(module (func $$type-mixed-arg-num-vs-num (param f32) (local i32) (local.tee 1 (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:602
assert_invalid(
  () => instantiate(`(module (func $$type-mixed-arg-num-vs-num (param i64 i32) (local f32) (local.tee 1 (f32.const 0))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:606
assert_invalid(
  () => instantiate(`(module (func $$type-mixed-arg-num-vs-num (param i64) (local f64 i64) (local.tee 1 (i64.const 0))))`),
  `type mismatch`,
);

// ./test/core/local_tee.wast:614
assert_invalid(
  () => instantiate(`(module (func $$unbound-local (local i32 i64) (local.tee 3 (i32.const 0)) drop))`),
  `unknown local`,
);

// ./test/core/local_tee.wast:618
assert_invalid(
  () => instantiate(`(module (func $$large-local (local i32 i64) (local.tee 14324343 (i32.const 0)) drop))`),
  `unknown local`,
);

// ./test/core/local_tee.wast:623
assert_invalid(
  () => instantiate(`(module (func $$unbound-param (param i32 i64) (local.tee 2 (i32.const 0)) drop))`),
  `unknown local`,
);

// ./test/core/local_tee.wast:627
assert_invalid(
  () => instantiate(`(module (func $$large-param (param i32 i64) (local.tee 714324343 (i32.const 0)) drop))`),
  `unknown local`,
);

// ./test/core/local_tee.wast:632
assert_invalid(
  () => instantiate(`(module (func $$unbound-mixed (param i32) (local i32 i64) (local.tee 3 (i32.const 0)) drop))`),
  `unknown local`,
);

// ./test/core/local_tee.wast:636
assert_invalid(
  () => instantiate(`(module (func $$large-mixed (param i64) (local i32 i64) (local.tee 214324343 (i32.const 0)) drop))`),
  `unknown local`,
);