• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14definitions:
15  - name: PandaAssembly
16    template: |
17      .language PandaAssembly
18  - name: aoobe_p
19    template: |
20      .record panda.ArrayIndexOutOfBoundsException<external>
21  - name: aoobe_j
22    template: |
23      .record panda.ArrayIndexOutOfBoundsException<external>
24  - name: npe_p
25    template: |
26      .record panda.NullPointerException <external>
27  - name: npe_j
28    template: |
29      .record panda.NullPointerException <external>
30
31tests:
32  - file-name: "fstarr.64"
33    isa:
34      title: Store to array
35      description: >
36        Store accumulator content into array slot pointed by index.
37      instructions:
38        - sig: fstarr.64 v1:in:f64[], v2:in:i32
39          acc: in:f64
40          format: [op_v1_4_v2_4]
41          properties: [acc_read, float]
42    commands:
43
44
45      - file-name: "reg_valid"
46        isa:
47          instructions:
48            - sig: fstarr.64 v1:in:f64[], v2:in:i32
49              acc: in:f64
50              format: [op_v1_4_v2_4]
51              properties: [acc_read, float]
52        check-type: empty
53        runner-options: [compile-only]
54        description: Check 'fstarr.64' instruction with valid register numbers.
55        header-template: []
56        code-template: |
57          #
58          .function i32 main() {
59              fstarr.64 %s, %s
60              ldai 0
61              return
62          }
63        cases:
64          - values: [v0, v15]
65          - values: [v15, v0]
66          - values: [v15, v15]
67          - case-template: |
68              #
69              .function i32 f1(f64[] a0, i32 a1) {
70                  fstarr.64 a0, a1   # valid registers
71                  ldai 0
72                  return
73              }
74
75              .function i32 main() {
76                  call.short f1, v1, v2
77                  return
78              }
79
80
81      - file-name: "reg_v_invalid"
82        isa:
83          instructions:
84            - sig: fstarr.64 v1:in:f64[], v2:in:i32
85              acc: in:f64
86              format: [op_v1_4_v2_4]
87              properties: [acc_read, float]
88        runner-options: [compile-failure]
89        description: Check 'fstarr.64' instruction with invalid register numbers.
90        code-template: |
91          #
92              fstarr.64 %s, *s
93        check-type: exit-positive
94        template-cases:
95          - values: [v0]
96            exclude: [v0, v15]
97          - values: [v15]
98            exclude: [v0, v15]
99          - values: [v255]
100          - values: [v256]
101          - values: [v65536]
102          - values: [a0]
103          - values: ['V1']
104          - values: ['null']
105          - values: [0]
106        cases:
107          - values: [v0]
108            id: v0
109          - values: [v15]
110            id: v15
111          - values: [v255]
112          - values: [v256]
113          - values: [v65536]
114          - values: [a0]
115          - values: ['V1']
116          - values: ['null']
117          - values: [0]
118
119
120      - file-name: "reg_a_invalid"
121        isa:
122          instructions:
123            - sig: fstarr.64 v1:in:f64[], v2:in:i32
124              acc: in:f64
125              format: [op_v1_4_v2_4]
126              properties: [acc_read, float]
127        runner-options: [compile-failure]
128        description: Check 'fstarr.64' instruction with invalid register numbers.
129        header-template: []
130        code-template: |
131              #
132              .function void f1(f64[] a0, i32 a1) {
133                  fstarr.64 %s
134                  return.void
135              }
136
137              .function i32 main() {
138                  call.short f1, v1, v2
139        check-type: exit-positive
140        cases:
141          - values:
142            - 'a0, a2'
143          - values:
144            - 'a2, a1'
145
146
147      - file-name: null_pointer_p
148        isa:
149          exceptions:
150            - x_null
151        description: Check 'fstarr.64' behavior when array is null reference.
152        tags: ['irtoc_ignore']
153        header-template: [npe_p]
154        code-template: |
155          .function f64[] get_null() {
156              lda.null
157              return.obj
158          }
159          .function i32 main() {
160              call.short get_null
161              sta.obj v0
162              movi v1, %s
163              fldai.64 0
164          begin:
165              fstarr.64 v0, v1
166          end:
167              ldai 1 # Should not reach this line
168              return
169
170          catch_NPE:
171              ldai 0 # Expected panda.NullPointerException
172              return
173
174          catch_all:
175              ldai 2 # Unexpected exception, test failed
176              return
177
178          .catch panda.NullPointerException, begin, end, catch_NPE
179          .catchall begin, end, catch_all
180        check-type: none
181        cases:
182          - values: [0]
183            tags: ['tsan']
184          - values: [1]
185          - values: [10]
186          - values: [128]
187          - values: [255]
188          - values: [65535]
189            tags: ['tsan']
190          - values: [0x7FFFFFFF]
191          - values: [0xFFFFFFFF]
192          - values: [0x80000000]
193
194
195      - file-name: null_pointer_j
196        isa:
197          exceptions:
198            - x_null
199        description: Check 'fstarr.64' behavior when array is null reference.
200        tags: ['irtoc_ignore']
201        header-template: [PandaAssembly, npe_j]
202        runner-options: [use-pa]
203        bugid: ['3047']
204        code-template: |
205          .function f64[] get_null() {
206              lda.null
207              return.obj
208          }
209          .function i32 main() {
210              call.short get_null
211              sta.obj v0
212              movi v1, %s
213              fldai.64 0
214          begin:
215              fstarr.64 v0, v1
216          end:
217              ldai 1 # Should not reach this line
218              return
219
220          catch_NPE:
221              ldai 0 # Expected panda.NullPointerException
222              return
223
224          catch_all:
225              ldai 2 # Unexpected exception, test failed
226              return
227
228          .catch panda.NullPointerException, begin, end, catch_NPE
229          .catchall begin, end, catch_all
230        check-type: none
231        cases:
232          - values: [0]
233            tags: ['tsan']
234          - values: [1]
235          - values: [10]
236          - values: [128]
237          - values: [255]
238          - values: [65535]
239            tags: ['tsan']
240          - values: [0x7FFFFFFF]
241          - values: [0xFFFFFFFF]
242          - values: [0x80000000]
243
244
245      - file-name: array_out_of_bounds_exception_p
246        isa:
247          exceptions:
248            - x_bounds
249        description: Check 'fstarr.64' behavior when index is out of array bounds.
250        tags: ['irtoc_ignore']
251        header-template: [aoobe_p, main]
252        code-template: |
253          #
254              movi v0, %s
255              newarr v0, v0, f64[]
256              movi v1, %s
257              fldai.64 0
258          begin:
259              fstarr.64 v0, v1
260          end:
261              ldai 1 # Should not reach this line
262              return
263
264          catch_AOOBE:
265              ldai 0 # Expected panda.ArrayIndexOutOfBoundsException
266              return
267
268          catch_all:
269              ldai 2 # Unexpected exception, test failed
270              return
271
272          .catch panda.ArrayIndexOutOfBoundsException, begin, end, catch_AOOBE
273          .catchall begin, end, catch_all
274        check-type: none
275        cases:
276          - values: [0, 0]
277            tags: ['tsan']
278          - values: [0, 1]
279          - values: [10, -10]
280          - values: [10, 128]
281          - values: [255, 255]
282          - values: [254, 255]
283          - values: [65535, 65535]
284            tags: ['tsan']
285          - values: [65535, 65536]
286          - values: [10, 0xFFFFFFFF]
287          - values: [256, 0xFFFFFFFE]
288          - values: [65536, 0xFFFFFFFD]
289            tags: ['tsan']
290          - values: [0x100000, 0xFFFFFFFC]
291          - values: [10, 0x80000000]
292          - values: [256, 0x80000001]
293          - values: [65536, 0x80000002]
294            tags: ['tsan']
295          - values: [0x100000, 0x80000003]
296
297
298      - file-name: array_out_of_bounds_exception_j
299        isa:
300          exceptions:
301            - x_bounds
302        description: Check 'fstarr.64' behavior when index is out of array bounds.
303        tags: ['irtoc_ignore']
304        runner-options: [use-pa]
305        header-template: [PandaAssembly, aoobe_j, main]
306        code-template: |
307          #
308              movi v0, %s
309              newarr v0, v0, f64[]
310              movi v1, %s
311              fldai.64 0
312          begin:
313              fstarr.64 v0, v1
314          end:
315              ldai 1 # Should not reach this line
316              return
317
318          catch_AOOBE:
319              ldai 0 # Expected panda.ArrayIndexOutOfBoundsException
320              return
321
322          catch_all:
323              ldai 2 # Unexpected exception, test failed
324              return
325
326          .catch panda.ArrayIndexOutOfBoundsException, begin, end, catch_AOOBE
327          .catchall begin, end, catch_all
328        check-type: none
329        cases:
330          - values: [0, 0]
331            tags: ['tsan']
332          - values: [0, 1]
333          - values: [10, -10]
334          - values: [10, 128]
335          - values: [255, 255]
336          - values: [254, 255]
337          - values: [65535, 65535]
338            tags: ['tsan']
339          - values: [65535, 65536]
340          - values: [10, 0xFFFFFFFF]
341          - values: [256, 0xFFFFFFFE]
342          - values: [65536, 0xFFFFFFFD]
343            tags: ['tsan']
344          - values: [0x100000, 0xFFFFFFFC]
345          - values: [10, 0x80000000]
346          - values: [256, 0x80000001]
347          - values: [65536, 0x80000002]
348            tags: ['tsan']
349          - values: [0x100000, 0x80000003]
350
351
352      - file-name: uninitialized_regs
353        isa:
354          verification:
355            - v1_array_type
356            - v2_i32
357            - acc_type
358        description: Check 'fstarr.64' with uninitialized registers
359        tags: ['verifier']
360        runner-options: ['verifier-failure', 'verifier-config']
361        header-template: []
362        code-template: |
363            #
364            .function i32 main() {
365                %s
366                fstarr.64 v1, v2
367        check-type: exit-positive
368        cases:
369          - values:
370              - |
371                # acc is not initialized
372                    movi v0, 10
373                    newarr v1, v0, f64[]
374                    movi v2, 0
375          - values:
376              - |
377                # v1 is not initialized
378                    movi v2, 0
379                    fldai.64 0
380          - values:
381              - |
382                # v2 is not initialized
383                    movi v0, 10
384                    newarr v1, v0, f64[]
385                    fldai.64 0
386          - values:
387              - |
388                # all regs are not initialized
389
390
391      - file-name: "acceptable_primitive_types_p"
392        isa:
393          verification:
394            - v1_array_type
395        description: Check acceptable array of primitive types for fstarr.64 instruction in Panda Assembly context.
396        runner-options: ['verifier-only', 'verifier-config']
397        tags: ['verifier']
398        header-template: [main]
399        code-template: |
400          #
401              movi v0, 1
402              newarr v1, v0, f64[]
403              movi v2, 0
404              fldai.64 0
405              fstarr.64 v1, v2
406        check-type: exit-positive
407
408
409      - file-name: "acceptable_primitive_types_j"
410        isa:
411          verification:
412            - v1_array_type
413        description: Check acceptable array of primitive types for fstarr.64 instruction in PandaAssembly context.
414        runner-options: [verifier-only, use-pa, verifier-config]
415        tags: ['verifier', 'pa-verifier']
416        bugid: ['6886']
417        header-template: [PandaAssembly, main]
418        code-template: |
419          #
420              movi v0, 1
421              newarr v1, v0, f64[]
422              movi v2, 0
423              fldai.64 0
424              fstarr.64 v1, v2
425        check-type: exit-positive
426
427
428      - file-name: "rejectable_primitive_types_p"
429        isa:
430          verification:
431            - v1_array_type
432        description: Check rejectable array of primitive types for fstarr.64 instruction in Panda Assembly context.
433        runner-options: ['verifier-failure', 'verifier-config']
434        tags: ['verifier']
435        header-template: [main]
436        code-template: |
437          #
438              movi v0, 1
439              newarr v1, v0, %s
440              movi v2, 0
441              fldai.64 0
442              fstarr.64 v1, v2
443        check-type: exit-positive
444        cases:
445          - values: ['u1[]']
446          - values: ['i8[]']
447          - values: ['u8[]']
448          - values: ['i16[]']
449          - values: ['u16[]']
450          - values: ['i32[]']
451          - values: ['u32[]']
452          - values: ['i64[]']
453          - values: ['u64[]']
454          - values: ['f32[]']
455
456
457      - file-name: "rejectable_primitive_types_j"
458        isa:
459          verification:
460            - v1_array_type
461        description: Check rejectable array of primitive types for fstarr.64 instruction in PandaAssembly context.
462        runner-options: [verifier-failure, use-pa, verifier-config]
463        tags: ['verifier', 'pa-verifier']
464        bugid: ['3293', '5271', '6886']
465        header-template: [PandaAssembly, main]
466        code-template: |
467          #
468              movi v0, 1
469              newarr v1, v0, %s
470              movi v2, 0
471              fldai.64 0
472              fstarr.64 v1, v2
473        check-type: exit-positive
474        cases:
475          - values: ['u1[]']
476          - values: ['i8[]']
477          - values: ['u8[]']
478          - values: ['i16[]']
479          - values: ['u16[]']
480          - values: ['i32[]']
481          - values: ['u32[]']
482          - values: ['i64[]']
483          - values: ['u64[]']
484          - values: ['f32[]']
485
486
487      - file-name: "arr_type_p"
488        isa:
489          verification:
490            - v1_array_type
491        description: Check 'fstarr.64' with incorrect array type in Panda Assembly context. See also "rejectable_primitive_types" tests.
492        runner-options: ['verifier-failure', 'verifier-config']
493        tags: ['verifier']
494        header-template: []
495        code-template: |
496          #
497          .record A {}
498          .function void A.ctor(A a0) <ctor> {
499              return.void
500          }
501          .record panda.String <external>
502          .record panda.Object <external>
503          .function i32 main() {
504              %s
505              movi v1, 0
506              fldai.64 0
507              fstarr.64 v0, v1
508        check-type: exit-positive
509        cases:
510          - values:
511              - movi v0, 0
512          - values:
513              - movi.64 v0, 0
514          - values:
515              - fmovi v0, 0
516          - values:
517              - fmovi.64 v0, 0
518          - values:
519              - |
520                #
521                    initobj A.ctor
522                    sta.obj v0
523          - values:
524              - |
525                #
526                    movi v0, 1
527                    newarr v0, v0, A[]
528          - values:
529              - |
530                #
531                    lda.type A
532                    sta.obj v0
533          - values:
534              - |
535                #
536                    lda.type A[]
537                    sta.obj v0
538          - values:
539              - |
540                #
541                    lda.type panda.String
542                    sta.obj v0
543          - values:
544              - |
545                #
546                    lda.type panda.String[]
547                    sta.obj v0
548          - values:
549              - |
550                #
551                    lda.type panda.Object
552                    sta.obj v0
553          - values:
554              - |
555                #
556                    lda.type panda.Object[]
557                    sta.obj v0
558          - values:
559              - |
560                #
561                    lda.str "string"
562                    sta.obj v0
563          - values:
564              - |
565                #
566                    movi v0, 1
567                    newarr v0, v0, panda.Object[]
568          - values:
569              - |
570                #
571                    movi v0, 1
572                    newarr v0, v0, panda.String[]
573
574
575      - file-name: "arr_type_j"
576        isa:
577          verification:
578            - v1_array_type
579        description: Check 'fstarr.64' with incorrect array type in PandaAssembly context. See also "rejectable_primitive_types" tests.
580        runner-options: [verifier-failure, use-pa, verifier-config]
581        tags: ['verifier', 'pa-verifier']
582        bugid: ['3293', '5271', '6886']
583        header-template: [PandaAssembly]
584        code-template: |
585          #
586          .record A {}
587          .function void A.ctor(A a0) <ctor> {
588              return.void
589          }
590          .record panda.Object <external>
591          .function void panda.Object.ctor(panda.Object a0) <external,ctor>
592          .function i32 main() {
593              %s
594              movi v1, 0
595              fldai.64 0
596              fstarr.64 v0, v1
597        check-type: exit-positive
598        cases:
599          - values:
600              - movi v0, 0
601          - values:
602              - movi.64 v0, 0
603          - values:
604              - fmovi v0, 0
605          - values:
606              - fmovi.64 v0, 0
607          - values:
608              - |
609                #
610                    initobj A.ctor
611                    sta.obj v0
612          - values:
613              - |
614                #
615                    movi v0, 1
616                    newarr v0, v0, A[]
617          - values:
618              - |
619                #
620                    initobj panda.Object.ctor
621                    sta.obj v0
622          - values:
623              - |
624                #
625                    movi v0, 1
626                    newarr v0, v0, panda.Object[]
627          - values:
628              - |
629                #
630                    lda.type A
631                    sta.obj v0
632          - values:
633              - |
634                #
635                    lda.type A[]
636                    sta.obj v0
637          - values:
638              - |
639                #
640                    lda.type panda.Object
641                    sta.obj v0
642          - values:
643              - |
644                #
645                    lda.type panda.Object[]
646                    sta.obj v0
647          - values:
648              - |
649                #
650                    lda.str "string"
651                    sta.obj v0
652
653
654      - file-name: "index_type_p"
655        isa:
656          verification:
657            - v2_i32
658        description: Check 'fstarr.64' with incorrect array index type in Panda Assembly context.
659        runner-options: ['verifier-failure', 'verifier-config']
660        tags: ['verifier']
661        header-template: []
662        code-template: |
663          #
664          .record A {}
665          .function void A.ctor(A a0) <ctor> {
666              return.void
667          }
668          .record panda.String <external>
669          .record panda.Object <external>
670          .function i32 main() {
671              movi v0, 1
672              newarr v1, v0, *s
673              %s
674              fldai.64 0
675              fstarr.64 v1, v2
676        check-type: exit-positive
677        cases:
678          - values: ['f64[]']
679        template-cases:
680          - values:
681              - mov.null v2
682          - values:
683              - movi.64 v2, 0
684          - values:
685              - fmovi v2, 0
686          - values:
687              - fmovi.64 v2, 0
688          - values:
689              - |
690                #
691                    initobj A.ctor
692                    sta.obj v1
693          - values:
694              - |
695                #
696                    movi v0, 1
697                    newarr v2, v0, A[]
698          - values:
699              - |
700                #
701                    lda.type A
702                    sta.obj v2
703          - values:
704              - |
705                #
706                    lda.type A[]
707                    sta.obj v2
708          - values:
709              - |
710                #
711                    lda.type panda.String
712                    sta.obj v2
713          - values:
714              - |
715                #
716                    lda.type panda.String[]
717                    sta.obj v2
718          - values:
719              - |
720                #
721                    lda.type panda.Object
722                    sta.obj v2
723          - values:
724              - |
725                #
726                    lda.type panda.Object[]
727                    sta.obj v2
728          - values:
729              - |
730                #
731                    lda.str "string"
732                    sta.obj v2
733          - values:
734              - |
735                #
736                    movi v0, 1
737                    newarr v2, v0, panda.Object[]
738          - values:
739              - |
740                #
741                    movi v0, 1
742                    newarr v2, v0, panda.String[]
743
744
745      - file-name: "index_type_j"
746        isa:
747          verification:
748            - v2_i32
749        description: Check 'fstarr.64' with incorrect array index type in PandaAssembly context.
750        runner-options: [verifier-failure, use-pa, verifier-config]
751        tags: ['verifier', 'pa-verifier']
752        bugid: ['3293', '5271', '6886']
753        header-template: [PandaAssembly]
754        code-template: |
755          #
756          .record A {}
757          .function void A.ctor(A a0) <ctor> {
758              return.void
759          }
760          .record panda.Object <external>
761          .function void panda.Object.ctor(panda.Object a0) <external,ctor>
762          .function i32 main() {
763              movi v0, 1
764              newarr v1, v0, *s
765              %s
766              fldai.64 0
767              fstarr.64 v1, v2
768        check-type: exit-positive
769        cases:
770          - values: ['f64[]']
771        template-cases:
772          - values:
773              - mov.null v2
774          - values:
775              - movi.64 v2, 0
776          - values:
777              - fmovi v2, 0
778          - values:
779              - fmovi.64 v2, 0
780          - values:
781              - |
782                #
783                    initobj A.ctor
784                    sta.obj v2
785          - values:
786              - |
787                #
788                    movi v0, 1
789                    newarr v2, v0, A[]
790          - values:
791              - |
792                #
793                    initobj panda.Object.ctor
794                    sta.obj v2
795          - values:
796              - |
797                #
798                    movi v0, 1
799                    newarr v2, v0, panda.Object[]
800          - values:
801              - |
802                #
803                    lda.type A
804                    sta.obj v2
805          - values:
806              - |
807                #
808                    lda.type A[]
809                    sta.obj v2
810          - values:
811              - |
812                #
813                    lda.type panda.Object
814                    sta.obj v2
815          - values:
816              - |
817                #
818                    lda.type panda.Object[]
819                    sta.obj v2
820          - values:
821              - |
822                #
823                    lda.str "string"
824                    sta.obj v2
825
826
827      - file-name: "acc_type_p"
828        isa:
829          verification:
830            - acc_type
831        description: Check 'fstarr.64' with incorrect accumulator type in Panda Assembly context.
832        runner-options: ['verifier-failure', 'verifier-config']
833        tags: ['verifier']
834        header-template: []
835        code-template: |
836          #
837          .record A {}
838          .function void A.ctor(A a0) <ctor> {
839              return.void
840          }
841          .record panda.String <external>
842          .record panda.Object <external>
843          .function i32 main() {
844              movi v0, 1
845              newarr v1, v0, *s
846              movi v2, 0
847              %s
848              fstarr.64 v1, v2
849        check-type: exit-positive
850        cases:
851          - values: ['f64[]']
852        template-cases:
853          - values:
854              - lda.null
855          - values:
856              - ldai.64 0
857          - values:
858              - ldai 0
859          - values:
860              - fldai 0
861            bugid: ['6094']
862          - values:
863              - |
864                #
865                    initobj A.ctor
866          - values:
867              - |
868                #
869                    lda.type A
870          - values:
871              - |
872                #
873                    lda.type panda.String
874          - values:
875              - |
876                #
877                    lda.type panda.String[]
878          - values:
879              - |
880                #
881                    lda.type panda.Object
882          - values:
883              - |
884                #
885                    lda.type panda.Object[]
886          - values:
887              - |
888                #
889                    lda.str "string"
890          - values:
891              - |
892                #
893                    movi v0, 1
894                    newarr v0, v0, panda.Object[]
895                    lda.obj v0
896          - values:
897              - |
898                #
899                    movi v0, 1
900                    newarr v0, v0, panda.String[]
901                    lda.obj v0
902
903
904      - file-name: "acc_type_j"
905        isa:
906          verification:
907            - acc_type
908        description: Check 'fstarr.64' with incorrect accumulator type in PandaAssembly context.
909        runner-options: [verifier-failure, use-pa, verifier-config]
910        tags: ['verifier', 'pa-verifier']
911        bugid: ['3293', '5271', '6886']
912        header-template: [PandaAssembly]
913        code-template: |
914          #
915          .record A {}
916          .function void A.ctor(A a0) <ctor> {
917              return.void
918          }
919          .record panda.Object <external>
920          .function void panda.Object.ctor(panda.Object a0) <external,ctor>
921          .function i32 main() {
922              movi v0, 1
923              newarr v1, v0, *s
924              movi v2, 0
925              %s
926              fstarr.64 v1, v2
927        check-type: exit-positive
928        cases:
929          - values: ['f64[]']
930        template-cases:
931          - values:
932              - lda.null
933          - values:
934              - ldai.64 0
935          - values:
936              - ldai 0
937          - values:
938              - fldai 0
939            bugid: ['6094']
940          - values:
941              - |
942                #
943                    initobj A.ctor
944          - values:
945              - |
946                #
947                    initobj panda.Object.ctor
948          - values:
949              - |
950                #
951                    lda.type A
952          - values:
953              - |
954                #
955                    lda.type A[]
956          - values:
957              - |
958                #
959                    lda.type panda.Object
960          - values:
961              - |
962                #
963                    lda.type panda.Object[]
964          - values:
965              - |
966                #
967                    lda.str "string"
968          - values:
969              - |
970                #
971                    movi v0, 1
972                    newarr v0, v0, panda.Object[]
973                    lda.obj v0
974          - values:
975              - |
976                #
977                    movi v0, 1
978                    newarr v0, v0, A[]
979                    lda.obj v0
980
981
982      - file-name: "mult_regs_types_p"
983        isa:
984          verification:
985            - v1_array_type
986            - v2_i32
987            - acc_type
988        description: Check 'fstarr.64' with multiple incorrect register types in Panda Assembly context.
989        runner-options: ['verifier-failure', 'verifier-config']
990        tags: ['verifier']
991        header-template: []
992        code-template: |
993          #
994          .record A {}
995          .function void A.ctor(A a0) <ctor> {
996              return.void
997          }
998          .record panda.String <external>
999          .record panda.Object <external>
1000          .function void panda.Object.ctor(panda.Object a0) <external,ctor>
1001          .function i32 main() {
1002              %s
1003              fstarr.64 v1, v2
1004        check-type: exit-positive
1005        cases:
1006          - values:
1007              - |
1008                # all registers invalid
1009                    initobj panda.Object.ctor
1010                    sta.obj v1
1011                    movi.64 v2, 0
1012                    lda.str "test string"
1013          - values:
1014              - |
1015                # v1 and v2 invalid
1016                    lda.str "test string"
1017                    sta.obj v1
1018                    fmovi.64 v2, 1
1019                    ldai 0
1020          - values:
1021              - |
1022                # v1 and acc invalid
1023                    lda.type panda.Object
1024                    sta.obj v1
1025                    movi v2, 0
1026                    lda.str "test string"
1027          - values:
1028              - |
1029                # v2 and acc invalid
1030                    movi v0, 1
1031                    newarr v1, v0, f64[]
1032                    sta.obj v2
1033                    initobj A.ctor
1034
1035
1036      - file-name: "mult_regs_types_j"
1037        isa:
1038          verification:
1039            - v1_array_type
1040            - v2_i32
1041            - acc_type
1042        description: Check 'fstarr.64' with multiple incorrect register types in PandaAssembly context.
1043        runner-options: [verifier-failure, use-pa, verifier-config]
1044        tags: ['verifier', 'pa-verifier']
1045        bugid: ['3293', '5271', '6886']
1046        header-template: [PandaAssembly]
1047        code-template: |
1048          #
1049          .record A {}
1050          .function void A.ctor(A a0) <ctor> {
1051              return.void
1052          }
1053          .record panda.Object <external>
1054          .function void panda.Object.ctor(panda.Object a0) <external,ctor>
1055          .function i32 main() {
1056              %s
1057              fstarr.64 v1, v2
1058        check-type: exit-positive
1059        cases:
1060          - values:
1061              - |
1062                # all registers invalid
1063                    initobj panda.Object.ctor
1064                    sta.obj v1
1065                    movi.64 v2, 0
1066                    lda.str "test string"
1067          - values:
1068              - |
1069                # v1 and v2 invalid
1070                    lda.str "test string"
1071                    sta.obj v1
1072                    fmovi.64 v2, 1
1073                    ldai 0
1074          - values:
1075              - |
1076                # v1 and acc invalid
1077                    lda.type panda.Object
1078                    sta.obj v1
1079                    movi v2, 0
1080                    lda.str "test string"
1081          - values:
1082              - |
1083                # v2 and acc invalid
1084                    movi v0, 1
1085                    newarr v1, v0, f64[]
1086                    sta.obj v2
1087                    initobj A.ctor
1088
1089
1090      - file-name: "store_arr_p"
1091        isa:
1092          instructions:
1093            - sig: fstarr.64 v1:in:f64[], v2:in:i32
1094              acc: in:f64
1095              format: [op_v1_4_v2_4]
1096              properties: [acc_read, float]
1097        description: Check fstarr.64 stores items to array of different size and type in Panda Assembly context.
1098        tags: ['irtoc_ignore']
1099        code-template: |
1100          #
1101              movi v0, *s
1102              newarr v1, v0, %s
1103              movi v2, *s
1104              fldai.64 1234567890.0
1105              fstarr.64 v1, v2
1106        check-type: exit-positive
1107        template-cases:
1108          - values: ['f64[]']
1109        cases:
1110          - values: ['1', '0']
1111          - values: ['255', '254']
1112            tags: ['tsan']
1113          - values: ['65536', '65535']
1114
1115
1116      - file-name: "store_arr_j"
1117        isa:
1118          instructions:
1119            - sig: fstarr.64 v1:in:f64[], v2:in:i32
1120              acc: in:f64
1121              format: [op_v1_4_v2_4]
1122              properties: [acc_read, float]
1123        description: Check fstarr.64 stores items to array of different size and type in PandaAssembly context.
1124        tags: ['irtoc_ignore']
1125        runner-options: ['use-pa']
1126        header-template: [PandaAssembly, main]
1127        code-template: |
1128          #
1129              movi v0, *s
1130              newarr v1, v0, %s
1131              movi v2, *s
1132              fldai.64 1234567890.0
1133              fstarr.64 v1, v2
1134        check-type: exit-positive
1135        template-cases:
1136          - values: ['f64[]']
1137        cases:
1138          - values: ['1', '0']
1139          - values: ['255', '254']
1140          - values: ['65536', '65535']
1141            tags: ['tsan']
1142
1143
1144      - file-name: "store_all_elements"
1145        isa:
1146          description: >
1147            Store accumulator content into array slot pointed by index.
1148        description: Check fstarr.64 stores correct items into array of primitives.
1149        tags: ['irtoc_ignore']
1150        header-template: []
1151        code-template: |
1152            .function i32 main() {
1153                movi v7, *s         # v7 is array size
1154                newarr v1, v7, %s          # v1 - testable array
1155
1156                movi v2, 0          # array index
1157            fill_array:
1158                lda v2
1159                i32tof64
1160                fstarr.64 v1, v2      # v1[v2] = acc
1161                inci v2, 1            # v2 = v2 + 1
1162                lda v2
1163                jne v7, fill_array
1164                inci v2, -1
1165            check_array:
1166                lda v2
1167                i32tof64
1168                sta.64 v3            # value to compare with
1169                lda v2
1170                fldarr.64 v1
1171                fcmpg.64 v3
1172                jeqz ok
1173                ldai 2
1174                return
1175            ok:
1176                inci v2, -1
1177                lda v2
1178                jgez check_array
1179        check-type: exit-positive
1180        template-cases:
1181          - values:
1182            - f64[]
1183        cases:
1184          - values: [10000]
1185            tags: ['tsan']
1186