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