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