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_header
16    template: |
17      .language PandaAssembly
18
19      .record panda.Class <external>
20      .record panda.Object <external>
21      .record panda.String <external>
22      .record panda.CharSequence <external>
23      .record panda.io.Serializable <external>
24      .record panda.NullPointerException <external>
25      .record panda.ClassCastException <external>
26
27      .record R <> {}
28      .record I <panda.interface> {}
29      .record Q <panda.extends=R, panda.implements=I> {}
30      .record A <panda.annotation, panda.annotation.type=runtime> {}
31      .record J <panda.interface, panda.implements=I> {}
32
33  - name: pandasm_header
34    template: |
35      .language PandaAssembly
36
37      .record panda.Class <external>
38      .record panda.Object <external>
39      .record panda.String <external>
40      .record panda.ClassCastException <external>
41
42      .record R {}
43      .record Q {}
44
45
46tests:
47  - file-name: "isinstance"
48    isa:
49      title: Is instance
50      description: >
51        Resolve object type by specified id and if an object in accumulator is an instance of the resolved type,
52        put 1 into accumulator, otherwise put 0.
53        Object of type O is instance of type T if O is the same as T or is subtype of T. For arrays T should be a root
54        type in type hierarchy or T is such array that O array elements are the same or subtype of T array elements.
55      instructions:
56        - sig: isinstance type_id
57          acc: inout:ref->i32
58          format: [op_id_16]
59    commands:
60
61      - file-name: "of_null_pa"
62        description: Check that null object reference is not an instance of any class
63        isa:
64          description: >
65            'null' object is not an instance of any class.
66        header-template: ['pandasm_header']
67        check-type: empty
68        code-template: |
69
70          .function i32 main() {
71            lda.null
72            isinstance %s
73            return
74          }
75        cases:
76          - values: ['panda.Class']
77          - values: ['panda.Object']
78          - values: ['R']
79
80
81      - file-name: "of_null_j"
82        description: Check that null object reference is not an instance of any class
83        isa:
84          description: >
85            'null' object is not an instance of any class.
86        header-template: ['PandaAssembly_header']
87        runner-options: ['use-pa']
88        check-type: empty
89        code-template: |
90
91          .function i32 main() {
92            lda.null
93            isinstance %s
94            return
95          }
96        cases:
97          - values: ['panda.Class']
98          - values: ['panda.Object']
99          - values: ['R']
100          - values: ['I']
101          - values: ['Q']
102          - values: ['A']
103
104
105      - file-name: "with_wrong_typeid_pa"
106        description: Check that compiler fails when type_id cannot be resolved to object type
107        isa:
108          verification:
109            - type_id_any_object
110        header-template: ['pandasm_header']
111        runner-options: ['compile-failure']
112        check-type: exit-positive
113        code-template: |
114
115          .function i32 main() {
116            %s
117            isinstance %s
118        cases:
119          - values:
120            - lda.null
121            - panda.XYZObj
122          - values:
123            - lda.null
124            - "null"
125          - values:
126            - |
127              newobj v0, panda.Object
128              lda.obj v0
129            - XYZObj
130          - values:
131            - |
132              newobj v0, panda.Object
133              lda.obj v0
134            - "\"xyz\""
135          - values:
136            - |
137              newobj v0, panda.Object
138              lda.obj v0
139            - i32
140          - values:
141            - ldai 1
142            - 1
143          - values:
144            - ldai.64 0xC0BAC0BAC0BA
145            - 0xC0BAC0BAC0BA
146          - values:
147            - fldai.64 2.7182818284590452353603
148            - 2.7182818284590452353603
149
150      - file-name: "with_valid_typeid_pa"
151        description: Check that verifier succeeds on valid typeid.
152        isa:
153          verification:
154            - type_id_any_object
155        header-template: ['pandasm_header']
156        check-type: empty
157        code-template: |
158
159          .function i32 main() {
160            newobj v0, R
161            lda.obj v0
162            isinstance panda.Object
163            jeqz set_failure
164            lda.obj v0
165            isinstance panda.Class
166            jnez set_failure
167            lda.obj v0
168            isinstance panda.String
169            jnez set_failure
170            lda.obj v0
171            isinstance panda.ClassCastException
172            jnez set_failure
173            lda.obj v0
174            isinstance R
175            jeqz set_failure
176            ldai 0
177            return
178          set_failure:
179            ldai 1
180            return
181          }
182
183      - file-name: "with_wrong_typeid_j"
184        description: Check that compiler fails when type_id cannot be resolved to object type
185        isa:
186          verification:
187            - type_id_any_object
188        header-template: ['PandaAssembly_header']
189        runner-options: ['use-pa', 'compile-failure']
190        check-type: exit-positive
191        code-template: |
192
193          .function i32 main() {
194            %s
195            isinstance %s
196        cases:
197          - values:
198            - lda.null
199            - panda.XYZObj
200          - values:
201            - |
202              newobj v0, panda.Object
203              lda.obj v0
204            - panda.XYZObj
205          - values:
206            - |
207              newobj v0, panda.Object
208              lda.obj v0
209            - "null"
210          - values:
211            - |
212              newobj v0, panda.Object
213              lda.obj v0
214            - "\"\""
215          - values:
216            - |
217              newobj v0, panda.Object
218              lda.obj v0
219            - f64
220          - values:
221            - ldai 0
222            - 0
223          - values:
224            - ldai.64 0x01
225            - 0x01
226          - values:
227            - fldai.64 2.7182818284590452353603
228            - 2.7182818284590452353603
229
230      - file-name: "with_valid_typeid_j"
231        description: Check that verifier succeeds on valid typeid.
232        isa:
233          verification:
234            - type_id_any_object
235        header-template: ['PandaAssembly_header']
236        runner-options: ['use-pa']
237        tags: ['irtoc_ignore']
238        check-type: empty
239        code-template: |
240
241          .function i32 main() {
242            newobj v0, Q
243            lda.obj v0
244            isinstance panda.Object
245            jeqz set_failure
246            lda.obj v0
247            isinstance panda.Class
248            jnez set_failure
249            lda.obj v0
250            isinstance panda.String
251            jnez set_failure
252            lda.obj v0
253            isinstance panda.ClassCastException
254            jnez set_failure
255            lda.obj v0
256            isinstance Q
257            jeqz set_failure
258            lda.obj v0
259            isinstance R
260            jeqz set_failure
261            lda.obj v0
262            isinstance I
263            jeqz set_failure
264            ldai 0
265            return
266          set_failure:
267            ldai 1
268            return
269          }
270
271      - file-name: "with_wrong_acc_value_pa"
272        description: Check that verifier fails when accumulator contains wrong value - neither object, nor null
273        isa:
274          verification:
275            - acc_obj_or_null
276        header-template: ['pandasm_header']
277        runner-options: ['verifier-failure', 'verifier-config']
278        tags: ['verifier']
279        check-type: exit-positive
280        code-template: |
281
282          .function i32 main() {
283            %s
284            isinstance %s
285        cases:
286          - values:
287            - ldai 1
288            - panda.Object
289          - values:
290            - ldai.64 0xC0BAC0BAC0BA
291            - panda.Object
292          - values:
293            - fldai.64 2.7182818284590452353603
294            - panda.Object
295
296
297      - file-name: "with_wrong_acc_value_j"
298        description: Check that verifier fails when accumulator contains wrong value - neither object, nor null
299        isa:
300          verification:
301            - acc_obj_or_null
302        header-template: ['PandaAssembly_header']
303        runner-options: ['use-pa', 'verifier-failure', 'verifier-config']
304        tags: [verifier, pa-verifier]
305        bugid: ['3293']
306        check-type: exit-positive
307        code-template: |
308
309          .function i32 main() {
310            %s
311            isinstance %s
312        cases:
313          - values:
314            - ldai 1
315            - panda.Object
316          - values:
317            - ldai.64 0xC0BAC0BAC0BA
318            - panda.Object
319          - values:
320            - fldai.64 2.7182818284590452353603
321            - panda.Object
322
323
324      - file-name: "when_1_is_expected_pa"
325        description: Check that the instruction sets accumulator to 1 when expected
326        isa:
327          description: >
328            Resolve object type by specified id and if an object in accumulator is an instance of the resolved type,
329            put 1 into accumulator, otherwise put 0.
330            Object of type O is instance of type T if O is the same as T or is subtype of T. For arrays T should be a root
331            type in type hierarchy or T is such array that O array elements are the same or subtype of T array elements.
332        header-template: ['pandasm_header']
333        check-type: empty
334        tags: ['tsan', 'irtoc_ignore']
335        code-template: |
336
337          .function i32 main() {
338            %s
339            isinstance %s
340            subi 1
341            return
342          }
343        cases:
344          # O has a type of T
345          - values:
346            - |
347              # O and T are of the same type, std object
348                newobj v0, panda.Object
349                lda.obj v0
350            - panda.Object
351          - values:
352            - |
353              # O and T are of the same type, custom object
354                newobj v0, R
355                lda.obj v0
356            - R
357          - values:
358            - |
359              # O and T are of the same type, string
360                lda.str "xyz"
361            - panda.String
362          - values:
363            - |
364              # O and T are of the same type, type
365                lda.type R
366            - panda.Class
367          # O is a subtype of T
368          - values:
369            - |
370              # O is a subtype of T, std object
371                newobj v0, panda.ClassCastException
372                lda.obj v0
373            - panda.Object
374          - values:
375            - |
376              # O is a subtype of T, custom object
377                newobj v0, R
378                lda.obj v0
379            - panda.Object
380          - values:
381            - |
382              # O is a subtype of T, string
383                lda.str "xyz"
384            - panda.Object
385          - values:
386            - |
387              # O is a subtype of T, type
388                lda.type R
389            - panda.Object
390          # O[] has a type of T[]
391          - values:
392            - |
393              # O and T are of the same type, both arrays, std object
394                movi v0, 10
395                newarr v0, v0, panda.Object[]
396                lda.obj v0
397            - panda.Object[]
398            bugid: ["1805"]
399          - values:
400            - |
401              # O and T are of the same type, both arrays, custom object
402                movi v0, 10
403                newarr v0, v0, R[]
404                lda.obj v0
405            - R[]
406            bugid: ["1805"]
407          - values:
408            - |
409              # O and T are of the same type, both arrays, string
410                movi v0, 10
411                newarr v0, v0, panda.String[]
412                lda.obj v0
413            - panda.String[]
414            bugid: ["1805"]
415          # O[] is a subtype of T[]
416          - values:
417            - |
418              # O is a subtype of T, both arrays, std object
419                movi v0, 10
420                newarr v0, v0, panda.ClassCastException[]
421                lda.obj v0
422            - panda.Object[]
423            bugid: ["1805"]
424          - values:
425            - |
426              # O is a subtype of T, both arrays, custom object
427                movi v0, 10
428                newarr v0, v0, R[]
429                lda.obj v0
430            - panda.Object[]
431            bugid: ["1805"]
432          # T is a root type for O[]
433          - values:
434            - |
435              # T is a root type for O[], std object
436                movi v0, 10
437                newarr v0, v0, panda.ClassCastException[]
438                lda.obj v0
439            - panda.Object
440          - values:
441            - |
442              # T is a root type for O[], custom object
443                movi v0, 10
444                newarr v0, v0, R[]
445                lda.obj v0
446            - panda.Object
447
448
449      - file-name: "when_1_is_expected_j"
450        description: Check that the instruction sets accumulator to 1 when expected
451        isa:
452          description: >
453            Resolve object type by specified id and if an object in accumulator is an instance of the resolved type,
454            put 1 into accumulator, otherwise put 0.
455            Object of type O is instance of type T if O is the same as T or is subtype of T. For arrays T should be a root
456            type in type hierarchy or T is such array that O array elements are the same or subtype of T array elements.
457        header-template: ['PandaAssembly_header']
458        runner-options: ['use-pa']
459        check-type: empty
460        tags: ['tsan', 'irtoc_ignore']
461        code-template: |
462
463          .function i32 main() {
464            %s
465            isinstance %s
466            subi 1
467            return
468          }
469        cases:
470          # O type is T
471          - values:
472            - |
473              # O and T are of the same type, std object
474                newobj v0, panda.Object
475                lda.obj v0
476            - panda.Object
477          - values:
478            - |
479              # O and T are of the same type, custom object
480                newobj v0, R
481                lda.obj v0
482            - R
483          - values:
484            - |
485              # O and T are of the same type, string
486                lda.str "xyz"
487            - panda.String
488          - values:
489            - |
490              # O and T are of the same type, type
491                lda.type R
492            - panda.Class
493          # O extends or implements T
494          - values:
495            - |
496              # O is a subtype of T, std object
497                newobj v0, panda.NullPointerException
498                lda.obj v0
499            - panda.Object
500          - values:
501            - |
502              # O implements T, std object
503                newobj v0, panda.NullPointerException
504                lda.obj v0
505            - panda.io.Serializable
506            ignore: true
507            bugid: ["1806"]
508          - values:
509            - |
510              # O is a subtype of T, custom object
511                newobj v0, Q
512                lda.obj v0
513            - R
514          - values:
515            - |
516              # O implements T, std object
517                newobj v0, Q
518                lda.obj v0
519            - I
520          - values:
521            - |
522              # O is a subtype of T, string
523                lda.str "xyz"
524            - panda.Object
525          - values:
526            - |
527              # O implements T, string
528                lda.str "xyz"
529            - panda.CharSequence
530            bugid: ["1806"]
531          - values:
532            - |
533              # O is a subtype of T, type
534                lda.type R
535            - panda.Object
536          - values:
537            - |
538              # O implements T , type
539                lda.type R
540            - panda.io.Serializable
541          # O[] type is T[]
542          - values:
543            - |
544              # O and T are of the same type, both arrays, std object
545                movi v0, 10
546                newarr v0, v0, panda.Object[]
547                lda.obj v0
548            - panda.Object[]
549            bugid: ["1805"]
550          - values:
551            - |
552              # O and T are of the same type, both arrays, custom object
553                movi v0, 10
554                newarr v0, v0, A[]
555                lda.obj v0
556            - A[]
557            bugid: ["1805"]
558          - values:
559            - |
560              # O and T are of the same type, both arrays, string
561                movi v0, 10
562                newarr v0, v0, panda.String[]
563                lda.obj v0
564            - panda.String[]
565            bugid: ["1805"]
566          # O[] extends or implements T[]
567          - values:
568            - |
569              # O is a subtype of T, both arrays, std object
570                movi v0, 10
571                newarr v0, v0, panda.NullPointerException[]
572                lda.obj v0
573            - panda.Object[]
574            bugid: ["1805"]
575          - values:
576            - |
577              # O implements T, both arrays, std object
578                movi v0, 10
579                newarr v0, v0, panda.NullPointerException[]
580                lda.obj v0
581            - panda.io.Serializable[]
582            ignore: true
583            bugid: ["1806"]
584          - values:
585            - |
586              # O is a subtype of T, both arrays, custom object
587                movi v0, 10
588                newarr v0, v0, Q[]
589                lda.obj v0
590            - R[]
591            bugid: ["1805"]
592          - values:
593            - |
594              # O implements T, both arrays, custom object
595                movi v0, 10
596                newarr v0, v0, Q[]
597                lda.obj v0
598            - I[]
599            bugid: ["1805"]
600          # T is a root type for O[]
601          - values:
602            - |
603              # T is a root type for O[], std object
604                movi v0, 10
605                newarr v0, v0, panda.NullPointerException[]
606                lda.obj v0
607            - panda.Object
608          - values:
609            - |
610              # T is a root type for O[], custom object
611              movi v0, 10
612              newarr v0, v0, R[]
613              lda.obj v0
614            - panda.Object
615
616
617      - file-name: "when_0_is_expected_pa"
618        description: Check that the instruction sets accumulator to 0 when expected
619        isa:
620          description: >
621            Resolve object type by specified id and if an object in accumulator is an instance of the resolved type,
622            put 1 into accumulator, otherwise put 0.
623            Object of type O is instance of type T if O is the same as T or is subtype of T. For arrays T should be a root
624            type in type hierarchy or T is such array that O array elements are the same or subtype of T array elements.
625        header-template: ['pandasm_header']
626        check-type: empty
627        code-template: |
628
629          .function i32 main() {
630            %s
631            isinstance %s
632            return
633          }
634        cases:
635          # O is not related to T
636          - values:
637            - |
638              # O and T are of unrelated types, std object
639                newobj v0, panda.ClassCastException
640                lda.obj v0
641            - R
642          - values:
643            - |
644              # O and T are of unrelated types, custom object
645                newobj v0, R
646                lda.obj v0
647            - Q
648          - values:
649            - |
650              # O and T are of unrelated types, string
651                lda.str "xyz"
652            - R
653          - values:
654            - |
655              # O and T are of unrelated types, type
656                lda.type R
657            - panda.ClassCastException
658          # O is a supertype of T
659          - values:
660            - |
661              # O is a supertype of T, std object
662                newobj v0, panda.Object
663                lda.obj v0
664            - panda.ClassCastException
665          - values:
666            - |
667              # O is a supertype of T, custom object
668                newobj v0, panda.Object
669                lda.obj v0
670            - R
671          # O[] is not related to T[]
672          - values:
673            - |
674              # O and T are of unrelated types, both arrays, std object
675                movi v0, 10
676                newarr v0, v0, panda.ClassCastException[]
677                lda.obj v0
678            - R[]
679            bugid: ["1805"]
680          - values:
681            - |
682              # O and T are of unrelated types, both arrays, custom object
683                movi v0, 10
684                newarr v0, v0, R[]
685                lda.obj v0
686            - Q[]
687            bugid: ["1805"]
688          # O[] is a supertype of T[]
689          - values:
690            - |
691              # O is a supertype of T, both arrays, std object
692                movi v0, 10
693                newarr v0, v0, panda.Object[]
694                lda.obj v0
695            - panda.ClassCastException[]
696            bugid: ["1805"]
697          - values:
698            - |
699              # O is a supertype of T, both arrays, custom object
700                movi v0, 10
701                newarr v0, v0, panda.Object[]
702                lda.obj v0
703            - R[]
704            bugid: ["1805"]
705          # T is not a root type for O[]
706          - values:
707            - |
708              # T is a not a root type for O[], std object
709                movi v0, 10
710                newarr v0, v0, panda.ClassCastException[]
711                lda.obj v0
712            - panda.String
713          - values:
714            - |
715              # T is a not a root type for O[], custom object
716                movi v0, 10
717                newarr v0, v0, R[]
718                lda.obj v0
719            - panda.ClassCastException
720
721
722      - file-name: "when_0_is_expected_j"
723        description: Check that the instruction sets accumulator to 0 when expected
724        isa:
725          description: >
726            Resolve object type by specified id and if an object in accumulator is an instance of the resolved type,
727            put 1 into accumulator, otherwise put 0.
728            Object of type O is instance of type T if O is the same as T or is subtype of T. For arrays T should be a root
729            type in type hierarchy or T is such array that O array elements are the same or subtype of T array elements.
730        header-template: ['PandaAssembly_header']
731        runner-options: ['use-pa']
732        check-type: empty
733        tags: ['tsan', 'irtoc_ignore']
734        code-template: |
735
736          .function i32 main() {
737            %s
738            isinstance %s
739            return
740          }
741        cases:
742          # O is not related to T
743          - values:
744            - |
745              # O and T are of unrelated types, std object
746                newobj v0, panda.NullPointerException
747                lda.obj v0
748            - panda.Class
749          - values:
750            - |
751              # O and T are of unrelated types, custom object
752                newobj v0, R
753                lda.obj v0
754            - A
755          - values:
756            - |
757              # O and T are of unrelated types, string
758                lda.str "xyz"
759            - panda.NullPointerException
760          - values:
761            - |
762              # O and T are of unrelated types, type
763                lda.type R
764            - panda.String
765          # O is a supertype of T
766          - values:
767            - |
768              # O is a supertype of T, std object
769                newobj v0, panda.Object
770                lda.obj v0
771            - panda.NullPointerException
772          - values:
773            - |
774              # O doesn't implement T, std object
775                newobj v0, panda.NullPointerException
776                lda.obj v0
777            - I
778          - values:
779            - |
780              # O is a supertype of T, custom object
781                newobj v0, R
782                lda.obj v0
783            - Q
784          - values:
785            - |
786              # O doesn't implement T, custom object
787                newobj v0, Q
788                lda.obj v0
789            - J
790          - values:
791            - |
792              # O doesn't implement T, string
793                lda.str "xyz"
794            - I
795          - values:
796            - |
797              # O doesn't implement T, type
798                lda.type R
799            - I
800          # O[] is not related to T[]
801          - values:
802            - |
803              # O and T are of unrelated types, both arrays, std object
804                movi v0, 10
805                newarr v0, v0, panda.NullPointerException[]
806                lda.obj v0
807            - R[]
808            bugid: ["1805"]
809          - values:
810            - |
811              # O and T are of unrelated types, both arrays, custom object
812                movi v0, 10
813                newarr v0, v0, A[]
814                lda.obj v0
815            - panda.Class[]
816            bugid: ["1805"]
817          # O[] is a supertype of T[]
818          - values:
819            - |
820              # O is a supertype of T, both arrays, std object
821                movi v0, 10
822                newarr v0, v0, panda.Object[]
823                lda.obj v0
824            - panda.NullPointerException[]
825            bugid: ["1805"]
826          - values:
827            - |
828              # O doesn't implement T, both arrays, std object
829                movi v0, 10
830                newarr v0, v0, panda.NullPointerException[]
831                lda.obj v0
832            - I[]
833            bugid: ["1805"]
834          - values:
835            - |
836              # O is a supertype of T, both arrays, custom object
837                movi v0, 10
838                newarr v0, v0, R[]
839                lda.obj v0
840            - Q[]
841            bugid: ["1805"]
842          - values:
843            - |
844              # O doesn't implement T, both arrays, custom object
845                movi v0, 10
846                newarr v0, v0, Q[]
847                lda.obj v0
848            - J[]
849            bugid: ["1805"]
850          # T is not a root type for O[]
851          - values:
852            - |
853              # T is not a root type for O[], std object
854                movi v0, 10
855                newarr v0, v0, panda.NullPointerException[]
856                lda.obj v0
857            - panda.String
858          - values:
859            - |
860              # T is not a root type for O[], custom object
861                movi v0, 10
862                newarr v0, v0, Q[]
863                lda.obj v0
864            - R
865
866      - file-name: "with_nodef_typeid_pa"
867        description: Check that NoClassDefFoundError is thrown when expected
868        isa:
869          exceptions:
870            - x_classdef
871        header-template: ['pandasm_header']
872        tags: ['irtoc_ignore']
873        check-type: empty
874        bugid: ['5385']
875        code-template: |
876          .record panda.NoClassDefFoundError <external>
877          .record panda.XYZObj <external>
878
879          .function i32 main() {
880          begin:
881            %s
882            isinstance %s
883            ldai 1
884            return
885          end:
886          catch_NCDFE:
887            ldai 0
888            return
889          catch_all:
890            ldai 2
891            return
892          .catch panda.NoClassDefFoundError, begin, end, catch_NCDFE
893          .catchall begin, end, catch_all
894          }
895        cases:
896          - values:
897            - lda.null
898            - panda.XYZObj
899          - values:
900            - lda.null
901            - panda.XYZObj[]
902          - values:
903            - |
904              #
905                newobj v0, panda.Object
906                lda.obj v0
907            - panda.XYZObj
908          - values:
909            - |
910              #
911                movi v0, 10
912                newarr v0, v0, panda.Object[]
913                lda.obj v0
914            - panda.XYZObj[]
915
916      - file-name: "with_nodef_typeid_j"
917        description: Check that NoClassDefFoundError is thrown when expected
918        isa:
919          exceptions:
920            - x_classdef
921        header-template: ['PandaAssembly_header']
922        tags: ['irtoc_ignore']
923        runner-options: ['use-pa']
924        check-type: empty
925        bugid: ['5385']
926        code-template: |
927          .record panda.NoClassDefFoundError <external>
928          .record panda.XYZObj <external>
929          .record panda.XYZSub <panda.extends=panda.XYZObj, panda.implements=I> {}
930          .record panda.XYZInf <panda.interface, external>
931
932          .function i32 main() {
933          begin:
934            %s
935            isinstance %s
936            ldai 1
937            return
938          end:
939          catch_NCDFE:
940            ldai 0
941            return
942          catch_all:
943            ldai 2
944            return
945          .catch panda.NoClassDefFoundError, begin, end, catch_NCDFE
946          .catchall begin, end, catch_all
947          }
948        cases:
949          - values:
950            - lda.null
951            - panda.XYZObj
952          - values:
953            - lda.null
954            - panda.XYZObj[]
955          - values:
956            - |
957              #
958                newobj v0, panda.Object
959                lda.obj v0
960            - panda.XYZObj
961          - values:
962            - |
963              #
964                movi v0, 10
965                newarr v0, v0, panda.Object[]
966                lda.obj v0
967            - panda.XYZObj[]
968          - values:
969            - lda.null
970            - panda.XYZSub
971          - values:
972            - lda.null
973            - panda.XYZSub[]
974          - values:
975            - |
976              #
977                newobj v0, panda.Object
978                lda.obj v0
979            - panda.XYZSub
980          - values:
981            - |
982              #
983                movi v0, 10
984                newarr v0, v0, panda.Object[]
985                lda.obj v0
986            - panda.XYZSub[]
987          - values:
988            - lda.null
989            - panda.XYZInf
990          - values:
991            - lda.null
992            - panda.XYZInf[]
993          - values:
994            - |
995              #
996                newobj v0, panda.Object
997                lda.obj v0
998            - panda.XYZInf
999          - values:
1000            - |
1001              #
1002                movi v0, 10
1003                newarr v0, v0, panda.Object[]
1004                lda.obj v0
1005            - panda.XYZInf[]
1006