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