• 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: "initobj.short"
21    isa:
22      title: Create new object and call initializer
23      description: |
24        Resolve class type from initializer method_id, allocate memory for an object, initialize its fields with their
25        default values (i.e. 0 for primitives and null for objects), call specified initializer and put a reference to
26        the newly created object into accumulator. method_id should resolve to an initializer.
27        Non-range instructions can be used to pass up to 4 arguments.
28        Unused register slot values will be discarded and corresponding registers will not be passed to initializer).
29      instructions:
30        - sig: initobj.short method_id, v1:in:none, v2:in:none
31          acc: out:ref
32          format: [op_v1_4_v2_4_id_16]
33    commands:
34
35      - file-name: "invalid_syntax"
36        isa:
37          verification:
38            - method_id_non_static
39            - method_id_accessible
40            - method_init_obj
41        runner-options: [compile-failure]
42        description: Check 'initobj.short' instruction with invalid method id.
43        header-template: []
44        code-template: |
45          .record A {
46              i32   f32
47              A     fA
48              i32[] f32Array
49              A[]   fAArray
50          }
51          .function void A.c2(A a0, u32 a1, u32 a2) <ctor> {
52              return.void
53          }
54          .function void A.c1(A a0, u64 a1) <ctor> {
55              return.void
56          }
57          .function void A.c0(A a0) <ctor> {
58              return.void
59          }
60          .function void A.aFunc(A a0) {
61              return.void
62          }
63          .function i32 main() {
64          begin:
65              initobj.short %s
66        check-type: exit-positive
67        cases:
68          - values:
69            - ""
70          - values:
71            - "label:"
72          - values:
73            - "begin"
74          - values:
75            - "{}"
76          - values:
77            - "}"
78          - values:
79            - "# comment"
80          - values:
81            - "null"
82          - values:
83            - "0"
84          - values:
85            - "v0"
86          - values:
87            - "i32"
88          - values:
89            - i32[]
90          - values:
91            - "\"A\""
92          - values:
93            - A
94          - values:
95            - "A.f32"
96          - values:
97            - "A.fA"
98          - values:
99            - "A.f32Array"
100          - values:
101            - "A.fAArray"
102          - values:
103            - "A[]"
104          - values:
105            - "panda.Object[]"
106          - values:
107            - "aFunc, v1"
108          - values:
109            - "Object"
110          - values:
111            - A.c2, v1, v2, v3
112          - values:
113            - A.c2, v1
114            ignore: true
115            bugid: ['1956','1304']
116          - values:
117            - A.c2, a1, a2
118          - values:
119            - A.c2, 0, 1
120          - values:
121            - A.c1
122            ignore: true
123            bugid: ['1956','1304']
124          - values:
125            - A.c1, a1, a2, a3
126          - values:
127            - A.c1, , ,
128
129
130      - file-name: "uninitialized_regs_p"
131        isa:
132          instructions:
133            - sig: initobj.short method_id, v1:in:none, v2:in:none
134              acc: out:ref
135              format: [op_v1_4_v2_4_id_16]
136        runner-options: ['verifier-failure', 'verifier-config']
137        tags: [verifier]
138        description: Check 'initobj.short' instruction with uninitialized registers in PandaAssembly context.
139        header-template: []
140        code-template: |
141          .record panda.Object <external>
142          .record panda.String <external>
143          .record R {}
144          .function void R.ctor(R a0%s) <ctor> {
145              return.void
146          }
147          .function i32 main() {
148              %s
149        check-type: exit-positive
150        cases:
151          - values:
152            # v1 not initialized
153            - ", i32 a1"
154            - initobj.short R.ctor, v1
155          - values:
156            # v2 not initialized
157            - ", i64 a1, f64 a2"
158            - |
159              #
160                  movi.64 v1, 1
161                  initobj.short R.ctor, v1, v2
162          - values:
163            # v1, v2 not initialized
164            - ", u1 a1, u8 a2"
165            - initobj.short R.ctor, v1, v2
166          - values:
167            # v2 not initialized but not used
168            - ", f64[] a1"
169            - |
170              #
171                  movi v0, 10
172                  newarr v1, v0, f64[]
173                  initobj.short R.ctor, v1, v2
174            runner-options: ['verifier-only', 'verifier-config']
175          - values:
176            # v4, v3 not initialized but not used
177            - ""
178            - initobj.short R.ctor, v4, v3
179            runner-options: ['verifier-only', 'verifier-config']
180
181
182      - file-name: "uninitialized_regs_j"
183        isa:
184          instructions:
185            - sig: initobj.short method_id, v1:in:none, v2:in:none
186              acc: out:ref
187              format: [op_v1_4_v2_4_id_16]
188        runner-options: [verifier-failure, use-pa, verifier-config]
189        tags: [verifier, pa-verifier]
190        description: Check 'initobj.short' instruction with uninitialized registers in PandaAssembly context.
191        header-template: [PandaAssembly]
192        bugid: ["5271"]
193        code-template: |
194          .record panda.Object <external>
195          .record panda.String <external>
196          .record R {}
197          %s
198          .function i32 main() {
199              %s
200        check-type: exit-positive
201        cases:
202          - values:
203            # v5 not initialized
204            - |
205              .function void R.ctor(R a0, i32 a1) <ctor> {
206                  return.void
207              }
208            - initobj.short R.ctor, v5
209          - values:
210            # v10 not initialized
211            - |
212              .function void R.ctor(R a0, i64 a1, f64 a2) <ctor> {
213                  return.void
214              }
215            - |
216              #
217                  fmovi.64 v1, 1.0
218                  initobj.short R.ctor, v10, v1
219          - values:
220            # v1, v4 not initialized
221            - |
222              .function void R.ctor(R a0, u1 a1, i8 a2) <ctor> {
223                  return.void
224              }
225            - initobj.short R.ctor, v1, v4
226          - values:
227            # v4 not initialized but not used
228            - |
229              .function void R.ctor(R a0, panda.String a1) <ctor> {
230                  return.void
231              }
232            - |
233              #
234                  lda.str "test"
235                  sta.obj v11
236                  initobj.short R.ctor, v11, v4
237            runner-options: [verifier-only, use-pa, verifier-config]
238          - values:
239            # v3, v4 not initialized but not used
240            - |
241              .record panda.NullPointerException <external>
242              .function void panda.NullPointerException.ctor1(panda.NullPointerException a0) <external, ctor>
243            - |
244              #
245                  initobj.short panda.NullPointerException.ctor1, v3, v4
246            runner-options: [verifier-only, use-pa, verifier-config]
247          - values:
248            # v1 is not initialized
249            - |
250              .record panda.NullPointerException <external>
251              .function void panda.NullPointerException.ctor2(panda.NullPointerException a0, panda.String a1) <external, ctor>
252            - |
253              #
254                  initobj.short panda.NullPointerException.ctor2, v1, v2
255
256
257      - file-name: "reg_v_invalid"
258        isa:
259          instructions:
260            - sig: initobj.short method_id, v1:in:none, v2:in:none
261              acc: out:ref
262              format: [op_v1_4_v2_4_id_16]
263        runner-options: [compile-failure]
264        description: Check 'initobj.short' instruction with invalid 'v' register numbers.
265        header-template: []
266        code-template: |
267          .record R {}
268          .function void R.c(R a0, i32 a1, i32 a2) <ctor> {
269              return.void
270          }
271          #
272          .function i32 main() {
273              initobj.short R.c, %s
274        check-type: exit-positive
275        cases:
276          - values:
277            - "v16, v1"
278          - values:
279            - "v0, v255"
280          - values:
281            - "v256, v3"
282          - values:
283            - "v2, v65535"
284          - values:
285            - "v65536, v1"
286
287
288      - file-name: "reg_a_invalid"
289        isa:
290          instructions:
291            - sig: initobj.short method_id, v1:in:none, v2:in:none
292              acc: out:ref
293              format: [op_v1_4_v2_4_id_16]
294        runner-options: [compile-failure]
295        description: Check 'initobj.short' instruction with invalid 'a' register numbers.
296        header-template: []
297        code-template: |
298          .record R {}
299          .function void R.c(R a0, i32 a1, i32 a2) <ctor> {
300              return.void
301          }
302          .function void func(i32 a0, i32 a1, i32 a2, i32 a3, i32 a4, i32 a5, i32 a6, i32 a7, i32 a8, i32 a9, i32 a10, i32 a11, i32 a12, i32 a13, i32 a14, i32 a15) {
303              initobj.short R.c, %s
304              return.void
305          }
306          #
307          .function i32 main() {
308              call.range func, v0
309        check-type: exit-positive
310        cases:
311          - values:
312            - "a16, a15"
313          - values:
314            - "a0, a255"
315          - values:
316            - "a256, a7"
317          - values:
318            - "a0, a65535"
319          - values:
320            - "a65536, a1"
321
322
323      - file-name: "reg_v_valid"
324        isa:
325          instructions:
326            - sig: initobj.short method_id, v1:in:none, v2:in:none
327              acc: out:ref
328              format: [op_v1_4_v2_4_id_16]
329        description: Check 'initobj.short' instruction with valid 'v' register numbers.
330        header-template: []
331        code-template: |
332          .record R {}
333          .function void R.c(R a0, i32 a1, i32 a2) <ctor> {
334              return.void
335          }
336          #
337          .function i32 main() {
338              movi %s, 100
339              movi %s, 200
340              lda.null
341              initobj.short R.c, %s, %s
342              jnez.obj ok
343              ldai 1
344              return
345          ok:
346        check-type: exit-positive
347        cases:
348          - values: [v0, v1, v0, v1]
349          - values: [v2, v3, v2, v3]
350          - values: [v4, v5, v4, v5]
351          - values: [v6, v7, v6, v7]
352          - values: [v8, v9, v8, v9]
353          - values: [v10, v11, v10, v11]
354          - values: [v12, v13, v12, v13]
355          - values: [v14, v15, v14, v15]
356
357
358      - file-name: "reg_a_valid"
359        isa:
360          instructions:
361            - sig: initobj.short method_id, v1:in:none, v2:in:none
362              acc: out:ref
363              format: [op_v1_4_v2_4_id_16]
364        runner-options: ['verifier-only', 'verifier-config']
365        tags: ['verifier']
366        description: Check 'initobj.short' instruction with valid 'a' register numbers.
367        header-template: []
368        code-template: |
369          .record R {}
370          .function void R.c(R a0, i32 a1, i32 a2) <ctor> {
371              return.void
372          }
373          .function void func(i32 a0, i32 a1, i32 a2, i32 a3, i32 a4, i32 a5, i32 a6, i32 a7, i32 a8, i32 a9, i32 a10, i32 a11, i32 a12, i32 a13, i32 a14, i32 a15) {
374              initobj.short R.c, a0, a1
375              initobj.short R.c, a2, a3
376              initobj.short R.c, a4, a5
377              initobj.short R.c, a6, a7
378              initobj.short R.c, a8, a9
379              initobj.short R.c, a10, a11
380              initobj.short R.c, a12, a13
381              initobj.short R.c, a14, a15
382              return.void
383          }
384          #
385          .function i32 main() {
386              movi v0, 0
387              movi v1, 1
388              movi v2, 2
389              movi v3, 3
390              movi v4, 4
391              movi v5, 5
392              movi v6, 6
393              movi v7, 7
394              movi v8, 8
395              movi v9, 9
396              movi v10, 10
397              movi v11, 11
398              movi v12, 12
399              movi v13, 13
400              movi v14, 14
401              movi v15, 15
402              call.range func, v0
403        check-type: exit-positive
404
405
406      - file-name: "invalid_ctor_p"
407        isa:
408          verification:
409            - method_id_non_static
410            - method_id_accessible
411            - method_init_obj
412        runner-options: ['verifier-failure', 'verifier-config']
413        tags: [verifier]
414        description: Check 'initobj.short' instruction with invalid initializer in PandaAssembly context.
415        header-template: []
416        code-template: |
417          .record R {}
418          %s
419          .function i32 main() {
420              %s
421        check-type: exit-positive
422        cases:
423          # static functions
424          - values:
425            - ""
426            - initobj.short main
427            bugid: ['3585']
428          - values:
429            - |
430              .function void R.cctor() <cctor> {
431                  return.void
432              }
433            - initobj.short R.cctor
434            bugid: ['3585']
435          - values:
436            - |
437              .function void R.cctor2(i32 a0) <cctor> {
438                  return.void
439              }
440            - |
441              #
442                  movi v1, 1
443                  initobj.short R.cctor2, v1
444          - values:
445            - |
446              .function void R.statFunc() <static> {
447                  return.void
448              }
449            - initobj.short R.statFunc
450            bugid: ['3585']
451          - values:
452            - |
453              .function void R.ctor() <ctor> {
454                  return.void
455              }
456              .function void R.statFunc2(R a0, i32 a1) <static> {
457                  return.void
458              }
459            - |
460              #
461                  movi v1, 1
462                  initobj.short R.ctor                 # should be ok
463                  sta.obj v0
464                  initobj.short R.statFunc2, v0, v1    # should fail
465          # virtual functions, not initializers
466          - values:
467            - |
468              .function void R.virtFunc(R a0) {
469                  return.void
470              }
471            - initobj.short R.virtFunc
472            bugid: ['3585']
473          - values:
474            - |
475              .function void R.ctor() <ctor> {
476                  return.void
477              }
478              .function void R.virtFunc2(R a0, i32 a1) {
479                  return.void
480              }
481            - |
482              #
483                  movi v1, 1
484                  initobj.short R.ctor                 # should be ok
485                  sta.obj v0
486                  initobj.short R.virtFunc2, v0, v1    # should fail
487          - values:
488            - |
489              .record panda.NullPointerException <external>
490              .record panda.String <external>
491              .function panda.String panda.NullPointerException.getMessage(panda.NullPointerException a0) <external>
492            - initobj.short panda.NullPointerException.getMessage
493            bugid: ['3585']
494          - values:
495            - |
496              .function void R.ctor() <ctor> {
497                  return.void
498              }
499              .record panda.NullPointerException <external>
500              .record panda.String <external>
501              .record panda.Object <external>
502              .function void panda.NullPointerException.ctor(panda.NullPointerException a0, panda.String a1, panda.Object a2) <external, ctor>
503              .function panda.String panda.NullPointerException.getMessage(panda.NullPointerException a0) <external>
504            - |
505              #
506                  lda.str "message"
507                  sta.obj v1
508                  initobj.short R.ctor                                      # should be ok
509                  sta.obj v2
510                  initobj.short panda.NullPointerException.ctor, v1, v2     # should be ok
511                  sta.obj v0
512                  initobj.short panda.NullPointerException.getMessage, v0   # should fail
513            bugid: ['3585']
514          # inaccessible methods
515          - values:
516            - .function void R.extFunc(R a0) <external>
517            - initobj.short R.extFunc
518            bugid: ['3585']
519          - values:
520            - .function void R.nativeFunc(R a0) <native>
521            - initobj.short R.nativeFunc
522            bugid: ['3585']
523          - values:
524            - .function void R.noimplFunc(R a0) <noimpl>
525            - initobj.short R.noimplFunc
526            bugid: ['3585']
527          # ctor without return
528          - values:
529            - .function void R.ctorNoReturn(R a0) <ctor> {}
530            - initobj.short R.ctorNoReturn
531            bugid: ['5607']
532            ignore: true
533
534
535      - file-name: "invalid_ctor_j"
536        isa:
537          verification:
538            - method_id_non_static
539            - method_id_accessible
540            - method_init_obj
541        runner-options: [verifier-failure, use-pa, verifier-config]
542        tags: [verifier, pa-verifier]
543        description: Check 'initobj.short' instruction with invalid initializer in PandaAssembly context.
544        header-template: [PandaAssembly]
545        bugid: ["5271"]
546        code-template: |
547          .record R {}
548          %s
549          .function i32 main() {
550              %s
551        check-type: exit-positive
552        cases:
553          # static functions
554          - values:
555            - ""
556            - initobj.short main
557            bugid: ['3585']
558          - values:
559            - |
560              .function void R.cctor() <cctor> {
561                  return.void
562              }
563            - initobj.short R.cctor
564            bugid: ['3585']
565          - values:
566            - |
567              .function void R.cctor(R a0, i32 a1) <cctor> {
568                  return.void
569              }
570            - |
571              #
572                  movi v1, 1
573                  initobj.short R.cctor, v1
574            bugid: ['3585']
575          - values:
576            - |
577              .function void R.statFunc() <static> {
578                  return.void
579              }
580            - initobj.short R.statFunc
581            bugid: ['3585']
582          - values:
583            - |
584              .function void R.ctor0() <ctor> {
585                  return.void
586              }
587              .function void R.ctor(R a0, i32 a1) <static> {
588                  return.void
589              }
590            - |
591              #
592                  initobj.short R.ctor0           # should be ok
593                  sta.obj v0
594                  movi v1, 1
595                  initobj.short R.ctor, v0, v1    # should fail
596          - values:
597            - |
598              .function void R.ctor(R a0, i32 a1) <static> {
599                  return.void
600              }
601            - |
602              #
603                  movi v1, 1
604                  initobj.short R.ctor, v1    # should fail
605            bugid: ['3585']
606          - values:
607            - |
608              .record panda.Long <external>
609              .function panda.Long panda.Long.valueOf(i64 a0) <external, static>
610            - |
611              #
612                  movi.64 v1, 1
613                  initobj.short panda.Long.valueOf, v1
614          # virtual functions, not initializers
615          - values:
616            - |
617              .function void R.virtFunc(R a0) {
618                  return.void
619              }
620            - initobj.short R.virtFunc
621            bugid: ['3585']
622          - values:
623            - |
624              .function void R.ctor() <ctor> {
625                  return.void
626              }
627              .function void R.virtFunc(R a0, i32 a1) {
628                  return.void
629              }
630            - |
631              #
632                  initobj.short R.ctor                 # should be ok
633                  sta.obj v0
634                  movi v1, 1
635                  initobj.short R.virtFunc, v0, v1     # should fail
636          - values:
637            - |
638              .record panda.NullPointerException <external>
639              .record panda.String <external>
640              .function void panda.NullPointerException.ctor(panda.NullPointerException a0, panda.String a1) <external, ctor>
641            - |
642              #
643                  lda.str "message"
644                  sta.obj v1
645                  initobj.short panda.NullPointerException.ctor, v1         # should be ok
646            runner-options: [verifier-only, use-pa, verifier-config]
647          - values:
648            - |
649              .record panda.NullPointerException <external>
650              .record panda.String <external>
651              .function panda.String panda.NullPointerException.getMessage(panda.NullPointerException a0) <external>
652            - initobj.short panda.NullPointerException.getMessage
653            bugid: ['3585', '5752']
654          - values:
655            - |
656              .record panda.NullPointerException <external>
657              .record panda.String <external>
658              .function void panda.NullPointerException.ctor(panda.NullPointerException a0, panda.String a1) <external, ctor>
659              .function panda.String panda.NullPointerException.getMessage(panda.NullPointerException a0) <external>
660            - |
661              #
662                  lda.str "message"
663                  sta.obj v1
664                  initobj.short panda.NullPointerException.ctor, v1             # should be ok
665                  sta.obj v0
666                  initobj.short panda.NullPointerException.getMessage, v0       # should fail
667            bugid: ['3585', '5752']
668          - values:
669              - |
670                .record panda.Long <external>
671                .function i64 panda.Long.longValue(panda.Long a0) <external>
672              - |
673                #
674                    initobj.short panda.Long.longValue
675            bugid: ['3585']
676          - values:
677              - |
678                .record panda.Long <external>
679                .function void panda.Long.ctor(panda.Long a0, i64 a1) <ctor, external>
680                .function i64 panda.Long.longValue(panda.Long a0) <external>
681              - |
682                #
683                    movi.64 v1, 1234567890
684                    initobj.short panda.Long.ctor, v1
685                    sta.obj v1
686                    initobj.short panda.Long.longValue, v1
687            bugid: ['3585']
688          # inaccessible methods
689          - values:
690            - .function void R.extFunc(R a0) <external>
691            - initobj.short R.extFunc
692            bugid: ['3585']
693          - values:
694            - .function void R.nativeFunc(R a0) <native>
695            - initobj.short R.nativeFunc
696            bugid: ['3585']
697          - values:
698            - .function void R.noimplFunc(R a0) <noimpl>
699            - initobj.short R.noimplFunc
700            bugid: ['3585']
701          - values:
702            - |
703              .record I <panda.interface> {}
704              .function void I.func(I a0) <noimpl>
705              .record Q <panda.implements=I> {}
706              .function void Q.func(Q a0) {
707                  return.void
708              }
709            - |
710              #
711                  initobj.short I.func
712            bugid: ['3585']
713          # ctor without return
714          - values:
715            - .function void R.ctorNoReturn(R a0) <ctor> {}
716            - initobj.short R.ctorNoReturn
717            bugid: ['5607']
718            ignore: true
719
720
721      - file-name: "incompatible_args_p"
722        isa:
723          verification:
724            - compatible_arguments
725        runner-options: ['verifier-failure', 'verifier-config']
726        tags: [verifier]
727        description: Check 'initobj.short' instruction with initializer called with incompatible arguments in PandaAssembly context.
728        header-template: []
729        code-template: |
730          .record panda.Object <external>
731          .record panda.Class <external>
732          .record panda.String <external>
733          .record R {}
734          .function void R.constructor(R a0, %s a1) <ctor> {
735              return.void
736          }
737
738          .function i32 main() {
739              *s
740              initobj.short R.constructor, v1
741        check-type: exit-positive
742        template-cases:
743          - values:
744            - u1
745            exclude: [i32]
746          - values:
747            - u8
748            exclude: [i32]
749          - values:
750            - i8
751            exclude: [i32]
752          - values:
753            - u16
754            exclude: [i32]
755          - values:
756            - i16
757            exclude: [i32]
758          - values:
759            - u32
760            exclude: [i32]
761          - values:
762            - u64
763            exclude: [i64]
764          - values:
765            - f32
766            exclude: [f64]
767          - values:
768            - u32[]
769            exclude: [u32a, nul]
770          - values:
771            - u64[]
772            exclude: [u64a, nul]
773          - values:
774            - f32[]
775            exclude: [f32a, nul]
776          - values:
777            - u32[][]
778            exclude: [u32aa, nul]
779          - values:
780            - u64[][]
781            exclude: [u64aa, nul]
782          - values:
783            - f32[][]
784            exclude: [f32aa, nul]
785          - values:
786            - R
787            exclude: [nul]
788          - values:
789            - panda.String
790            exclude: [str, nul]
791          - values:
792            - panda.Class
793            exclude: [typ, nul]
794          - values:
795            - panda.Object
796            exclude: [u32a, u64a, f32a, u32aa, u64aa, f32aa, str, typ, ra, stra, typa, obja, raa, straa, typaa, objaa, nul]
797          - values:
798            - R[]
799            exclude: [ra, nul]
800          - values:
801            - panda.String[]
802            exclude: [stra, nul]
803          - values:
804            - panda.Class[]
805            exclude: [typa, nul]
806          - values:
807            - panda.Object[]
808            exclude: [obja, u32aa, u64aa, f32aa, ra, stra, typa, raa, straa, typaa, objaa, nul]
809          - values:
810            - R[][]
811            exclude: [raa, nul]
812          - values:
813            - panda.String[][]
814            exclude: [straa, nul]
815          - values:
816            - panda.Class[][]
817            exclude: [typaa, nul]
818          - values:
819            - panda.Object[][]
820            exclude: [objaa, raa, straa, typaa, nul]
821        cases:
822          - values:
823            - movi v1, 1
824            id: i32
825          - values:
826            - movi.64 v1, 1
827            id: i64
828          - values:
829            - fmovi.64 v1, 1.0
830            id: f64
831          - values:
832            - |
833              #
834                  movi v1, 10
835                  newarr v1, v1, u32[]
836            id: u32a
837          - values:
838            - |
839              #
840                  movi v1, 10
841                  newarr v1, v1, u64[]
842            id: u64a
843          - values:
844            - |
845              #
846                  movi v1, 10
847                  newarr v1, v1, f32[]
848            id: f32a
849          - values:
850            - |
851              #
852                  movi v1, 10
853                  newarr v1, v1, u32[][]
854            id: u32aa
855          - values:
856            - |
857              #
858                  movi v1, 10
859                  newarr v1, v1, u64[][]
860            id: u64aa
861          - values:
862            - |
863              #
864                  movi v1, 10
865                  newarr v1, v1, f32[][]
866            id: f32aa
867          - values:
868            - |
869              #
870                  lda.str "test message"
871                  sta.obj v1
872            id: str
873          - values:
874            - |
875              #
876                  lda.type R
877                  sta.obj v1
878            id: typ
879          - values:
880            - |
881              #
882                  movi v1, 10
883                  newarr v1, v1, R[]
884            id: ra
885          - values:
886            - |
887              #
888                  movi v1, 10
889                  newarr v1, v1, panda.String[]
890            id: stra
891          - values:
892            - |
893              #
894                  movi v1, 10
895                  newarr v1, v1, panda.Class[]
896            id: typa
897          - values:
898            - |
899              #
900                  movi v1, 10
901                  newarr v1, v1, panda.Object[]
902            id: obja
903          - values:
904            - |
905              #
906                  movi v1, 10
907                  newarr v1, v1, R[][]
908            id: raa
909          - values:
910            - |
911              #
912                  movi v1, 10
913                  newarr v1, v1, panda.String[][]
914            id: straa
915          - values:
916            - |
917              #
918                  movi v1, 10
919                  newarr v1, v1, panda.Class[][]
920            id: typaa
921          - values:
922            - |
923              #
924                  movi v1, 10
925                  newarr v1, v1, panda.Object[][]
926            id: objaa
927          - values:
928            - mov.null v1
929            id: nul
930
931
932      - file-name: "incompatible_args_j"
933        isa:
934          verification:
935            - compatible_arguments
936        runner-options: [verifier-failure, use-pa, verifier-config]
937        tags: [verifier, pa-verifier]
938        description: Check 'initobj.short' instruction with initializer called with incompatible arguments in PandaAssembly context.
939        header-template: [PandaAssembly]
940        bugid: ["5271"]
941        code-template: |
942          .record panda.Object <external>
943          .record panda.Class <external>
944          .record R {}
945          .function void R.constructor(R a0, %s a1) <ctor> {
946              return.void
947          }
948
949          .function i32 main() {
950              *s
951              initobj.short R.constructor, v1
952        check-type: exit-positive
953        template-cases:
954          - values:
955            - u1
956            exclude: [i32]
957          - values:
958            - i8
959            exclude: [i32]
960          - values:
961            - u16
962            exclude: [i32]
963          - values:
964            - i16
965            exclude: [i32]
966          - values:
967            - i32
968            exclude: [i32]
969          - values:
970            - i64
971            exclude: [i64]
972          - values:
973            - f32
974            exclude: [f64]
975          - values:
976            - f64
977            exclude: [f64]
978          - values:
979            - u1[]
980            exclude: [u1a, nul]
981          - values:
982            - i8[]
983            exclude: [i8a, nul]
984          - values:
985            - u16[]
986            exclude: [u1a, u16a, nul]
987          - values:
988            - i16[]
989            exclude: [i8a, i16a, nul]
990          - values:
991            - i32[]
992            exclude: [i8a, i16a, i32a, nul]
993          - values:
994            - i64[]
995            exclude: [i64a, nul]
996          - values:
997            - f32[]
998            exclude: [f32a, nul]
999          - values:
1000            - f64[]
1001            exclude: [f32a, f64a, nul]
1002          - values:
1003            - i32[][]
1004            exclude: [i32aa, nul]
1005          - values:
1006            - f64[][]
1007            exclude: [f64aa, nul]
1008          - values:
1009            - R
1010            exclude: [nul]
1011          - values:
1012            - panda.Class
1013            exclude: [typ, nul]
1014          - values:
1015            - panda.Object
1016            exclude: [u1a, i8a, u16a, i16a, i32a, i64a, f32a, f64a, i32aa, f64aa, typ, ra, typa, obja, raa, typaa, objaa, nul]
1017          - values:
1018            - R[]
1019            exclude: [ra, nul]
1020          - values:
1021            - panda.Class[]
1022            exclude: [typa, nul]
1023          - values:
1024            - panda.Object[]
1025            exclude: [obja, i32aa, f64aa, ra, typa, raa, typaa, objaa, nul]
1026          - values:
1027            - R[][]
1028            exclude: [raa, nul]
1029          - values:
1030            - panda.Class[][]
1031            exclude: [typaa, nul]
1032          - values:
1033            - panda.Object[][]
1034            exclude: [objaa, raa, typaa, nul]
1035        cases:
1036          - values:
1037            - movi v1, 1
1038            id: i32
1039          - values:
1040            - movi.64 v1, 1
1041            id: i64
1042          - values:
1043            - fmovi.64 v1, 1.0
1044            id: f64
1045          - values:
1046            - |
1047              #
1048                  movi v1, 10
1049                  newarr v1, v1, u1[]
1050            id: u1a
1051          - values:
1052            - |
1053              #
1054                  movi v1, 10
1055                  newarr v1, v1, i8[]
1056            id: i8a
1057          - values:
1058            - |
1059              #
1060                  movi v1, 10
1061                  newarr v1, v1, u16[]
1062            id: u16a
1063          - values:
1064            - |
1065              #
1066                  movi v1, 10
1067                  newarr v1, v1, i16[]
1068            id: i16a
1069          - values:
1070            - |
1071              #
1072                  movi v1, 10
1073                  newarr v1, v1, i32[]
1074            id: i32a
1075          - values:
1076            - |
1077              #
1078                  movi v1, 10
1079                  newarr v1, v1, i64[]
1080            id: i64a
1081          - values:
1082            - |
1083              #
1084                  movi v1, 10
1085                  newarr v1, v1, f32[]
1086            id: f32a
1087          - values:
1088            - |
1089              #
1090                  movi v1, 10
1091                  newarr v1, v1, f64[]
1092            id: f64a
1093          - values:
1094            - |
1095              #
1096                  movi v1, 10
1097                  newarr v1, v1, i32[][]
1098            id: i32aa
1099          - values:
1100            - |
1101              #
1102                  movi v1, 10
1103                  newarr v1, v1, f64[][]
1104            id: f64aa
1105          - values:
1106            - |
1107              #
1108                  lda.type R
1109                  sta.obj v1
1110            id: typ
1111          - values:
1112            - |
1113              #
1114                  movi v1, 10
1115                  newarr v1, v1, R[]
1116            id: ra
1117          - values:
1118            - |
1119              #
1120                  movi v1, 10
1121                  newarr v1, v1, panda.Class[]
1122            id: typa
1123          - values:
1124            - |
1125              #
1126                  movi v1, 10
1127                  newarr v1, v1, panda.Object[]
1128            id: obja
1129          - values:
1130            - |
1131              #
1132                  movi v1, 10
1133                  newarr v1, v1, R[][]
1134            id: raa
1135          - values:
1136            - |
1137              #
1138                  movi v1, 10
1139                  newarr v1, v1, panda.Class[][]
1140            id: typaa
1141          - values:
1142            - |
1143              #
1144                  movi v1, 10
1145                  newarr v1, v1, panda.Object[][]
1146            id: objaa
1147          - values:
1148            - mov.null v1
1149            id: nul
1150
1151
1152      - file-name: "compatible_primitive_args_p"
1153        isa:
1154          verification:
1155            - compatible_arguments
1156        runner-options: ['verifier-only', 'verifier-config']
1157        tags: [verifier]
1158        description: Check 'initobj.short' instruction with initializer called with compatible primitive arguments in PandaAssembly context.
1159        header-template: []
1160        code-template: |
1161          .record R {}
1162          .function void R.constructor(R a0, %s a1) <ctor> {
1163              return.void
1164          }
1165          .function i32 main() {
1166              %s
1167              initobj.short R.constructor, v1
1168        check-type: exit-positive
1169        cases:
1170          - values:
1171            - u1
1172            - movi v1, 1
1173          - values:
1174            - u8
1175            - movi v1, 1
1176          - values:
1177            - i8
1178            - movi v1, 1
1179          - values:
1180            - u16
1181            - movi v1, 1
1182          - values:
1183            - i16
1184            - movi v1, 1
1185          - values:
1186            - u32
1187            - movi v1, 1
1188          - values:
1189            - i32
1190            - movi v1, 1
1191          - values:
1192            - i64
1193            - movi.64 v1, 1
1194          - values:
1195            - u64
1196            - movi.64 v1, 1
1197          - values:
1198            - f32
1199            - fmovi v1, 1.1
1200          - values:
1201            - f64
1202            - fmovi.64 v1, 1.1
1203
1204
1205      - file-name: "compatible_primitive_args_j"
1206        isa:
1207          verification:
1208            - compatible_arguments
1209        runner-options: [verifier-only, use-pa, verifier-config]
1210        tags: [verifier, pa-verifier]
1211        description: Check 'initobj.short' instruction with initializer called with compatible primitive arguments in PandaAssembly context.
1212        header-template: [PandaAssembly]
1213        code-template: |
1214          .record R {}
1215          .function void R.constructor(R a0, %s a1) <ctor> {
1216              return.void
1217          }
1218          .function i32 main() {
1219              %s
1220              initobj.short R.constructor, v1
1221        check-type: exit-positive
1222        cases:
1223          - values:
1224            - u1
1225            - movi v1, 1
1226          - values:
1227            - i8
1228            - movi v1, 1
1229          - values:
1230            - u16
1231            - movi v1, 1
1232          - values:
1233            - i16
1234            - movi v1, 1
1235          - values:
1236            - i32
1237            - movi v1, 1
1238          - values:
1239            - i64
1240            - movi.64 v1, 1
1241          - values:
1242            - f32
1243            - fmovi v1, 1.1
1244          - values:
1245            - f64
1246            - fmovi.64 v1, 1.1
1247
1248
1249      - file-name: "compatible_prim_array_args_p"
1250        isa:
1251          verification:
1252            - compatible_arguments
1253        runner-options: ['verifier-only', 'verifier-config']
1254        tags: [verifier]
1255        description: Check 'initobj.short' instruction with initializer called with compatible primitive array arguments in PandaAssembly context.
1256        header-template: []
1257        code-template: |
1258          .record R {}
1259          .function void R.constructor(R a0, %s a1) <ctor> {
1260              return.void
1261          }
1262          .function i32 main() {
1263              movi v0, 10
1264              newarr v1, v0, %s
1265              initobj.short R.constructor, v1
1266        check-type: exit-positive
1267        cases:
1268          - values:
1269            - "u1[]"
1270            - "u1[]"
1271          - values:
1272            - "u8[]"
1273            - "u8[]"
1274          - values:
1275            - "i8[]"
1276            - "i8[]"
1277          - values:
1278            - "u16[]"
1279            - "u16[]"
1280          - values:
1281            - "i16[]"
1282            - "i16[]"
1283          - values:
1284            - "u32[]"
1285            - "u32[]"
1286          - values:
1287            - "i32[]"
1288            - "i32[]"
1289          - values:
1290            - "u64[]"
1291            - "u64[]"
1292          - values:
1293            - "i64[]"
1294            - "i64[]"
1295          - values:
1296            - "f32[]"
1297            - "f32[]"
1298          - values:
1299            - "f64[]"
1300            - "f64[]"
1301          - values:
1302            - "u1[][]"
1303            - "u1[][]"
1304          - values:
1305            - "u8[][]"
1306            - "u8[][]"
1307          - values:
1308            - "i8[][]"
1309            - "i8[][]"
1310          - values:
1311            - "u16[][]"
1312            - "u16[][]"
1313          - values:
1314            - "i16[][]"
1315            - "i16[][]"
1316          - values:
1317            - "u32[][]"
1318            - "u32[][]"
1319          - values:
1320            - "i32[][]"
1321            - "i32[][]"
1322          - values:
1323            - "u64[][]"
1324            - "u64[][]"
1325          - values:
1326            - "i64[][]"
1327            - "i64[][]"
1328          - values:
1329            - "f32[][]"
1330            - "f32[][]"
1331          - values:
1332            - "f64[][]"
1333            - "f64[][]"
1334
1335
1336      - file-name: "compatible_prim_array_args_j"
1337        isa:
1338          verification:
1339            - compatible_arguments
1340        runner-options: [verifier-only, use-pa, verifier-config]
1341        tags: [verifier, pa-verifier]
1342        description: Check 'initobj.short' instruction with initializer called with compatible primitive array arguments in PandaAssembly context.
1343        header-template: [PandaAssembly]
1344        code-template: |
1345          .record R {}
1346          .function void R.constructor(R a0, %s a1) <ctor> {
1347              return.void
1348          }
1349          .function i32 main() {
1350              movi v0, 10
1351              newarr v1, v0, %s
1352              initobj.short R.constructor, v1
1353        check-type: exit-positive
1354        cases:
1355          - values:
1356            - "u1[]"
1357            - "u1[]"
1358          - values:
1359            - "i8[]"
1360            - "i8[]"
1361          - values:
1362            - "u16[]"
1363            - "u16[]"
1364          - values:
1365            - "i16[]"
1366            - "i16[]"
1367          - values:
1368            - "i32[]"
1369            - "i32[]"
1370          - values:
1371            - "i64[]"
1372            - "i64[]"
1373          - values:
1374            - "f32[]"
1375            - "f32[]"
1376          - values:
1377            - "f64[]"
1378            - "f64[]"
1379          - values:
1380            - "u1[][]"
1381            - "u1[][]"
1382          - values:
1383            - "i8[][]"
1384            - "i8[][]"
1385          - values:
1386            - "u16[][]"
1387            - "u16[][]"
1388          - values:
1389            - "i16[][]"
1390            - "i16[][]"
1391          - values:
1392            - "i32[][]"
1393            - "i32[][]"
1394          - values:
1395            - "i64[][]"
1396            - "i64[][]"
1397          - values:
1398            - "f32[][]"
1399            - "f32[][]"
1400          - values:
1401            - "f64[][]"
1402            - "f64[][]"
1403
1404
1405      - file-name: "compatible_obj_args_p"
1406        isa:
1407          verification:
1408            - compatible_arguments
1409        runner-options: ['verifier-only', 'verifier-config']
1410        tags: [verifier]
1411        description: Check 'initobj.short' instruction with initializer called with compatible object arguments in PandaAssembly context.
1412        header-template: []
1413        code-template: |
1414          .record panda.Object <external>
1415          .record panda.Class <external>
1416          .record panda.String <external>
1417          .record Q {}
1418          .function void Q.ctor(Q a0) <ctor> {
1419              return.void
1420          }
1421          .record R {}
1422          .function void R.constructor(R a0, %s a1) <ctor> {
1423              return.void
1424          }
1425          .function i32 main() {
1426              %s
1427              initobj.short R.constructor, v1
1428        check-type: exit-positive
1429        cases:
1430          # Object of type O is instance of type T if O is the same as T ...
1431          - values:
1432            - Q
1433            - |
1434              #
1435                  initobj.short Q.ctor
1436                  sta.obj v1
1437          - values:
1438            - panda.String
1439            - |
1440              #
1441                  lda.str "test"
1442                  sta.obj v1
1443          - values:
1444            - panda.Class
1445            - |
1446              #
1447                  lda.type Q
1448                  sta.obj v1
1449          # ... or is subtype of T
1450          - values:
1451            - panda.Object
1452            - |
1453              #
1454                  initobj.short Q.ctor
1455                  sta.obj v1
1456          - values:
1457            - panda.Object
1458            - |
1459              #
1460                  lda.str "test"
1461                  sta.obj v1
1462          - values:
1463            - panda.Object
1464            - |
1465              #
1466                  lda.type Q
1467                  sta.obj v1
1468            id: cls
1469            bugid: ["3594"]
1470            ignore: true
1471          # For arrays T should be a root type in type hierarchy ...
1472          - values:
1473            - panda.Object
1474            - |
1475              #
1476                  movi v0, 10
1477                  newarr v1, v0, i32[]
1478          - values:
1479            - panda.Object
1480            - |
1481              #
1482                  movi v0, 10
1483                  newarr v1, v0, f64[][]
1484          - values:
1485            - panda.Object
1486            - |
1487              #
1488                  movi v0, 10
1489                  newarr v1, v0, Q[]
1490          - values:
1491            - panda.Object
1492            - |
1493              #
1494                  movi v0, 10
1495                  newarr v1, v0, panda.Object[]
1496          - values:
1497            - panda.Object
1498            - |
1499              #
1500                  movi v0, 10
1501                  newarr v1, v0, panda.String[]
1502          - values:
1503            - panda.Object
1504            - |
1505              #
1506                  movi v0, 10
1507                  newarr v1, v0, panda.Class[]
1508
1509
1510      - file-name: "compatible_obj_args_j"
1511        isa:
1512          verification:
1513            - compatible_arguments
1514        runner-options: [verifier-only, use-pa, verifier-config]
1515        tags: [verifier, pa-verifier]
1516        description: Check 'initobj.short' instruction with initializer called with compatible object arguments in PandaAssembly context.
1517        header-template: [PandaAssembly]
1518        code-template: |
1519          .record panda.Object <external>
1520          .record panda.Class <external>
1521          .record panda.String <external>
1522          .record panda.io.Serializable <external>
1523          .record I <panda.interface> {}
1524          .record E {}
1525          .record Q <panda.extends=E, panda.implements=I> {}
1526          .function void Q.ctor(Q a0) <ctor> {
1527              return.void
1528          }
1529          .record R {}
1530          .function void R.constructor(R a0, %s a1) <ctor> {
1531              return.void
1532          }
1533          .function i32 main() {
1534              %s
1535              initobj.short R.constructor, v1
1536        check-type: exit-positive
1537        cases:
1538          # Object of type O is instance of type T if O is the same as T ...
1539          - values:
1540            - Q
1541            - |
1542              #
1543                  initobj.short Q.ctor
1544                  sta.obj v1
1545          - values:
1546            - panda.String
1547            - |
1548              #
1549                  lda.str "test"
1550                  sta.obj v1
1551          - values:
1552            - panda.Class
1553            - |
1554              #
1555                  lda.type Q
1556                  sta.obj v1
1557          # ... or is subtype of T
1558          - values:
1559            - E
1560            - |
1561              #
1562                  initobj.short Q.ctor
1563                  sta.obj v1
1564          - values:
1565            - I
1566            - |
1567              #
1568                  initobj.short Q.ctor
1569                  sta.obj v1
1570          - values:
1571            - panda.Object
1572            - |
1573              #
1574                  initobj.short Q.ctor
1575                  sta.obj v1
1576          - values:
1577            - panda.Object
1578            - |
1579              #
1580                  lda.str "test"
1581                  sta.obj v1
1582          - values:
1583            - panda.io.Serializable
1584            - |
1585              #
1586                  lda.type panda.String
1587                  sta.obj v1
1588            ignore: true
1589            bugid: ['1806']
1590          - values:
1591            - panda.Object
1592            - |
1593              #
1594                  lda.type Q
1595                  sta.obj v1
1596            bugid: ['3594']
1597            ignore: true
1598          # For arrays T should be a root type in type hierarchy ...
1599          - values:
1600            - panda.Object
1601            - |
1602              #
1603                  movi v0, 10
1604                  newarr v1, v0, i32[]
1605          - values:
1606            - panda.Object
1607            - |
1608              #
1609                  movi v0, 10
1610                  newarr v1, v0, f64[][]
1611          - values:
1612            - panda.Object
1613            - |
1614              #
1615                  movi v0, 10
1616                  newarr v1, v0, Q[]
1617          - values:
1618            - panda.Object
1619            - |
1620              #
1621                  movi v0, 10
1622                  newarr v1, v0, panda.Object[]
1623          - values:
1624            - panda.Object
1625            - |
1626              #
1627                  movi v0, 10
1628                  newarr v1, v0, panda.String[]
1629          - values:
1630            - panda.Object
1631            - |
1632              #
1633                  movi v0, 10
1634                  newarr v1, v0, panda.Class[]
1635
1636
1637      - file-name: "compatible_obj_array_args_p"
1638        isa:
1639          verification:
1640            - compatible_arguments
1641        runner-options: ['verifier-only', 'verifier-config']
1642        tags: [verifier]
1643        description: Check 'initobj.short' instruction with initializer called with compatible object array arguments in PandaAssembly context.
1644        header-template: []
1645        code-template: |
1646          .record panda.Object <external>
1647          .record panda.Class <external>
1648          .record panda.String <external>
1649          .record Q {}
1650          .record R {}
1651          .function void R.constructor(R a0, %s a1) <ctor> {
1652              return.void
1653          }
1654          .function i32 main() {
1655              movi v0, 10
1656              newarr v1, v0, %s
1657              initobj.short R.constructor, v1
1658        check-type: exit-positive
1659        cases:
1660          # T is such array that O array elements are the same as T array elements
1661          - values:
1662            - Q[]
1663            - Q[]
1664          - values:
1665            - Q[][]
1666            - Q[][]
1667          - values:
1668            - "panda.Object[]"
1669            - "panda.Object[]"
1670          - values:
1671            - "panda.Object[][]"
1672            - "panda.Object[][]"
1673          - values:
1674            - panda.String[]
1675            - panda.String[]
1676          - values:
1677            - panda.String[][]
1678            - panda.String[][]
1679          - values:
1680            - panda.Class[]
1681            - panda.Class[]
1682          - values:
1683            - panda.Class[][]
1684            - panda.Class[][]
1685          # T is such array that O array elements are subtypes of T array elements
1686          - values:
1687            - "panda.Object[]"
1688            - "panda.Object[][]"
1689            bugid: ["3608"]
1690          - values:
1691            - "panda.Object[]"
1692            - Q[]
1693            bugid: ["3608"]
1694          - values:
1695            - "panda.Object[]"
1696            - Q[][]
1697            bugid: ["3608"]
1698          - values:
1699            - "panda.Object[]"
1700            - panda.Class[]
1701            bugid: ["3608"]
1702          - values:
1703            - "panda.Object[]"
1704            - panda.Class[][]
1705            bugid: ["3608"]
1706          - values:
1707            - "panda.Object[]"
1708            - panda.String[]
1709            bugid: ["3608"]
1710          - values:
1711            - "panda.Object[]"
1712            - panda.String[][]
1713            bugid: ["3608"]
1714          - values:
1715            - "panda.Object[]"
1716            - i32[][]
1717            bugid: ["3608"]
1718          - values:
1719            - "panda.Object[]"
1720            - f64[][][]
1721            bugid: ["3608"]
1722          # inherited types from panda.Object[][]
1723          - values:
1724            - "panda.Object[][]"
1725            - panda.Object[][][]
1726            bugid: ["3608"]
1727          - values:
1728            - "panda.Object[][]"
1729            - panda.Class[][]
1730            bugid: ["3608"]
1731          - values:
1732            - "panda.Object[][]"
1733            - panda.Class[][][]
1734            bugid: ["3608"]
1735          - values:
1736            - "panda.Object[][]"
1737            - i32[][][]
1738            bugid: ["3608"]
1739          - values:
1740            - "panda.Object[][]"
1741            - f64[][][][]
1742            bugid: ["3608"]
1743
1744
1745      - file-name: "compatible_obj_array_args_j"
1746        isa:
1747          verification:
1748            - compatible_arguments
1749        runner-options: [verifier-only, use-pa, verifier-config]
1750        tags: [verifier, pa-verifier]
1751        description: Check 'initobj.short' instruction with initializer called with compatible object array arguments in PandaAssembly context.
1752        header-template: [PandaAssembly]
1753        code-template: |
1754          .record panda.Object <external>
1755          .record panda.Class <external>
1756          .record panda.String <external>
1757          .record I <panda.interface> {}
1758          .record E {}
1759          .record Q <panda.extends=E, panda.implements=I> {}
1760          .record R {}
1761          .function void R.constructor(R a0, %s a1) <ctor> {
1762              return.void
1763          }
1764          .function i32 main() {
1765              movi v0, 10
1766              newarr v1, v0, %s
1767              initobj.short R.constructor, v1
1768        check-type: exit-positive
1769        cases:
1770          # T is such array that O array elements are the same as T array elements
1771          - values:
1772            - Q[]
1773            - Q[]
1774          - values:
1775            - Q[][]
1776            - Q[][]
1777          - values:
1778            - "panda.Object[]"
1779            - "panda.Object[]"
1780          - values:
1781            - "panda.Object[][]"
1782            - "panda.Object[][]"
1783          - values:
1784            - panda.String[]
1785            - panda.String[]
1786          - values:
1787            - panda.String[][]
1788            - panda.String[][]
1789          - values:
1790            - panda.Class[]
1791            - panda.Class[]
1792          - values:
1793            - panda.Class[][]
1794            - panda.Class[][]
1795          # T is such array that O array elements are subtypes of T array elements
1796          - values:
1797            - E[]
1798            - Q[]
1799          - values:
1800            - I[]
1801            - Q[]
1802          - values:
1803            - "panda.Object[]"
1804            - "panda.Object[][]"
1805            bugid: ["3608"]
1806          - values:
1807            - "panda.Object[]"
1808            - Q[]
1809            bugid: ["3608"]
1810          - values:
1811            - "panda.Object[]"
1812            - Q[][]
1813            bugid: ["3608"]
1814          - values:
1815            - "panda.Object[]"
1816            - panda.Class[]
1817            bugid: ["3608"]
1818          - values:
1819            - "panda.Object[]"
1820            - panda.Class[][]
1821            bugid: ["3608"]
1822          - values:
1823            - "panda.Object[]"
1824            - panda.String[]
1825            bugid: ["3608"]
1826          - values:
1827            - "panda.Object[]"
1828            - panda.String[][]
1829            bugid: ["3608"]
1830          - values:
1831            - "panda.Object[]"
1832            - i32[][]
1833            bugid: ["3608"]
1834          - values:
1835            - "panda.Object[]"
1836            - f64[][][]
1837            bugid: ["3608"]
1838          # inherited types from object[][]
1839          - values:
1840            - E[][]
1841            - Q[][]
1842          - values:
1843            - I[][]
1844            - Q[][]
1845          - values:
1846            - "panda.Object[][]"
1847            - panda.Object[][][]
1848            bugid: ["3608"]
1849          - values:
1850            - "panda.Object[][]"
1851            - panda.Class[][]
1852            bugid: ["3608"]
1853          - values:
1854            - "panda.Object[][]"
1855            - panda.Class[][][]
1856            bugid: ["3608"]
1857          - values:
1858            - "panda.Object[][]"
1859            - i32[][][]
1860            bugid: ["3608"]
1861          - values:
1862            - "panda.Object[][]"
1863            - f64[][][][]
1864            bugid: ["3608"]
1865
1866
1867      - file-name: "compatible_obj_null_args_p"
1868        isa:
1869          verification:
1870            - compatible_arguments
1871        runner-options: ['verifier-only', 'verifier-config']
1872        tags: [verifier]
1873        description: Check 'initobj.short' instruction with initializer called with null object ref in PandaAssembly context.
1874        header-template: []
1875        code-template: |
1876          .record panda.Object <external>
1877          .record panda.Class <external>
1878          .record panda.String <external>
1879          .record Q {}
1880          .record R {}
1881          .function void R.constructor(R a0, %s a1) <ctor> {
1882              return.void
1883          }
1884          .function i32 main() {
1885              mov.null v1
1886              initobj.short R.constructor, v1
1887        check-type: exit-positive
1888        cases:
1889          - values: ["i32[]"]
1890          - values: ["f64[][]"]
1891          - values: ["panda.Object"]
1892          - values: ["panda.Object[]"]
1893          - values: ["panda.Object[][]"]
1894          - values: ["Q"]
1895          - values: ["Q[][]"]
1896          - values: ["panda.String"]
1897          - values: ["panda.String[]"]
1898          - values: ["panda.Class"]
1899          - values: ["panda.Class[]"]
1900
1901
1902      - file-name: "compatible_obj_null_args_j"
1903        isa:
1904          verification:
1905            - compatible_arguments
1906        runner-options: [verifier-only, use-pa, verifier-config]
1907        tags: [verifier, pa-verifier]
1908        description: Check 'initobj.short' instruction with initializer called with null object ref in PandaAssembly context.
1909        header-template: [PandaAssembly]
1910        code-template: |
1911          .record panda.Object <external>
1912          .record panda.Class <external>
1913          .record panda.String <external>
1914          .record Q {}
1915          .record R {}
1916          .function void R.constructor(R a0, %s a1) <ctor> {
1917              return.void
1918          }
1919          .function i32 main() {
1920              mov.null v1
1921              initobj.short R.constructor, v1
1922        check-type: exit-positive
1923        cases:
1924          - values: ["i32[]"]
1925          - values: ["f64[][]"]
1926          - values: ["panda.Object"]
1927          - values: ["panda.Object[]"]
1928          - values: ["panda.Object[][]"]
1929          - values: ["Q"]
1930          - values: ["Q[][]"]
1931          - values: ["panda.String"]
1932          - values: ["panda.String[]"]
1933          - values: ["panda.Class"]
1934          - values: ["panda.Class[]"]
1935
1936
1937      - file-name: "valid_instance_p"
1938        isa:
1939          description: |
1940            Resolve class type from initializer method_id, allocate memory for an object, initialize its fields with their
1941            default values (i.e. 0 for primitives and null for objects), call specified initializer and put a reference to
1942            the newly created object into accumulator. method_id should resolve to an initializer.
1943        description: Check 'initobj.short' with valid method id creates expected instance type in PandaAssembly context.
1944        tags: ['irtoc_ignore']
1945        header-template: []
1946        code-template: |
1947          .record panda.Object <external>
1948          .record panda.String <external>
1949          .record R {}
1950          .function void R.ctor0(R a0) <ctor> {
1951              return.void
1952          }
1953          .function R R.ctor0x(R a0) <ctor> {
1954              lda.null
1955              return.obj
1956          }
1957          .function void R.ctor1(R a0, i32 a1) <ctor> {
1958              return.void
1959          }
1960          .function R[] R.ctor1x(R a0, i32 a1) <ctor> {
1961              movi v0, 10
1962              newarr v0, v0, R[]
1963              lda.obj v0
1964              return.obj
1965          }
1966          .function void R.ctor2(R a0, R a1, i16 a2) <ctor> {
1967              return.void
1968          }
1969          .function R R.ctor2x(R a0, R a1, i16 a2) <ctor> {
1970              lda.null
1971              return.obj
1972          }
1973          .record panda.NullPointerException <external>
1974          .function void panda.NullPointerException.ctor(panda.NullPointerException a0, panda.String a1, panda.Object a2) <external, ctor>
1975
1976          .function i32 main() {
1977          # sample data to put in arguments: v1 - v5
1978              movi v1, 1
1979              movi.64 v2, 64
1980              fmovi.64 v3, 3.14
1981              mov.null v4
1982              lda.str "message"
1983              sta.obj v5
1984          # create the object
1985              initobj.short %s
1986              jnez.obj chk1
1987              ldai 1
1988              return
1989          chk1:
1990              sta.obj v0
1991              isinstance %s
1992              jeq v1, chk2
1993              ldai 2
1994              return
1995          chk2:
1996              lda.obj v0
1997              isinstance panda.Object
1998              jeq v1, ok
1999              ldai 3
2000              return
2001          ok:
2002        check-type: exit-positive
2003        cases:
2004          - values:
2005            - R.ctor0
2006            - R
2007          - values:
2008            - R.ctor0x
2009            - R
2010          - values:
2011            - R.ctor1, v1
2012            - R
2013          - values:
2014            - R.ctor1x, v1
2015            - R
2016          - values:
2017            - R.ctor2, v4, v1
2018            - R
2019          - values:
2020            - R.ctor2x, v4, v1
2021            - R
2022            tags: ['tsan']
2023          - values:
2024            - panda.NullPointerException.ctor, v5, v4
2025            - panda.NullPointerException
2026            tags: ['tsan']
2027
2028
2029      - file-name: "valid_instance_j"
2030        isa:
2031          description: |
2032            Resolve class type from initializer method_id, allocate memory for an object, initialize its fields with their
2033            default values (i.e. 0 for primitives and null for objects), call specified initializer and put a reference to
2034            the newly created object into accumulator. method_id should resolve to an initializer.
2035        description: Check 'initobj.short' with valid method id creates expected instance type in PandaAssembly context.
2036        tags: ['irtoc_ignore']
2037        header-template: [PandaAssembly]
2038        runner-options: [use-pa]
2039        code-template: |
2040          .record panda.Object <external>
2041          .record panda.String <external>
2042          .record R {}
2043          .function void R.ctor0(R a0) <ctor> {
2044              return.void
2045          }
2046          .function R R.ctor0x(R a0) <ctor> {
2047              lda.null
2048              return.obj
2049          }
2050          .function void R.ctor1(R a0, i32 a1) <ctor> {
2051              return.void
2052          }
2053          .function R R.ctor1x(R a0, i32 a1) <ctor> {
2054              lda.null
2055              return.obj
2056          }
2057          .function void R.ctor2(R a0, R a1, i16 a2) <ctor> {
2058              return.void
2059          }
2060          .function panda.Object R.ctor2x(R a0, R a1, i16 a2) <ctor> {
2061              lda.null
2062              return.obj
2063          }
2064          .record panda.NullPointerException <external>
2065          .function void panda.NullPointerException.ctor(panda.NullPointerException a0, panda.String a1) <external, ctor>
2066
2067          .function i32 main() {
2068          # sample data to put in arguments: v1 - v5
2069              movi v1, 1
2070              movi.64 v2, 64
2071              fmovi.64 v3, 3.14
2072              mov.null v4
2073              lda.str "message"
2074              sta.obj v5
2075          # create the object
2076              initobj.short %s
2077              jnez.obj chk1
2078              ldai 1
2079              return
2080          chk1:
2081              sta.obj v0
2082              isinstance %s
2083              jeq v1, chk2
2084              ldai 2
2085              return
2086          chk2:
2087              lda.obj v0
2088              isinstance panda.Object
2089              jeq v1, ok
2090              ldai 3
2091              return
2092          ok:
2093        check-type: exit-positive
2094        cases:
2095          - values:
2096            - R.ctor0
2097            - R
2098          - values:
2099            - R.ctor0x
2100            - R
2101          - values:
2102            - R.ctor1, v1
2103            - R
2104            tags: ['tsan']
2105          - values:
2106            - R.ctor1x, v1
2107            - R
2108          - values:
2109            - R.ctor2, v4, v1
2110            - R
2111            tags: ['tsan']
2112          - values:
2113            - R.ctor2x, v4, v1
2114            - R
2115          - values:
2116            - panda.NullPointerException.ctor, v5
2117            - panda.NullPointerException
2118
2119
2120      - file-name: "check_args_num_p"
2121        isa:
2122          instructions:
2123            - sig: initobj.short method_id, v1:in:none, v2:in:none
2124              acc: out:ref
2125              format: [op_v1_4_v2_4_id_16]
2126        description: Check 'initobj.short' constructor behavior with various number of arguments in PandaAssembly context.
2127        header-template: []
2128        code-template: |
2129          .record R {
2130              i32      f1
2131              i32      f2
2132          }
2133          .function void R.ctor0(R a0) <ctor> {
2134              return.void
2135          }
2136          .function void R.ctor1(R a0, i32 a1) <ctor> {
2137              lda a1
2138              stobj a0, R.f1
2139              return.void
2140          }
2141          .function void R.ctor2(R a0, i32 a1, i32 a2) <ctor> {
2142              lda a1
2143              stobj a0, R.f1
2144              lda a2
2145              stobj a0, R.f2
2146              return.void
2147          }
2148          .function i32 main() {
2149          # sample data to put in args
2150              movi v1, 10
2151              movi v2, 20
2152          # create the object
2153              %s
2154              sta.obj v0
2155          lab1:
2156              ldobj v0, R.f1
2157              movi v7, %s
2158              jeq v7, lab2
2159              ldai 1
2160              return
2161          lab2:
2162              ldobj v0, R.f2
2163              movi v7, %s
2164              jeq v7, ok
2165              ldai 2
2166              return
2167          ok:
2168        check-type: exit-positive
2169        cases:
2170          - values: ["initobj.short R.ctor0", 0, 0]
2171          - values: ["initobj.short R.ctor1, v2", 20, 0]
2172            tags: ['tsan']
2173          - values: ["initobj.short R.ctor2, v2, v1", 20, 10]
2174
2175
2176      - file-name: "check_args_num_j"
2177        isa:
2178          instructions:
2179            - sig: initobj.short method_id, v1:in:none, v2:in:none
2180              acc: out:ref
2181              format: [op_v1_4_v2_4_id_16]
2182        description: Check 'initobj.short' constructor behavior with various number of arguments in PandaAssembly context.
2183        runner-options: [use-pa]
2184        header-template: [PandaAssembly]
2185        code-template: |
2186          .record R {
2187              i32      f1
2188              i32      f2
2189          }
2190          .function void R.ctor0(R a0) <ctor> {
2191              return.void
2192          }
2193          .function void R.ctor1(R a0, i32 a1) <ctor> {
2194              lda a1
2195              stobj a0, R.f1
2196              return.void
2197          }
2198          .function void R.ctor2(R a0, i32 a1, i32 a2) <ctor> {
2199              lda a1
2200              stobj a0, R.f1
2201              lda a2
2202              stobj a0, R.f2
2203              return.void
2204          }
2205          .function i32 main() {
2206          # sample data to put in args
2207              movi v3, 30
2208              movi v4, 40
2209          # create the object
2210              %s
2211              sta.obj v0
2212          lab1:
2213              ldobj v0, R.f1
2214              movi v7, %s
2215              jeq v7, lab2
2216              ldai 1
2217              return
2218          lab2:
2219              ldobj v0, R.f2
2220              movi v7, %s
2221              jeq v7, ok
2222              ldai 2
2223              return
2224          ok:
2225        check-type: exit-positive
2226        cases:
2227          - values: ["initobj.short R.ctor0", 0, 0]
2228          - values: ["initobj.short R.ctor1, v4", 40, 0]
2229          - values: ["initobj.short R.ctor2, v4, v3", 40, 30]
2230            tags: ['tsan']
2231
2232
2233      - file-name: "check_all_32bit_types_p"
2234        isa:
2235          instructions:
2236            - sig: initobj.short method_id, v1:in:none, v2:in:none
2237              acc: out:ref
2238              format: [op_v1_4_v2_4_id_16]
2239        description: Check 'initobj.short' constructor behavior with primitive 32bit argument types in PandaAssembly context.
2240        header-template: []
2241        code-template: |
2242          .record Z {
2243              %s    f
2244          }
2245          .function void Z.ctor1(Z a0) <ctor> {
2246              return.void
2247          }
2248          .function void Z.ctor2(Z a0, %s a1) <ctor> {
2249              lda a1
2250              stobj a0, Z.f
2251              return.void
2252          }
2253          .function i32 main() {
2254              initobj.short Z.ctor1
2255              sta.obj v0
2256              ldobj v0, Z.f
2257              jeqz chk2
2258              ldai 1
2259              return
2260          chk2:
2261              movi v1, %s
2262              initobj.short Z.ctor2, v1
2263              sta.obj v0
2264              ldobj v0, Z.f
2265              %s
2266              jeqz ok
2267              ldai 2
2268              return
2269          ok:
2270        check-type: exit-positive
2271        cases:
2272          - values:
2273            - u1
2274            - u1
2275            - 1
2276            - |
2277              #
2278                  jne v1, exit_failure
2279                  ldai 0
2280                  return
2281              exit_failure:
2282                  ldai 1
2283                  return
2284          - values:
2285            - u1
2286            - u1
2287            - 0
2288            - |
2289              #
2290                  jne v1, exit_failure
2291                  ldai 0
2292                  return
2293              exit_failure:
2294                  ldai 1
2295                  return
2296          - values: [u8, u8, 0, ucmp v1]
2297          - values: [u8, u8, 0x000000ff, ucmp v1]
2298          - values: [u8, u8, 0x0000005a, ucmp v1]
2299            tags: ['tsan']
2300          - values:
2301            - i8
2302            - i8
2303            - 0
2304            - |
2305              #
2306                  jne v1, exit_failure
2307                  ldai 0
2308                  return
2309              exit_failure:
2310                  ldai 1
2311                  return
2312          - values:
2313            - i8
2314            - i8
2315            - 0xffffffff
2316            - |
2317              #
2318                  jne v1, exit_failure
2319                  ldai 0
2320                  return
2321              exit_failure:
2322                  ldai 1
2323                  return
2324          - values:
2325            - i8
2326            - i8
2327            - 0x0000005a
2328            - |
2329              #
2330                  jne v1, exit_failure
2331                  ldai 0
2332                  return
2333              exit_failure:
2334                  ldai 1
2335                  return
2336          - values: [u16, u16, 0, ucmp v1]
2337          - values: [u16, u16, 0x0000ffff, ucmp v1]
2338            tags: ['tsan']
2339          - values: [u16, u16, 0x00005a5a, ucmp v1]
2340          - values:
2341            - i16
2342            - i16
2343            - 0
2344            - |
2345              #
2346                  jne v1, exit_failure
2347                  ldai 0
2348                  return
2349              exit_failure:
2350                  ldai 1
2351                  return
2352          - values:
2353            - i16
2354            - i16
2355            - 0xffffffff
2356            - |
2357              #
2358                  jne v1, exit_failure
2359                  ldai 0
2360                  return
2361              exit_failure:
2362                  ldai 1
2363                  return
2364          - values:
2365            - i16
2366            - i16
2367            - 0x00005a5a
2368            - |
2369              #
2370                  jne v1, exit_failure
2371                  ldai 0
2372                  return
2373              exit_failure:
2374                  ldai 1
2375                  return
2376          - values: [u32, u32, 0, ucmp v1]
2377            tags: ['tsan']
2378          - values: [u32, u32, 0xffffffff, ucmp v1]
2379          - values: [u32, u32, 0x5a5a5a5a, ucmp v1]
2380          - values:
2381            - i32
2382            - i32
2383            - 0
2384            - |
2385              #
2386                  jne v1, exit_failure
2387                  ldai 0
2388                  return
2389              exit_failure:
2390                  ldai 1
2391                  return
2392          - values:
2393            - i32
2394            - i32
2395            - 0xffffffff
2396            - |
2397              #
2398                  jne v1, exit_failure
2399                  ldai 0
2400                  return
2401              exit_failure:
2402                  ldai 1
2403                  return
2404          - values:
2405            - i32
2406            - i32
2407            - 0x5a5a5a5a
2408            - |
2409              #
2410                  jne v1, exit_failure
2411                  ldai 0
2412                  return
2413              exit_failure:
2414                  ldai 1
2415                  return
2416
2417
2418      - file-name: "check_all_32bit_types_j"
2419        isa:
2420          instructions:
2421            - sig: initobj.short method_id, v1:in:none, v2:in:none
2422              acc: out:ref
2423              format: [op_v1_4_v2_4_id_16]
2424        description: Check 'initobj.short' constructor behavior with primitive 32bit argument types in PandaAssembly context.
2425        runner-options: [use-pa]
2426        header-template: [PandaAssembly]
2427        code-template: |
2428          .record Z {
2429              %s    f
2430          }
2431          .function void Z.ctor1(Z a0) <ctor> {
2432              return.void
2433          }
2434          .function void Z.ctor2(Z a0, %s a1) <ctor> {
2435              lda a1
2436              stobj a0, Z.f
2437              return.void
2438          }
2439          .function i32 main() {
2440              initobj.short Z.ctor1
2441              sta.obj v0
2442              ldobj v0, Z.f
2443              jeqz chk2
2444              ldai 1
2445              return
2446          chk2:
2447              movi v1, %s
2448              initobj.short Z.ctor2, v1
2449              sta.obj v0
2450              ldobj v0, Z.f
2451              %s
2452              jeqz ok
2453              ldai 2
2454              return
2455          ok:
2456        check-type: exit-positive
2457        cases:
2458          - values:
2459            - u1
2460            - u1
2461            - 1
2462            - |
2463              #
2464                  jne v1, exit_failure
2465                  ldai 0
2466                  return
2467              exit_failure:
2468                  ldai 1
2469                  return
2470          - values:
2471            - u1
2472            - u1
2473            - 0
2474            - |
2475              #
2476                  jne v1, exit_failure
2477                  ldai 0
2478                  return
2479              exit_failure:
2480                  ldai 1
2481                  return
2482          - values:
2483            - i8
2484            - i8
2485            - 0
2486            - |
2487              #
2488                  jne v1, exit_failure
2489                  ldai 0
2490                  return
2491              exit_failure:
2492                  ldai 1
2493                  return
2494          - values:
2495            - i8
2496            - i8
2497            - 0xffffffff
2498            - |
2499              #
2500                  jne v1, exit_failure
2501                  ldai 0
2502                  return
2503              exit_failure:
2504                  ldai 1
2505                  return
2506          - values:
2507            - i8
2508            - i8
2509            - 0x0000005a
2510            - |
2511              #
2512                  jne v1, exit_failure
2513                  ldai 0
2514                  return
2515              exit_failure:
2516                  ldai 1
2517                  return
2518            tags: ['tsan']
2519          - values: [u16, u16, 0, ucmp v1]
2520          - values: [u16, u16, 0x0000ffff, ucmp v1]
2521            tags: ['tsan']
2522          - values: [u16, u16, 0x00005a5a, ucmp v1]
2523          - values:
2524            - i16
2525            - i16
2526            - 0
2527            - |
2528              #
2529                  jne v1, exit_failure
2530                  ldai 0
2531                  return
2532              exit_failure:
2533                  ldai 1
2534                  return
2535          - values:
2536            - i16
2537            - i16
2538            - 0xffffffff
2539            - |
2540              #
2541                  jne v1, exit_failure
2542                  ldai 0
2543                  return
2544              exit_failure:
2545                  ldai 1
2546                  return
2547          - values:
2548            - i16
2549            - i16
2550            - 0x00005a5a
2551            - |
2552              #
2553                  jne v1, exit_failure
2554                  ldai 0
2555                  return
2556              exit_failure:
2557                  ldai 1
2558                  return
2559          - values:
2560            - i32
2561            - i32
2562            - 0
2563            - |
2564              #
2565                  jne v1, exit_failure
2566                  ldai 0
2567                  return
2568              exit_failure:
2569                  ldai 1
2570                  return
2571          - values:
2572            - i32
2573            - i32
2574            - 0xffffffff
2575            - |
2576              #
2577                  jne v1, exit_failure
2578                  ldai 0
2579                  return
2580              exit_failure:
2581                  ldai 1
2582                  return
2583          - values:
2584            - i32
2585            - i32
2586            - 0x5a5a5a5a
2587            - |
2588              #
2589                  jne v1, exit_failure
2590                  ldai 0
2591                  return
2592              exit_failure:
2593                  ldai 1
2594                  return
2595
2596
2597      - file-name: "check_int_64bit_types_p"
2598        isa:
2599          instructions:
2600            - sig: initobj.short method_id, v1:in:none, v2:in:none
2601              acc: out:ref
2602              format: [op_v1_4_v2_4_id_16]
2603        description: Check 'initobj.short' constructor behavior with primitive integer 64bit argument types in PandaAssembly context.
2604        header-template: []
2605        code-template: |
2606          .record Z {
2607              %s    f
2608          }
2609          .function void Z.ctor1(Z a0) <ctor> {
2610              return.void
2611          }
2612          .function void Z.ctor2(Z a0, %s a1) <ctor> {
2613              lda.64 a1
2614              stobj.64 a0, Z.f
2615              return.void
2616          }
2617          .function i32 main() {
2618              initobj.short Z.ctor1
2619              sta.obj v0
2620              ldobj.64 v0, Z.f
2621              movi.64 v1, 0
2622              %s
2623              jeqz chk2
2624              ldai 1
2625              return
2626          chk2:
2627              movi.64 v1, %s
2628              initobj.short Z.ctor2, v1
2629              sta.obj v0
2630              ldobj.64 v0, Z.f
2631              %s
2632              jeqz ok
2633              ldai 2
2634              return
2635          ok:
2636        check-type: exit-positive
2637        cases:
2638          - values: [u64, u64, ucmp.64 v1, 0, ucmp.64 v1]
2639          - values: [u64, u64, ucmp.64 v1, 0xffffffffffffffff, ucmp.64 v1]
2640            tags: ['tsan']
2641          - values: [u64, u64, ucmp.64 v1, 0x5a5a5a5a5a5a5a5a, ucmp.64 v1]
2642          - values: [i64, i64, ucmp.64 v1, 0, cmp.64 v1]
2643          - values: [i64, i64, ucmp.64 v1, 0xffffffffffffffff, cmp.64 v1]
2644          - values: [i64, i64, ucmp.64 v1, 0x5a5a5a5a5a5a5a5a, cmp.64 v1]
2645            tags: ['tsan']
2646
2647
2648      - file-name: "check_int_64bit_types_j"
2649        isa:
2650          instructions:
2651            - sig: initobj.short method_id, v1:in:none, v2:in:none
2652              acc: out:ref
2653              format: [op_v1_4_v2_4_id_16]
2654        description: Check 'initobj.short' constructor behavior with primitive integer 64bit argument types in PandaAssembly context.
2655        runner-options: [use-pa]
2656        header-template: [PandaAssembly]
2657        code-template: |
2658          .record Z {
2659              %s    f
2660          }
2661          .function void Z.ctor1(Z a0) <ctor> {
2662              return.void
2663          }
2664          .function void Z.ctor2(Z a0, %s a1) <ctor> {
2665              lda.64 a1
2666              stobj.64 a0, Z.f
2667              return.void
2668          }
2669          .function i32 main() {
2670              initobj.short Z.ctor1
2671              sta.obj v0
2672              ldobj.64 v0, Z.f
2673              movi.64 v1, 0
2674              %s
2675              jeqz chk2
2676              ldai 1
2677              return
2678          chk2:
2679              movi.64 v1, %s
2680              initobj.short Z.ctor2, v1
2681              sta.obj v0
2682              ldobj.64 v0, Z.f
2683              %s
2684              jeqz ok
2685              ldai 2
2686              return
2687          ok:
2688        check-type: exit-positive
2689        cases:
2690          - values: [i64, i64, ucmp.64 v1, 0, cmp.64 v1]
2691          - values: [i64, i64, ucmp.64 v1, 0xffffffffffffffff, cmp.64 v1]
2692          - values: [i64, i64, ucmp.64 v1, 0x5a5a5a5a5a5a5a5a, cmp.64 v1]
2693            tags: ['tsan']
2694
2695
2696      - file-name: "check_float64_type_p"
2697        isa:
2698          instructions:
2699            - sig: initobj.short method_id, v1:in:none, v2:in:none
2700              acc: out:ref
2701              format: [op_v1_4_v2_4_id_16]
2702        description: Check 'initobj.short' constructor behavior with primitive float argument types in PandaAssembly context.
2703        tags: ['irtoc_ignore']
2704        header-template: []
2705        code-template: |
2706          .record Z {
2707              f64    f
2708          }
2709          .function void Z.ctor1(Z a0) <ctor> {
2710              return.void
2711          }
2712          .function void Z.ctor2(Z a0, f64 a1) <ctor> {
2713              lda.64 a1
2714              stobj.64 a0, Z.f
2715              return.void
2716          }
2717          .function i32 main() {
2718              initobj.short Z.ctor1
2719              sta.obj v0
2720              ldobj.64 v0, Z.f
2721              fmovi.64 v1, 0.0
2722              fcmpg.64 v1
2723              jeqz chk2
2724              ldai 1
2725              return
2726          chk2:
2727              fmovi.64 v1, %s
2728              initobj.short Z.ctor2, v1
2729              sta.obj v0
2730              ldobj.64 v0, Z.f
2731              fcmpg.64 v1
2732              jeqz ok
2733              ldai 2
2734              return
2735          ok:
2736        check-type: exit-positive
2737        cases:
2738          - values: [0.0]
2739          - values: [4.625]
2740          - values: [-4.625]
2741          - values: [0xfff0000000000000] # -Inf
2742            tags: ['tsan']
2743          - values: [0x7ff0000000000000] # +Inf
2744          - values: [0x7ff8000000000000]
2745          - values: [0x7ff8000000000010]
2746          - values: [0x7fffffffffffffff]
2747          - values: [0xffffffffffffffff]
2748            tags: ['tsan']
2749
2750      - file-name: "check_float32_type_p"
2751        isa:
2752          instructions:
2753            - sig: initobj.short method_id, v1:in:none, v2:in:none
2754              acc: out:ref
2755              format: [op_v1_4_v2_4_id_16]
2756        description: Check 'initobj.short' constructor behavior with primitive float argument types in PandaAssembly context.
2757        tags: ['irtoc_ignore']
2758        header-template: []
2759        code-template: |
2760          .record Z {
2761              f32    f
2762          }
2763          .function void Z.ctor1(Z a0) <ctor> {
2764              return.void
2765          }
2766          .function void Z.ctor2(Z a0, f32 a1) <ctor> {
2767              lda a1
2768              stobj a0, Z.f
2769              return.void
2770          }
2771          .function i32 main() {
2772              initobj.short Z.ctor1
2773              sta.obj v0
2774              ldobj v0, Z.f
2775              fmovi v1, 0.0
2776              fcmpg v1
2777              jeqz chk2
2778              ldai 1
2779              return
2780          chk2:
2781              fmovi v1, %s
2782              initobj.short Z.ctor2, v1
2783              sta.obj v0
2784              ldobj v0, Z.f
2785              fcmpg v1
2786              jeqz ok
2787              ldai 2
2788              return
2789          ok:
2790        check-type: exit-positive
2791        cases:
2792          - values: [0.0]
2793          - values: [4.625]
2794          - values: [-4.625]
2795          - values: [0xff800000] # -Inf
2796          - values: [0x7f800000] # +Inf
2797          - values: [0x7fc00000]
2798          - values: [0x7fc00010]
2799          - values: [0x7fffffff]
2800          - values: [0xffffffff]
2801
2802      - file-name: "check_float64_type_j"
2803        isa:
2804          instructions:
2805            - sig: initobj.short method_id, v1:in:none, v2:in:none
2806              acc: out:ref
2807              format: [op_v1_4_v2_4_id_16]
2808        description: Check 'initobj.short' constructor behavior with primitive float argument types in PandaAssembly context.
2809        tags: ['irtoc_ignore']
2810        runner-options: [use-pa]
2811        header-template: [PandaAssembly]
2812        code-template: |
2813          .record Z {
2814              f64    f
2815          }
2816          .function void Z.ctor1(Z a0) <ctor> {
2817              return.void
2818          }
2819          .function void Z.ctor2(Z a0, f64 a1) <ctor> {
2820              lda.64 a1
2821              stobj.64 a0, Z.f
2822              return.void
2823          }
2824          .function i32 main() {
2825              initobj.short Z.ctor1
2826              sta.obj v0
2827              ldobj.64 v0, Z.f
2828              fmovi.64 v1, 0.0
2829              fcmpg.64 v1
2830              jeqz chk2
2831              ldai 1
2832              return
2833          chk2:
2834              fmovi.64 v1, %s
2835              initobj.short Z.ctor2, v1
2836              sta.obj v0
2837              ldobj.64 v0, Z.f
2838              fcmpg.64 v1
2839              jeqz ok
2840              ldai 2
2841              return
2842          ok:
2843        check-type: exit-positive
2844        cases:
2845          - values: [0.0]
2846          - values: [4.625]
2847          - values: [-4.625]
2848          - values: [0xfff0000000000000] # -Inf
2849          - values: [0x7ff0000000000000] # +Inf
2850          - values: [0x7ff8000000000000]
2851          - values: [0x7ff8000000000010]
2852          - values: [0x7fffffffffffffff]
2853          - values: [0xffffffffffffffff]
2854
2855      - file-name: "check_float32_type_j"
2856        isa:
2857          instructions:
2858            - sig: initobj.short method_id, v1:in:none, v2:in:none
2859              acc: out:ref
2860              format: [op_v1_4_v2_4_id_16]
2861        description: Check 'initobj.short' constructor behavior with primitive float argument types in PandaAssembly context.
2862        tags: ['irtoc_ignore']
2863        runner-options: [use-pa]
2864        header-template: [PandaAssembly]
2865        code-template: |
2866          .record Z {
2867              f32    f
2868          }
2869          .function void Z.ctor1(Z a0) <ctor> {
2870              return.void
2871          }
2872          .function void Z.ctor2(Z a0, f32 a1) <ctor> {
2873              lda a1
2874              stobj a0, Z.f
2875              return.void
2876          }
2877          .function i32 main() {
2878              initobj.short Z.ctor1
2879              sta.obj v0
2880              ldobj v0, Z.f
2881              fmovi v1, 0.0
2882              fcmpg v1
2883              jeqz chk2
2884              ldai 1
2885              return
2886          chk2:
2887              fmovi v1, %s
2888              initobj.short Z.ctor2, v1
2889              sta.obj v0
2890              ldobj v0, Z.f
2891              fcmpg v1
2892              jeqz ok
2893              ldai 2
2894              return
2895          ok:
2896        check-type: exit-positive
2897        cases:
2898          - values: [0.0]
2899          - values: [4.625]
2900          - values: [-4.625]
2901          - values: [0xff800000] # -Inf
2902            tags: ['tsan']
2903          - values: [0x7f800000] # +Inf
2904            tags: ['tsan']
2905          - values: [0x7fc00000]
2906          - values: [0x7fc00010]
2907          - values: [0x7fffffff]
2908          - values: [0xffffffff]
2909
2910      - file-name: "check_obj_types_p"
2911        isa:
2912          instructions:
2913            - sig: initobj.short method_id, v1:in:none, v2:in:none
2914              acc: out:ref
2915              format: [op_v1_4_v2_4_id_16]
2916        description: Check 'initobj.short' constructor behavior with several object type arguments in PandaAssembly context.
2917        header-template: []
2918        code-template: |
2919          .record panda.Object <external>
2920          .record panda.Class <external>
2921          .record panda.String <external>
2922          .record Z {
2923              %s    f
2924          }
2925          .function void Z.ctor1(Z a0) <ctor> {
2926              return.void
2927          }
2928          .function void Z.ctor2(Z a0, %s a1) <ctor> {
2929              lda.obj a1
2930              stobj.obj a0, Z.f
2931              return.void
2932          }
2933          .function i32 main() {
2934              initobj.short Z.ctor1
2935              sta.obj v0
2936              ldobj.obj v0, Z.f
2937              jeqz.obj chk2
2938              ldai 1
2939              return
2940          chk2:
2941              %s
2942              sta.obj v1
2943              initobj.short Z.ctor2, v1
2944              sta.obj v0
2945              ldobj.obj v0, Z.f
2946              jeq.obj v1, ok
2947              ldai 2
2948              return
2949          ok:
2950        check-type: exit-positive
2951        cases:
2952          - values: [panda.String, panda.String, lda.str "test"]
2953          - values: [panda.Object, panda.String, lda.str "test"]
2954          - values: [panda.Class, panda.Class, lda.type Z]
2955          - values:
2956            - panda.Object
2957            - panda.Class
2958            - lda.type Z
2959            bugid: ["3594"]
2960          - values: [panda.Object, panda.Object, initobj.short Z.ctor1]
2961          - values: [panda.String, panda.String, lda.null]
2962          - values:
2963            - "i32[]"
2964            - "i32[]"
2965            - |
2966              #
2967                  movi v7, 10
2968                  newarr v7, v7, i32[]
2969                  lda.obj v7
2970          - values:
2971            - "i64[]"
2972            - "i64[]"
2973            - |
2974              #
2975                  movi v7, 10
2976                  newarr v7, v7, i64[]
2977                  lda.obj v7
2978            tags: ['tsan']
2979          - values:
2980            - "panda.String[]"
2981            - "panda.String[]"
2982            - |
2983              #
2984                  movi v7, 10
2985                  newarr v7, v7, panda.String[]
2986                  lda.obj v7
2987          - values:
2988            - Z[]
2989            - Z[]
2990            - |
2991              #
2992                  movi v7, 10
2993                  newarr v7, v7, Z[]
2994                  lda.obj v7
2995          - values:
2996            - panda.Object
2997            - u1[]
2998            - |
2999              #
3000                  movi v7, 10
3001                  newarr v7, v7, u1[]
3002                  lda.obj v7
3003            tags: ['tsan']
3004          - values:
3005            - panda.Object
3006            - panda.Object[]
3007            - |
3008              #
3009                  movi v7, 10
3010                  newarr v7, v7, Z[]
3011                  lda.obj v7
3012            bugid: ['3608']
3013          - values:
3014            - panda.Object[]
3015            - panda.Object[]
3016            - |
3017              #
3018                  movi v7, 10
3019                  newarr v7, v7, Z[][]
3020                  lda.obj v7
3021            bugid: ['3608']
3022
3023
3024      - file-name: "check_obj_types_j"
3025        isa:
3026          instructions:
3027            - sig: initobj.short method_id, v1:in:none, v2:in:none
3028              acc: out:ref
3029              format: [op_v1_4_v2_4_id_16]
3030        description: Check 'initobj.short' constructor behavior with several object type arguments in PandaAssembly context.
3031        runner-options: [use-pa]
3032        header-template: [PandaAssembly]
3033        code-template: |
3034          .record panda.Object <external>
3035          .record panda.Class <external>
3036          .record panda.String <external>
3037          .record Z {
3038              %s    f
3039          }
3040          .function void Z.ctor1(Z a0) <ctor> {
3041              return.void
3042          }
3043          .function void Z.ctor2(Z a0, %s a1) <ctor> {
3044              lda.obj a1
3045              stobj.obj a0, Z.f
3046              return.void
3047          }
3048          .function i32 main() {
3049              initobj.short Z.ctor1
3050              sta.obj v0
3051              ldobj.obj v0, Z.f
3052              jeqz.obj chk2
3053              ldai 1
3054              return
3055          chk2:
3056              %s
3057              sta.obj v1
3058              initobj.short Z.ctor2, v1
3059              sta.obj v0
3060              ldobj.obj v0, Z.f
3061              jeq.obj v1, ok
3062              ldai 2
3063              return
3064          ok:
3065        check-type: exit-positive
3066        cases:
3067          - values: [panda.String, panda.String, lda.str "test"]
3068          - values: [panda.Object, panda.String, lda.str "test"]
3069          - values: [panda.Class, panda.Class, lda.type Z]
3070          - values: [panda.Object, panda.Class, lda.type Z]
3071          - values: [panda.Object, panda.Object, initobj.short Z.ctor1]
3072          - values: [panda.String, panda.String, lda.null]
3073          - values:
3074            - "i32[]"
3075            - "i32[]"
3076            - |
3077              #
3078                  movi v7, 10
3079                  newarr v7, v7, i32[]
3080                  lda.obj v7
3081          - values:
3082            - "i64[]"
3083            - "i64[]"
3084            - |
3085              #
3086                  movi v7, 10
3087                  newarr v7, v7, i64[]
3088                  lda.obj v7
3089          - values:
3090            - "panda.String[]"
3091            - "panda.String[]"
3092            - |
3093              #
3094                  movi v7, 10
3095                  newarr v7, v7, panda.String[]
3096                  lda.obj v7
3097          - values:
3098            - Z[]
3099            - Z[]
3100            - |
3101              #
3102                  movi v7, 10
3103                  newarr v7, v7, Z[]
3104                  lda.obj v7
3105          - values:
3106            - panda.Object
3107            - u1[]
3108            - |
3109              #
3110                  movi v7, 10
3111                  newarr v7, v7, u1[]
3112                  lda.obj v7
3113          - values:
3114            - panda.Object
3115            - panda.Object
3116            - |
3117              #
3118                  movi v7, 10
3119                  newarr v7, v7, Z[]
3120                  lda.obj v7
3121            tags: ['tsan']
3122          - values:
3123            - panda.Object
3124            - panda.Object[]
3125            - |
3126              #
3127                  movi v7, 10
3128                  newarr v7, v7, panda.String[]
3129                  lda.obj v7
3130            tags: ['tsan']
3131          - values:
3132            - panda.Object[]
3133            - panda.Object[]
3134            - |
3135              #
3136                  movi v7, 10
3137                  newarr v7, v7, panda.String[][]
3138                  lda.obj v7
3139            bugid: ['3608']
3140
3141
3142      - file-name: 'oome_p'
3143        isa:
3144          exceptions:
3145            - x_oom
3146        description: Create objects with 'initobj.short' instruction until OutOfMemoryError in PandaAssembly context
3147        tags: ['irtoc_ignore']
3148        header-template: []
3149        panda-options: "--heap-size-limit=67108864"
3150        bugid: ['3578', '4170', '4171']
3151        code-template: |
3152          .record panda.OutOfMemoryError <external>
3153          .record Z {
3154          %s
3155          }
3156          .function void Z.ctor(Z a0) <ctor> {
3157              return.void
3158          }
3159          .function i32 main() {
3160              movi v7, 50000   # array size
3161              newarr v6, v7, Z[]       # array ref
3162              movi v1, 0       # index
3163          begin:
3164              initobj.short Z.ctor
3165              starr.obj v6, v1
3166              inci v1, 1
3167              lda v1
3168              jlt v7, begin
3169          end:
3170              ldai 1 # Should not reach this line
3171              return
3172
3173          catch_OOME:
3174              ldai 0 # Expected panda.OutOfMemoryError
3175              return
3176
3177          catch_all:
3178              ldai 2 # Unexpected exception, test failed
3179              return
3180
3181          .catch panda.OutOfMemoryError, begin, end, catch_OOME
3182          .catchall begin, end, catch_all
3183        check-type: none
3184        cases:
3185          - values:
3186            - "#{[*1..500].map do |i| \"    f64   f#{i}\\n\" end .join}"
3187            tags: ['tsan']
3188
3189
3190      - file-name: 'oome_j'
3191        isa:
3192          exceptions:
3193            - x_oom
3194        description: Create objects with 'initobj.short' instruction until OutOfMemoryError in PandaAssembly context
3195        tags: ['irtoc_ignore']
3196        runner-options: [use-pa]
3197        header-template: [PandaAssembly]
3198        panda-options: "--heap-size-limit=67108864"
3199        bugid: ['3578', '4171', '6147']
3200        code-template: |
3201          .record panda.OutOfMemoryError <external>
3202          .record Z {
3203          %s
3204          }
3205          .function void Z.ctor(Z a0) <ctor> {
3206              return.void
3207          }
3208          .function i32 main() {
3209              movi v7, 50000   # array size
3210              newarr v6, v7, Z[]       # array ref
3211              movi v1, 0       # index
3212          begin:
3213              initobj.short Z.ctor
3214              starr.obj v6, v1
3215              inci v1, 1
3216              lda v1
3217              jlt v7, begin
3218          end:
3219              ldai 1 # Should not reach this line
3220              return
3221
3222          catch_OOME:
3223              ldai 0 # Expected panda.OutOfMemoryError
3224              return
3225
3226          catch_all:
3227              ldai 2 # Unexpected exception, test failed
3228              return
3229
3230          .catch panda.OutOfMemoryError, begin, end, catch_OOME
3231          .catchall begin, end, catch_all
3232        check-type: none
3233        cases:
3234          - values:
3235            - "#{[*1..500].map do |i| \"    f64   f#{i}\\n\" end .join}"
3236            tags: ['tsan']
3237
3238
3239      - file-name: 'ame_p'
3240        isa:
3241          exceptions:
3242            - x_abstract
3243        description: Create objects with 'initobj.short' instruction with AbstractMethodError in PandaAssembly context
3244        tags: ['irtoc_ignore']
3245        header-template: []
3246        bugid: ['3625']
3247        code-template: |
3248          .record panda.AbstractMethodError <external>
3249          .record Z {}
3250          .function void Z.ctor0(Z a0) <ctor, noimpl>
3251          .function void Z.ctor2(Z a0, i32 a1, i32 a2) <ctor, noimpl>
3252          .function i32 main() {
3253          begin:
3254              %s
3255              initobj.short %s
3256          end:
3257              ldai 1 # Should not reach this line
3258              return
3259
3260          catch_AME:
3261              ldai 0 # Expected panda.AbstractMethodError
3262              return
3263
3264          catch_all:
3265              ldai 2 # Unexpected exception, test failed
3266              return
3267
3268          .catch panda.AbstractMethodError, begin, end, catch_AME
3269          .catchall begin, end, catch_all
3270        check-type: none
3271        cases:
3272          - values:
3273            - ""
3274            - Z.ctor0
3275            tags: ['tsan']
3276          - values:
3277            - |
3278              #
3279                  movi v1, 10
3280                  movi v2, 20
3281            - Z.ctor2, v1, v2
3282
3283
3284      - file-name: 'ame_j'
3285        isa:
3286          exceptions:
3287            - x_abstract
3288        description: Create objects with 'initobj.short' instruction with AbstractMethodError in PandaAssembly context
3289        header-template: [PandaAssembly]
3290        runner-options: [use-pa]
3291        tags: ['irtoc_ignore']
3292        bugid: ['3625']
3293        code-template: |
3294          .record panda.AbstractMethodError <external>
3295          .record Z {}
3296          .function void Z.ctor0(Z a0) <ctor, noimpl>
3297          .function void Z.ctor2(Z a0, i32 a1, i32 a2) <ctor, noimpl>
3298          .function i32 main() {
3299          begin:
3300              %s
3301              initobj.short %s
3302          end:
3303              ldai 1 # Should not reach this line
3304              return
3305
3306          catch_AME:
3307              ldai 0 # Expected panda.AbstractMethodError
3308              return
3309
3310          catch_all:
3311              ldai 2 # Unexpected exception, test failed
3312              return
3313
3314          .catch panda.AbstractMethodError, begin, end, catch_AME
3315          .catchall begin, end, catch_all
3316        check-type: none
3317        cases:
3318          - values:
3319            - ""
3320            - Z.ctor0
3321          - values:
3322            - |
3323              #
3324                  movi v3, 30
3325                  movi v4, 40
3326            - Z.ctor2, v3, v4
3327            tags: ['tsan']
3328
3329
3330      - file-name: "regs_restored_p"
3331        isa:
3332          description: |
3333            Resolve class type from initializer method_id, allocate memory for an object, initialize its fields with their
3334            default values (i.e. 0 for primitives and null for objects), call specified initializer and put a reference to
3335            the newly created object into accumulator. method_id should resolve to an initializer.
3336        description: Check 'initobj.short' that registers are restored after the initializer call PandaAssembly context.
3337        tags: ['tsan']
3338        header-template: []
3339        code-template: |
3340          .record R {}
3341          .function void R.ctor2(R a0, i16 a1, i32 a2) <ctor> {
3342              movi a1, -100
3343              movi a2, -200
3344              movi v0, 100
3345              movi v1, 200
3346              movi v2, 300
3347              movi v3, 400
3348              movi v4, 500
3349              movi v5, 600
3350              movi v6, 700
3351              movi v7, 800
3352              movi v8, 900
3353              movi v9, 1000
3354              movi v10, 1100
3355              movi v11, 1200
3356              movi v12, 1300
3357              movi v13, 1400
3358              movi v14, 1500
3359              movi v15, 1600
3360              return.void
3361          }
3362          .function i32 main() {
3363              movi v0, 1
3364              movi v1, 2
3365              movi v2, 3
3366              movi v3, 4
3367              movi v4, 5
3368              movi v5, 6
3369              movi v6, 7
3370              movi v7, 8
3371              movi v8, 9
3372              movi v9, 10
3373              movi v10, 11
3374              movi v11, 12
3375              movi v12, 13
3376              movi v13, 14
3377              movi v14, 15
3378              movi v15, 16
3379              initobj.short R.ctor2, v1, v2
3380              initobj.short R.ctor2, v3, v4
3381              initobj.short R.ctor2, v5, v6
3382              initobj.short R.ctor2, v7, v8
3383              initobj.short R.ctor2, v9, v10
3384              initobj.short R.ctor2, v11, v12
3385              initobj.short R.ctor2, v13, v14
3386              initobj.short R.ctor2, v15, v0
3387              ldai 1
3388              jeq v0, ok1
3389              return
3390          ok1:
3391              ldai 2
3392              jeq v1, ok2
3393              return
3394          ok2:
3395              ldai 3
3396              jeq v2, ok3
3397              return
3398          ok3:
3399              ldai 4
3400              jeq v3, ok4
3401              return
3402          ok4:
3403              ldai 5
3404              jeq v4, ok5
3405              return
3406          ok5:
3407              ldai 6
3408              jeq v5, ok6
3409              return
3410          ok6:
3411              ldai 7
3412              jeq v6, ok7
3413              return
3414          ok7:
3415              ldai 8
3416              jeq v7, ok8
3417              return
3418          ok8:
3419              ldai 9
3420              jeq v8, ok9
3421              return
3422          ok9:
3423              ldai 10
3424              jeq v9, ok10
3425              return
3426          ok10:
3427              ldai 11
3428              jeq v10, ok11
3429              return
3430          ok11:
3431              ldai 12
3432              jeq v11, ok12
3433              return
3434          ok12:
3435              ldai 13
3436              jeq v12, ok13
3437              return
3438          ok13:
3439              ldai 14
3440              jeq v13, ok14
3441              return
3442          ok14:
3443              ldai 15
3444              jeq v14, ok15
3445              return
3446          ok15:
3447              ldai 16
3448              jeq v15, ok16
3449              return
3450          ok16:
3451        check-type: exit-positive
3452
3453
3454      - file-name: "regs_restored_j"
3455        isa:
3456          description: |
3457            Resolve class type from initializer method_id, allocate memory for an object, initialize its fields with their
3458            default values (i.e. 0 for primitives and null for objects), call specified initializer and put a reference to
3459            the newly created object into accumulator. method_id should resolve to an initializer.
3460        description: Check 'initobj.short' that registers are restored after the initializer call PandaAssembly context.
3461        header-template: [PandaAssembly]
3462        tags: ['tsan']
3463        runner-options: [use-pa]
3464        code-template: |
3465          .record R {}
3466          .function void R.ctor2(R a0, i16 a1, i32 a2) <ctor> {
3467              movi a1, -100
3468              movi a2, -200
3469              movi v0, 100
3470              movi v1, 200
3471              movi v2, 300
3472              movi v3, 400
3473              movi v4, 500
3474              movi v5, 600
3475              movi v6, 700
3476              movi v7, 800
3477              movi v8, 900
3478              movi v9, 1000
3479              movi v10, 1100
3480              movi v11, 1200
3481              movi v12, 1300
3482              movi v13, 1400
3483              movi v14, 1500
3484              movi v15, 1600
3485              return.void
3486          }
3487          .function i32 main() {
3488              movi v0, 1
3489              movi v1, 2
3490              movi v2, 3
3491              movi v3, 4
3492              movi v4, 5
3493              movi v5, 6
3494              movi v6, 7
3495              movi v7, 8
3496              movi v8, 9
3497              movi v9, 10
3498              movi v10, 11
3499              movi v11, 12
3500              movi v12, 13
3501              movi v13, 14
3502              movi v14, 15
3503              movi v15, 16
3504              initobj.short R.ctor2, v1, v2
3505              initobj.short R.ctor2, v3, v4
3506              initobj.short R.ctor2, v5, v6
3507              initobj.short R.ctor2, v7, v8
3508              initobj.short R.ctor2, v9, v10
3509              initobj.short R.ctor2, v11, v12
3510              initobj.short R.ctor2, v13, v14
3511              initobj.short R.ctor2, v15, v0
3512              ldai 1
3513              jeq v0, ok1
3514              return
3515          ok1:
3516              ldai 2
3517              jeq v1, ok2
3518              return
3519          ok2:
3520              ldai 3
3521              jeq v2, ok3
3522              return
3523          ok3:
3524              ldai 4
3525              jeq v3, ok4
3526              return
3527          ok4:
3528              ldai 5
3529              jeq v4, ok5
3530              return
3531          ok5:
3532              ldai 6
3533              jeq v5, ok6
3534              return
3535          ok6:
3536              ldai 7
3537              jeq v6, ok7
3538              return
3539          ok7:
3540              ldai 8
3541              jeq v7, ok8
3542              return
3543          ok8:
3544              ldai 9
3545              jeq v8, ok9
3546              return
3547          ok9:
3548              ldai 10
3549              jeq v9, ok10
3550              return
3551          ok10:
3552              ldai 11
3553              jeq v10, ok11
3554              return
3555          ok11:
3556              ldai 12
3557              jeq v11, ok12
3558              return
3559          ok12:
3560              ldai 13
3561              jeq v12, ok13
3562              return
3563          ok13:
3564              ldai 14
3565              jeq v13, ok14
3566              return
3567          ok14:
3568              ldai 15
3569              jeq v14, ok15
3570              return
3571          ok15:
3572              ldai 16
3573              jeq v15, ok16
3574              return
3575          ok16:
3576        check-type: exit-positive
3577
3578
3579      - file-name: "valid_static_initializer_p"
3580        isa:
3581          description: |
3582            Resolve class type from initializer method_id, allocate memory for an object, initialize its fields with their
3583            default values (i.e. 0 for primitives and null for objects), call specified initializer and put a reference to
3584            the newly created object into accumulator. method_id should resolve to an initializer.
3585        description: Check 'initobj.short' with static initializer in PandaAssembly context.
3586        header-template: []
3587        code-template: |
3588          .record R {
3589              i32   cnt   <static>
3590          }
3591          .function void R.ctor(R a0) <ctor> {
3592              ldstatic R.cnt
3593              addi 1
3594              ststatic R.cnt
3595              return.void
3596          }
3597          .function void R.cctor() <cctor> {
3598              ldstatic R.cnt
3599              addi 1
3600              ststatic R.cnt
3601              return.void
3602          }
3603          .function i32 main() {
3604              initobj.short R.ctor
3605              initobj.short R.ctor
3606              ldstatic R.cnt
3607              movi v0, 3
3608              jeq v0, ok
3609              ldai 20
3610              return
3611          ok:
3612        check-type: exit-positive
3613
3614
3615      - file-name: "valid_static_initializer_j"
3616        isa:
3617          description: |
3618            Resolve class type from initializer method_id, allocate memory for an object, initialize its fields with their
3619            default values (i.e. 0 for primitives and null for objects), call specified initializer and put a reference to
3620            the newly created object into accumulator. method_id should resolve to an initializer.
3621        description: Check 'initobj.short' with static initializer in PandaAssembly context.
3622        runner-options: [use-pa]
3623        header-template: [PandaAssembly]
3624        code-template: |
3625          .record R {
3626              i32   cnt   <static>
3627          }
3628          .function void R.cctor() <cctor> {
3629              ldstatic R.cnt
3630              addi 1
3631              ststatic R.cnt
3632              return.void
3633          }
3634          .function void R.ctor(R a0) <ctor> {
3635              ldstatic R.cnt
3636              addi 1
3637              ststatic R.cnt
3638              return.void
3639          }
3640          .record Q <panda.extends=R> {}
3641          .function void Q.ctor(Q a0) <ctor> {
3642              ldstatic R.cnt
3643              addi 1
3644              ststatic R.cnt
3645              return.void
3646          }
3647          .function i32 main() {
3648              initobj.short Q.ctor
3649              initobj.short Q.ctor
3650              ldstatic R.cnt
3651              movi v0, 3
3652              jeq v0, ok
3653              ldai 20
3654              return
3655          ok:
3656        check-type: exit-positive
3657
3658