/
endianness.rs
1122 lines (1049 loc) 路 45.6 KB
/
endianness.rs
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
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/endianness.wast
#![allow(
warnings,
dead_code
)]
use wabt::wat2wasm;
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, Instance, Export};
use super::_common::{
spectest_importobject,
NaNCheck,
};
// Line 1
fn create_module_1() -> ResultObject {
let module_str = "(module
(type (;0;) (func (param i32 i32)))
(type (;1;) (func (param i32 i64)))
(type (;2;) (func (param i32) (result i32)))
(type (;3;) (func (param i32) (result i64)))
(type (;4;) (func (param i64) (result i64)))
(type (;5;) (func (param f32) (result f32)))
(type (;6;) (func (param f64) (result f64)))
(func (;0;) (type 0) (param i32 i32)
get_local 0
get_local 1
i32.store8
get_local 0
i32.const 1
i32.add
get_local 1
i32.const 8
i32.shr_u
i32.store8)
(func (;1;) (type 0) (param i32 i32)
get_local 0
get_local 1
call 0
get_local 0
i32.const 2
i32.add
get_local 1
i32.const 16
i32.shr_u
call 0)
(func (;2;) (type 1) (param i32 i64)
get_local 0
get_local 1
i32.wrap/i64
call 1
get_local 0
i32.const 4
i32.add
get_local 1
i64.const 32
i64.shr_u
i32.wrap/i64
call 1)
(func (;3;) (type 2) (param i32) (result i32)
get_local 0
i32.load8_u
get_local 0
i32.const 1
i32.add
i32.load8_u
i32.const 8
i32.shl
i32.or)
(func (;4;) (type 2) (param i32) (result i32)
get_local 0
call 3
get_local 0
i32.const 2
i32.add
call 3
i32.const 16
i32.shl
i32.or)
(func (;5;) (type 3) (param i32) (result i64)
get_local 0
call 4
i64.extend_u/i32
get_local 0
i32.const 4
i32.add
call 4
i64.extend_u/i32
i64.const 32
i64.shl
i64.or)
(func (;6;) (type 2) (param i32) (result i32)
i32.const 0
get_local 0
call 0
i32.const 0
i32.load16_s)
(func (;7;) (type 2) (param i32) (result i32)
i32.const 0
get_local 0
call 0
i32.const 0
i32.load16_u)
(func (;8;) (type 2) (param i32) (result i32)
i32.const 0
get_local 0
call 1
i32.const 0
i32.load)
(func (;9;) (type 4) (param i64) (result i64)
i32.const 0
get_local 0
i32.wrap/i64
call 0
i32.const 0
i64.load16_s)
(func (;10;) (type 4) (param i64) (result i64)
i32.const 0
get_local 0
i32.wrap/i64
call 0
i32.const 0
i64.load16_u)
(func (;11;) (type 4) (param i64) (result i64)
i32.const 0
get_local 0
i32.wrap/i64
call 1
i32.const 0
i64.load32_s)
(func (;12;) (type 4) (param i64) (result i64)
i32.const 0
get_local 0
i32.wrap/i64
call 1
i32.const 0
i64.load32_u)
(func (;13;) (type 4) (param i64) (result i64)
i32.const 0
get_local 0
call 2
i32.const 0
i64.load)
(func (;14;) (type 5) (param f32) (result f32)
i32.const 0
get_local 0
i32.reinterpret/f32
call 1
i32.const 0
f32.load)
(func (;15;) (type 6) (param f64) (result f64)
i32.const 0
get_local 0
i64.reinterpret/f64
call 2
i32.const 0
f64.load)
(func (;16;) (type 2) (param i32) (result i32)
i32.const 0
get_local 0
i32.store16
i32.const 0
call 3)
(func (;17;) (type 2) (param i32) (result i32)
i32.const 0
get_local 0
i32.store
i32.const 0
call 4)
(func (;18;) (type 4) (param i64) (result i64)
i32.const 0
get_local 0
i64.store16
i32.const 0
call 3
i64.extend_u/i32)
(func (;19;) (type 4) (param i64) (result i64)
i32.const 0
get_local 0
i64.store32
i32.const 0
call 4
i64.extend_u/i32)
(func (;20;) (type 4) (param i64) (result i64)
i32.const 0
get_local 0
i64.store
i32.const 0
call 5)
(func (;21;) (type 5) (param f32) (result f32)
i32.const 0
get_local 0
f32.store
i32.const 0
call 4
f32.reinterpret/i32)
(func (;22;) (type 6) (param f64) (result f64)
i32.const 0
get_local 0
f64.store
i32.const 0
call 5
f64.reinterpret/i64)
(memory (;0;) 1)
(export \"i32_load16_s\" (func 6))
(export \"i32_load16_u\" (func 7))
(export \"i32_load\" (func 8))
(export \"i64_load16_s\" (func 9))
(export \"i64_load16_u\" (func 10))
(export \"i64_load32_s\" (func 11))
(export \"i64_load32_u\" (func 12))
(export \"i64_load\" (func 13))
(export \"f32_load\" (func 14))
(export \"f64_load\" (func 15))
(export \"i32_store16\" (func 16))
(export \"i32_store\" (func 17))
(export \"i64_store16\" (func 18))
(export \"i64_store32\" (func 19))
(export \"i64_store\" (func 20))
(export \"f32_store\" (func 21))
(export \"f64_store\" (func 22)))
";
let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed");
instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated")
}
fn start_module_1(result_object: &ResultObject) {
result_object.instance.start();
}
// Line 133
fn c1_l133_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c1_l133_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_load16_s") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1 as i32, &result_object.instance);
assert_eq!(result, -1 as i32);
}
// Line 134
fn c2_l134_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c2_l134_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_load16_s") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-4242 as i32, &result_object.instance);
assert_eq!(result, -4242 as i32);
}
// Line 135
fn c3_l135_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c3_l135_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_load16_s") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(42 as i32, &result_object.instance);
assert_eq!(result, 42 as i32);
}
// Line 136
fn c4_l136_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c4_l136_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_load16_s") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(12816 as i32, &result_object.instance);
assert_eq!(result, 12816 as i32);
}
// Line 138
fn c5_l138_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c5_l138_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_load16_u") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1 as i32, &result_object.instance);
assert_eq!(result, 65535 as i32);
}
// Line 139
fn c6_l139_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c6_l139_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_load16_u") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-4242 as i32, &result_object.instance);
assert_eq!(result, 61294 as i32);
}
// Line 140
fn c7_l140_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c7_l140_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_load16_u") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(42 as i32, &result_object.instance);
assert_eq!(result, 42 as i32);
}
// Line 141
fn c8_l141_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c8_l141_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_load16_u") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(51966 as i32, &result_object.instance);
assert_eq!(result, 51966 as i32);
}
// Line 143
fn c9_l143_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c9_l143_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1 as i32, &result_object.instance);
assert_eq!(result, -1 as i32);
}
// Line 144
fn c10_l144_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c10_l144_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-42424242 as i32, &result_object.instance);
assert_eq!(result, -42424242 as i32);
}
// Line 145
fn c11_l145_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c11_l145_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(42424242 as i32, &result_object.instance);
assert_eq!(result, 42424242 as i32);
}
// Line 146
fn c12_l146_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c12_l146_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1414717974 as i32, &result_object.instance);
assert_eq!(result, -1414717974 as i32);
}
// Line 148
fn c13_l148_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c13_l148_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load16_s") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1 as i64, &result_object.instance);
assert_eq!(result, -1 as i64);
}
// Line 149
fn c14_l149_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c14_l149_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load16_s") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-4242 as i64, &result_object.instance);
assert_eq!(result, -4242 as i64);
}
// Line 150
fn c15_l150_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c15_l150_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load16_s") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(42 as i64, &result_object.instance);
assert_eq!(result, 42 as i64);
}
// Line 151
fn c16_l151_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c16_l151_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load16_s") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(12816 as i64, &result_object.instance);
assert_eq!(result, 12816 as i64);
}
// Line 153
fn c17_l153_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c17_l153_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load16_u") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1 as i64, &result_object.instance);
assert_eq!(result, 65535 as i64);
}
// Line 154
fn c18_l154_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c18_l154_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load16_u") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-4242 as i64, &result_object.instance);
assert_eq!(result, 61294 as i64);
}
// Line 155
fn c19_l155_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c19_l155_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load16_u") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(42 as i64, &result_object.instance);
assert_eq!(result, 42 as i64);
}
// Line 156
fn c20_l156_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c20_l156_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load16_u") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(51966 as i64, &result_object.instance);
assert_eq!(result, 51966 as i64);
}
// Line 158
fn c21_l158_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c21_l158_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load32_s") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1 as i64, &result_object.instance);
assert_eq!(result, -1 as i64);
}
// Line 159
fn c22_l159_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c22_l159_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load32_s") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-42424242 as i64, &result_object.instance);
assert_eq!(result, -42424242 as i64);
}
// Line 160
fn c23_l160_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c23_l160_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load32_s") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(42424242 as i64, &result_object.instance);
assert_eq!(result, 42424242 as i64);
}
// Line 161
fn c24_l161_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c24_l161_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load32_s") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(305419896 as i64, &result_object.instance);
assert_eq!(result, 305419896 as i64);
}
// Line 163
fn c25_l163_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c25_l163_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load32_u") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1 as i64, &result_object.instance);
assert_eq!(result, 4294967295 as i64);
}
// Line 164
fn c26_l164_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c26_l164_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load32_u") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-42424242 as i64, &result_object.instance);
assert_eq!(result, 4252543054 as i64);
}
// Line 165
fn c27_l165_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c27_l165_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load32_u") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(42424242 as i64, &result_object.instance);
assert_eq!(result, 42424242 as i64);
}
// Line 166
fn c28_l166_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c28_l166_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load32_u") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(2880249322 as i64, &result_object.instance);
assert_eq!(result, 2880249322 as i64);
}
// Line 168
fn c29_l168_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c29_l168_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1 as i64, &result_object.instance);
assert_eq!(result, -1 as i64);
}
// Line 169
fn c30_l169_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c30_l169_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-42424242 as i64, &result_object.instance);
assert_eq!(result, -42424242 as i64);
}
// Line 170
fn c31_l170_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c31_l170_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(2880249322 as i64, &result_object.instance);
assert_eq!(result, 2880249322 as i64);
}
// Line 171
fn c32_l171_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c32_l171_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-6075977126246539798 as i64, &result_object.instance);
assert_eq!(result, -6075977126246539798 as i64);
}
// Line 173
fn c33_l173_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c33_l173_action_invoke");
let func_index = match result_object.module.info.exports.get("f32_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(f32, &Instance) -> f32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1.0 as f32, &result_object.instance);
assert_eq!(result, -1.0 as f32);
}
// Line 174
fn c34_l174_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c34_l174_action_invoke");
let func_index = match result_object.module.info.exports.get("f32_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(f32, &Instance) -> f32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(0.01234 as f32, &result_object.instance);
assert_eq!(result, 0.01234 as f32);
}
// Line 175
fn c35_l175_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c35_l175_action_invoke");
let func_index = match result_object.module.info.exports.get("f32_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(f32, &Instance) -> f32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(4242.4243 as f32, &result_object.instance);
assert_eq!(result, 4242.4243 as f32);
}
// Line 176
fn c36_l176_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c36_l176_action_invoke");
let func_index = match result_object.module.info.exports.get("f32_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(f32, &Instance) -> f32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(340282350000000000000000000000000000000.0 as f32, &result_object.instance);
assert_eq!(result, 340282350000000000000000000000000000000.0 as f32);
}
// Line 178
fn c37_l178_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c37_l178_action_invoke");
let func_index = match result_object.module.info.exports.get("f64_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(f64, &Instance) -> f64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1.0 as f64, &result_object.instance);
assert_eq!(result, -1.0 as f64);
}
// Line 179
fn c38_l179_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c38_l179_action_invoke");
let func_index = match result_object.module.info.exports.get("f64_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(f64, &Instance) -> f64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(1234.56789 as f64, &result_object.instance);
assert_eq!(result, 1234.56789 as f64);
}
// Line 180
fn c39_l180_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c39_l180_action_invoke");
let func_index = match result_object.module.info.exports.get("f64_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(f64, &Instance) -> f64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(424242.424242 as f64, &result_object.instance);
assert_eq!(result, 424242.424242 as f64);
}
// Line 181
fn c40_l181_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c40_l181_action_invoke");
let func_index = match result_object.module.info.exports.get("f64_load") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(f64, &Instance) -> f64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0 as f64, &result_object.instance);
assert_eq!(result, 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0 as f64);
}
// Line 184
fn c41_l184_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c41_l184_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_store16") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1 as i32, &result_object.instance);
assert_eq!(result, 65535 as i32);
}
// Line 185
fn c42_l185_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c42_l185_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_store16") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-4242 as i32, &result_object.instance);
assert_eq!(result, 61294 as i32);
}
// Line 186
fn c43_l186_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c43_l186_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_store16") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(42 as i32, &result_object.instance);
assert_eq!(result, 42 as i32);
}
// Line 187
fn c44_l187_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c44_l187_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_store16") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(51966 as i32, &result_object.instance);
assert_eq!(result, 51966 as i32);
}
// Line 189
fn c45_l189_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c45_l189_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_store") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1 as i32, &result_object.instance);
assert_eq!(result, -1 as i32);
}
// Line 190
fn c46_l190_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c46_l190_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_store") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-4242 as i32, &result_object.instance);
assert_eq!(result, -4242 as i32);
}
// Line 191
fn c47_l191_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c47_l191_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_store") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(42424242 as i32, &result_object.instance);
assert_eq!(result, 42424242 as i32);
}
// Line 192
fn c48_l192_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c48_l192_action_invoke");
let func_index = match result_object.module.info.exports.get("i32_store") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i32, &Instance) -> i32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-559035650 as i32, &result_object.instance);
assert_eq!(result, -559035650 as i32);
}
// Line 194
fn c49_l194_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c49_l194_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_store16") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1 as i64, &result_object.instance);
assert_eq!(result, 65535 as i64);
}
// Line 195
fn c50_l195_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c50_l195_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_store16") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-4242 as i64, &result_object.instance);
assert_eq!(result, 61294 as i64);
}
// Line 196
fn c51_l196_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c51_l196_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_store16") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(42 as i64, &result_object.instance);
assert_eq!(result, 42 as i64);
}
// Line 197
fn c52_l197_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c52_l197_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_store16") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(51966 as i64, &result_object.instance);
assert_eq!(result, 51966 as i64);
}
// Line 199
fn c53_l199_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c53_l199_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_store32") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1 as i64, &result_object.instance);
assert_eq!(result, 4294967295 as i64);
}
// Line 200
fn c54_l200_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c54_l200_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_store32") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-4242 as i64, &result_object.instance);
assert_eq!(result, 4294963054 as i64);
}
// Line 201
fn c55_l201_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c55_l201_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_store32") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(42424242 as i64, &result_object.instance);
assert_eq!(result, 42424242 as i64);
}
// Line 202
fn c56_l202_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c56_l202_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_store32") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(3735931646 as i64, &result_object.instance);
assert_eq!(result, 3735931646 as i64);
}
// Line 204
fn c57_l204_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c57_l204_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_store") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1 as i64, &result_object.instance);
assert_eq!(result, -1 as i64);
}
// Line 205
fn c58_l205_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c58_l205_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_store") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-42424242 as i64, &result_object.instance);
assert_eq!(result, -42424242 as i64);
}
// Line 206
fn c59_l206_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c59_l206_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_store") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(2880249322 as i64, &result_object.instance);
assert_eq!(result, 2880249322 as i64);
}
// Line 207
fn c60_l207_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c60_l207_action_invoke");
let func_index = match result_object.module.info.exports.get("i64_store") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(i64, &Instance) -> i64 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-6075977126246539798 as i64, &result_object.instance);
assert_eq!(result, -6075977126246539798 as i64);
}
// Line 209
fn c61_l209_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c61_l209_action_invoke");
let func_index = match result_object.module.info.exports.get("f32_store") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(f32, &Instance) -> f32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(-1.0 as f32, &result_object.instance);
assert_eq!(result, -1.0 as f32);
}
// Line 210
fn c62_l210_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c62_l210_action_invoke");
let func_index = match result_object.module.info.exports.get("f32_store") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(f32, &Instance) -> f32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(0.01234 as f32, &result_object.instance);
assert_eq!(result, 0.01234 as f32);
}
// Line 211
fn c63_l211_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c63_l211_action_invoke");
let func_index = match result_object.module.info.exports.get("f32_store") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(f32, &Instance) -> f32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(4242.4243 as f32, &result_object.instance);
assert_eq!(result, 4242.4243 as f32);
}
// Line 212
fn c64_l212_action_invoke(result_object: &ResultObject) {
println!("Executing function {}", "c64_l212_action_invoke");
let func_index = match result_object.module.info.exports.get("f32_store") {
Some(&Export::Function(index)) => index,
_ => panic!("Function not found"),
};
let invoke_fn: fn(f32, &Instance) -> f32 = get_instance_function!(result_object.instance, func_index);
let result = invoke_fn(340282350000000000000000000000000000000.0 as f32, &result_object.instance);
assert_eq!(result, 340282350000000000000000000000000000000.0 as f32);
}