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