• 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
14---
15definitions:
16  - name: PandaAssembly
17    template: >
18      .language PandaAssembly
19
20tests:
21  - file-name: call
22    isa:
23      title: Static call
24      description: >
25        Call indicated static method, i.e. create new frame, pass values of arguments and
26        continue execution from the first instruction of a method.
27        Callee should treat accumulator value as undefined and cannot use it until accumulator
28        definition in the new frame.
29        Result (if any) is returned in accumulator (see 'Calling sequence' chapter for more details).
30        Method, its class and the number of argument is resolved by given method_id in
31        runtime constant-pool.
32        Arguments are passed in source registers in the same order as in method signature.
33        Non-range instructions can be used to pass up to 4 arguments (unused register slot values will
34        be discarded and corresponding registers will not be passed to the callee).
35        For methods with more arguments range kind of instruction is to be used, which takes the needed number
36        of arguments starting from 'vs' register.
37      verification:
38        - method_id_static
39        - compatible_arguments
40    commands:
41      - file-name: op_v1_4_v2_4_v3_4_v4_4_id_16
42        isa:
43          instructions:
44            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
45              acc: out:top
46              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
47        header-template: []
48        description: Check that 'call' supports up to 4 arguments.
49        tags: ['tsan']
50        code-template: |
51          .function void f1(%s) {
52              return.void
53          }
54          .function i32 main() {
55          %s
56              call f1%s
57        check-type: exit-positive
58        cases:
59          - values:
60            - ''
61            - ''
62            - ''
63          - values:
64            - 'i32 a0'
65            - 'movi v0, 0'
66            - ', v0'
67          - values:
68            - 'i32 a0, i32 a1'
69            - 'movi v0, 0'
70            - ', v0, v0'
71          - values:
72            - 'i32 a0, i32 a1'
73            - |
74              #
75                  movi v0, 0
76                  movi v1, 0
77            - ', v0, v1'
78          - values:
79            - 'i32 a0, i32 a1'
80            - |
81              #
82                  movi v0, 0
83                  movi v1, 0
84            - ', v1, v0'
85          - values:
86            - 'i64 a0, f64 a1'
87            - |
88              #
89                  movi.64 v0, 0
90                  fmovi.64 v1, 0
91            - ', v0, v1'
92          - values:
93              - 'i32 a0, i32 a1, i32 a2'
94              - 'movi v0, 0'
95              - ', v0, v0, v0'
96          - values:
97              - 'i32 a0, i32 a1, i32 a2, i32 a3'
98              - 'movi v0, 0'
99              - ', v0, v0, v0, v0'
100          - values:
101              - 'i32 a0, i32 a1, i32 a2, i32 a3, i32 a4'
102              - |
103                #
104                    movi v0, 0
105                    movi v1, 0
106                    movi v2, 0
107                    movi v3, 0
108              - ', v0, v1, v2, v3'
109            runner-options: [compile-failure]
110            ignore: true
111            bugid: ['7488']
112          - values:
113              - 'i32 a0, i32 a1, i32 a2, i32 a3, i32 a4'
114              - |
115                #
116                    movi v0, 0
117                    movi v1, 0
118                    movi v2, 0
119                    movi v3, 0
120                    movi v4, 0
121              - ', v0, v1, v2, v3, v4'
122            runner-options: [compile-failure]
123
124      - file-name: str_arg
125        isa:
126          instructions:
127            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
128              acc: out:top
129              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
130        header-template: [panda_string]
131        description: Check that 'call' works with String object.
132        code-template: |
133          .function void f1(panda.String a0) {
134              return.void
135          }
136          .function i32 main() {
137          %s
138              call f1%s
139        check-type: exit-positive
140        cases:
141          - values:
142            - ''
143            - ''
144            runner-options: [compile-failure]
145          - values:
146            - |
147              #
148                  lda.str "some string"
149                  sta.obj v0
150            - ', v0'
151          - values:
152            - '    mov.null v0'
153            - ', v0'
154          - values:
155            - ''
156            - ', "some string"'
157            runner-options: [compile-failure]
158
159      - file-name: uninitialized_values
160        bugid: ['1324']
161        tags: ['verifier']
162        runner-options: ['verifier-failure', 'verifier-config']
163        isa:
164          instructions:
165            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
166              acc: out:top
167              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
168        description: Verifier should check usage of uninitialized arguments passed to function.
169        header-template: []
170        code-template: |
171          .function void f1(%s) {
172              %s
173              return.void
174          }
175          .function i32 main() {
176              %s
177              call f1%s
178        check-type: exit-positive
179
180        # Template parameters:
181        #            1st argument is function arguments
182        #            2nd - usage of acc or reg
183        #            3rd - possible initialization of registers
184        #            4th - call parameters
185        cases:
186          - values: ['i32 a0',          '',          '',    ', v0']
187          - values: ['i32 a0, i32 a1, i32 a2, i32 a3',  '',          '',    ', v0, v0, v0, v0']
188          - values: ['i32 a0, f64 a1, i64 a2, i32 a3',  '',          '',    ', v0, v1, v2, v3']
189          - values: ['i32 a0, i32 a1',  '',          'movi v0, 0',    ', v0, v1']
190            description: Check if several registers in 'call' is uninitialized.
191          - values: ['i32 a0, f64 a1, i64 a2, i32 a3',  '',          'movi v0, 0',    ', v0, v1, v2, v3']
192            description: Check if several registers in 'call' is uninitialized.
193          - values:
194            - ''
195            - |
196              #
197                  lda a3
198                  lda a4
199            - ''
200            - ''
201            description: Check usage of undefined parameter.
202            runner-options: [compile-failure]
203
204      - file-name: uninitialized_reg_no_arg
205        bugid: ['1324']
206        tags: ['verifier']
207        runner-options: ['verifier-failure', 'verifier-config']
208        isa:
209          instructions:
210            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
211              acc: out:top
212              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
213        description: Verifier should check usage of uninitialized registers in function.
214        header-template: []
215        code-template: |
216          .function void f1() {
217              %s
218              return.void
219          }
220          .function i32 main() {
221              %s
222              call f1
223        check-type: exit-positive
224        cases:
225          - values:
226            - lda v0
227            - movi v0, 123
228          - values:
229            - lda v1
230            - movi v1, 123
231          - values:
232            - lda.64 v0
233            - movi.64 v0, 0xFFFFFFFFFFFFFFFF
234          - values:
235            - lda.64 v1
236            - movi.64 v1, 0xFFFFFFFFFFFFFFFF
237          - values:
238            - lda.64 v0
239            - fmovi.64 v0, 3.1415926535
240          - values:
241            - lda.64 v1
242            - movi.64 v1, 0xFFFFFFFFFFFFFFFF
243          - values:
244            - lda.obj v0
245            - |
246              #
247                  lda.str "some string"
248                  sta.obj v0
249          - values:
250            - lda.obj v1
251            - |
252              #
253                  lda.str "some string"
254                  sta.obj v1
255
256      - file-name: args_count_mismatch
257        runner-options: [compile-only]
258        isa:
259          instructions:
260            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
261              acc: out:top
262              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
263        description: Check 'call' when arguments of function and instruction parameters mismatch.
264        header-template: []
265        code-template: |
266          .function void f1(%s) {
267              return.void
268          }
269          .function i32 main() {
270              %s
271              call f1%s
272        check-type: exit-positive
273
274        # Template parameters:
275        #            1st - function arguments
276        #            2nd - possible initialization of registers
277        #            3rd - call parameters
278        cases:
279          - values: ['',                '',            ', v0']
280            description: Check uninitialized register is ignored when its value is not used.
281          - values: ['',                '',            ', v0, v0, v0, v0']
282            description: Check uninitialized register is ignored when its value is not used.
283          - values: ['i32 a0',          '',            '']
284            runner-options: [compile-failure]
285            description: Mismatch function parameters.
286          - values: ['i32 a0, i32 a1, i32 a2, i32 a3',  'movi v0, 0',  ', v0, v0, v0']
287            runner-options: [compile-failure]
288            description: Mismatch function parameters.
289            ignore: true
290            bugid: ['1956','1304']
291          - values: ['i32 a0, i32 a1, i32 a2, i32 a3',  'movi v0, 0',  ', v0']
292            runner-options: [compile-failure]
293            description: Mismatch function parameters.
294            ignore: true
295            bugid: ['1956','1304']
296          - values: ['',                'movi v0, 0',  ', v0']
297            description: Check initialized register is ignored when its value is not used.
298          - values: ['i32 a0',                'movi v0, 0',  ', v0, v0, v0, v0']
299            description: Check initialized register is ignored when its value is not used.
300          - values: ['i32 a0, i32 a1, i32 a2',                'movi v0, 0',  ', v0, v0, v0, v0']
301            description: Check initialized register is ignored when its value is not used.
302
303      - file-name: args_type_mismatch
304        bugid: ['1324']
305        tags: ['verifier']
306        runner-options: ['verifier-failure', 'verifier-config']
307        isa:
308          instructions:
309            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
310              acc: out:top
311              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
312        description: Check 'call' when argument type of function and instruction mismatch.
313        header-template: []
314        code-template: |
315          %s
316          .function void f1(%s) {
317              return.void
318          }
319          .function i32 main() {
320              %s
321              call f1, v0
322        check-type: exit-positive
323
324        # Template parameters:
325        #            1 - type definitions
326        #            2 - function arguments
327        #            3 - possible initialization of registers
328        #            4 - call parameters
329        cases:
330            - values: ['',                'i32 a0',      'mov.null v0']
331            - values: ['',                'i64 a0',      'mov.null v0']
332            - values: ['',                'f64 a0',      'mov.null v0']
333            - values: ['',                'i32 a0',      'movi.64 v0, 0']
334            - values: ['',                'f64 a0',      'movi.64 v0, 0']
335            - values: ['.record Obj {}',  'Obj a0',      'movi.64 v0, 0']
336            - values: ['',                'i64 a0',      'movi v0, 0']
337            - values: ['',                'f64 a0',      'movi v0, 0']
338            - values: ['.record Obj {}',  'Obj a0',      'movi v0, 0']
339            - values:
340              - |
341                #
342                .record Obj {}
343
344                .function void Obj.ctor(Obj a0) <ctor> {
345                    return.void
346                }
347              - i32 a0
348              - |
349                #
350                    initobj.short Obj.ctor
351                    sta v0
352
353            - values:
354                - |
355                  #
356                  .record Obj {}
357
358                  .function void Obj.ctor(Obj a0) <ctor> {
359                      return.void
360                  }
361                - i64 a0
362                - |
363                  #
364                      initobj.short Obj.ctor
365                      sta v0
366
367      - file-name: reg
368        runner-options: [compile-only]
369        isa:
370          instructions:
371            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
372              acc: out:top
373              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
374        description: Check 'call' register number width.
375        header-template: []
376        code-template: |
377          .function void f1(i32 a0) {
378              return.void
379          }
380          .function i32 main() {
381              movi %s, 0
382              call f1, %s
383        check-type: exit-positive
384        cases:
385          - values: ['v0', 'v0']
386          - values: ['v7', 'v7']
387          - values: ['v8', 'v8']
388          - values: ['v15', 'v15']
389          - values: ['v16', 'v16']
390            runner-options: [compile-failure]
391          - values: ['v127', 'v127']
392            runner-options: [compile-failure]
393          - values: ['v0', '1']
394            runner-options: [compile-failure]
395          - values: ['v0', '1.1']
396            runner-options: [compile-failure]
397          - values: ['v0', '0xFFFFFFFFFFFFFFFF']
398            runner-options: [compile-failure]
399          - values: ['v0', '"some string"']
400            runner-options: [compile-failure]
401
402      - file-name: reg2
403        runner-options: [compile-only]
404        isa:
405          instructions:
406            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
407              acc: out:top
408              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
409        description: Check 'call' register number width.
410        header-template: []
411        code-template: |
412          .function void f1(i32 a0, i32 a1, i32 a2, i32 a3) {
413              return.void
414          }
415          .function i32 main() {
416              movi %s, 0
417              movi %s, 1
418              movi %s, 2
419              movi %s, 3
420              call f1, %s, %s, %s, %s
421        check-type: exit-positive
422        cases:
423          - values: ['v0', 'v1', 'v2', 'v3', 'v0', 'v1', 'v2', 'v3']
424          - values: ['v12', 'v13', 'v14', 'v15', 'v13', 'v13', 'v14', 'v15']
425          - values: ['v15', 'v15', 'v15', 'v15', 'v15', 'v15', 'v15', 'v15']
426          - values: ['v15', 'v16', 'v15', 'v16', 'v15', 'v16', 'v15', 'v16']
427            runner-options: [compile-failure]
428          - values: ['v16', 'v15', 'v16', 'v15', 'v16', 'v15', 'v16', 'v15']
429            runner-options: [compile-failure]
430          - values: ['v16', 'v16', 'v16', 'v16', 'v16', 'v16', 'v16', 'v16']
431            runner-options: [compile-failure]
432          - values: ['v127', 'v127', 'v127', 'v127', 'v127', 'v127', 'v127', 'v127']
433            runner-options: [compile-failure]
434
435      - file-name: arg_1_i32_acc
436        isa:
437          instructions:
438            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
439              acc: out:top
440              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
441        description: Check correctness of passed arguments. Load parameter to accumulator. Check i32 type of arguments.
442        tags: ['tsan']
443        header-template: []
444        code-template: |
445          .function i32 f1(i32 a0) {
446              lda a0
447              movi v1, %s
448              jne v1, exit_failure
449              ldai 0
450              return
451          exit_failure:
452              ldai 1
453              return
454          }
455          .function i32 main() {
456              movi v0, %s
457              call f1, v0
458
459        check-type: no-check
460        cases:
461          - values: ["0", "0"]
462          - values: ["1", "1"]
463          - values: ["1234567", "1234567"]
464          - values: ["0x7FFFFFFF", "0x7FFFFFFF"]
465          - values: ["0x80000000", "0x80000000"]
466          - values: ["0x9ABCDEF0", "0x9ABCDEF0"]
467          - values: ["0xFFFFFFFF", "0xFFFFFFFF"]
468
469      - file-name: arg_1_f64_acc
470        isa:
471          instructions:
472            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
473              acc: out:top
474              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
475        description: Check correctness of passed arguments. Load parameter to accumulator. Check f64 type of arguments.
476        header-template: []
477        tags: ['irtoc_ignore']
478        code-template: |
479          .function i32 f1(f64 a0) {
480              lda.64 a0
481              fmovi.64 v1, %s
482              fcmpg.64 v1
483              return
484          }
485          .function i32 main() {
486              fmovi.64 v0, %s
487              call f1, v0
488        check-type: no-check
489        cases:
490          - values: ["0", "0"]
491          - values: ["1.1", "1.1"]
492          - values: ["0x7ff0000000000000", "0x7ff0000000000000"]
493          - values: ["0xfff0000000000000", "0xfff0000000000000"]
494          - values: ["0x7fefffffffffffff", "0x7fefffffffffffff"]
495          - values: ["0xffefffffffffffff", "0xffefffffffffffff"]
496          - values: ["100e100", "100e100"]
497
498      - file-name: arg_1_i32_reg
499        isa:
500          instructions:
501            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
502              acc: out:top
503              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
504        description: Check correctness of passed arguments. Load parameter to register. Check i32 type of arguments.
505        header-template: []
506        code-template: |
507          .function i32 f1(i32 a0) {
508              mov v1, a0
509              ldai %s
510              jne v1, exit_failure
511              ldai 0
512              return
513          exit_failure:
514              ldai 1
515              return
516          }
517          .function i32 main() {
518              movi v0, %s
519              call f1, v0
520        check-type: no-check
521        cases:
522          - values: ["0", "0"]
523          - values: ["1", "1"]
524          - values: ["1234567", "1234567"]
525          - values: ["0x7FFFFFFF", "0x7FFFFFFF"]
526          - values: ["0x80000000", "0x80000000"]
527          - values: ["0x9ABCDEF0", "0x9ABCDEF0"]
528          - values: ["0xFFFFFFFF", "0xFFFFFFFF"]
529
530      - file-name: arg_1_f64_reg
531        isa:
532          instructions:
533            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
534              acc: out:top
535              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
536        description: Check correctness of passed arguments. Load parameter to register. Check f64 type of arguments.
537        header-template: []
538        tags: ['irtoc_ignore']
539        code-template: |
540          .function i32 f1(f64 a0) {
541              mov.64 v1, a0
542              fldai.64 %s
543              fcmpg.64 v1
544              return
545          }
546          .function i32 main() {
547              fmovi.64 v0, %s
548              call f1, v0
549        check-type: no-check
550        cases:
551          - values: ["0", "0"]
552          - values: ["1.1", "1.1"]
553          - values: ["0x7ff0000000000000", "0x7ff0000000000000"]
554          - values: ["0xfff0000000000000", "0xfff0000000000000"]
555          - values: ["0x7fefffffffffffff", "0x7fefffffffffffff"]
556          - values: ["0xffefffffffffffff", "0xffefffffffffffff"]
557          - values: ["100e100", "100e100"]
558
559      - file-name: arg_2_i32_acc
560        isa:
561          instructions:
562            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
563              acc: out:top
564              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
565        description: Check correctness of passed arguments. Load parameter to accumulator. Check i32 type of arguments.
566        header-template: []
567        code-template: |
568          .function i32 f1(i32 a0, i32 a1, i32 a2, i32 a3) {
569              lda a0
570              movi v1, %s
571              jeq v1, f1_check1
572          # 1st arg does not match, exit
573              ldai 1
574              return
575          f1_check1:
576              lda a1
577              movi v1, %s
578              jeq v1, f1_check2
579              ldai 1
580              return
581          f1_check2:
582              lda a2
583              movi v1, %s
584              jeq v1, f1_check3
585              ldai 1
586              return
587          f1_check3:
588              lda a3
589              movi v1, %s
590              jne v1, exit_failure
591              ldai 0
592              return
593          exit_failure:
594              ldai 1
595              return
596          }
597          .function i32 main() {
598              movi v0, %s
599              movi v1, %s
600              movi v2, %s
601              movi v3, %s
602              call f1, v0, v1, v2, v3
603
604        check-type: no-check
605        cases:
606          - values: ["0", "0", "0", "0", "0", "0", "0", "0"]
607          - values: ["0", "1", "2", "3", "0", "1", "2", "3"]
608          - values: ["-3", "-2", "-1", "0", "-3", "-2", "-1", "0"]
609          - values: ["0", "1234567", "89101112", "13141516", "0", "1234567", "89101112", "13141516"]
610          - values: ["0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF"]
611          - values: ["0", "0x80000000", "0", "0x80000000", "0", "0x80000000", "0", "0x80000000"]
612          - values: ["0x80000000", "0", "0x80000000", "0", "0x80000000", "0", "0x80000000", "0"]
613          - values: ["0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000"]
614          - values: ["0x9ABCDEF0", "0xFEDCBA09", "0x87654321", "0x12345678", "0x9ABCDEF0", "0xFEDCBA09", "0x87654321", "0x12345678"]
615          - values: ["0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF"]
616          - values: ["0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0"]
617          - values: ["0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF"]
618
619      - file-name: arg_2_i32_reg
620        isa:
621          instructions:
622            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
623              acc: out:top
624              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
625        description: Check correctness of passed arguments. Load parameter to register. Check i32 type of arguments.
626        header-template: []
627        code-template: |
628          .function i32 f1(i32 a0, i32 a1, i32 a2, i32 a3) {
629              mov v1, a0
630              ldai %s
631              jeq v1, f1_check1
632          # 1st arg does not match, exit
633              ldai 1
634              return
635          f1_check1:
636              mov v1, a1
637              ldai %s
638              jeq v1, f1_check2
639          # 1st arg does not match, exit
640              ldai 1
641              return
642          f1_check2:
643              mov v1, a2
644              ldai %s
645              jeq v1, f1_check3
646          # 1st arg does not match, exit
647              ldai 1
648              return
649          f1_check3:
650              mov v1, a3
651              ldai %s
652              jne v1, exit_failure
653              ldai 0
654              return
655          exit_failure:
656              ldai 1
657              return
658          }
659          .function i32 main() {
660              movi v0, %s
661              movi v1, %s
662              movi v2, %s
663              movi v3, %s
664              call f1, v0, v1, v2, v3
665        check-type: no-check
666        cases:
667          - values: ["0", "0", "0", "0", "0", "0", "0", "0"]
668          - values: ["0", "1", "2", "3", "0", "1", "2", "3"]
669          - values: ["-3", "-2", "-1", "0", "-3", "-2", "-1", "0"]
670          - values: ["0", "1234567", "89101112", "13141516", "0", "1234567", "89101112", "13141516"]
671          - values: ["0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF"]
672          - values: ["0", "0x80000000", "0", "0x80000000", "0", "0x80000000", "0", "0x80000000"]
673          - values: ["0x80000000", "0", "0x80000000", "0", "0x80000000", "0", "0x80000000", "0"]
674          - values: ["0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000"]
675          - values: ["0x9ABCDEF0", "0xFEDCBA09", "0x87654321", "0x12345678", "0x9ABCDEF0", "0xFEDCBA09", "0x87654321", "0x12345678"]
676          - values: ["0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF"]
677          - values: ["0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0"]
678          - values: ["0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF"]
679
680      - file-name: arg_2_f64_acc
681        isa:
682          instructions:
683            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
684              acc: out:top
685              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
686        description: Check correctness of passed arguments. Load parameter to accumulator. Check f64 type of arguments.
687        tags: ['irtoc_ignore']
688        header-template: []
689        code-template: |
690          .function i32 f1(f64 a0, f64 a1, f64 a2, f64 a3) {
691              lda.64 a0
692              fmovi.64 v1, %s
693              fcmpg.64 v1
694              jeqz f1_check1
695          # 1st arg does not match, exit
696              ldai 1
697              return
698          f1_check1:
699              lda.64 a1
700              fmovi.64 v1, %s
701              fcmpg.64 v1
702              jeqz f1_check2
703              ldai 1
704              return
705          f1_check2:
706              lda.64 a2
707              fmovi.64 v1, %s
708              fcmpg.64 v1
709              jeqz f1_check3
710              ldai 1
711              return
712          f1_check3:
713              lda.64 a3
714              fmovi.64 v1, %s
715              fcmpg.64 v1
716              return
717          }
718          .function i32 main() {
719              fmovi.64 v0, %s
720              fmovi.64 v1, %s
721              fmovi.64 v2, %s
722              fmovi.64 v3, %s
723              call f1, v0, v1, v2, v3
724
725        check-type: no-check
726        cases:
727          - values: ["0", "0", "0", "0", "0", "0", "0", "0"]
728          - values: ["1.2", "1.1", "1.3", "1.4", "1.2", "1.1", "1.3", "1.4"]
729          - values: ["0x7ff0000000000000", "0xfff0000000000000", "0x0000000000000001", "0x8000000000000001", "0x7ff0000000000000", "0xfff0000000000000", "0x0000000000000001", "0x8000000000000001"]
730          - values: ["0xffefffffffffffff", "0x7fefffffffffffff", "3.1415926535", "3.1415926535e89", "0xffefffffffffffff", "0x7fefffffffffffff", "3.1415926535", "3.1415926535e89"]
731          - values: ["100e100", "200e200", "-50e-50", "123e123", "100e100", "200e200", "-50e-50", "123e123"]
732
733      - file-name: arg_2_f64_reg
734        isa:
735          instructions:
736            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
737              acc: out:top
738              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
739        description: Check correctness of passed arguments. Load parameter to register. Check f64 type of arguments.
740        tags: ['tsan', 'irtoc_ignore']
741        header-template: []
742        code-template: |
743          .function i32 f1(f64 a0, f64 a1, f64 a2, f64 a3) {
744              mov.64 v1, a0
745              fldai.64 %s
746              fcmpg.64 v1
747              jeqz f1_check1
748          # 1st arg does not match, exit
749              ldai 1
750              return
751          f1_check1:
752              mov.64 v1, a1
753              fldai.64 %s
754              fcmpg.64 v1
755              jeqz f1_check2
756          # 1st arg does not match, exit
757              ldai 1
758              return
759          f1_check2:
760              mov.64 v1, a2
761              fldai.64 %s
762              fcmpg.64 v1
763              jeqz f1_check3
764          # 1st arg does not match, exit
765              ldai 1
766              return
767          f1_check3:
768              mov.64 v1, a3
769              fldai.64 %s
770              fcmpg.64 v1
771              return
772          }
773          .function i32 main() {
774              fmovi.64 v0, %s
775              fmovi.64 v1, %s
776              fmovi.64 v2, %s
777              fmovi.64 v3, %s
778              call f1, v0, v1, v2, v3
779        check-type: no-check
780        cases:
781          - values: ["0", "0", "0", "0", "0", "0", "0", "0"]
782          - values: ["1.2", "1.1", "1.3", "1.4", "1.2", "1.1", "1.3", "1.4"]
783          - values: ["0x7ff0000000000000", "0xfff0000000000000", "0x0000000000000001", "0x8000000000000001", "0x7ff0000000000000", "0xfff0000000000000", "0x0000000000000001", "0x8000000000000001"]
784          - values: ["0xffefffffffffffff", "0x7fefffffffffffff", "3.1415926535", "3.1415926535e89", "0xffefffffffffffff", "0x7fefffffffffffff", "3.1415926535", "3.1415926535e89"]
785          - values: ["100e100", "200e200", "-50e-50", "123e123", "100e100", "200e200", "-50e-50", "123e123"]
786
787      - file-name: arg_1_i64_acc
788        isa:
789          instructions:
790            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
791              acc: out:top
792              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
793        description: Check correctness of passed arguments. Load parameter to accumulator. Check i64 type of arguments.
794        header-template: []
795        code-template: |
796          .function i32 f1(i64 a0) {
797              lda.64 a0
798              movi.64 v1, %s
799              cmp.64 v1
800              return
801          }
802          .function i32 main() {
803              movi.64 v0, %s
804              call f1, v0
805
806        check-type: no-check
807        cases:
808          - values: ["0", "0"]
809          - values: ["1", "1"]
810          - values: ["0x1234567890ABCDEF", "0x1234567890ABCDEF"]
811          - values: ["0x7FFFFFFFFFFFFFFF", "0x7FFFFFFFFFFFFFFF"]
812          - values: ["0x8000000000000000", "0x8000000000000000"]
813          - values: ["0xFEDCBA0987654321", "0xFEDCBA0987654321"]
814          - values: ["0xFFFFFFFFFFFFFFFF", "0xFFFFFFFFFFFFFFFF"]
815
816      - file-name: arg_1_i64_reg
817        isa:
818          instructions:
819            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
820              acc: out:top
821              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
822        description: Check correctness of passed arguments. Load parameter to accumulator. Check i64 type of arguments.
823        header-template: []
824        code-template: |
825          .function i32 f1(i64 a0) {
826              mov.64 v1, a0
827              ldai.64 %s
828              cmp.64 v1
829              return
830          }
831          .function i32 main() {
832              movi.64 v0, %s
833              call f1, v0
834
835        check-type: no-check
836        cases:
837          - values: ["0", "0"]
838          - values: ["1", "1"]
839          - values: ["0x1234567890ABCDEF", "0x1234567890ABCDEF"]
840          - values: ["0x7FFFFFFFFFFFFFFF", "0x7FFFFFFFFFFFFFFF"]
841          - values: ["0x8000000000000000", "0x8000000000000000"]
842          - values: ["0xFEDCBA0987654321", "0xFEDCBA0987654321"]
843          - values: ["0xFFFFFFFFFFFFFFFF", "0xFFFFFFFFFFFFFFFF"]
844
845      - file-name: arg_2_i64_acc
846        isa:
847          instructions:
848            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
849              acc: out:top
850              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
851        description: Check correctness of passed arguments. Load parameter to accumulator.
852        header-template: []
853        code-template: |
854          .function i32 f1(i64 a0, i64 a1, i64 a2, i64 a3) {
855              lda.64 a0
856              movi.64 v1, %s
857              cmp.64 v1
858              jeqz f1_check1
859          # 1st arg does not match, exit
860              ldai 1
861              return
862          f1_check1:
863              lda.64 a1
864              movi.64 v1, %s
865              cmp.64 v1
866              jeqz f1_check2
867          # 1st arg does not match, exit
868              ldai 1
869              return
870          f1_check2:
871              lda.64 a2
872              movi.64 v1, %s
873              cmp.64 v1
874              jeqz f1_check3
875          # 1st arg does not match, exit
876              ldai 1
877              return
878          f1_check3:
879              lda.64 a3
880              movi.64 v1, %s
881              cmp.64 v1
882              return
883          }
884          .function i32 main() {
885              movi.64 v0, %s
886              movi.64 v1, %s
887              movi.64 v2, %s
888              movi.64 v3, %s
889              call f1, v0, v1, v2, v3
890
891        check-type: no-check
892        cases:
893          - values: ["0", "0", "0", "0", "0", "0", "0", "0"]
894          - values: ["0", "1", "0", "1", "0", "1", "0", "1"]
895          - values: ["1", "0", "1", "0", "1", "0", "1", "0"]
896          - values: ["0x1234567890ABCDEF", "0x234567890ABCDEF1", "0x34567890ABCDEF12", "0x4567890ABCDEF123", "0x1234567890ABCDEF", "0x234567890ABCDEF1", "0x34567890ABCDEF12", "0x4567890ABCDEF123"]
897          - values: ["0x7FFFFFFFFFFFFFFF", "0", "0x7FFFFFFFFFFFFFFF", "0", "0x7FFFFFFFFFFFFFFF", "0", "0x7FFFFFFFFFFFFFFF", "0"]
898          - values: ["0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000"]
899          - values: ["0xFEDCBA0987654321", "0xEDCBA0987654321F", "0xDCBA0987654321FE", "0xCBA0987654321FED", "0xFEDCBA0987654321", "0xEDCBA0987654321F", "0xDCBA0987654321FE", "0xCBA0987654321FED"]
900
901      - file-name: arg_2_i64_reg
902        isa:
903          instructions:
904            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
905              acc: out:top
906              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
907        description: Check correctness of passed arguments. Load parameter to register. Check i64 type of arguments.
908        header-template: []
909        code-template: |
910          .function i32 f1(i64 a0, i64 a1, i64 a2, i64 a3) {
911              mov.64 v1, a0
912              ldai.64 %s
913              cmp.64 v1
914              jeqz f1_check1
915          # 1st arg does not match, exit
916              ldai 1
917              return
918          f1_check1:
919              mov.64 v1, a1
920              ldai.64 %s
921              cmp.64 v1
922              jeqz f1_check2
923          # 1st arg does not match, exit
924              ldai 1
925              return
926          f1_check2:
927              mov.64 v1, a2
928              ldai.64 %s
929              cmp.64 v1
930              jeqz f1_check3
931          # 1st arg does not match, exit
932              ldai 1
933              return
934          f1_check3:
935
936              mov.64 v1, a3
937              ldai.64 %s
938              cmp.64 v1
939              return
940          }
941          .function i32 main() {
942              movi.64 v0, %s
943              movi.64 v1, %s
944              movi.64 v2, %s
945              movi.64 v3, %s
946              call f1, v0, v1, v2, v3
947
948        check-type: no-check
949        cases:
950          - values: ["0", "0", "0", "0", "0", "0", "0", "0"]
951          - values: ["0", "1", "0", "1", "0", "1", "0", "1"]
952          - values: ["1", "0", "1", "0", "1", "0", "1", "0"]
953          - values: ["0x1234567890ABCDEF", "0x234567890ABCDEF1", "0x34567890ABCDEF12", "0x4567890ABCDEF123", "0x1234567890ABCDEF", "0x234567890ABCDEF1", "0x34567890ABCDEF12", "0x4567890ABCDEF123"]
954          - values: ["0x7FFFFFFFFFFFFFFF", "0", "0x7FFFFFFFFFFFFFFF", "0", "0x7FFFFFFFFFFFFFFF", "0", "0x7FFFFFFFFFFFFFFF", "0"]
955          - values: ["0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000"]
956          - values: ["0xFEDCBA0987654321", "0xEDCBA0987654321F", "0xDCBA0987654321FE", "0xCBA0987654321FED", "0xFEDCBA0987654321", "0xEDCBA0987654321F", "0xDCBA0987654321FE", "0xCBA0987654321FED"]
957
958      - file-name: arg_1_obj_acc
959        isa:
960          instructions:
961            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
962              acc: out:top
963              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
964        description: Check correctness of passed arguments. Load parameter to accumulator. Check object type of arguments.
965        header-template: [obj_ctor]
966        code-template: |
967          .function Obj fnc(Obj a0) {
968              lda.obj a0
969              return.obj
970          }
971
972          .function i32 main() {
973              %s
974              sta.obj v0
975              ldai 0 # acc is i32
976              call fnc, v0 # acc contains returned Obj
977              jne.obj v0, return_ne_num
978              ldai 0
979              return
980          return_ne_num:
981              ldai 1
982              return
983
984        check-type: no-check
985        cases:
986          - values:
987            - "lda.null"
988          - values:
989            - "initobj Obj.ctor"
990
991      - file-name: arg_2_obj_acc
992        isa:
993          instructions:
994            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
995              acc: out:top
996              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
997        description: Check correctness of passed arguments. Load parameter to accumulator. Check object type.
998        tags: ['tsan', 'irtoc_ignore']
999        header-template: [obj_ctor]
1000        code-template: |
1001          .record ObjTuple {
1002              Obj o0
1003              Obj o1
1004              Obj o2
1005              Obj o3
1006          }
1007
1008          .function void ObjTuple.ctor(ObjTuple a0, Obj a1, Obj a2, Obj a3, Obj a4) <ctor> {
1009              lda.obj a1
1010              stobj.obj a0, ObjTuple.o0
1011              lda.obj a2
1012              stobj.obj a0, ObjTuple.o1
1013              lda.obj a3
1014              stobj.obj a0, ObjTuple.o2
1015              lda.obj a4
1016              stobj.obj a0, ObjTuple.o3
1017              return.void
1018          }
1019
1020          .function ObjTuple getObjTuple(Obj a0, Obj a1, Obj a2, Obj a3) {
1021              mov.obj v0, a0
1022              mov.obj v1, a1
1023              mov.obj v2, a2
1024              mov.obj v3, a3
1025              initobj ObjTuple.ctor, v0, v1, v2, v3
1026              return.obj
1027          }
1028
1029          .function i32 main() {
1030              %s
1031              call getObjTuple, v0, v1, v2, v3
1032              sta.obj v4
1033
1034              # check ObjTuple.o0 contains correct value (v0)
1035              ldobj.obj v4, ObjTuple.o0
1036              jeq.obj v0, tuple_2_check_1
1037              ldai 1
1038              return
1039          tuple_2_check_1:
1040              # check ObjTuple.o1 contains correct value (v1)
1041              ldobj.obj v4, ObjTuple.o1
1042              jeq.obj v1, tuple_2_check_2
1043              ldai 1
1044              return
1045          tuple_2_check_2:
1046              # check ObjTuple.o2 contains correct value (v2)
1047              ldobj.obj v4, ObjTuple.o2
1048              jeq.obj v2, tuple_2_check_3
1049              ldai 1
1050              return
1051          tuple_2_check_3:
1052              # check ObjTuple.o3 contains correct value (v3)
1053              ldobj.obj v4, ObjTuple.o3
1054              jne.obj v3, return_ne_num
1055              ldai 0
1056              return
1057          return_ne_num:
1058              ldai 1
1059              return
1060
1061        check-type: no-check
1062        cases:
1063          - values:
1064              - |
1065                #
1066                    mov.null v0
1067                    mov.null v1
1068                    mov.null v2
1069                    mov.null v3
1070          - values:
1071              - |
1072                #
1073                    initobj.short Obj.ctor
1074                    sta.obj v0
1075                    initobj.short Obj.ctor
1076                    sta.obj v1
1077                    initobj.short Obj.ctor
1078                    sta.obj v2
1079                    initobj.short Obj.ctor
1080                    sta.obj v3
1081          - values:
1082              - |
1083                #
1084                    mov.null v0
1085                    initobj.short Obj.ctor
1086                    sta.obj v1
1087                    initobj.short Obj.ctor
1088                    sta.obj v2
1089                    initobj.short Obj.ctor
1090                    sta.obj v3
1091          - values:
1092              - |
1093                #
1094                    initobj.short Obj.ctor
1095                    sta.obj v0
1096                    mov.null v1
1097                    initobj.short Obj.ctor
1098                    sta.obj v2
1099                    initobj.short Obj.ctor
1100                    sta.obj v3
1101          - values:
1102              - |
1103                #
1104                    initobj.short Obj.ctor
1105                    sta.obj v0
1106                    initobj.short Obj.ctor
1107                    sta.obj v1
1108                    mov.null v2
1109                    initobj.short Obj.ctor
1110                    sta.obj v3
1111          - values:
1112              - |
1113                #
1114                    initobj.short Obj.ctor
1115                    sta.obj v0
1116                    initobj.short Obj.ctor
1117                    sta.obj v1
1118                    initobj.short Obj.ctor
1119                    sta.obj v2
1120                    mov.null v3
1121
1122      - file-name: arg_2_str_acc
1123        isa:
1124          instructions:
1125              - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
1126                acc: out:top
1127                format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
1128        description: Check correctness of passed arguments. Load parameter to accumulator. Check String type.
1129        tags: ['irtoc_ignore']
1130        header-template: [panda_string]
1131        code-template: |
1132          .record ObjTuple {
1133              panda.String o1
1134              panda.String o2
1135          }
1136
1137          .function void ObjTuple.ctor(ObjTuple a0, panda.String a1, panda.String a2) <ctor> {
1138              lda.obj a1
1139              stobj.obj a0, ObjTuple.o1
1140              lda.obj a2
1141              stobj.obj a0, ObjTuple.o2
1142              return.void
1143          }
1144
1145          .function ObjTuple getObjTuple(panda.String a0, panda.String a1) {
1146              mov.obj v0, a0
1147              mov.obj v1, a1
1148              initobj.short ObjTuple.ctor, v0, v1
1149              return.obj
1150          }
1151
1152          .function i32 main() {
1153              %s
1154              call getObjTuple, v0, v1
1155              sta.obj v2
1156
1157              # check ObjTuple.o1 contains correct value (v0)
1158              ldobj.obj v2, ObjTuple.o1
1159              jeq.obj v0, tuple_2_check
1160              ldai 1
1161              return
1162          tuple_2_check:
1163              # check ObjTuple.o2 contains correct value (v1)
1164              ldobj.obj v2, ObjTuple.o2
1165              jeq.obj v1, tuple_2_check_passed
1166              ldai 1
1167              return
1168          tuple_2_check_passed:
1169              ldai 0
1170
1171        check-type: no-check
1172        cases:
1173          - values:
1174              - |
1175                #
1176                    mov.null v0
1177                    mov.null v1
1178          - values:
1179              - |
1180                #
1181                    lda.str "some string 1"
1182                    sta.obj v0
1183                    lda.str "some string 2"
1184                    sta.obj v1
1185          - values:
1186              - |
1187                #
1188                    mov.null v0
1189                    lda.str "some string 2"
1190                    sta.obj v1
1191          - values:
1192              - |
1193                #
1194                    lda.str "some string 1"
1195                    sta.obj v0
1196                    mov.null v1
1197
1198
1199      - file-name: method_id_not_static_p
1200        tags: ['verifier']
1201        runner-options: ['verifier-failure', 'verifier-config']
1202        isa:
1203          instructions:
1204            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
1205              acc: out:top
1206              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
1207          verification:
1208            - method_id_static
1209            - method_id_non_abstract
1210        description: Method_id must resolve to a static method in Panda Assembly context. Not static methods should be rejected by verifier.
1211        header-template: []
1212        code-template: |
1213            .record A {}
1214
1215            .function void A.ctor(A a0) <ctor> {
1216                return.void
1217            }
1218
1219            .function i32 A.foo(A a0%s) *s
1220
1221            .function i32 main() {
1222                initobj A.ctor
1223                sta.obj v0
1224                %s
1225                call A.foo, v0%s
1226        check-type: exit-positive
1227        cases:
1228            - values:
1229              - |
1230                {
1231                    ldai 0
1232                    return
1233                }
1234              ignore: true
1235              bugid: ['3247']
1236            - values: ['<noimpl>']
1237              ignore: true
1238              bugid: ['3247']
1239            - values:
1240              - |
1241                <static> {
1242                    ldai 0
1243                    return
1244                }
1245              runner-options: ['verifier-only', 'verifier-config']
1246        template-cases:
1247          - values: ['', '##-', '']
1248          - values: [', A a1', 'mov.obj v1, v0', ', v1']
1249
1250      - file-name: method_id_not_static_j
1251        tags: ['verifier', 'pa-verifier']
1252        bugid: ['6886']
1253        runner-options: [verifier-failure, use-pa, verifier-config]
1254        isa:
1255          instructions:
1256            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
1257              acc: out:top
1258              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
1259          verification:
1260            - method_id_static
1261            - method_id_non_abstract
1262        description: Method_id must resolve to a static method in PandaAssembly context. Not static methods should be rejected by verifier.
1263        header-template: [PandaAssembly]
1264        code-template: |
1265            .record A {}
1266
1267            .function void A.ctor(A a0) <ctor> {
1268                return.void
1269            }
1270
1271            .function i32 A.foo(A a0%s) *s
1272
1273            .function i32 main() {
1274                initobj A.ctor
1275                sta.obj v0
1276                %s
1277                call A.foo, v0%s
1278        check-type: exit-positive
1279        cases:
1280            - values:
1281              - |
1282                {
1283                    ldai 0
1284                    return
1285                }
1286              ignore: true
1287              bugid: ['3247']
1288            - values: ['<noimpl>']
1289              ignore: true
1290              bugid: ['3247']
1291            - values:
1292              - |
1293                <static> {
1294                    ldai 0
1295                    return
1296                }
1297              runner-options: [verifier-only, use-pa, verifier-config]
1298        template-cases:
1299          - values: ['', '##-', '']
1300          - values: [', A a1', 'mov.obj v1, v0', ', v1']
1301
1302      - file-name: method_id_not_static_2_j
1303        tags: ['verifier']
1304        bugid: ['3247']
1305        ignore: true
1306        runner-options: [verifier-failure, use-pa, verifier-config]
1307        isa:
1308          instructions:
1309            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
1310              acc: out:top
1311              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
1312          verification:
1313            - method_id_static
1314            - method_id_non_abstract
1315        description: Method_id must resolve to a static method in PandaAssembly context.
1316        header-template: [PandaAssembly]
1317        code-template: |
1318            .record A {}
1319            .function i32 A.foo(A a0) <noimpl>
1320            %s
1321            .function i32 %s.foo(%s a0) {
1322                ldai 0
1323                return
1324            }
1325
1326            .function i32 main() {
1327                newobj v0, %s
1328                call A.foo, v0
1329
1330        check-type: exit-positive
1331        cases:
1332          - values:
1333              - .record B <panda.extends=A> {}
1334              - B
1335              - B
1336              - B
1337
1338          - values:
1339              - |
1340                .record B <panda.extends=A> {}
1341                .record C <panda.extends=B> {}
1342              - C
1343              - C
1344              - C
1345
1346          - values:
1347              - |
1348                #
1349                .record B <panda.extends=A> {}
1350                .record C <panda.extends=B> {}
1351                .record D <panda.extends=C> {}
1352                .record E <panda.extends=D> {}
1353                .record F <panda.extends=E> {}
1354              - F
1355              - F
1356              - F
1357
1358      - file-name: method_id_abstract
1359        isa:
1360          instructions:
1361            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
1362              acc: out:top
1363              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
1364          verification:
1365            - method_id_static
1366            - method_id_non_abstract
1367        description: Check verifier behavior when 'call' is used with abstract method.
1368        header-template: []
1369        runner-options: [use-pa]
1370        code-template: |
1371            .language PandaAssembly
1372
1373            .record A {}
1374            .function i32 A.foo(A a0) <noimpl>
1375
1376            %s
1377
1378            .function i32 main() {
1379                call %s.foo, v0
1380        check-type: exit-positive
1381        cases:
1382          - values:
1383              - ''
1384              - A
1385            runner-options: [verifier-failure, use-pa, verifier-config]
1386            tags: ['verifier', 'pa-verifier']
1387            bugid: ['3293', '5271', '6886']
1388
1389          - values:
1390              - .record B <panda.extends=A> {}
1391              - B
1392            runner-options: [compile-failure]
1393
1394          - values:
1395              - |
1396                #
1397                .record B <panda.extends=A> {}
1398                .record C <panda.extends=B> {}
1399                .record D <panda.extends=C> {}
1400                .record E <panda.extends=D> {}
1401                .record F <panda.extends=E> {}
1402              - F
1403            runner-options: [compile-failure]
1404
1405      - file-name: amount_of_args
1406        isa:
1407          instructions:
1408              - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
1409                acc: out:top
1410                format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
1411        header-template: []
1412        description: Compiler should check amount of `call.short` argument and function parameters.
1413        code-template: |
1414            .function void f1(i32 a0%s) {
1415                return.void
1416            }
1417            .function i32 main() {
1418                call f1%s
1419        check-type: none
1420        runner-options: [compile-failure]
1421        cases:
1422            - values: ['', '']
1423            - values: [', i32 a1', '']
1424            - values: [', i32 a1', ', v0']
1425            - values: [', i32 a1, i32 a2', '']
1426            - values: [', i32 a1, i32 a2', ', v0']
1427            - values: [', i32 a1, i32 a2', ', v0, v0']
1428            - values: [', i32 a1, i32 a2, i32 a3', '']
1429            - values: [', i32 a1, i32 a2, i32 a3', ', v0']
1430            - values: [', i32 a1, i32 a2, i32 a3', ', v0, v0']
1431            - values: [', i32 a1, i32 a2, i32 a3', ', v0, v0, v0']
1432            - values: [', i32 a1, i32 a2, i32 a3, i32 a4', '']
1433            - values: [', i32 a1, i32 a2, i32 a3, i32 a4', ', v0']
1434            - values: [', i32 a1, i32 a2, i32 a3, i32 a4', ', v0, v0, v0, v0']
1435
1436      - file-name: unused_regs
1437        isa:
1438          description: >
1439            Non-range instructions can be used to pass up to 4 arguments (unused register slot values will
1440            be discarded and corresponding registers will not be passed to the callee).
1441        header-template: []
1442        description: Verifier should ignore unused register slots.
1443        code-template: |
1444            .function i32 foo(%s) {
1445                ldai 0
1446                return
1447            }
1448            .function i32 main() {
1449                %s
1450                call foo%s
1451        check-type: no-check
1452        cases:
1453          - values:
1454            - ""
1455            - ""
1456            - ", v5, v4, v3, v2"
1457          - values:
1458            - "i32 a0"
1459            - |
1460              #
1461                  movi v5, 123
1462            - ", v5, v4, v3"
1463          - values:
1464            - "i64 a0, i32 a1"
1465            - |
1466              #
1467                  movi v2, 1
1468                  movi.64 v6, 123456789
1469            - ", v6, v2, v0"
1470          - values:
1471            - "f64 a0, i64 a1, i32 a2"
1472            - |
1473              #
1474                  movi v7, 1
1475                  movi.64 v0, 123456789
1476                  fmovi.64 v8, 1.1
1477            - ", v8, v0, v7, v9"
1478
1479      - file-name: x_call_j
1480        runner-options: [use-pa]
1481        header-template: [PandaAssembly]
1482        isa:
1483          exceptions:
1484            - x_call
1485        tags: ['irtoc_ignore']
1486        description: Bytecode may throw an error if an exception occures in the called bytecode.
1487        code-template: |
1488          .record panda.Throwable <external>
1489          .record E1 <panda.extends=panda.Throwable> {}
1490          .function void f() {
1491              newobj v0, E1
1492              throw v0
1493              return.void
1494          }
1495          .function i32 main() {
1496              jmp try_begin
1497          catch_E1_block_begin:
1498              ldai 0
1499              return
1500          try_begin:
1501              call f
1502          try_end:
1503          .catch E1, try_begin, try_end, catch_E1_block_begin
1504              ldai 1
1505              return
1506        check-type: none
1507
1508      - file-name: unsupported_types
1509        tags: ['verifier']
1510        runner-options: ['use-pa', 'verifier-failure', 'verifier-config']
1511        isa:
1512          instructions:
1513            - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top
1514              acc: out:top
1515              format: [op_v1_4_v2_4_v3_4_v4_4_id_16]
1516        description: Verifier should report an error on use of unsupported primitive types.
1517        header-template: [PandaAssembly]
1518        bugid: ['7993']
1519        ignore: true
1520        code-template: |
1521          .function u8 f1() {
1522              ldai 0
1523              return
1524          }
1525          .function u32 f2() {
1526              ldai 0
1527              return
1528          }
1529          .function u64 f3() {
1530              ldai.64 0
1531              return.64
1532          }
1533          .function i32 main() {
1534        check-type: exit-positive
1535