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