1# Copyright (c) 2021 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13--- 14definitions: 15 - name: java 16 template: > 17 .language Java 18 - name: r_A 19 template: | 20 .record A {} 21 22 .function void A.constructor(A a0) <ctor> { 23 return.void 24 } 25 - name: r_B 26 template: | 27 .record B {} 28 29 .function void B.constructor(B a0) <ctor> { 30 return.void 31 } 32 33tests: 34 - file-name: call.virt.range.negative 35 isa: 36 instructions: 37 - sig: call.virt.range method_id, v:in:top 38 acc: out:top 39 format: [op_v_8_id_16] 40 title: Object calls 41 description: > 42 Call indicated object method, i.e. create new frame, pass values of arguments and 43 continue execution from the first instruction of a method. 44 Callee should treat accumulator value as undefined and cannot use it until accumulator 45 definition in the new frame. 46 Result (if any) is returned in accumulator (see 'Calling sequence' chapter for more details). 47 Method, its class and the number of argument is resolved by given method_id in runtime 48 constant-pool based on object reference using language-specific semantics (currently only Java 49 virtual methods are supported, further extensions are TBD). 50 Object reference is passed in the first source register, arguments are passed starting from 51 the second source register in the same order as in method signature. 52 Non-range instructions can be used to pass up to 4 arguments (including object reference). 53 Unused register slot values will be discarded and corresponding registers will not be 54 passed to the callee). 55 For methods with more arguments range kinds of instruction are to be used, which takes 56 the needed number of arguments starting from 'vs' register (including object reference). 57 verification: 58 - method_id_non_static 59 - compatible_arguments 60 - method_id_accessible 61 exceptions: 62 - x_null 63 - x_abstract 64 commands: 65 66 - file-name: wrong_object_1 67 isa: 68 instructions: 69 - sig: call.virt.range method_id, v:in:top 70 acc: out:top 71 format: [op_v_8_id_16] 72 verification: 73 - compatible_arguments 74 header-template: [r_A, r_B] 75 description: Check incorrect usage of `call.virt.range` instruction. First argument is of incorrect type instead of object reference. 76 tags: ['verifier'] 77 bugid: ['5271'] 78 runner-options: ['verifier-failure', 'verifier-debug-config'] 79 code-template: | 80 .function i32 A.foo(A a0%s) { 81 ldai 1 82 return 83 } 84 85 .function i32 main() { 86 %s 87 call.virt.range A.foo%s 88 movi v0, 1 89 jne v0, exit_failure 90 ldai 0 91 return 92 exit_failure: 93 ldai 1 94 return 95 check-type: none 96 cases: 97 - values: 98 - '' 99 - '' 100 - ',' 101 runner-options: [compile-failure] 102 bugid: ['1855'] 103 - values: 104 - '' 105 - 'movi v0, 0' 106 - ', v0' 107 - values: 108 - '' 109 - | 110 # 111 lda.type A 112 sta.obj v0 113 - ', v0' 114 bugid: ['2256'] 115 - values: 116 - '' 117 - | 118 # 119 lda.type B 120 sta.obj v0 121 - ', v0' 122 - values: 123 - '' 124 - 'movi.64 v0, 0' 125 - ', v0' 126 - values: 127 - '' 128 - 'fmovi.64 v0, 0' 129 - ', v0' 130 - values: 131 - '' 132 - | 133 # 134 lda.str "some string" 135 sta.obj v0 136 - ', v0' 137 - values: 138 - '' 139 - | 140 # 141 lda.str "some string" 142 sta.obj v0 143 movi v1, 1 144 - ', v0' 145 - values: 146 - '' 147 - | 148 # 149 lda.str "some string" 150 sta.obj v0 151 movi.64 v1, 1 152 - ', v0' 153 - values: 154 - '' 155 - | 156 # 157 lda.str "some string" 158 sta.obj v0 159 fmovi.64 v1, 1 160 - ', v0' 161 - values: 162 - ', i32 a1' 163 - | 164 # 165 movi v0, 0 166 movi v1, 1 167 - ', v0' 168 - values: 169 - ', i64 a1' 170 - | 171 # 172 movi v0, 0 173 movi.64 v1, 1 174 - ', v0' 175 - values: 176 - ', f64 a1' 177 - | 178 # 179 movi v0, 0 180 fmovi.64 v1, 1.1 181 - ', v0' 182 183 - values: 184 - ', i32 a1' 185 - | 186 # 187 movi.64 v0, 0 188 movi v1, 1 189 - ', v0' 190 - values: 191 - ', i64 a1' 192 - | 193 # 194 movi.64 v0, 0 195 movi.64 v1, 1 196 - ', v0' 197 - values: 198 - ', f64 a1' 199 - | 200 # 201 movi.64 v0, 0 202 fmovi.64 v1, 1.1 203 - ', v0' 204 205 - values: 206 - ', i32 a1' 207 - | 208 # 209 fmovi.64 v0, 0.0 210 movi v1, 1 211 - ', v0' 212 - values: 213 - ', i64 a1' 214 - | 215 # 216 fmovi.64 v0, 0 217 movi.64 v1, 1 218 - ', v0' 219 - values: 220 - ', f64 a1' 221 - | 222 # 223 fmovi.64 v0, 0 224 fmovi.64 v1, 1.1 225 - ', v0' 226 227 - values: 228 - ', i32 a1, f64 a2, i64 a3' 229 - | 230 # 231 fmovi.64 v0, 0.0 232 movi v1, 1 233 fmovi.64 v2, 123.456 234 movi.64 v3, 0x100000000 235 - ', v0' 236 - values: 237 - ', i64 a1, i64[] a2, i64[] a3' 238 - | 239 # 240 fmovi.64 v0, 0 241 movi.64 v1, 1 242 mov.null v2 243 mov.null v3 244 - ', v0' 245 - values: 246 - ', f64[] a1, i64[] a2, i32[] a3' 247 - | 248 # 249 fmovi.64 v0, 0 250 mov.null v1 251 mov.null v2 252 mov.null v3 253 - ', v0' 254 255 - file-name: p_wrong_object_2 256 isa: 257 instructions: 258 - sig: call.virt.range method_id, v:in:top 259 acc: out:top 260 format: [op_v_8_id_16] 261 verification: 262 - compatible_arguments 263 header-template: [r_A, r_B] 264 description: > 265 Check incorrect usage of `call.virt.range` instruction. First argument is a reference to object of incompatible type. 266 Use PandaAssembly language context. 267 runner-options: ['verifier-failure', 'verifier-debug-config'] 268 tags: [verifier] 269 bugid: ['1324'] 270 template-cases: 271 - values: 272 - | 273 %s 274 .function i32 A.foo(A a0%s) { 275 ldai 1 276 return 277 } 278 - values: 279 - | 280 %s 281 ##- %s 282 .function i32 A.foo(A a0) { 283 ldai 1 284 return 285 } 286 code-template: | 287 %s 288 289 .function i32 main() { 290 initobj.short B.constructor 291 sta.obj v0 292 *s 293 call.virt.range A.foo, v0 294 295 check-type: exit-positive 296 cases: 297 - values: 298 - '' 299 - '' 300 - '' 301 - values: 302 - '' 303 - ',i32 a1' 304 - 'movi v1, 0' 305 - values: 306 - '' 307 - ',i32 a1' 308 - 'movi v1, 1' 309 - values: 310 - '' 311 - ', i64 a1' 312 - 'movi.64 v1, 0' 313 - values: 314 - '' 315 - ', i64 a1' 316 - 'movi.64 v1, 0x100000000' 317 - values: 318 - '' 319 - ', f64 a1' 320 - 'fmovi.64 v1, 0' 321 - values: 322 - '' 323 - ', f64 a1' 324 - 'fmovi.64 v1, 1.1' 325 - values: 326 - '.record panda.String <external>' 327 - ', panda.String a1' 328 - | 329 # 330 lda.str "some string" 331 sta.obj v1 332 - values: 333 - '' 334 - ', i32 a1, f64 a2, i64 a3' 335 - | 336 # 337 movi v1, 1 338 fmovi.64 v2, 123.456 339 movi.64 v3, 0x100000000 340 - values: 341 - '' 342 - ', i64 a1, i64[] a2, i64[] a3' 343 - | 344 # 345 movi.64 v1, 1 346 mov.null v2 347 mov.null v3 348 - values: 349 - '' 350 - ', f64[] a1, i64[] a2, i32[] a3' 351 - | 352 # 353 mov.null v1 354 mov.null v2 355 mov.null v3 356 357 - file-name: arg_types_1 358 isa: 359 instructions: 360 - sig: call.virt.range method_id, v:in:top 361 acc: out:top 362 format: [op_v_8_id_16] 363 verification: 364 - compatible_arguments 365 header-template: [r_A] 366 description: > 367 Verifier should report when register type does not match function argument type. 368 code-template: | 369 .record panda.Object <external> 370 .record panda.String <external> 371 .function void A.func(A a0, %s) { 372 return.void 373 } 374 375 .function i32 main() { 376 initobj A.constructor 377 sta.obj v0 378 *s 379 call.virt.range A.func, v0 380 template-cases: 381 - values: 382 - 'i32 a1' 383 exclude: [i32] 384 - values: 385 - 'i64 a1' 386 exclude: [i64] 387 - values: 388 - 'f64 a1' 389 exclude: [f64] 390 - values: 391 - 'i32[] a1' 392 exclude: [i32arr] 393 - values: 394 - 'i64[] a1' 395 exclude: [i64arr] 396 - values: 397 - 'f64[] a1' 398 exclude: [f64arr] 399 - values: 400 - 'panda.String a1' 401 exclude: [str] 402 - values: 403 - 'panda.String[] a1' 404 exclude: [strarr] 405 - values: 406 - 'panda.Object a1' 407 exclude: [obj, objarr, i32arr, i64arr, f64arr, str, strarr] 408 - values: 409 - 'panda.Object[] a1' 410 exclude: [objarr, strarr] 411 412 check-type: exit-positive 413 bugid: ['1324'] 414 tags: [verifier] 415 runner-options: ['verifier-failure', 'verifier-debug-config'] 416 cases: 417 - values: 418 - | 419 # 420 movi v1, 0 421 id: i32 422 - values: 423 - | 424 # 425 movi v1, 1 426 id: i32 427 - values: 428 - | 429 # 430 movi.64 v1, 0 431 id: i64 432 - values: 433 - | 434 # 435 movi.64 v1, 1 436 id: i64 437 - values: 438 - | 439 # 440 fmovi.64 v1, 0 441 id: f64 442 - values: 443 - | 444 # 445 fmovi.64 v1, 3.1415926535 446 id: f64 447 - values: 448 - | 449 # 450 movi v1, 123 451 newarr v1, v1, i32[] 452 id: i32arr 453 - values: 454 - | 455 # 456 movi v1, 123 457 newarr v1, v1, i64[] 458 id: i64arr 459 - values: 460 - | 461 # 462 movi v1, 123 463 newarr v1, v1, f64[] 464 id: f64arr 465 - values: 466 - | 467 # 468 lda.str "some string" 469 sta.obj v1 470 id: str 471 - values: 472 - | 473 # 474 movi v1, 123 475 newarr v1, v1, panda.String[] 476 id: strarr 477 - values: 478 - | 479 # 480 newobj v1, panda.Object 481 id: obj 482 - values: 483 - | 484 # 485 movi v1, 123 486 newarr v1, v1, panda.Object[] 487 id: objarr 488 489 - file-name: arg_types_2 490 isa: 491 instructions: 492 - sig: call.virt.range method_id, v:in:top 493 acc: out:top 494 format: [op_v_8_id_16] 495 verification: 496 - compatible_arguments 497 header-template: [r_A] 498 description: > 499 Verifier should report when register type does not match function argument type. 500 code-template: | 501 # Defenitions for all set of tests 502 .record panda.String <external> 503 .record panda.Object <external> 504 505 .function void A.func(A a0, %s) { 506 return.void 507 } 508 509 .function i32 main() { 510 initobj A.constructor 511 sta.obj v0 512 *s 513 call.virt.range A.func, v0 514 template-cases: 515 - values: 516 - 'i32 a1, i32 a2' 517 - values: 518 - 'f64 a1, f64 a2' 519 - values: 520 - 'i64 a1, i64 a2' 521 - values: 522 - 'i32[] a1, i32[] a2' 523 - values: 524 - 'i64[] a1, i64[] a2' 525 - values: 526 - 'f64[] a1, f64[] a2' 527 - values: 528 - 'panda.String a1, panda.String a2' 529 - values: 530 - 'panda.String[] a1, panda.String[] a2' 531 exclude: [6] 532 - values: 533 - 'panda.Object a1, panda.Object a2' 534 exclude: [2, 3, 4, 5, 6, 7, 9] 535 - values: 536 - 'panda.Object[] a1, panda.Object[] a2' 537 exclude: [6, 7, 9] 538 check-type: exit-positive 539 bugid: ['1324'] 540 tags: [verifier] 541 runner-options: ['verifier-failure', 'verifier-debug-config'] 542 cases: 543 - values: 544 - | 545 # 546 movi v1, 1 547 fmovi.64 v2, 3.1415926535 548 - values: 549 - | 550 # 551 movi.64 v1, 0 552 movi v2, 123 553 newarr v2, v2, i32[] 554 - values: 555 - | 556 # 557 movi v1, 123 558 newarr v1, v1, i32[] 559 movi v2, 321 560 newarr v2, v2, i64[] 561 id: 2 562 - values: 563 - | 564 # 565 movi v1, 123 566 newarr v1, v1, i64[] 567 lda.str "some string" 568 sta.obj v2 569 id: 3 570 - values: 571 - | 572 # 573 movi v1, 123 574 newarr v1, v1, f64[] 575 lda.str "some string" 576 sta.obj v2 577 id: 4 578 - values: 579 - | 580 # 581 lda.str "some string" 582 sta.obj v1 583 movi v2, 123 584 newarr v2, v2, panda.String[] 585 id: 5 586 - values: 587 - | 588 # 589 movi v1, 123 590 newarr v1, v1, panda.String[] 591 mov.null v2 592 id: 6 593 - values: 594 - | 595 # 596 mov.null v1 597 movi v2,123 598 newarr v2, v2, panda.Object[] 599 id: 7 600 - values: 601 - | 602 # 603 movi v1, 123 604 newarr v1, v1, panda.String[] 605 fmovi.64 v2, 3.1415926535 606 - values: 607 - | 608 # 609 movi v1, 123 610 newarr v1, v1, panda.Object[] 611 movi v2, 321 612 newarr v2, v2, panda.Object[] 613 id: 9 614 615 - file-name: arg_types_3 616 isa: 617 instructions: 618 - sig: call.virt.range method_id, v:in:top 619 acc: out:top 620 format: [op_v_8_id_16] 621 verification: 622 - compatible_arguments 623 header-template: [r_A] 624 description: > 625 Verifier should report when register type does not match function argument type. 626 code-template: | 627 # Defenitions for all set of tests 628 .record panda.String <external> 629 .record panda.Object <external> 630 631 .function void A.func(A a0, %s) { 632 return.void 633 } 634 635 .function i32 main() { 636 initobj A.constructor 637 sta.obj v0 638 *s 639 call.virt.range A.func, v0 640 template-cases: 641 - values: 642 - 'i32 a1, i32 a2, i32 a3' 643 - values: 644 - 'f64 a1, f64 a2, f64 a3' 645 - values: 646 - 'i64 a1, i64 a2, i64 a3' 647 - values: 648 - 'i32[] a1, i32[] a2, i32[] a3' 649 - values: 650 - 'i64[] a1, i64[] a2, i64[] a3' 651 - values: 652 - 'f64[] a1, f64[] a2, f64[] a3' 653 - values: 654 - 'panda.String a1, panda.String a2, panda.String a3' 655 - values: 656 - 'panda.String[] a1, panda.String[] a2, panda.String[] a3' 657 - values: 658 - 'panda.Object a1, panda.Object a2, panda.Object a3' 659 exclude: [2, 3, 4, 5] 660 - values: 661 - 'panda.Object[] a1, panda.Object[] a2, panda.Object[] a3' 662 663 check-type: exit-positive 664 bugid: ['1324'] 665 tags: [verifier] 666 runner-options: ['verifier-failure', 'verifier-debug-config'] 667 cases: 668 - values: 669 - | 670 # 671 movi v1, 1 672 fmovi.64 v2, 3.1415926535 673 movi v3, 1 674 - values: 675 - | 676 # 677 movi.64 v1, 0 678 movi v2, 123 679 newarr v2, v2, i32[] 680 movi v3, 123 681 newarr v3, v3, i32[] 682 - values: 683 - | 684 # 685 movi v1, 123 686 newarr v1, v1, i32[] 687 movi v2, 321 688 newarr v2, v2, i64[] 689 movi v3, 123 690 newarr v3, v3, i32[] 691 id: 2 692 - values: 693 - | 694 # 695 movi v1, 123 696 newarr v1, v1, i64[] 697 lda.str "some string" 698 sta.obj v2 699 lda.str "some string" 700 sta.obj v3 701 id: 3 702 - values: 703 - | 704 # 705 movi v1, 123 706 newarr v1, v1, f64[] 707 lda.str "some string" 708 sta.obj v2 709 movi v3, 123 710 newarr v3, v3, f64[] 711 id: 4 712 - values: 713 - | 714 # 715 lda.str "some string" 716 sta.obj v1 717 movi v2, 123 718 newarr v2, v2, panda.String[] 719 movi v3, 123 720 newarr v3, v3, panda.String[] 721 id: 5 722 - values: 723 - | 724 # 725 movi v1, 123 726 newarr v1, v1, panda.String[] 727 mov.null v2 728 fmovi.64 v3, 3.1415926535 729 - values: 730 - | 731 # 732 mov.null v1 733 movi v2,123 734 newarr v2, v2, panda.Object[] 735 fmovi.64 v3, 3.1415926535 736 id: f64arr 737 - values: 738 - | 739 # 740 movi v1, 123 741 newarr v1, v1, panda.String[] 742 fmovi.64 v2, 3.1415926535 743 movi v3, 123 744 newarr v3, v3, f64[] 745 - values: 746 - | 747 # 748 movi v1, 123 749 newarr v1, v1, panda.Object[] 750 movi v3, 123 751 newarr v3, v3, f64[] 752 - values: 753 - | 754 # 755 movi v1, 123 756 newarr v1, v1, panda.Object[][] 757 movi v3, 123 758 newarr v3, v3, f64[][] 759 - values: 760 - | 761 # 762 movi v1, 123 763 newarr v1, v1, panda.Object[][][] 764 movi v3, 123 765 newarr v3, v3, f64[][][] 766 767 - file-name: acc_uninitialized 768 isa: 769 instructions: 770 - sig: call.virt.range method_id, v:in:top 771 acc: out:top 772 format: [op_v_8_id_16] 773 header-template: [r_A] 774 description: > 775 Verifier should report that uninitialized accumulator is used in function. 776 check-type: exit-positive 777 bugid: ['1324'] 778 tags: [verifier] 779 runner-options: ['verifier-failure', 'verifier-debug-config'] 780 code-template: | 781 .function void A.func(A a0) { 782 %s 783 return.void 784 } 785 786 .function i32 main() { 787 initobj A.constructor 788 sta.obj v0 789 call.virt.range A.func, v0 790 cases: 791 - values: 792 - sta v0 793 - values: 794 - sta.64 v0 795 - values: 796 - sta.obj v0 797 798 - file-name: reg_uninitialized 799 isa: 800 instructions: 801 - sig: call.virt.range method_id, v:in:top 802 acc: out:top 803 format: [op_v_8_id_16] 804 header-template: [r_A] 805 description: > 806 Verifier should report that uninitialized register is used in function. 807 check-type: exit-positive 808 bugid: ['1324'] 809 tags: [verifier] 810 runner-options: ['verifier-failure', 'verifier-debug-config'] 811 code-template: | 812 .function void A.func(A a0) { 813 %s 814 return.void 815 } 816 817 .function i32 main() { 818 initobj A.constructor 819 sta.obj v0 820 call.virt.range A.func, v0 821 template-cases: 822 - values: 823 - lda %s 824 exclude: [r16] 825 - values: 826 - lda.64 %s 827 exclude: [r16] 828 - values: 829 - lda.obj %s 830 exclude: [r16] 831 - values: 832 - mov v0, %s 833 cases: 834 - values: [v0] 835 - values: [v1] 836 - values: [v128] 837 - values: [v255] 838 - values: [v256] 839 id: r16 840 - values: [v32768] 841 id: r16 842 - values: [v65535] 843 id: r16 844 845 - file-name: p_method_id_accessible 846 isa: 847 instructions: 848 - sig: call.virt.range method_id, v:in:top 849 acc: out:top 850 format: [op_v_8_id_16] 851 verification: 852 - method_id_accessible 853 header-template: [r_A] 854 description: > 855 Verifier should report that method is not accessible if method_id is not resolved to existing method. Use PandaAssembly language context. 856 check-type: exit-positive 857 tags: [verifier] 858 runner-options: ['verifier-failure', 'verifier-debug-config'] 859 code-template: | 860 .function %s A.func(A a0, *s a1) <external> 861 862 .function i32 main() { 863 initobj A.constructor 864 sta.obj v0 865 *s 866 call.virt.range A.func, v0 867 template-cases: 868 - values: 869 - 'void' 870 - values: 871 - 'i32' 872 exclude: [void] 873 - values: 874 - 'i64' 875 exclude: [void] 876 - values: 877 - 'f64' 878 exclude: [void] 879 - values: 880 - 'i32[]' 881 exclude: [void] 882 - values: 883 - 'i64[]' 884 exclude: [void] 885 - values: 886 - 'f64[]' 887 exclude: [void] 888 - values: 889 - 'A' 890 exclude: [void] 891 - values: 892 - 'A[]' 893 exclude: [void] 894 cases: 895 - case-template: | 896 .function void A.func(A a0) <external> 897 898 .function i32 main() { 899 initobj A.constructor 900 sta.obj v0 901 call.virt.range A.func, v0 902 id: void 903 - values: ['i32', 'movi v1, 12345678'] 904 - values: ['i64', 'movi.64 v1, 0x123456789ABCDEF'] 905 - values: ['f64', 'fmovi.64 v1, 3.1415926535'] 906 - values: 907 - 'i32[]' 908 - | 909 # 910 movi v1, 123 911 newarr v1, v1, i32[] 912 - values: 913 - 'i64[]' 914 - | 915 # 916 movi v1, 123 917 newarr v1, v1, i64[] 918 - values: 919 - 'f64[]' 920 - | 921 # 922 movi v1, 123 923 newarr v1, v1, f64[] 924 - values: 925 - 'A' 926 - | 927 # 928 initobj A.constructor 929 sta.obj v1 930 - values: 931 - 'A[]' 932 - | 933 # 934 movi v1, 123 935 newarr v1, v1, A[] 936 937 - file-name: p_method_id_non_static 938 bugid: ['1324', '2374'] 939 isa: 940 instructions: 941 - sig: call.virt.range method_id, v:in:top 942 acc: out:top 943 format: [op_v_8_id_16] 944 verification: 945 - method_id_non_static 946 header-template: [r_A] 947 description: > 948 Verifier should report that method is not accessible if method_id is not resolved to existing method. Use PandaAssembly language context. 949 check-type: exit-positive 950 tags: [verifier] 951 runner-options: ['verifier-failure', 'verifier-debug-config'] 952 code-template: | 953 .function %s A.func(A a0, *s a1) <static> { 954 %s 955 } 956 957 .function i32 main() { 958 initobj A.constructor 959 sta.obj v0 960 *s 961 call.virt.range A.func, v0 962 template-cases: 963 - values: 964 - 'void' 965 - 'return.void' 966 - values: 967 - 'i32' 968 - | 969 # 970 ldai 1 971 return 972 exclude: [void] 973 - values: 974 - 'i64' 975 - | 976 # 977 ldai.64 1 978 return.64 979 exclude: [void] 980 - values: 981 - 'f64' 982 - | 983 # 984 fldai.64 3.1415926535 985 return.64 986 exclude: [void] 987 - values: 988 - 'i32[]' 989 - | 990 # 991 movi v1, 123 992 newarr v1, v1, i32[] 993 lda.obj v1 994 return.obj 995 exclude: [void] 996 - values: 997 - 'i64[]' 998 - | 999 # 1000 movi v1, 123 1001 newarr v1, v1, i64[] 1002 lda.obj v1 1003 return.obj 1004 exclude: [void] 1005 - values: 1006 - 'f64[]' 1007 - | 1008 # 1009 movi v1, 123 1010 newarr v1, v1, f64[] 1011 lda.obj v1 1012 return.obj 1013 exclude: [void] 1014 - values: 1015 - 'A' 1016 - | 1017 # 1018 initobj A.constructor 1019 sta.obj v1 1020 return.obj 1021 - values: 1022 - 'A[]' 1023 - | 1024 # 1025 movi v1, 123 1026 newarr v1, v1, A[] 1027 lda.obj v1 1028 return.obj 1029 cases: 1030 - case-template: | 1031 .function void A.func(A a0) <static> { 1032 return.void 1033 } 1034 1035 .function i32 main() { 1036 initobj A.constructor 1037 sta.obj v0 1038 call.virt.range A.func, v0 1039 id: void 1040 - values: ['i32', 'movi v1, 12345678'] 1041 - values: ['i64', 'movi.64 v1, 0x123456789ABCDEF'] 1042 - values: ['f64', 'fmovi.64 v1, 3.1415926535'] 1043 - values: 1044 - 'i32[]' 1045 - | 1046 # 1047 movi v1, 123 1048 newarr v1, v1, i32[] 1049 - values: 1050 - 'i64[]' 1051 - | 1052 # 1053 movi v1, 123 1054 newarr v1, v1, i64[] 1055 - values: 1056 - 'f64[]' 1057 - | 1058 # 1059 movi v1, 123 1060 newarr v1, v1, f64[] 1061 - values: 1062 - 'A' 1063 - | 1064 # 1065 initobj A.constructor 1066 sta.obj v1 1067 - values: 1068 - 'A[]' 1069 - | 1070 # 1071 movi v1, 123 1072 newarr v1, v1, A[] 1073 1074 - file-name: match_parameters_amount 1075 isa: 1076 instructions: 1077 - sig: call.virt.range method_id, v:in:top 1078 acc: out:top 1079 format: [op_v_8_id_16] 1080 header-template: [r_A] 1081 description: > 1082 Compiler should check amount of function parameters with corresponding call.virt.range. 1083 check-type: none 1084 runner-options: ['verifier-failure', 'verifier-debug-config'] 1085 tags: [verifier] 1086 code-template: | 1087 1088 .function void A.func(A a0, i32 a1%s) <external> 1089 1090 .function i32 main() { 1091 call.virt.range A.func, v0 1092 cases: 1093 - values: ['', ''] 1094 - values: [', i32 a2', ', v1'] 1095 - values: [', i32 a2, i32 a3', ', v1'] 1096 - values: [', i32 a2, i32 a3', ', v1, v1'] 1097 - values: [', i32 a2, i32 a3, i32 a4', ', v1'] 1098 - values: [', i32 a2, i32 a3, i32 a4', ', v1, v1'] 1099 - values: [', i32 a2, i32 a3, i32 a4', ', v1, v1, v1'] 1100 - values: [', i32 a2, i32 a3, i32 a4', ', v1, v1, v1, v1'] 1101