• 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
19tests:
20  - file-name: call.acc.short
21    isa:
22      title: Static call with accumulator as input
23      description: >
24        Call indicated static method, i.e. create new frame, pass values of arguments and
25        continue execution from the first instruction of a method.
26        Callee should treat accumulator value as undefined and cannot use it until accumulator
27        definition in the new frame.
28        Result (if any) is returned in accumulator (see 'Calling sequence' chapter for more details).
29        Method, its class and the number of argument is resolved by given method_id in
30        runtime constant-pool.
31        Arguments are passed in source registers in the same order as in method signature.
32        Non-range instructions can be used to pass up to 4 arguments (unused register slot values will
33        be discarded and corresponding registers will not be passed to the callee).
34        In dynamically-typed language context accept 'any' values in source registers.
35        Immediate operand encodes a position starting from 0 on which accumulator is passed.
36      verification:
37        - method_id_static
38        - compatible_arguments
39        - method_id_non_abstract
40      instructions:
41        - sig: call.acc.short method_id, v:in:top, imm:u1
42          acc: inout:top
43          format: [op_v_4_imm_4_id_16]
44    commands:
45
46      - file-name: op_v_4_imm_4_id_16
47        description: Check that compiler reports an error on invalid instruction format.
48        isa:
49          instructions:
50            - sig: call.acc.short method_id, v:in:top, imm:u1
51              acc: inout:top
52              format: [op_v_4_imm_4_id_16]
53        header-template: []
54        check-type: exit-positive
55        runner-options: [compile-failure]
56        code-template: |
57          .function void f0() {
58              return.void
59          }
60          .function void f1(i32 a0) {
61              return.void
62          }
63          .function void f2(i32 a0, i32 a1) {
64              return.void
65          }
66          .function void f3(i32 a0, i32 a1, i32 a2) {
67              return.void
68          }
69          .function i32 main() {
70              call.acc.short %s
71        cases:
72          - values: ['foo, v0, 0']
73          - values: ['foo, v1, 1']
74          - values: ['f0']
75          - values: ['f1, v0']
76          - values: ['f2, v0, 0']
77            runner-options: [compile-only]
78          - values: ['f2, v16, 0']
79          - values: ['f2, v255, 1']
80          - values: ['f2, v32767, 1']
81          - values: ['f2, v65536, 0']
82          - values: ['f2, v255, 1']
83          - values: ['f2, a0, 1']
84          - values: ['f3, v0, 0']
85
86
87      - file-name: reg_v_valid
88        description: Check with all valid 'v' register numbers.
89        isa:
90          instructions:
91            - sig: call.acc.short method_id, v:in:top, imm:u1
92              acc: inout:top
93              format: [op_v_4_imm_4_id_16]
94        runner-options: [verifier-only, verifier-config]
95        tags: [verifier]
96        header-template: []
97        check-type: exit-positive
98        code-template: |
99          .function i32 foo(i32 a0, i32 a1) {
100              lda a0
101              return
102          }
103          .function i32 main() {
104              ldai 0
105              movi v0, 0
106              movi v1, 1
107              movi v2, 2
108              movi v3, 3
109              movi v4, 4
110              movi v5, 5
111              movi v6, 6
112              movi v7, 7
113              movi v8, 8
114              movi v9, 9
115              movi v10, 10
116              movi v11, 11
117              movi v12, 12
118              movi v13, 13
119              movi v14, 14
120              movi v15, 15
121              call.acc.short foo, v0, 1
122              call.acc.short foo, v1, 1
123              call.acc.short foo, v2, 1
124              call.acc.short foo, v3, 1
125              call.acc.short foo, v4, 1
126              call.acc.short foo, v5, 1
127              call.acc.short foo, v6, 1
128              call.acc.short foo, v7, 1
129              call.acc.short foo, v8, 1
130              call.acc.short foo, v9, 1
131              call.acc.short foo, v10, 1
132              call.acc.short foo, v11, 1
133              call.acc.short foo, v12, 1
134              call.acc.short foo, v13, 1
135              call.acc.short foo, v14, 1
136              call.acc.short foo, v15, 1
137
138
139      - file-name: reg_a_valid
140        description: Check with all valid 'a' register numbers.
141        isa:
142          instructions:
143            - sig: call.acc.short method_id, v:in:top, imm:u1
144              acc: inout:top
145              format: [op_v_4_imm_4_id_16]
146        runner-options: [verifier-only, verifier-config]
147        tags: [verifier]
148        header-template: []
149        check-type: exit-positive
150        code-template: |
151          .function i32 foo(i32 a0, i32 a1) {
152              lda a0
153              return
154          }
155          .function void f(i32 a0, i32 a1, i32 a2, i32 a3, i32 a4, i32 a5, i32 a6, i32 a7, i32 a8, i32 a9, i32 a10, i32 a11, i32 a12, i32 a13, i32 a14, i32 a15) {
156              ldai 0
157              call.acc.short foo, a0, 1
158              call.acc.short foo, a1, 1
159              call.acc.short foo, a2, 1
160              call.acc.short foo, a3, 1
161              call.acc.short foo, a4, 1
162              call.acc.short foo, a5, 1
163              call.acc.short foo, a6, 1
164              call.acc.short foo, a7, 1
165              call.acc.short foo, a8, 1
166              call.acc.short foo, a9, 1
167              call.acc.short foo, a10, 1
168              call.acc.short foo, a11, 1
169              call.acc.short foo, a12, 1
170              call.acc.short foo, a13, 1
171              call.acc.short foo, a14, 1
172              call.acc.short foo, a15, 1
173              return.void
174          }
175          .function i32 main() {
176              movi v0, 0
177              movi v1, 1
178              movi v2, 2
179              movi v3, 3
180              movi v4, 4
181              movi v5, 5
182              movi v6, 6
183              movi v7, 7
184              movi v8, 8
185              movi v9, 9
186              movi v10, 10
187              movi v11, 11
188              movi v12, 12
189              movi v13, 13
190              movi v14, 14
191              movi v15, 15
192              call.range f, v0
193
194
195      - file-name: uninitialized_regs
196        description: Check that verifier reports an error on uninitialized registers.
197        isa:
198          instructions:
199            - sig: call.acc.short method_id, v:in:top, imm:u1
200              acc: inout:top
201              format: [op_v_4_imm_4_id_16]
202        header-template: []
203        runner-options: [verifier-failure, verifier-config]
204        tags: [verifier]
205        check-type: exit-positive
206        code-template: |
207          .function i32 foo(%s) {
208              %s
209              return
210          }
211          .function i32 main() {
212              %s
213              call.acc.short foo, %s
214        cases:
215          - description: Register v0 is not initialized.
216            values:
217            - i32 a0, i32 a1
218            - lda a0
219            - ldai 0
220            - v0, 0
221          - description: Register v0 is not initialized.
222            values:
223            - i32 a0, i32 a1
224            - lda a1
225            - ldai 0
226            - v0, 1
227          - description: Register v0 is not initialized, but it's not used.
228            values:
229            - i32 a0
230            - lda a0
231            - ldai 0
232            - v0, 0
233            runner-options: [verifier-only, verifier-config]
234          - description: Accumulator is not initialized.
235            values:
236            - i32 a0, i32 a1
237            - lda a1
238            - movi v0, 0
239            - v0, 0
240          - description: Accumulator is not initialized.
241            values:
242            - i32 a0, i32 a1
243            - lda a0
244            - movi v0, 0
245            - v0, 1
246          - description: Accumulator is not initialized, but it's not used.
247            values:
248            - i32 a0
249            - lda a0
250            - movi v0, 0
251            - v0, 1
252            runner-options: [verifier-only, verifier-config]
253          - description: Accumulator and v0 are both not initialized.
254            values:
255            - i32 a0, i32 a1
256            - ldai 0
257            - ''
258            - v0, 0
259          - description: Accumulator and v0 are both not initialized, but they are not used.
260            values:
261            - ''
262            - ldai 0
263            - ''
264            - v0, 0
265            runner-options: [verifier-only, verifier-config]
266          - description: Accumulator is not initialized in function.
267            values:
268            - i32 a0, i32 a1
269            - call.acc.short foo, a0, 0
270            - |
271              #
272                  ldai 0
273                  movi v0, 0
274            - v0, 0
275
276
277      - file-name: not_static_method
278        description: Check that verifier reports an error on non-static method.
279        isa:
280          verification:
281            - method_id_static
282        header-template: []
283        runner-options: [verifier-failure, verifier-config]
284        tags: [verifier]
285        check-type: exit-positive
286        code-template: |
287          .record R {}
288          .function void %s {
289              return.void
290          }
291          .function i32 main() {
292              newobj v0, R
293              ldai 0
294              call.acc.short %s
295        cases:
296          - values:
297            - R.foo(R a0, i32 a1)
298            - R.foo, v0, 1
299            bugid: ['5542']
300            ignore: true
301          - values:
302            - R.foo(R a0)
303            - R.foo, v0, 1
304            bugid: ['5542']
305            ignore: true
306          - values:
307            - R.foo(i32 a0, R a1)
308            - R.foo, v0, 0
309            runner-options: [verifier-only, verifier-config]
310          - values:
311            - R.foo(R a0, i32 a1) <ctor>
312            - R.foo, v0, 1
313            bugid: ['5542']
314            ignore: true
315          - values:
316            - R.foo(R a0) <ctor>
317            - R.foo, v0, 1
318            bugid: ['5542']
319            ignore: true
320          - values:
321            - R.foo() <cctor>
322            - R.foo, v0, 1
323            runner-options: [verifier-only, verifier-config]
324          - values:
325            - R.foo(R a0, i32 a1) <cctor>
326            - R.foo, v0, 1
327            runner-options: [verifier-only, verifier-config]
328          - values:
329            - R.foo(R a0, i32 a1) <static>
330            - R.foo, v0, 1
331            runner-options: [verifier-only, verifier-config]
332          - values:
333            - foo(R a0, i32 a1)
334            - foo, v0, 1
335            runner-options: [verifier-only, verifier-config]
336
337
338      - file-name: abstract_method
339        description: Check that verifier reports an error on abstract method.
340        isa:
341          verification:
342            - method_id_non_abstract
343        header-template: []
344        runner-options: [verifier-failure, verifier-config]
345        tags: [verifier]
346        check-type: exit-positive
347        bugid: ['5544']
348        ignore: true
349        code-template: |
350          .record R {}
351          .function void %s
352          .function i32 main() {
353              newobj v0, R
354              ldai 0
355              call.acc.short %s
356        cases:
357          - values:
358            - R.foo(R a0, i32 a1) <static, noimpl>
359            - R.foo, v0, 1
360          - values:
361            - foo(R a0, i32 a1) <noimpl>
362            - foo, v0, 1
363
364
365      - file-name: invalid_method
366        description: Check that verifier reports an error on invalid method.
367        isa:
368          verification:
369            - method_id_static
370            - method_id_non_abstract
371        header-template: []
372        runner-options: [verifier-failure, verifier-config]
373        tags: [verifier]
374        check-type: exit-positive
375        code-template: |
376          .record R {}
377          %s
378          .function i32 main() {
379              newobj v0, R
380              ldai 0
381              call.acc.short %s
382        cases:
383          - description: No return in function.
384            values:
385            - .function void R.foo(R a0, i32 a1) <static> {}
386            - R.foo, v0, 1
387            bugid: ['5607']
388            ignore: true
389          - description: No return in function.
390            values:
391            - |
392              #
393              .function void R.foo(i32 a0, R a1) {
394                  ldai 0
395              }
396            - R.foo, v0, 0
397          - description: No return in cctor.
398            values:
399            - |
400              #
401              .function i32 R.foo(R a0) <cctor> {}
402            - R.foo, v0, 0
403            bugid: ['5607']
404            ignore: true
405
406
407      - file-name: incompatible_v_p
408        description: Check 'call.acc.short' instruction called with incompatible register argument in PandaAssembly context.
409        isa:
410          verification:
411            - compatible_arguments
412        runner-options: [verifier-failure, verifier-config]
413        tags: [verifier]
414        header-template: []
415        check-type: exit-positive
416        code-template: |
417          .record panda.Object <external>
418          .record panda.Class <external>
419          .record panda.String <external>
420          .record R {}
421          .function void R.foo(i32 a0, %s a1) {
422              return.void
423          }
424          .function i32 main() {
425              *s
426              ldai 0
427              call.acc.short R.foo, v1, 0
428        template-cases:
429          - values:
430            - u1
431            exclude: [i32]
432          - values:
433            - u8
434            exclude: [i32]
435          - values:
436            - i8
437            exclude: [i32]
438          - values:
439            - u16
440            exclude: [i32]
441          - values:
442            - i16
443            exclude: [i32]
444          - values:
445            - u32
446            exclude: [i32]
447          - values:
448            - u64
449            exclude: [i64]
450          - values:
451            - f32
452            exclude: [f32]
453            bugid: ['7445']
454          - values:
455            - f64
456            exclude: [f64]
457          - values:
458            - u32[]
459            exclude: [u32a, nul]
460          - values:
461            - u64[]
462            exclude: [u64a, nul]
463          - values:
464            - f32[]
465            exclude: [f32a, nul]
466          - values:
467            - u32[][]
468            exclude: [u32aa, nul]
469          - values:
470            - u64[][]
471            exclude: [u64aa, nul]
472          - values:
473            - f32[][]
474            exclude: [f32aa, nul]
475          - values:
476            - R
477            exclude: [nul]
478          - values:
479            - panda.String
480            exclude: [str, nul]
481          - values:
482            - panda.Class
483            exclude: [typ, nul]
484          - values:
485            - panda.Object
486            exclude: [u32a, u64a, f32a, u32aa, u64aa, f32aa, str, typ, ra, stra, typa, obja, raa, straa, typaa, objaa, nul]
487          - values:
488            - R[]
489            exclude: [ra, nul]
490          - values:
491            - panda.String[]
492            exclude: [stra, nul]
493          - values:
494            - panda.Class[]
495            exclude: [typa, nul]
496          - values:
497            - panda.Object[]
498            exclude: [obja, u32aa, u64aa, f32aa, ra, stra, typa, raa, straa, typaa, objaa, nul]
499          - values:
500            - R[][]
501            exclude: [raa, nul]
502          - values:
503            - panda.String[][]
504            exclude: [straa, nul]
505          - values:
506            - panda.Class[][]
507            exclude: [typaa, nul]
508          - values:
509            - panda.Object[][]
510            exclude: [objaa, raa, straa, typaa, nul]
511        cases:
512          - values:
513            - movi v1, 1
514            id: i32
515          - values:
516            - movi.64 v1, 1
517            id: i64
518          - values:
519            - fmovi v1, 1.0
520            id: f32
521            bugid: ['7445']
522          - values:
523            - fmovi.64 v1, 1.0
524            id: f64
525          - values:
526            - |
527              #
528                  movi v1, 10
529                  newarr v1, v1, u32[]
530            id: u32a
531          - values:
532            - |
533              #
534                  movi v1, 10
535                  newarr v1, v1, u64[]
536            id: u64a
537          - values:
538            - |
539              #
540                  movi v1, 10
541                  newarr v1, v1, f32[]
542            id: f32a
543          - values:
544            - |
545              #
546                  movi v1, 10
547                  newarr v1, v1, u32[][]
548            id: u32aa
549          - values:
550            - |
551              #
552                  movi v1, 10
553                  newarr v1, v1, u64[][]
554            id: u64aa
555          - values:
556            - |
557              #
558                  movi v1, 10
559                  newarr v1, v1, f32[][]
560            id: f32aa
561          - values:
562            - |
563              #
564                  lda.str "test message"
565                  sta.obj v1
566            id: str
567          - values:
568            - |
569              #
570                  lda.type R
571                  sta.obj v1
572            id: typ
573          - values:
574            - |
575              #
576                  movi v1, 10
577                  newarr v1, v1, R[]
578            id: ra
579          - values:
580            - |
581              #
582                  movi v1, 10
583                  newarr v1, v1, panda.String[]
584            id: stra
585          - values:
586            - |
587              #
588                  movi v1, 10
589                  newarr v1, v1, panda.Class[]
590            id: typa
591          - values:
592            - |
593              #
594                  movi v1, 10
595                  newarr v1, v1, panda.Object[]
596            id: obja
597          - values:
598            - |
599              #
600                  movi v1, 10
601                  newarr v1, v1, R[][]
602            id: raa
603          - values:
604            - |
605              #
606                  movi v1, 10
607                  newarr v1, v1, panda.String[][]
608            id: straa
609          - values:
610            - |
611              #
612                  movi v1, 10
613                  newarr v1, v1, panda.Class[][]
614            id: typaa
615          - values:
616            - |
617              #
618                  movi v1, 10
619                  newarr v1, v1, panda.Object[][]
620            id: objaa
621          - values:
622            - mov.null v1
623            id: nul
624
625
626      - file-name: incompatible_acc_p
627        description: Check 'call.acc.short' instruction called with incompatible accumulator argument in PandaAssembly context.
628        isa:
629          verification:
630            - compatible_arguments
631        runner-options: [verifier-failure, verifier-config]
632        tags: [verifier]
633        header-template: []
634        check-type: exit-positive
635        code-template: |
636          .record panda.Object <external>
637          .record panda.Class <external>
638          .record panda.String <external>
639          .record R {}
640          .function void R.foo(i32 a0, %s a1) {
641              return.void
642          }
643          .function i32 main() {
644              *s
645              movi v1, 0
646              call.acc.short R.foo, v1, 1
647        template-cases:
648          - values:
649            - u1
650            exclude: [i32]
651          - values:
652            - u8
653            exclude: [i32]
654          - values:
655            - i8
656            exclude: [i32]
657          - values:
658            - u16
659            exclude: [i32]
660          - values:
661            - i16
662            exclude: [i32]
663          - values:
664            - u32
665            exclude: [i32]
666          - values:
667            - u64
668            exclude: [i64]
669          - values:
670            - f32
671            exclude: [f32]
672            bugid: ['7445']
673          - values:
674            - f64
675            exclude: [f64]
676          - values:
677            - u32[]
678            exclude: [u32a, nul]
679          - values:
680            - u64[]
681            exclude: [u64a, nul]
682          - values:
683            - f32[]
684            exclude: [f32a, nul]
685          - values:
686            - u32[][]
687            exclude: [u32aa, nul]
688          - values:
689            - u64[][]
690            exclude: [u64aa, nul]
691          - values:
692            - f32[][]
693            exclude: [f32aa, nul]
694          - values:
695            - R
696            exclude: [nul]
697          - values:
698            - panda.String
699            exclude: [str, nul]
700          - values:
701            - panda.Class
702            exclude: [typ, nul]
703          - values:
704            - panda.Object
705            exclude: [u32a, u64a, f32a, u32aa, u64aa, f32aa, str, typ, ra, stra, typa, obja, raa, straa, typaa, objaa, nul]
706          - values:
707            - R[]
708            exclude: [ra, nul]
709          - values:
710            - panda.String[]
711            exclude: [stra, nul]
712          - values:
713            - panda.Class[]
714            exclude: [typa, nul]
715          - values:
716            - panda.Object[]
717            exclude: [obja, u32aa, u64aa, f32aa, ra, stra, typa, raa, straa, typaa, objaa, nul]
718          - values:
719            - R[][]
720            exclude: [raa, nul]
721          - values:
722            - panda.String[][]
723            exclude: [straa, nul]
724          - values:
725            - panda.Class[][]
726            exclude: [typaa, nul]
727          - values:
728            - panda.Object[][]
729            exclude: [objaa, raa, straa, typaa, nul]
730        cases:
731          - values:
732            - ldai 1
733            id: i32
734          - values:
735            - ldai.64 1
736            id: i64
737          - values:
738            - fldai 1.0
739            id: f32
740            bugid: ['7445']
741          - values:
742            - fldai.64 1.0
743            id: f64
744          - values:
745            - |
746              #
747                  movi v1, 10
748                  newarr v1, v1, u32[]
749                  lda.obj v1
750            id: u32a
751          - values:
752            - |
753              #
754                  movi v1, 10
755                  newarr v1, v1, u64[]
756                  lda.obj v1
757            id: u64a
758          - values:
759            - |
760              #
761                  movi v1, 10
762                  newarr v1, v1, f32[]
763                  lda.obj v1
764            id: f32a
765          - values:
766            - |
767              #
768                  movi v1, 10
769                  newarr v1, v1, u32[][]
770                  lda.obj v1
771            id: u32aa
772          - values:
773            - |
774              #
775                  movi v1, 10
776                  newarr v1, v1, u64[][]
777                  lda.obj v1
778            id: u64aa
779          - values:
780            - |
781              #
782                  movi v1, 10
783                  newarr v1, v1, f32[][]
784                  lda.obj v1
785            id: f32aa
786          - values:
787            - |
788              #
789                  lda.str "test message"
790            id: str
791          - values:
792            - |
793              #
794                  lda.type R
795            id: typ
796          - values:
797            - |
798              #
799                  movi v1, 10
800                  newarr v1, v1, R[]
801                  lda.obj v1
802            id: ra
803          - values:
804            - |
805              #
806                  movi v1, 10
807                  newarr v1, v1, panda.String[]
808                  lda.obj v1
809            id: stra
810          - values:
811            - |
812              #
813                  movi v1, 10
814                  newarr v1, v1, panda.Class[]
815                  lda.obj v1
816            id: typa
817          - values:
818            - |
819              #
820                  movi v1, 10
821                  newarr v1, v1, panda.Object[]
822                  lda.obj v1
823            id: obja
824          - values:
825            - |
826              #
827                  movi v1, 10
828                  newarr v1, v1, R[][]
829                  lda.obj v1
830            id: raa
831          - values:
832            - |
833              #
834                  movi v1, 10
835                  newarr v1, v1, panda.String[][]
836                  lda.obj v1
837            id: straa
838          - values:
839            - |
840              #
841                  movi v1, 10
842                  newarr v1, v1, panda.Class[][]
843                  lda.obj v1
844            id: typaa
845          - values:
846            - |
847              #
848                  movi v1, 10
849                  newarr v1, v1, panda.Object[][]
850                  lda.obj v1
851            id: objaa
852          - values:
853            - lda.null
854            id: nul
855
856
857      - file-name: incompatible_v_j
858        isa:
859          verification:
860            - compatible_arguments
861        runner-options: [verifier-failure, use-pa, verifier-config]
862        tags: [verifier, pa-verifier]
863        bugid: ["6886"]
864        description: Check 'call.acc.short' instruction with incompatible register in PandaAssembly context.
865        header-template: [PandaAssembly]
866        code-template: |
867          .record panda.Object <external>
868          .record panda.Class <external>
869          .record R {}
870          .function void R.foo(i32 a0, %s a1) <static> {
871              return.void
872          }
873          .function i32 main() {
874              *s
875              ldai 0
876              call.acc.short R.foo, v1, 0
877        check-type: exit-positive
878        template-cases:
879          - values:
880            - u1
881            exclude: [i32]
882          - values:
883            - i8
884            exclude: [i32]
885          - values:
886            - u16
887            exclude: [i32]
888          - values:
889            - i16
890            exclude: [i32]
891          - values:
892            - i32
893            exclude: [i32]
894          - values:
895            - i64
896            exclude: [i64]
897          - values:
898            - f32
899            exclude: [f32]
900            bugid: ['7445']
901          - values:
902            - f64
903            exclude: [f64]
904          - values:
905            - u1[]
906            exclude: [u1a, nul]
907          - values:
908            - i8[]
909            exclude: [i8a, nul]
910          - values:
911            - u16[]
912            exclude: [u1a, u16a, nul]
913          - values:
914            - i16[]
915            exclude: [i8a, i16a, nul]
916          - values:
917            - i32[]
918            exclude: [i8a, i16a, i32a, nul]
919          - values:
920            - i64[]
921            exclude: [i64a, nul]
922          - values:
923            - f32[]
924            exclude: [f32a, nul]
925          - values:
926            - f64[]
927            exclude: [f32a, f64a, nul]
928          - values:
929            - i32[][]
930            exclude: [i32aa, nul]
931          - values:
932            - f64[][]
933            exclude: [f64aa, nul]
934          - values:
935            - R
936            exclude: [nul]
937          - values:
938            - panda.Class
939            exclude: [typ, nul]
940          - values:
941            - panda.Object
942            exclude: [u1a, i8a, u16a, i16a, i32a, i64a, f32a, f64a, i32aa, f64aa, typ, ra, typa, obja, raa, typaa, objaa, nul]
943          - values:
944            - R[]
945            exclude: [ra, nul]
946          - values:
947            - panda.Class[]
948            exclude: [typa, nul]
949          - values:
950            - panda.Object[]
951            exclude: [obja, i32aa, f64aa, ra, typa, raa, typaa, objaa, nul]
952          - values:
953            - R[][]
954            exclude: [raa, nul]
955          - values:
956            - panda.Class[][]
957            exclude: [typaa, nul]
958          - values:
959            - panda.Object[][]
960            exclude: [objaa, raa, typaa, nul]
961        cases:
962          - values:
963            - movi v1, 1
964            id: i32
965          - values:
966            - movi.64 v1, 1
967            id: i64
968          - values:
969            - fmovi v1, 1.0
970            id: f32
971            bugid: ['7445']
972          - values:
973            - fmovi.64 v1, 1.0
974            id: f64
975          - values:
976            - |
977              #
978                  movi v1, 10
979                  newarr v1, v1, u1[]
980            id: u1a
981          - values:
982            - |
983              #
984                  movi v1, 10
985                  newarr v1, v1, i8[]
986            id: i8a
987          - values:
988            - |
989              #
990                  movi v1, 10
991                  newarr v1, v1, u16[]
992            id: u16a
993          - values:
994            - |
995              #
996                  movi v1, 10
997                  newarr v1, v1, i16[]
998            id: i16a
999          - values:
1000            - |
1001              #
1002                  movi v1, 10
1003                  newarr v1, v1, i32[]
1004            id: i32a
1005          - values:
1006            - |
1007              #
1008                  movi v1, 10
1009                  newarr v1, v1, i64[]
1010            id: i64a
1011          - values:
1012            - |
1013              #
1014                  movi v1, 10
1015                  newarr v1, v1, f32[]
1016            id: f32a
1017          - values:
1018            - |
1019              #
1020                  movi v1, 10
1021                  newarr v1, v1, f64[]
1022            id: f64a
1023          - values:
1024            - |
1025              #
1026                  movi v1, 10
1027                  newarr v1, v1, i32[][]
1028            id: i32aa
1029          - values:
1030            - |
1031              #
1032                  movi v1, 10
1033                  newarr v1, v1, f64[][]
1034            id: f64aa
1035          - values:
1036            - |
1037              #
1038                  lda.type R
1039                  sta.obj v1
1040            id: typ
1041          - values:
1042            - |
1043              #
1044                  movi v1, 10
1045                  newarr v1, v1, R[]
1046            id: ra
1047          - values:
1048            - |
1049              #
1050                  movi v1, 10
1051                  newarr v1, v1, panda.Class[]
1052            id: typa
1053          - values:
1054            - |
1055              #
1056                  movi v1, 10
1057                  newarr v1, v1, panda.Object[]
1058            id: obja
1059          - values:
1060            - |
1061              #
1062                  movi v1, 10
1063                  newarr v1, v1, R[][]
1064            id: raa
1065          - values:
1066            - |
1067              #
1068                  movi v1, 10
1069                  newarr v1, v1, panda.Class[][]
1070            id: typaa
1071          - values:
1072            - |
1073              #
1074                  movi v1, 10
1075                  newarr v1, v1, panda.Object[][]
1076            id: objaa
1077          - values:
1078            - mov.null v1
1079            id: nul
1080
1081
1082      - file-name: incompatible_acc_j
1083        isa:
1084          verification:
1085            - compatible_arguments
1086        runner-options: [verifier-failure, use-pa, verifier-config]
1087        tags: [verifier, pa-verifier]
1088        bugid: ["6886"]
1089        description: Check 'call.acc.short' instruction with incompatible accumulator in PandaAssembly context.
1090        header-template: [PandaAssembly]
1091        check-type: exit-positive
1092        code-template: |
1093          .record panda.Object <external>
1094          .record panda.Class <external>
1095          .record R {}
1096          .function void R.foo(%s a0, i32 a1) <static> {
1097              return.void
1098          }
1099          .function i32 main() {
1100              *s
1101              movi v1, 0
1102              call.acc.short R.foo, v1, 0
1103        template-cases:
1104          - values:
1105            - u1
1106            exclude: [i32]
1107          - values:
1108            - i8
1109            exclude: [i32]
1110          - values:
1111            - u16
1112            exclude: [i32]
1113          - values:
1114            - i16
1115            exclude: [i32]
1116          - values:
1117            - i32
1118            exclude: [i32]
1119          - values:
1120            - i64
1121            exclude: [i64]
1122          - values:
1123            - f32
1124            exclude: [f32]
1125            bugid: ['7445']
1126          - values:
1127            - f64
1128            exclude: [f64]
1129          - values:
1130            - u1[]
1131            exclude: [u1a, nul]
1132          - values:
1133            - i8[]
1134            exclude: [i8a, nul]
1135          - values:
1136            - u16[]
1137            exclude: [u1a, u16a, nul]
1138          - values:
1139            - i16[]
1140            exclude: [i8a, i16a, nul]
1141          - values:
1142            - i32[]
1143            exclude: [i8a, i16a, i32a, nul]
1144          - values:
1145            - i64[]
1146            exclude: [i64a, nul]
1147          - values:
1148            - f32[]
1149            exclude: [f32a, nul]
1150          - values:
1151            - f64[]
1152            exclude: [f32a, f64a, nul]
1153          - values:
1154            - i32[][]
1155            exclude: [i32aa, nul]
1156          - values:
1157            - f64[][]
1158            exclude: [f64aa, nul]
1159          - values:
1160            - R
1161            exclude: [nul]
1162          - values:
1163            - panda.Class
1164            exclude: [typ, nul]
1165          - values:
1166            - panda.Object
1167            exclude: [u1a, i8a, u16a, i16a, i32a, i64a, f32a, f64a, i32aa, f64aa, typ, ra, typa, obja, raa, typaa, objaa, nul]
1168          - values:
1169            - R[]
1170            exclude: [ra, nul]
1171          - values:
1172            - panda.Class[]
1173            exclude: [typa, nul]
1174          - values:
1175            - panda.Object[]
1176            exclude: [obja, i32aa, f64aa, ra, typa, raa, typaa, objaa, nul]
1177          - values:
1178            - R[][]
1179            exclude: [raa, nul]
1180          - values:
1181            - panda.Class[][]
1182            exclude: [typaa, nul]
1183          - values:
1184            - panda.Object[][]
1185            exclude: [objaa, raa, typaa, nul]
1186        cases:
1187          - values:
1188            - ldai 1
1189            id: i32
1190          - values:
1191            - ldai.64 1
1192            id: i64
1193          - values:
1194            - fldai 1.0
1195            id: f32
1196            bugid: ['7445']
1197          - values:
1198            - fldai.64 1.0
1199            id: f64
1200          - values:
1201            - |
1202              #
1203                  movi v1, 10
1204                  newarr v1, v1, u1[]
1205                  lda.obj v1
1206            id: u1a
1207          - values:
1208            - |
1209              #
1210                  movi v1, 10
1211                  newarr v1, v1, i8[]
1212                  lda.obj v1
1213            id: i8a
1214          - values:
1215            - |
1216              #
1217                  movi v1, 10
1218                  newarr v1, v1, u16[]
1219                  lda.obj v1
1220            id: u16a
1221          - values:
1222            - |
1223              #
1224                  movi v1, 10
1225                  newarr v1, v1, i16[]
1226                  lda.obj v1
1227            id: i16a
1228          - values:
1229            - |
1230              #
1231                  movi v1, 10
1232                  newarr v1, v1, i32[]
1233                  lda.obj v1
1234            id: i32a
1235          - values:
1236            - |
1237              #
1238                  movi v1, 10
1239                  newarr v1, v1, i64[]
1240                  lda.obj v1
1241            id: i64a
1242          - values:
1243            - |
1244              #
1245                  movi v1, 10
1246                  newarr v1, v1, f32[]
1247                  lda.obj v1
1248            id: f32a
1249          - values:
1250            - |
1251              #
1252                  movi v1, 10
1253                  newarr v1, v1, f64[]
1254                  lda.obj v1
1255            id: f64a
1256          - values:
1257            - |
1258              #
1259                  movi v1, 10
1260                  newarr v1, v1, i32[][]
1261                  lda.obj v1
1262            id: i32aa
1263          - values:
1264            - |
1265              #
1266                  movi v1, 10
1267                  newarr v1, v1, f64[][]
1268                  lda.obj v1
1269            id: f64aa
1270          - values:
1271            - |
1272              #
1273                  lda.type R
1274            id: typ
1275          - values:
1276            - |
1277              #
1278                  movi v1, 10
1279                  newarr v1, v1, R[]
1280                  lda.obj v1
1281            id: ra
1282          - values:
1283            - |
1284              #
1285                  movi v1, 10
1286                  newarr v1, v1, panda.Class[]
1287                  lda.obj v1
1288            id: typa
1289          - values:
1290            - |
1291              #
1292                  movi v1, 10
1293                  newarr v1, v1, panda.Object[]
1294                  lda.obj v1
1295            id: obja
1296          - values:
1297            - |
1298              #
1299                  movi v1, 10
1300                  newarr v1, v1, R[][]
1301                  lda.obj v1
1302            id: raa
1303          - values:
1304            - |
1305              #
1306                  movi v1, 10
1307                  newarr v1, v1, panda.Class[][]
1308                  lda.obj v1
1309            id: typaa
1310          - values:
1311            - |
1312              #
1313                  movi v1, 10
1314                  newarr v1, v1, panda.Object[][]
1315                  lda.obj v1
1316            id: objaa
1317          - values:
1318            - lda.null
1319            id: nul
1320
1321
1322      - file-name: compatible_primitive_args_p
1323        isa:
1324          verification:
1325            - compatible_arguments
1326        runner-options: [verifier-only, verifier-config]
1327        tags: [verifier]
1328        description: Check 'call.acc.short' instruction with compatible primitive arguments in PandaAssembly context.
1329        header-template: []
1330        check-type: exit-positive
1331        code-template: |
1332          .record R {}
1333          .function void R.foo(%s a0, %s a1) <static> {
1334              return.void
1335          }
1336          .function i32 main() {
1337              %s
1338              %s
1339              call.acc.short R.foo, v1, 0
1340        cases:
1341          - values:
1342            - u1
1343            - u8
1344            - ldai 1
1345            - movi v1, 1
1346          - values:
1347            - i8
1348            - u16
1349            - ldai 1
1350            - movi v1, 1
1351          - values:
1352            - i16
1353            - u32
1354            - ldai 1
1355            - movi v1, 1
1356          - values:
1357            - i64
1358            - i32
1359            - ldai.64 1
1360            - movi v1, 1
1361          - values:
1362            - u64
1363            - f32
1364            - ldai.64 1
1365            - fmovi v1, 1.1
1366          - values:
1367            - f64
1368            - i64
1369            - fldai.64 1.1
1370            - movi.64 v1, 1
1371          - values:
1372            - f32
1373            - f64
1374            - fldai 1.1
1375            - fmovi.64 v1, 1.1
1376
1377
1378      - file-name: compatible_primitive_args_j
1379        isa:
1380          verification:
1381            - compatible_arguments
1382        runner-options: [verifier-only, use-pa, verifier-config]
1383        tags: [verifier, pa-verifier]
1384        bugid: ["6886"]
1385        description: Check 'call.acc.short' instruction with compatible primitive arguments in PandaAssembly context.
1386        header-template: [PandaAssembly]
1387        code-template: |
1388          .record R {}
1389          .function void R.foo(%s a0, %s a1) <static> {
1390              return.void
1391          }
1392          .function i32 main() {
1393              %s
1394              %s
1395              call.acc.short R.foo, v1, 1
1396        check-type: exit-positive
1397        cases:
1398          - values:
1399            - u1
1400            - f64
1401            - movi v1, 1
1402            - fldai.64 1.1
1403          - values:
1404            - u16
1405            - i16
1406            - movi v1, 1
1407            - ldai 1
1408          - values:
1409            - i32
1410            - i64
1411            - movi v1, 1
1412            - ldai.64 1
1413          - values:
1414            - f32
1415            - i8
1416            - fmovi v1, 1.1
1417            - ldai 1
1418          - values:
1419            - f64
1420            - f32
1421            - fmovi.64 v1, 1.1
1422            - fldai 1.1
1423
1424
1425      - file-name: compatible_prim_array_args_p
1426        isa:
1427          verification:
1428            - compatible_arguments
1429        runner-options: [verifier-only, verifier-config]
1430        tags: [verifier]
1431        description: Check 'call.acc.short' instruction called with compatible primitive array arguments in PandaAssembly context.
1432        header-template: []
1433        code-template: |
1434          .function void foo(%s a0, %s a1) {
1435              return.void
1436          }
1437          .function i32 main() {
1438              movi v0, 10
1439              newarr v1, v0, %s
1440              lda.obj v1
1441              movi v0, 10
1442              newarr v1, v0, %s
1443              call.acc.short foo, v1, 0
1444        check-type: exit-positive
1445        cases:
1446          - values:
1447            - u1[]
1448            - u8[]
1449            - u1[]
1450            - u8[]
1451          - values:
1452            - i8[]
1453            - u16[]
1454            - i8[]
1455            - u16[]
1456          - values:
1457            - i16[]
1458            - u32[]
1459            - i16[]
1460            - u32[]
1461          - values:
1462            - f32[][]
1463            - u64[]
1464            - f32[][]
1465            - u64[]
1466          - values:
1467            - i64[]
1468            - f32[]
1469            - i64[]
1470            - f32[]
1471          - values:
1472            - f64[]
1473            - u1[][]
1474            - f64[]
1475            - u1[][]
1476          - values:
1477            - u8[][]
1478            - i8[][]
1479            - u8[][]
1480            - i8[][]
1481          - values:
1482            - u16[][]
1483            - i16[][]
1484            - u16[][]
1485            - i16[][]
1486          - values:
1487            - u32[][]
1488            - i32[][]
1489            - u32[][]
1490            - i32[][]
1491          - values:
1492            - u64[][]
1493            - i64[][]
1494            - u64[][]
1495            - i64[][]
1496          - values:
1497            - i32[]
1498            - f64[][]
1499            - i32[]
1500            - f64[][]
1501
1502
1503      - file-name: compatible_prim_array_args_j
1504        isa:
1505          verification:
1506            - compatible_arguments
1507        runner-options: [verifier-only, use-pa, verifier-config]
1508        tags: [verifier, pa-verifier]
1509        bugid: ["6886"]
1510        description: Check 'call.acc.short' instruction called with compatible primitive array arguments in PandaAssembly context.
1511        header-template: [PandaAssembly]
1512        code-template: |
1513          .function void foo(%s a0, %s a1) {
1514              return.void
1515          }
1516          .function i32 main() {
1517              movi v0, 10
1518              newarr v1, v0, %s
1519              movi v0, 10
1520              newarr v0, v0, %s
1521              lda.obj v0
1522              call.acc.short foo, v1, 1
1523        check-type: exit-positive
1524        cases:
1525          - values:
1526            - u1[]
1527            - f64[][]
1528            - u1[]
1529            - f64[][]
1530          - values:
1531            - u16[]
1532            - i16[]
1533            - u16[]
1534            - i16[]
1535          - values:
1536            - i32[]
1537            - i64[]
1538            - i32[]
1539            - i64[]
1540          - values:
1541            - f32[]
1542            - f64[]
1543            - f32[]
1544            - f64[]
1545          - values:
1546            - u1[][]
1547            - i8[][]
1548            - u1[][]
1549            - i8[][]
1550          - values:
1551            - u16[][]
1552            - i16[][]
1553            - u16[][]
1554            - i16[][]
1555          - values:
1556            - i32[][]
1557            - i64[][]
1558            - i32[][]
1559            - i64[][]
1560          - values:
1561            - f32[][]
1562            - i8[]
1563            - f32[][]
1564            - i8[]
1565
1566
1567      - file-name: compatible_obj_args_p
1568        isa:
1569          verification:
1570            - compatible_arguments
1571        runner-options: [verifier-only, verifier-config]
1572        tags: [verifier]
1573        description: Check 'call.acc.short' instruction called with compatible object arguments in PandaAssembly context.
1574        header-template: []
1575        check-type: exit-positive
1576        code-template: |
1577          .record panda.Object <external>
1578          .record panda.Class <external>
1579          .record panda.String <external>
1580          .record Q {}
1581          .record R {}
1582          .function void foo(%s a0, %s a1) {
1583              return.void
1584          }
1585          .function i32 main() {
1586              %s
1587              call.acc.short foo, v1, 0
1588        cases:
1589          # Object of type O is instance of type T if O is the same as T ...
1590          - values:
1591            - Q
1592            - panda.String
1593            - |
1594              #
1595                  lda.str "test"
1596                  sta.obj v1
1597                  newobj v0, Q
1598                  lda.obj v0
1599          - values:
1600            - panda.Class
1601            - R
1602            - |
1603              #
1604                  lda.type Q
1605                  newobj v1, R
1606          # ... or is subtype of T
1607          - values:
1608            - panda.Object
1609            - panda.Object
1610            - |
1611              #
1612                  newobj v1, Q
1613                  lda.str "test"
1614          - values:
1615            - panda.Object
1616            - panda.Object
1617            - |
1618              #
1619                  lda.type Q
1620                  newobj v1, R
1621            bugid: ['3594']
1622            ignore: true
1623          # For arrays T should be a root type in type hierarchy ...
1624          - values:
1625            - panda.Object
1626            - panda.Object
1627            - |
1628              #
1629                  movi v0, 10
1630                  newarr v1, v0, i32[]
1631                  lda.obj v1
1632                  newarr v1, v0, f64[][]
1633          - values:
1634            - panda.Object
1635            - panda.Object
1636            - |
1637              #
1638                  movi v0, 10
1639                  newarr v1, v0, Q[]
1640                  lda.obj v1
1641                  newarr v1, v0, panda.Object[]
1642          - values:
1643            - panda.Object
1644            - panda.Object
1645            - |
1646              #
1647                  movi v0, 10
1648                  newarr v1, v0, panda.String[]
1649                  lda.obj v1
1650                  newarr v1, v0, panda.Class[]
1651
1652
1653      - file-name: compatible_obj_args_j
1654        isa:
1655          verification:
1656            - compatible_arguments
1657        runner-options: [verifier-only, use-pa, verifier-config]
1658        tags: [verifier, pa-verifier]
1659        bugid: ["6886"]
1660        description: Check 'call.acc.short' instruction called with compatible object arguments in PandaAssembly context.
1661        header-template: [PandaAssembly]
1662        check-type: exit-positive
1663        code-template: |
1664          .record panda.Object <external>
1665          .record panda.Class <external>
1666          .record panda.String <external>
1667          .record panda.io.Serializable <external>
1668          .record I <panda.interface> {}
1669          .record E {}
1670          .record Q <panda.extends=E, panda.implements=I> {}
1671          .record R {}
1672          .function void foo(%s a0, %s a1) {
1673              return.void
1674          }
1675          .function i32 main() {
1676              %s
1677              call.acc.short foo, v1, 1
1678        cases:
1679          # Object of type O is instance of type T if O is the same as T ...
1680          - values:
1681            - Q
1682            - panda.String
1683            - |
1684              #
1685                  newobj v1, Q
1686                  lda.str "test"
1687          - values:
1688            - panda.Class
1689            - E
1690            - |
1691              #
1692                  lda.type Q
1693                  sta.obj v1
1694                  newobj v0, E
1695                  lda.obj v0
1696          # ... or is subtype of T
1697          - values:
1698            - E
1699            - I
1700            - |
1701              #
1702                  newobj v1, Q
1703                  newobj v0, Q
1704                  lda.obj v0
1705          - values:
1706            - panda.Object
1707            - panda.Object
1708            - |
1709              #
1710                  newobj v1, Q
1711                  lda.str "test"
1712          - values:
1713            - panda.io.Serializable
1714            - panda.Object
1715            - |
1716              #
1717                  lda.type panda.String
1718                  sta.obj v1
1719                  lda.type Q
1720            bugid: ['3594']
1721            ignore: true
1722          # For arrays T should be a root type in type hierarchy ...
1723          - values:
1724            - panda.Object
1725            - panda.Object
1726            - |
1727              #
1728                  movi v0, 10
1729                  newarr v1, v0, i32[]
1730                  lda.obj v1
1731                  newarr v1, v0, f64[][]
1732          - values:
1733            - panda.Object
1734            - panda.Object
1735            - |
1736              #
1737                  movi v0, 10
1738                  newarr v1, v0, Q[]
1739                  lda.obj v1
1740                  newarr v1, v0, panda.Object[]
1741          - values:
1742            - panda.Object
1743            - panda.Object
1744            - |
1745              #
1746                  movi v0, 10
1747                  newarr v1, v0, panda.String[]
1748                  lda.obj v1
1749                  newarr v1, v0, panda.Class[]
1750
1751
1752      - file-name: compatible_obj_array_args_p
1753        isa:
1754          verification:
1755            - compatible_arguments
1756        runner-options: [verifier-only, verifier-config]
1757        tags: [verifier]
1758        description: Check 'call.acc.short' instruction called with compatible object array arguments in PandaAssembly context.
1759        header-template: []
1760        check-type: exit-positive
1761        code-template: |
1762          .record panda.Object <external>
1763          .record panda.Class <external>
1764          .record panda.String <external>
1765          .record Q {}
1766          .record R {}
1767          .function void foo(%s a0, %s a1) {
1768              return.void
1769          }
1770          .function i32 main() {
1771              movi v0, 10
1772              newarr v1, v0, %s
1773              lda.obj v1
1774              newarr v1, v0, %s
1775              call.acc.short foo, v1, 0
1776        cases:
1777          # T is such array that O array elements are the same as T array elements
1778          - values:
1779            - Q[]
1780            - Q[][]
1781            - Q[]
1782            - Q[][]
1783          - values:
1784            - panda.Object[]
1785            - panda.Object[][]
1786            - panda.Object[]
1787            - panda.Object[][]
1788          - values:
1789            - panda.String[]
1790            - panda.String[][]
1791            - panda.String[]
1792            - panda.String[][]
1793          - values:
1794            - panda.Class[]
1795            - panda.Class[][]
1796            - panda.Class[]
1797            - panda.Class[][]
1798          # T is such array that O array elements are subtypes of T array elements
1799          - values:
1800            - panda.Object[]
1801            - panda.Object[]
1802            - panda.Object[][]
1803            - Q[]
1804          - values:
1805            - panda.Object[]
1806            - panda.Object[]
1807            - Q[][]
1808            - panda.Class[]
1809          - values:
1810            - panda.Object[]
1811            - panda.Object[]
1812            - panda.Class[][]
1813            - panda.String[]
1814          - values:
1815            - panda.Object[]
1816            - panda.Object[]
1817            - panda.String[][]
1818            - i32[][]
1819          - values:
1820            - panda.Object[]
1821            - panda.Object[][]
1822            - f64[][][]
1823            - panda.Object[][][]
1824          - values:
1825            - panda.Object[][]
1826            - panda.Object[][]
1827            - panda.Class[][]
1828            - panda.Class[][][]
1829          - values:
1830            - panda.Object[][]
1831            - panda.Object[][]
1832            - i32[][][]
1833            - f64[][][][]
1834
1835
1836      - file-name: compatible_obj_array_args_j
1837        isa:
1838          verification:
1839            - compatible_arguments
1840        runner-options: [verifier-only, use-pa, verifier-config]
1841        tags: [verifier, pa-verifier]
1842        bugid: ["6886"]
1843        description: Check 'call.acc.short' instruction called with compatible object array arguments in PandaAssembly context.
1844        header-template: [PandaAssembly]
1845        code-template: |
1846          .record panda.Object <external>
1847          .record panda.Class <external>
1848          .record panda.String <external>
1849          .record I <panda.interface> {}
1850          .record E {}
1851          .record Q <panda.extends=E, panda.implements=I> {}
1852          .record R {}
1853          .function void foo(%s a0, %s a1) {
1854              return.void
1855          }
1856          .function i32 main() {
1857              movi v0, 10
1858              newarr v1, v0, %s
1859              newarr v0, v0, %s
1860              lda.obj v0
1861              call.acc.short foo, v1, 1
1862        check-type: exit-positive
1863        cases:
1864          # T is such array that O array elements are the same as T array elements
1865          - values:
1866            - Q[]
1867            - panda.String[]
1868            - Q[]
1869            - panda.String[]
1870          - values:
1871            - Q[][]
1872            - panda.String[][]
1873            - Q[][]
1874            - panda.String[][]
1875          - values:
1876            - panda.Object[]
1877            - panda.Class[][]
1878            - panda.Object[]
1879            - panda.Class[][]
1880          - values:
1881            - panda.Class[]
1882            - panda.Object[][]
1883            - panda.Class[]
1884            - panda.Object[][]
1885          # T is such array that O array elements are subtypes of T array elements
1886          - values:
1887            - E[]
1888            - panda.Object[]
1889            - Q[]
1890            - Q[][]
1891          - values:
1892            - I[]
1893            - panda.Object[]
1894            - Q[]
1895            - panda.Class[]
1896          - values:
1897            - panda.Object[]
1898            - panda.Object[]
1899            - panda.Object[][]
1900            - Q[]
1901          - values:
1902            - panda.Object[]
1903            - panda.Object[]
1904            - panda.String[]
1905            - f64[][][]
1906          - values:
1907            - panda.Object[]
1908            - panda.Object[]
1909            - panda.String[][]
1910            - i32[][]
1911          # inherited types from object[][]
1912          - values:
1913            - E[][]
1914            - panda.Object[][]
1915            - Q[][]
1916            - panda.Object[][][]
1917          - values:
1918            - I[][]
1919            - panda.Object[][]
1920            - Q[][]
1921            - panda.Class[][][]
1922          - values:
1923            - panda.Object[][]
1924            - panda.Object[][]
1925            - panda.Class[][]
1926            - i32[][][]
1927
1928
1929      - file-name: compatible_obj_null_args_p
1930        isa:
1931          verification:
1932            - compatible_arguments
1933        runner-options: [verifier-only, verifier-config]
1934        tags: [verifier]
1935        description: Check 'call.acc.short' instruction called with null object ref in PandaAssembly context.
1936        header-template: []
1937        check-type: exit-positive
1938        code-template: |
1939          .record panda.Object <external>
1940          .record panda.Class <external>
1941          .record panda.String <external>
1942          .record Q {}
1943          .function void foo(%s a0, %s a1) {
1944              return.void
1945          }
1946          .function i32 main() {
1947              mov.null v1
1948              lda.null
1949              call.acc.short foo, v1, 0
1950        cases:
1951          - values: ['i32[]', 'f64[][]']
1952          - values: ['panda.Object', 'panda.Object[]']
1953          - values: ['panda.Object[][]', 'Q']
1954          - values: ['Q[][]', 'panda.String']
1955          - values: ['panda.String[]', 'panda.Class']
1956          - values: ['panda.Class[]', 'u32[][][]']
1957
1958
1959      - file-name: compatible_obj_null_args_j
1960        isa:
1961          verification:
1962            - compatible_arguments
1963        runner-options: [verifier-only, use-pa, verifier-config]
1964        tags: [verifier, pa-verifier]
1965        bugid: ["6886"]
1966        description: Check 'call.acc.short' instruction called with null object ref in PandaAssembly context.
1967        header-template: [PandaAssembly]
1968        code-template: |
1969          .record panda.Object <external>
1970          .record panda.Class <external>
1971          .record panda.String <external>
1972          .record Q {}
1973          .function void foo(%s a0, %s a1) {
1974              return.void
1975          }
1976          .function i32 main() {
1977              mov.null v1
1978              lda.null
1979              call.acc.short foo, v1, 1
1980        check-type: exit-positive
1981        cases:
1982          - values: ['i32[]', 'f64[][]']
1983          - values: ['panda.Object', 'panda.Object[]']
1984          - values: ['panda.Object[][]', 'Q']
1985          - values: ['Q[][]', 'panda.String']
1986          - values: ['panda.String[]', 'panda.Class']
1987          - values: ['panda.Class[]', 'u1[][][]']
1988
1989
1990      - file-name: values_signed
1991        isa:
1992          instructions:
1993            - sig: call.acc.short method_id, v:in:top, imm:u1
1994              acc: inout:top
1995              format: [op_v_4_imm_4_id_16]
1996        runner-options: []
1997        description: Check 'call.acc.short' instruction called with integer values.
1998        header-template: []
1999        check-type: empty
2000        code-template: |
2001          .function i32 foo(i32 a0, i64 a1) {
2002              ldai %s
2003              jeq a0, ok1
2004              ldai 1
2005              return
2006            ok1:
2007              ldai.64 %s
2008              cmp.64 a1
2009              return
2010          }
2011          .function i32 main() {
2012              movi v1, %s
2013              movi.64 v2, %s
2014              lda v1
2015              call.acc.short foo, v2, 0
2016              jeqz pass1
2017              return
2018          pass1:
2019              lda.64 v2
2020              call.acc.short foo, v1, 1
2021              return
2022          }
2023        cases:
2024          - values: [0, -1, 0, -1]
2025          - values: [-1, 0, -1, 0]
2026          - values: [0x5a5a5a5a, 0xa5a5a5a5cafebabe, 0x5a5a5a5a, 0xa5a5a5a5cafebabe]
2027          - values: [0x11111111, 0xe1e1e1e1e1e1e1e1, 0x11111111, 0xe1e1e1e1e1e1e1e1]
2028
2029
2030      - file-name: values_unsigned
2031        isa:
2032          instructions:
2033            - sig: call.acc.short method_id, v:in:top, imm:u1
2034              acc: inout:top
2035              format: [op_v_4_imm_4_id_16]
2036        runner-options: []
2037        description: Check 'call.acc.short' instruction called with unsigned values.
2038        header-template: []
2039        check-type: empty
2040        code-template: |
2041          .function i32 foo(u32 a0, u64 a1) {
2042              ldai %s
2043              ucmp a0
2044              jeqz ok1
2045              return
2046            ok1:
2047              ldai.64 %s
2048              ucmp.64 a1
2049              return
2050          }
2051          .function i32 main() {
2052              movi v1, %s
2053              movi.64 v2, %s
2054              lda v1
2055              call.acc.short foo, v2, 0
2056              jeqz pass1
2057              return
2058          pass1:
2059              lda.64 v2
2060              call.acc.short foo, v1, 1
2061              return
2062          }
2063        cases:
2064          - values: [0xffffffff, 0xefffffffffffffff, 0xffffffff, 0xefffffffffffffff]
2065          - values: [123456789, 0, 123456789, 0]
2066          - values: [0x5a5a5a5a, 0xa5a5a5a5a5a5a5a5, 0x5a5a5a5a, 0xa5a5a5a5a5a5a5a5]
2067          - values: [0x1111eeee, 0xeeee1111ffffdddd, 0x1111eeee, 0xeeee1111ffffdddd]
2068
2069
2070      - file-name: values_float
2071        isa:
2072          instructions:
2073            - sig: call.acc.short method_id, v:in:top, imm:u1
2074              acc: inout:top
2075              format: [op_v_4_imm_4_id_16]
2076        runner-options: []
2077        tags: ['irtoc_ignore']
2078        description: Check 'call.acc.short' instruction called with float values.
2079        header-template: []
2080        check-type: empty
2081        code-template: |
2082          .function i32 foo(f32 a0, f64 a1) {
2083              fldai %s
2084              fcmpg a0
2085              jeqz ok1
2086              return
2087          ok1:
2088              fldai.64 %s
2089              fcmpg.64 a1
2090              return
2091          }
2092          .function i32 main() {
2093              fmovi v1, %s
2094              fmovi.64 v2, %s
2095              lda v1
2096              call.acc.short foo, v2, 0
2097              jeqz pass1
2098              return
2099          pass1:
2100              lda.64 v2
2101              call.acc.short foo, v1, 1
2102              return
2103          }
2104        cases:
2105          - values: [0, -1.1, 0, -1.1]
2106          - values: [-1.1, 0.12345678, -1.1, 0.12345678]
2107          - values: [1.98765e14, -0.000000019e19, 1.98765e14, -0.000000019e19]
2108          - values: [0.717171717171717171717171e71, 0.373737373737373737e37, 0.717171717171717171717171e71, 0.373737373737373737e37]
2109          - values: [0xff800000, 0x7ff0000000000000, 0xff800000, 0x7ff0000000000000]
2110
2111
2112      - file-name: values_obj_p
2113        isa:
2114          instructions:
2115            - sig: call.acc.short method_id, v:in:top, imm:u1
2116              acc: inout:top
2117              format: [op_v_4_imm_4_id_16]
2118        runner-options: []
2119        description: Check 'call.acc.short' instruction called with object values in PandaAssembly context.
2120        header-template: []
2121        check-type: empty
2122        code-template: |
2123          .record panda.Object <external>
2124          .record panda.String <external>
2125          .record R {}
2126          # put objects into array
2127          .function panda.Object foo(panda.Object a0, panda.Object a1) {
2128              movi v0, 2
2129              newarr v0, v0, panda.Object[]
2130              lda.obj a0
2131              movi v2, 0
2132              starr.obj v0, v2
2133              lda.obj a1
2134              movi v2, 1
2135              starr.obj v0, v2
2136              lda.obj v0
2137              return.obj
2138          }
2139          # check that array contains correct obj refs
2140          .function i32 check(panda.Object a0, panda.Object a1, panda.Object[] a2) {
2141              ldai 0
2142              ldarr.obj a2
2143              jeq.obj a0, ok1
2144              ldai 1
2145              return
2146          ok1:
2147              ldai 1
2148              ldarr.obj a2
2149              jeq.obj a1, ok2
2150              ldai 2
2151              return
2152          ok2:
2153              ldai 0
2154              return
2155          }
2156          .function i32 main() {
2157              %s
2158              lda.obj v1
2159              call.acc.short foo, v2, 0    #  acc, v2
2160              sta.obj v7
2161              call check, v1, v2, v7
2162              jeqz pass1
2163              return
2164          pass1:
2165              lda.obj v2
2166              call.acc.short foo, v1, 1    # v1, acc
2167              sta.obj v7
2168              call check, v1, v2, v7
2169              return
2170          }
2171        cases:
2172          - values:
2173            - |
2174              #
2175                  newobj v1, R
2176                  newobj v2, panda.Object
2177          - values:
2178            - |
2179              #
2180                  lda.str "test"
2181                  sta.obj v1
2182                  lda.type panda.String
2183                  sta.obj v2
2184          - values:
2185            - |
2186              #
2187                  mov.null v1
2188                  newobj v2, R
2189          - values:
2190            - |
2191              #
2192                  newobj v1, panda.Object
2193                  mov.null v2
2194          - values:
2195            - |
2196              #
2197                  movi v0, 0
2198                  newarr v1, v0, panda.String[]
2199                  lda.str ""
2200                  sta.obj v2
2201          - values:
2202            - |
2203              #
2204                  movi v0, 1
2205                  newarr v1, v0, R[][]
2206                  newarr v2, v0, i32[]
2207
2208
2209      - file-name: values_obj_j
2210        isa:
2211          instructions:
2212            - sig: call.acc.short method_id, v:in:top, imm:u1
2213              acc: inout:top
2214              format: [op_v_4_imm_4_id_16]
2215        runner-options: [use-pa]
2216        description: Check 'call.acc.short' instruction called with object values in PandaAssembly context.
2217        header-template: [PandaAssembly]
2218        check-type: empty
2219        code-template: |
2220          .record panda.Object <external>
2221          .record panda.String <external>
2222          .record R {}
2223          # put objects into array
2224          .function panda.Object foo(panda.Object a0, panda.Object a1) {
2225              movi v0, 2
2226              newarr v0, v0, panda.Object[]
2227              lda.obj a0
2228              movi v2, 0
2229              starr.obj v0, v2
2230              lda.obj a1
2231              movi v2, 1
2232              starr.obj v0, v2
2233              lda.obj v0
2234              return.obj
2235          }
2236          # check that array contains correct obj refs
2237          .function i32 check(panda.Object a0, panda.Object a1, panda.Object[] a2) {
2238              ldai 0
2239              ldarr.obj a2
2240              jeq.obj a0, ok1
2241              ldai 1
2242              return
2243          ok1:
2244              ldai 1
2245              ldarr.obj a2
2246              jeq.obj a1, ok2
2247              ldai 2
2248              return
2249          ok2:
2250              ldai 0
2251              return
2252          }
2253          .function i32 main() {
2254              %s
2255              lda.obj v1
2256              call.acc.short foo, v2, 0    #  acc, v2
2257              sta.obj v7
2258              call check, v1, v2, v7
2259              jeqz pass1
2260              return
2261          pass1:
2262              lda.obj v2
2263              call.acc.short foo, v1, 1    # v1, acc
2264              sta.obj v7
2265              call check, v1, v2, v7
2266              return
2267          }
2268        cases:
2269          - values:
2270            - |
2271              #
2272                  newobj v1, R
2273                  newobj v2, panda.Object
2274          - values:
2275            - |
2276              #
2277                  lda.str "test"
2278                  sta.obj v1
2279                  lda.type panda.String
2280                  sta.obj v2
2281          - values:
2282            - |
2283              #
2284                  mov.null v1
2285                  newobj v2, R
2286          - values:
2287            - |
2288              #
2289                  newobj v1, panda.Object
2290                  mov.null v2
2291          - values:
2292            - |
2293              #
2294                  movi v0, 0
2295                  newarr v1, v0, panda.String[]
2296                  lda.str ""
2297                  sta.obj v2
2298          - values:
2299            - |
2300              #
2301                  movi v0, 1
2302                  newarr v1, v0, R[][]
2303                  newarr v2, v0, i32[]
2304
2305
2306      - file-name: regs_restored
2307        isa:
2308          description: >
2309            Call indicated static method, i.e. create new frame, pass values of arguments and
2310            continue execution from the first instruction of a method.
2311            Callee should treat accumulator value as undefined and cannot use it until accumulator
2312            definition in the new frame.
2313        description: Check 'call.acc.short' that registers are restored after the call.
2314        tags: [tsan]
2315        header-template: []
2316        code-template: |
2317          .function void foo(i32 a0) {
2318              movi a0, -100
2319              movi v0, 100
2320              movi v1, 200
2321              movi v2, 300
2322              movi v3, 400
2323              movi v4, 500
2324              movi v5, 600
2325              movi v6, 700
2326              movi v7, 800
2327              movi v8, 900
2328              movi v9, 1000
2329              movi v10, 1100
2330              movi v11, 1200
2331              movi v12, 1300
2332              movi v13, 1400
2333              movi v14, 1500
2334              movi v15, 1600
2335              ldai 9999
2336              return.void
2337          }
2338          .function i32 main() {
2339              movi v0, 1
2340              movi v1, 2
2341              movi v2, 3
2342              movi v3, 4
2343              movi v4, 5
2344              movi v5, 6
2345              movi v6, 7
2346              movi v7, 8
2347              movi v8, 9
2348              movi v9, 10
2349              movi v10, 11
2350              movi v11, 12
2351              movi v12, 13
2352              movi v13, 14
2353              movi v14, 15
2354              movi v15, 16
2355              call.acc.short foo, v0, 1
2356              call.acc.short foo, v1, 1
2357              call.acc.short foo, v2, 1
2358              call.acc.short foo, v3, 1
2359              call.acc.short foo, v4, 1
2360              call.acc.short foo, v5, 1
2361              call.acc.short foo, v6, 1
2362              call.acc.short foo, v7, 1
2363              call.acc.short foo, v8, 1
2364              call.acc.short foo, v9, 1
2365              call.acc.short foo, v10, 1
2366              call.acc.short foo, v11, 1
2367              call.acc.short foo, v12, 1
2368              call.acc.short foo, v13, 1
2369              call.acc.short foo, v14, 1
2370              call.acc.short foo, v15, 1
2371              ldai 1
2372              jeq v0, ok1
2373              return
2374          ok1:
2375              ldai 2
2376              jeq v1, ok2
2377              return
2378          ok2:
2379              ldai 3
2380              jeq v2, ok3
2381              return
2382          ok3:
2383              ldai 4
2384              jeq v3, ok4
2385              return
2386          ok4:
2387              ldai 5
2388              jeq v4, ok5
2389              return
2390          ok5:
2391              ldai 6
2392              jeq v5, ok6
2393              return
2394          ok6:
2395              ldai 7
2396              jeq v6, ok7
2397              return
2398          ok7:
2399              ldai 8
2400              jeq v7, ok8
2401              return
2402          ok8:
2403              ldai 9
2404              jeq v8, ok9
2405              return
2406          ok9:
2407              ldai 10
2408              jeq v9, ok10
2409              return
2410          ok10:
2411              ldai 11
2412              jeq v10, ok11
2413              return
2414          ok11:
2415              ldai 12
2416              jeq v11, ok12
2417              return
2418          ok12:
2419              ldai 13
2420              jeq v12, ok13
2421              return
2422          ok13:
2423              ldai 14
2424              jeq v13, ok14
2425              return
2426          ok14:
2427              ldai 15
2428              jeq v14, ok15
2429              return
2430          ok15:
2431              ldai 16
2432              jeq v15, ok16
2433              return
2434          ok16:
2435        check-type: exit-positive
2436