1# Copyright (c) 2021-2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13--- 14definitions: 15 - name: PandaAssembly 16 template: > 17 .language PandaAssembly 18 19tests: 20 - file-name: call.range 21 isa: 22 title: Static call 23 description: > 24 Call indicated static method, i.e. create new frame, pass values of arguments and 25 continue execution from the first instruction of a method. 26 Callee should treat accumulator value as undefined and cannot use it until accumulator 27 definition in the new frame. 28 Result (if any) is returned in accumulator (see 'Calling sequence' chapter for more details). 29 Method, its class and the number of argument is resolved by given method_id in 30 runtime constant-pool. 31 Arguments are passed in source registers in the same order as in method signature. 32 Non-range instructions can be used to pass up to 4 arguments (unused register slot values will 33 be discarded and corresponding registers will not be passed to the callee). 34 For methods with more arguments range kind of instruction is to be used, which takes the needed number 35 of arguments starting from 'vs' register. 36 verification: 37 - method_id_static 38 - compatible_arguments 39 40 commands: 41 - file-name: op_v_8_id_32_args 42 isa: 43 instructions: 44 - sig: call.range method_id, v:in:top 45 acc: out:top 46 format: [op_v_8_id_16] 47 header-template: [] 48 description: Check that 'call.range' invokes function with different amount of args. 49 tags: ['tsan'] 50 code-template: | 51 .function void f1(%s) { 52 return.void 53 } 54 .function i32 main() { 55 %s 56 call.range f1, v0 57 check-type: exit-positive 58 cases: 59 - values: ['', ''] 60 - values: 61 - 'i32 a0' 62 - 'movi v0, 0' 63 - values: 64 - 'i32 a0, i32 a1' 65 - | 66 # 67 movi v0, 0 68 movi v1, 0 69 70 - values: 71 - 'i32 a0, i32 a1, i32 a2, i32 a3' 72 - | 73 # 74 movi v0, 0 75 movi v1, 0 76 movi v2, 0 77 movi v3, 0 78 - values: 79 - '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, i32 a16, i32 a17, i32 a18, i32 a19, i32 a20, i32 a21, i32 a22, i32 a23, i32 a24, i32 a25, i32 a26, i32 a27, i32 a28, i32 a29, i32 a30, i32 a31, i32 a32, i32 a33, i32 a34, i32 a35, i32 a36, i32 a37, i32 a38, i32 a39, i32 a40, i32 a41, i32 a42, i32 a43, i32 a44, i32 a45, i32 a46, i32 a47, i32 a48, i32 a49, i32 a50, i32 a51, i32 a52, i32 a53, i32 a54, i32 a55, i32 a56, i32 a57, i32 a58, i32 a59, i32 a60, i32 a61, i32 a62, i32 a63, i32 a64, i32 a65, i32 a66, i32 a67, i32 a68, i32 a69, i32 a70, i32 a71, i32 a72, i32 a73, i32 a74, i32 a75, i32 a76, i32 a77, i32 a78, i32 a79, i32 a80, i32 a81, i32 a82, i32 a83, i32 a84, i32 a85, i32 a86, i32 a87, i32 a88, i32 a89, i32 a90, i32 a91, i32 a92, i32 a93, i32 a94, i32 a95, i32 a96, i32 a97, i32 a98, i32 a99, i32 a100, i32 a101, i32 a102, i32 a103, i32 a104, i32 a105, i32 a106, i32 a107, i32 a108, i32 a109, i32 a110, i32 a111, i32 a112, i32 a113, i32 a114, i32 a115, i32 a116, i32 a117, i32 a118, i32 a119, i32 a120, i32 a121, i32 a122, i32 a123, i32 a124, i32 a125, i32 a126, i32 a127, i32 a128, i32 a129, i32 a130, i32 a131, i32 a132, i32 a133, i32 a134, i32 a135, i32 a136, i32 a137, i32 a138, i32 a139, i32 a140, i32 a141, i32 a142, i32 a143, i32 a144, i32 a145, i32 a146, i32 a147, i32 a148, i32 a149, i32 a150, i32 a151, i32 a152, i32 a153, i32 a154, i32 a155, i32 a156, i32 a157, i32 a158, i32 a159, i32 a160, i32 a161, i32 a162, i32 a163, i32 a164, i32 a165, i32 a166, i32 a167, i32 a168, i32 a169, i32 a170, i32 a171, i32 a172, i32 a173, i32 a174, i32 a175, i32 a176, i32 a177, i32 a178, i32 a179, i32 a180, i32 a181, i32 a182, i32 a183, i32 a184, i32 a185, i32 a186, i32 a187, i32 a188, i32 a189, i32 a190, i32 a191, i32 a192, i32 a193, i32 a194, i32 a195, i32 a196, i32 a197, i32 a198, i32 a199, i32 a200, i32 a201, i32 a202, i32 a203, i32 a204, i32 a205, i32 a206, i32 a207, i32 a208, i32 a209, i32 a210, i32 a211, i32 a212, i32 a213, i32 a214, i32 a215, i32 a216, i32 a217, i32 a218, i32 a219, i32 a220, i32 a221, i32 a222, i32 a223, i32 a224, i32 a225, i32 a226, i32 a227, i32 a228, i32 a229, i32 a230, i32 a231, i32 a232, i32 a233, i32 a234, i32 a235, i32 a236, i32 a237, i32 a238, i32 a239, i32 a240, i32 a241, i32 a242, i32 a243, i32 a244, i32 a245, i32 a246, i32 a247, i32 a248, i32 a249, i32 a250, i32 a251, i32 a252, i32 a253, i32 a254, i32 a255' 80 - '' 81 runner-options: [compile-only] 82 - values: 83 - '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, i32 a16, i32 a17, i32 a18, i32 a19, i32 a20, i32 a21, i32 a22, i32 a23, i32 a24, i32 a25, i32 a26, i32 a27, i32 a28, i32 a29, i32 a30, i32 a31, i32 a32, i32 a33, i32 a34, i32 a35, i32 a36, i32 a37, i32 a38, i32 a39, i32 a40, i32 a41, i32 a42, i32 a43, i32 a44, i32 a45, i32 a46, i32 a47, i32 a48, i32 a49, i32 a50, i32 a51, i32 a52, i32 a53, i32 a54, i32 a55, i32 a56, i32 a57, i32 a58, i32 a59, i32 a60, i32 a61, i32 a62, i32 a63, i32 a64, i32 a65, i32 a66, i32 a67, i32 a68, i32 a69, i32 a70, i32 a71, i32 a72, i32 a73, i32 a74, i32 a75, i32 a76, i32 a77, i32 a78, i32 a79, i32 a80, i32 a81, i32 a82, i32 a83, i32 a84, i32 a85, i32 a86, i32 a87, i32 a88, i32 a89, i32 a90, i32 a91, i32 a92, i32 a93, i32 a94, i32 a95, i32 a96, i32 a97, i32 a98, i32 a99, i32 a100, i32 a101, i32 a102, i32 a103, i32 a104, i32 a105, i32 a106, i32 a107, i32 a108, i32 a109, i32 a110, i32 a111, i32 a112, i32 a113, i32 a114, i32 a115, i32 a116, i32 a117, i32 a118, i32 a119, i32 a120, i32 a121, i32 a122, i32 a123, i32 a124, i32 a125, i32 a126, i32 a127, i32 a128, i32 a129, i32 a130, i32 a131, i32 a132, i32 a133, i32 a134, i32 a135, i32 a136, i32 a137, i32 a138, i32 a139, i32 a140, i32 a141, i32 a142, i32 a143, i32 a144, i32 a145, i32 a146, i32 a147, i32 a148, i32 a149, i32 a150, i32 a151, i32 a152, i32 a153, i32 a154, i32 a155, i32 a156, i32 a157, i32 a158, i32 a159, i32 a160, i32 a161, i32 a162, i32 a163, i32 a164, i32 a165, i32 a166, i32 a167, i32 a168, i32 a169, i32 a170, i32 a171, i32 a172, i32 a173, i32 a174, i32 a175, i32 a176, i32 a177, i32 a178, i32 a179, i32 a180, i32 a181, i32 a182, i32 a183, i32 a184, i32 a185, i32 a186, i32 a187, i32 a188, i32 a189, i32 a190, i32 a191, i32 a192, i32 a193, i32 a194, i32 a195, i32 a196, i32 a197, i32 a198, i32 a199, i32 a200, i32 a201, i32 a202, i32 a203, i32 a204, i32 a205, i32 a206, i32 a207, i32 a208, i32 a209, i32 a210, i32 a211, i32 a212, i32 a213, i32 a214, i32 a215, i32 a216, i32 a217, i32 a218, i32 a219, i32 a220, i32 a221, i32 a222, i32 a223, i32 a224, i32 a225, i32 a226, i32 a227, i32 a228, i32 a229, i32 a230, i32 a231, i32 a232, i32 a233, i32 a234, i32 a235, i32 a236, i32 a237, i32 a238, i32 a239, i32 a240, i32 a241, i32 a242, i32 a243, i32 a244, i32 a245, i32 a246, i32 a247, i32 a248, i32 a249, i32 a250, i32 a251, i32 a252, i32 a253, i32 a254, i32 a255, i32 a256' 84 - '' 85 runner-options: [compile-only] 86 87 - file-name: str_args 88 isa: 89 instructions: 90 - sig: call.range method_id, v:in:top 91 acc: out:top 92 format: [op_v_8_id_16] 93 header-template: [panda_string] 94 description: Check that 'call.range' works with String object. 95 tags: ['tsan'] 96 code-template: | 97 .function void f1(panda.String a0) { 98 return.void 99 } 100 .function i32 main() { 101 %s 102 call.range f1%s 103 check-type: exit-positive 104 cases: 105 - values: 106 - '' 107 - '' 108 runner-options: [compile-failure] 109 - values: 110 - | 111 # 112 lda.str "some string" 113 sta.obj v0 114 - ', v0' 115 - values: 116 - ' mov.null v0' 117 - ', v0' 118 - values: 119 - '' 120 - ', "some string"' 121 runner-options: [compile-failure] 122 123 - file-name: reg 124 isa: 125 instructions: 126 - sig: call.range method_id, v:in:top 127 acc: out:top 128 format: [op_v_8_id_16] 129 header-template: [] 130 description: Check 'call.range' available register number width. 131 code-template: | 132 .function void f1() { 133 return.void 134 } 135 .function i32 main() { 136 call.range f1, %s 137 check-type: exit-positive 138 cases: 139 - values: 140 - 'v0' 141 - values: 142 - 'v1' 143 - values: 144 - 'v127' 145 - values: 146 - 'v255' 147 - values: 148 - 'v256' 149 runner-options: [compile-failure] 150 - values: 151 - '0' 152 runner-options: [compile-failure] 153 - values: 154 - '0x7fffffff' 155 runner-options: [compile-failure] 156 - values: 157 - '1.1' 158 runner-options: [compile-failure] 159 - values: 160 - '"some string"' 161 runner-options: [compile-failure] 162 - case-template: | 163 .function void f1(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, i32 a16, i32 a17, i32 a18, i32 a19, i32 a20, i32 a21, i32 a22, i32 a23, i32 a24, i32 a25, i32 a26, i32 a27, i32 a28, i32 a29, i32 a30, i32 a31, i32 a32, i32 a33, i32 a34, i32 a35, i32 a36, i32 a37, i32 a38, i32 a39, i32 a40, i32 a41, i32 a42, i32 a43, i32 a44, i32 a45, i32 a46, i32 a47, i32 a48, i32 a49, i32 a50, i32 a51, i32 a52, i32 a53, i32 a54, i32 a55, i32 a56, i32 a57, i32 a58, i32 a59, i32 a60, i32 a61, i32 a62, i32 a63, i32 a64, i32 a65, i32 a66, i32 a67, i32 a68, i32 a69, i32 a70, i32 a71, i32 a72, i32 a73, i32 a74, i32 a75, i32 a76, i32 a77, i32 a78, i32 a79, i32 a80, i32 a81, i32 a82, i32 a83, i32 a84, i32 a85, i32 a86, i32 a87, i32 a88, i32 a89, i32 a90, i32 a91, i32 a92, i32 a93, i32 a94, i32 a95, i32 a96, i32 a97, i32 a98, i32 a99, i32 a100, i32 a101, i32 a102, i32 a103, i32 a104, i32 a105, i32 a106, i32 a107, i32 a108, i32 a109, i32 a110, i32 a111, i32 a112, i32 a113, i32 a114, i32 a115, i32 a116, i32 a117, i32 a118, i32 a119, i32 a120, i32 a121, i32 a122, i32 a123, i32 a124, i32 a125, i32 a126, i32 a127, i32 a128, i32 a129, i32 a130, i32 a131, i32 a132, i32 a133, i32 a134, i32 a135, i32 a136, i32 a137, i32 a138, i32 a139, i32 a140, i32 a141, i32 a142, i32 a143, i32 a144, i32 a145, i32 a146, i32 a147, i32 a148, i32 a149, i32 a150, i32 a151, i32 a152, i32 a153, i32 a154, i32 a155, i32 a156, i32 a157, i32 a158, i32 a159, i32 a160, i32 a161, i32 a162, i32 a163, i32 a164, i32 a165, i32 a166, i32 a167, i32 a168, i32 a169, i32 a170, i32 a171, i32 a172, i32 a173, i32 a174, i32 a175, i32 a176, i32 a177, i32 a178, i32 a179, i32 a180, i32 a181, i32 a182, i32 a183, i32 a184, i32 a185, i32 a186, i32 a187, i32 a188, i32 a189, i32 a190, i32 a191, i32 a192, i32 a193, i32 a194, i32 a195, i32 a196, i32 a197, i32 a198, i32 a199, i32 a200, i32 a201, i32 a202, i32 a203, i32 a204, i32 a205, i32 a206, i32 a207, i32 a208, i32 a209, i32 a210, i32 a211, i32 a212, i32 a213, i32 a214, i32 a215, i32 a216, i32 a217, i32 a218, i32 a219, i32 a220, i32 a221, i32 a222, i32 a223, i32 a224, i32 a225, i32 a226, i32 a227, i32 a228, i32 a229, i32 a230, i32 a231, i32 a232, i32 a233, i32 a234, i32 a235, i32 a236, i32 a237, i32 a238, i32 a239, i32 a240, i32 a241, i32 a242, i32 a243, i32 a244, i32 a245, i32 a246, i32 a247, i32 a248, i32 a249, i32 a250, i32 a251, i32 a252, i32 a253, i32 a254, i32 a255, i32 a256) { 164 return.void 165 } 166 .function i32 main() { 167 call.range f1, v255 168 runner-options: [compile-only] 169 170 - file-name: uninitialized_values 171 bugid: ['1324'] 172 tags: ['verifier'] 173 runner-options: ['verifier-failure', 'verifier-config'] 174 isa: 175 instructions: 176 - sig: call.range method_id, v:in:top 177 acc: out:top 178 format: [op_v_8_id_16] 179 description: Verifier should check usage of uninitialized arguments passed to function. 180 header-template: [] 181 code-template: | 182 .function void f1(%s) { 183 %s 184 return.void 185 } 186 .function i32 main() { 187 %s 188 call.range f1%s 189 check-type: exit-positive 190 191 # Template parameters: 192 # 1st argument is function arguments 193 # 2nd - usage of acc or reg 194 # 3rd - possible initialization of registers 195 # 4th - call parameters 196 cases: 197 - values: ['i32 a0', '', '', ', v0'] 198 - values: ['i32 a0, i32 a1, i32 a2, i32 a3', '', '', ', v0'] 199 - values: ['i32 a0, f64 a1, i64 a2, i32 a3', '', '', ', v0'] 200 - values: ['i32 a0, i32 a1', '', 'movi v0, 0', ', v0'] 201 description: Check if several registers in 'call.range' is uninitialized. 202 - values: ['i32 a0, f64 a1, i64 a2, i32 a3', '', 'movi v0, 0', ', v0'] 203 description: Check if several registers in 'call.range' is uninitialized. 204 - values: 205 - '' 206 - | 207 # 208 lda a3 209 lda a4 210 - '' 211 - '' 212 description: Check usage of undefined parameter. 213 runner-options: [compile-failure] 214 215 - file-name: uninitialized_reg_no_arg 216 bugid: ['1324'] 217 tags: ['verifier'] 218 runner-options: ['verifier-failure', 'verifier-config'] 219 isa: 220 instructions: 221 - sig: call.range method_id, v:in:top 222 acc: out:top 223 format: [op_v_8_id_16] 224 description: Verifier should check usage of uninitialized registers in function. 225 header-template: [] 226 code-template: | 227 .function void f1() { 228 %s 229 return.void 230 } 231 .function i32 main() { 232 %s 233 movi v2, 0 234 call.range f1, v2 235 check-type: exit-positive 236 cases: 237 - values: 238 - lda v0 239 - movi v0, 123 240 - values: 241 - lda v1 242 - movi v1, 123 243 - values: 244 - lda.64 v0 245 - movi.64 v0, 0xFFFFFFFFFFFFFFFF 246 - values: 247 - lda.64 v1 248 - movi.64 v1, 0xFFFFFFFFFFFFFFFF 249 - values: 250 - lda.64 v0 251 - fmovi.64 v0, 3.1415926535 252 - values: 253 - lda.64 v1 254 - movi.64 v1, 0xFFFFFFFFFFFFFFFF 255 - values: 256 - lda.obj v0 257 - | 258 # 259 lda.str "some string" 260 sta.obj v0 261 - values: 262 - lda.obj v1 263 - | 264 # 265 lda.str "some string" 266 sta.obj v1 267 268 - file-name: args_type_mismatch 269 bugid: ['1324'] 270 tags: ['verifier'] 271 runner-options: ['verifier-failure', 'verifier-config'] 272 isa: 273 instructions: 274 - sig: call.range method_id, v:in:top 275 acc: out:top 276 format: [op_v_8_id_16] 277 description: Check 'call.range' when argument type of function and instruction mismatch. 278 header-template: [] 279 code-template: | 280 %s 281 .function void f1(%s) { 282 return.void 283 } 284 .function i32 main() { 285 %s 286 call.range f1, v0 287 check-type: exit-positive 288 289 # Template parameters: 290 # 1 - type definitions 291 # 2 - function arguments 292 # 3 - possible initialization of registers 293 cases: 294 - values: ['', 'i32 a0', 'mov.null v0'] 295 - values: ['', 'i64 a0', 'mov.null v0'] 296 - values: ['', 'f64 a0', 'mov.null v0'] 297 - values: ['', 'i32 a0', 'movi.64 v0, 0'] 298 - values: ['', 'f64 a0', 'movi.64 v0, 0'] 299 - values: ['.record Obj {}', 'Obj a0', 'movi.64 v0, 0'] 300 - values: ['', 'i64 a0', 'movi v0, 0'] 301 - values: ['', 'f64 a0', 'movi v0, 0'] 302 - values: ['.record Obj {}', 'Obj a0', 'movi v0, 0'] 303 - values: 304 - | 305 # 306 .record Obj {} 307 308 .function void Obj.ctor(Obj a0) <ctor> { 309 return.void 310 } 311 - i32 a0 312 - | 313 # 314 initobj.short Obj.ctor 315 sta.obj v0 316 317 - values: 318 - | 319 # 320 .record Obj {} 321 322 .function void Obj.ctor(Obj a0) <ctor> { 323 return.void 324 } 325 - i64 a0 326 - | 327 # 328 initobj.short Obj.ctor 329 sta.obj v0 330 331 - file-name: reg_err 332 runner-options: [compile-failure] 333 isa: 334 instructions: 335 - sig: call.range method_id, v:in:top 336 acc: out:top 337 format: [op_v_8_id_16] 338 description: Check 'call.range' register number width. 339 header-template: [] 340 code-template: | 341 .function void f1(i32 a0) { 342 return.void 343 } 344 .function i32 main() { 345 call.range f1, %s 346 check-type: exit-positive 347 cases: 348 - values: ['1'] 349 - values: ['1.1'] 350 - values: ['0xFFFFFFFFFFFFFFFF'] 351 - values: ['"some string"'] 352 353 - file-name: arg_1_i32_acc 354 isa: 355 instructions: 356 - sig: call.range method_id, v:in:top 357 acc: out:top 358 format: [op_v_8_id_16] 359 description: Check correctness of passed arguments. Load parameter to accumulator. Check i32 type of arguments. 360 header-template: [] 361 code-template: | 362 .function i32 f1(i32 a0) { 363 lda a0 364 movi v1, %s 365 jne v1, exit_failure 366 ldai 0 367 return 368 exit_failure: 369 ldai 1 370 return 371 } 372 .function i32 main() { 373 movi v0, %s 374 call.range f1, v0 375 376 check-type: no-check 377 cases: 378 - values: ["0", "0"] 379 - values: ["1", "1"] 380 - values: ["1234567", "1234567"] 381 - values: ["0x7FFFFFFF", "0x7FFFFFFF"] 382 - values: ["0x80000000", "0x80000000"] 383 - values: ["0x9ABCDEF0", "0x9ABCDEF0"] 384 - values: ["0xFFFFFFFF", "0xFFFFFFFF"] 385 386 - file-name: arg_1_f64_acc 387 isa: 388 instructions: 389 - sig: call.range method_id, v:in:top 390 acc: out:top 391 format: [op_v_8_id_16] 392 description: Check correctness of passed arguments. Load parameter to accumulator. Check f64 type of arguments. 393 tags: ['irtoc_ignore'] 394 header-template: [] 395 code-template: | 396 .function i32 f1(f64 a0) { 397 lda.64 a0 398 fmovi.64 v1, %s 399 fcmpg.64 v1 400 return 401 } 402 .function i32 main() { 403 fmovi.64 v0, %s 404 call.range f1, v0 405 check-type: no-check 406 cases: 407 - values: ["0", "0"] 408 - values: ["1.1", "1.1"] 409 - values: ["0x7ff0000000000000", "0x7ff0000000000000"] 410 - values: ["0xfff0000000000000", "0xfff0000000000000"] 411 - values: ["0x7fefffffffffffff", "0x7fefffffffffffff"] 412 - values: ["0xffefffffffffffff", "0xffefffffffffffff"] 413 - values: ["100e100", "100e100"] 414 415 - file-name: arg_1_i32_reg 416 isa: 417 instructions: 418 - sig: call.range method_id, v:in:top 419 acc: out:top 420 format: [op_v_8_id_16] 421 description: Check correctness of passed arguments. Load parameter to register. Check i32 type of arguments. 422 header-template: [] 423 code-template: | 424 .function i32 f1(i32 a0) { 425 mov v1, a0 426 ldai %s 427 jne v1, exit_failure 428 ldai 0 429 return 430 exit_failure: 431 ldai 1 432 return 433 } 434 .function i32 main() { 435 movi v0, %s 436 call.range f1, v0 437 check-type: no-check 438 cases: 439 - values: ["0", "0"] 440 - values: ["1", "1"] 441 - values: ["1234567", "1234567"] 442 - values: ["0x7FFFFFFF", "0x7FFFFFFF"] 443 - values: ["0x80000000", "0x80000000"] 444 - values: ["0x9ABCDEF0", "0x9ABCDEF0"] 445 - values: ["0xFFFFFFFF", "0xFFFFFFFF"] 446 447 - file-name: arg_1_f64_reg 448 isa: 449 instructions: 450 - sig: call.range method_id, v:in:top 451 acc: out:top 452 format: [op_v_8_id_16] 453 description: Check correctness of passed arguments. Load parameter to register. Check f64 type of arguments. 454 tags: ['irtoc_ignore'] 455 header-template: [] 456 code-template: | 457 .function i32 f1(f64 a0) { 458 mov.64 v1, a0 459 fldai.64 %s 460 fcmpg.64 v1 461 return 462 } 463 .function i32 main() { 464 fmovi.64 v0, %s 465 call.range f1, v0 466 check-type: no-check 467 cases: 468 - values: ["0", "0"] 469 - values: ["1.1", "1.1"] 470 - values: ["0x7ff0000000000000", "0x7ff0000000000000"] 471 - values: ["0xfff0000000000000", "0xfff0000000000000"] 472 - values: ["0x7fefffffffffffff", "0x7fefffffffffffff"] 473 - values: ["0xffefffffffffffff", "0xffefffffffffffff"] 474 - values: ["100e100", "100e100"] 475 476 - file-name: arg_2_i32_acc 477 isa: 478 instructions: 479 - sig: call.range method_id, v:in:top 480 acc: out:top 481 format: [op_v_8_id_16] 482 description: Check correctness of passed arguments. Load parameter to accumulator. Check i32 type of arguments. 483 header-template: [] 484 code-template: | 485 .function i32 f1(i32 a0, i32 a1, i32 a2, i32 a3) { 486 lda a0 487 movi v1, %s 488 jeq v1, f1_check1 489 # 1st arg does not match, exit 490 ldai 1 491 return 492 f1_check1: 493 lda a1 494 movi v1, %s 495 jeq v1, f1_check2 496 ldai 1 497 return 498 f1_check2: 499 lda a2 500 movi v1, %s 501 jeq v1, f1_check3 502 ldai 1 503 return 504 f1_check3: 505 lda a3 506 movi v1, %s 507 jne v1, exit_failure 508 ldai 0 509 return 510 exit_failure: 511 ldai 1 512 return 513 } 514 .function i32 main() { 515 movi v0, %s 516 movi v1, %s 517 movi v2, %s 518 movi v3, %s 519 call.range f1, v0 520 521 check-type: no-check 522 cases: 523 - values: ["0", "0", "0", "0", "0", "0", "0", "0"] 524 - values: ["0", "1", "2", "3", "0", "1", "2", "3"] 525 - values: ["-3", "-2", "-1", "0", "-3", "-2", "-1", "0"] 526 - values: ["0", "1234567", "89101112", "13141516", "0", "1234567", "89101112", "13141516"] 527 - values: ["0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF"] 528 - values: ["0", "0x80000000", "0", "0x80000000", "0", "0x80000000", "0", "0x80000000"] 529 - values: ["0x80000000", "0", "0x80000000", "0", "0x80000000", "0", "0x80000000", "0"] 530 - values: ["0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000"] 531 - values: ["0x9ABCDEF0", "0xFEDCBA09", "0x87654321", "0x12345678", "0x9ABCDEF0", "0xFEDCBA09", "0x87654321", "0x12345678"] 532 - values: ["0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF"] 533 - values: ["0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0"] 534 - values: ["0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF"] 535 536 - file-name: arg_2_i32_reg 537 isa: 538 instructions: 539 - sig: call.range method_id, v:in:top 540 acc: out:top 541 format: [op_v_8_id_16] 542 description: Check correctness of passed arguments. Load parameter to register. Check i32 type of arguments. 543 header-template: [] 544 code-template: | 545 .function i32 f1(i32 a0, i32 a1, i32 a2, i32 a3) { 546 mov v1, a0 547 ldai %s 548 jeq v1, f1_check1 549 # 1st arg does not match, exit 550 ldai 1 551 return 552 f1_check1: 553 mov v1, a1 554 ldai %s 555 jeq v1, f1_check2 556 # 1st arg does not match, exit 557 ldai 1 558 return 559 f1_check2: 560 mov v1, a2 561 ldai %s 562 jeq v1, f1_check3 563 # 1st arg does not match, exit 564 ldai 1 565 return 566 f1_check3: 567 mov v1, a3 568 ldai %s 569 jne v1, exit_failure 570 ldai 0 571 return 572 exit_failure: 573 ldai 1 574 return 575 } 576 .function i32 main() { 577 movi v0, %s 578 movi v1, %s 579 movi v2, %s 580 movi v3, %s 581 call.range f1, v0 582 check-type: no-check 583 cases: 584 - values: ["0", "0", "0", "0", "0", "0", "0", "0"] 585 - values: ["0", "1", "2", "3", "0", "1", "2", "3"] 586 - values: ["-3", "-2", "-1", "0", "-3", "-2", "-1", "0"] 587 - values: ["0", "1234567", "89101112", "13141516", "0", "1234567", "89101112", "13141516"] 588 - values: ["0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF", "0x7FFFFFFF"] 589 - values: ["0", "0x80000000", "0", "0x80000000", "0", "0x80000000", "0", "0x80000000"] 590 - values: ["0x80000000", "0", "0x80000000", "0", "0x80000000", "0", "0x80000000", "0"] 591 - values: ["0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000", "0x80000000"] 592 - values: ["0x9ABCDEF0", "0xFEDCBA09", "0x87654321", "0x12345678", "0x9ABCDEF0", "0xFEDCBA09", "0x87654321", "0x12345678"] 593 - values: ["0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF"] 594 - values: ["0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0", "0xFFFFFFFF", "0"] 595 - values: ["0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF", "0xFFFFFFFF"] 596 597 - file-name: arg_2_f64_acc 598 isa: 599 instructions: 600 - sig: call.range method_id, v:in:top 601 acc: out:top 602 format: [op_v_8_id_16] 603 description: Check correctness of passed arguments. Load parameter to accumulator. Check f64 type of arguments. 604 header-template: [] 605 tags: ['irtoc_ignore'] 606 code-template: | 607 .function i32 f1(f64 a0, f64 a1, f64 a2, f64 a3) { 608 lda.64 a0 609 fmovi.64 v1, %s 610 fcmpg.64 v1 611 jeqz f1_check1 612 # 1st arg does not match, exit 613 ldai 1 614 return 615 f1_check1: 616 lda.64 a1 617 fmovi.64 v1, %s 618 fcmpg.64 v1 619 jeqz f1_check2 620 ldai 1 621 return 622 f1_check2: 623 lda.64 a2 624 fmovi.64 v1, %s 625 fcmpg.64 v1 626 jeqz f1_check3 627 ldai 1 628 return 629 f1_check3: 630 lda.64 a3 631 fmovi.64 v1, %s 632 fcmpg.64 v1 633 return 634 } 635 .function i32 main() { 636 fmovi.64 v0, %s 637 fmovi.64 v1, %s 638 fmovi.64 v2, %s 639 fmovi.64 v3, %s 640 call.range f1, v0 641 check-type: no-check 642 cases: 643 - values: ["0", "0", "0", "0", "0", "0", "0", "0"] 644 - values: ["1.2", "1.1", "1.3", "1.4", "1.2", "1.1", "1.3", "1.4"] 645 - values: ["0x7ff0000000000000", "0xfff0000000000000", "0x0000000000000001", "0x8000000000000001", "0x7ff0000000000000", "0xfff0000000000000", "0x0000000000000001", "0x8000000000000001"] 646 - values: ["0xffefffffffffffff", "0x7fefffffffffffff", "3.1415926535", "3.1415926535e89", "0xffefffffffffffff", "0x7fefffffffffffff", "3.1415926535", "3.1415926535e89"] 647 - values: ["100e100", "200e200", "-50e-50", "123e123", "100e100", "200e200", "-50e-50", "123e123"] 648 649 - file-name: arg_2_f64_reg 650 isa: 651 instructions: 652 - sig: call.range method_id, v:in:top 653 acc: out:top 654 format: [op_v_8_id_16] 655 description: Check correctness of passed arguments. Load parameter to register. Check f64 type of arguments. 656 tags: ['tsan', 'irtoc_ignore'] 657 header-template: [] 658 code-template: | 659 .function i32 f1(f64 a0, f64 a1, f64 a2, f64 a3) { 660 mov.64 v1, a0 661 fldai.64 %s 662 fcmpg.64 v1 663 jeqz f1_check1 664 # 1st arg does not match, exit 665 ldai 1 666 return 667 f1_check1: 668 mov.64 v1, a1 669 fldai.64 %s 670 fcmpg.64 v1 671 jeqz f1_check2 672 # 1st arg does not match, exit 673 ldai 1 674 return 675 f1_check2: 676 mov.64 v1, a2 677 fldai.64 %s 678 fcmpg.64 v1 679 jeqz f1_check3 680 # 1st arg does not match, exit 681 ldai 1 682 return 683 f1_check3: 684 mov.64 v1, a3 685 fldai.64 %s 686 fcmpg.64 v1 687 return 688 } 689 .function i32 main() { 690 fmovi.64 v0, %s 691 fmovi.64 v1, %s 692 fmovi.64 v2, %s 693 fmovi.64 v3, %s 694 call.range f1, v0 695 check-type: no-check 696 cases: 697 - values: ["0", "0", "0", "0", "0", "0", "0", "0"] 698 - values: ["1.2", "1.1", "1.3", "1.4", "1.2", "1.1", "1.3", "1.4"] 699 - values: ["0x7ff0000000000000", "0xfff0000000000000", "0x0000000000000001", "0x8000000000000001", "0x7ff0000000000000", "0xfff0000000000000", "0x0000000000000001", "0x8000000000000001"] 700 - values: ["0xffefffffffffffff", "0x7fefffffffffffff", "3.1415926535", "3.1415926535e89", "0xffefffffffffffff", "0x7fefffffffffffff", "3.1415926535", "3.1415926535e89"] 701 - values: ["100e100", "200e200", "-50e-50", "123e123", "100e100", "200e200", "-50e-50", "123e123"] 702 703 - file-name: arg_1_i64_acc 704 isa: 705 instructions: 706 - sig: call.range method_id, v:in:top 707 acc: out:top 708 format: [op_v_8_id_16] 709 description: Check correctness of passed arguments. Load parameter to accumulator. Check i64 type of arguments. 710 header-template: [] 711 code-template: | 712 .function i32 f1(i64 a0) { 713 lda.64 a0 714 movi.64 v1, %s 715 cmp.64 v1 716 return 717 } 718 .function i32 main() { 719 movi.64 v0, %s 720 call.range f1, v0 721 722 check-type: no-check 723 cases: 724 - values: ["0", "0"] 725 - values: ["1", "1"] 726 - values: ["0x1234567890ABCDEF", "0x1234567890ABCDEF"] 727 - values: ["0x7FFFFFFFFFFFFFFF", "0x7FFFFFFFFFFFFFFF"] 728 - values: ["0x8000000000000000", "0x8000000000000000"] 729 - values: ["0xFEDCBA0987654321", "0xFEDCBA0987654321"] 730 - values: ["0xFFFFFFFFFFFFFFFF", "0xFFFFFFFFFFFFFFFF"] 731 732 - file-name: arg_1_i64_reg 733 isa: 734 instructions: 735 - sig: call.range method_id, v:in:top 736 acc: out:top 737 format: [op_v_8_id_16] 738 description: Check correctness of passed arguments. Load parameter to accumulator. Check i64 type of arguments. 739 header-template: [] 740 code-template: | 741 .function i32 f1(i64 a0) { 742 mov.64 v1, a0 743 ldai.64 %s 744 cmp.64 v1 745 return 746 } 747 .function i32 main() { 748 movi.64 v0, %s 749 call.range f1, v0 750 751 check-type: no-check 752 cases: 753 - values: ["0", "0"] 754 - values: ["1", "1"] 755 - values: ["0x1234567890ABCDEF", "0x1234567890ABCDEF"] 756 - values: ["0x7FFFFFFFFFFFFFFF", "0x7FFFFFFFFFFFFFFF"] 757 - values: ["0x8000000000000000", "0x8000000000000000"] 758 - values: ["0xFEDCBA0987654321", "0xFEDCBA0987654321"] 759 - values: ["0xFFFFFFFFFFFFFFFF", "0xFFFFFFFFFFFFFFFF"] 760 761 - file-name: arg_2_i64_acc 762 isa: 763 instructions: 764 - sig: call.range method_id, v:in:top 765 acc: out:top 766 format: [op_v_8_id_16] 767 description: Check correctness of passed arguments. Load parameter to accumulator. 768 header-template: [] 769 code-template: | 770 .function i32 f1(i64 a0, i64 a1, i64 a2, i64 a3) { 771 lda.64 a0 772 movi.64 v1, %s 773 cmp.64 v1 774 jeqz f1_check1 775 # 1st arg does not match, exit 776 ldai 1 777 return 778 f1_check1: 779 lda.64 a1 780 movi.64 v1, %s 781 cmp.64 v1 782 jeqz f1_check2 783 # 1st arg does not match, exit 784 ldai 1 785 return 786 f1_check2: 787 lda.64 a2 788 movi.64 v1, %s 789 cmp.64 v1 790 jeqz f1_check3 791 # 1st arg does not match, exit 792 ldai 1 793 return 794 f1_check3: 795 lda.64 a3 796 movi.64 v1, %s 797 cmp.64 v1 798 return 799 } 800 .function i32 main() { 801 movi.64 v0, %s 802 movi.64 v1, %s 803 movi.64 v2, %s 804 movi.64 v3, %s 805 call.range f1, v0 806 807 check-type: no-check 808 cases: 809 - values: ["0", "0", "0", "0", "0", "0", "0", "0"] 810 - values: ["0", "1", "0", "1", "0", "1", "0", "1"] 811 - values: ["1", "0", "1", "0", "1", "0", "1", "0"] 812 - values: ["0x1234567890ABCDEF", "0x234567890ABCDEF1", "0x34567890ABCDEF12", "0x4567890ABCDEF123", "0x1234567890ABCDEF", "0x234567890ABCDEF1", "0x34567890ABCDEF12", "0x4567890ABCDEF123"] 813 - values: ["0x7FFFFFFFFFFFFFFF", "0", "0x7FFFFFFFFFFFFFFF", "0", "0x7FFFFFFFFFFFFFFF", "0", "0x7FFFFFFFFFFFFFFF", "0"] 814 - values: ["0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000"] 815 - values: ["0xFEDCBA0987654321", "0xEDCBA0987654321F", "0xDCBA0987654321FE", "0xCBA0987654321FED", "0xFEDCBA0987654321", "0xEDCBA0987654321F", "0xDCBA0987654321FE", "0xCBA0987654321FED"] 816 817 - file-name: arg_2_i64_reg 818 isa: 819 instructions: 820 - sig: call.range method_id, v:in:top 821 acc: out:top 822 format: [op_v_8_id_16] 823 description: Check correctness of passed arguments. Load parameter to register. Check i64 type of arguments. 824 tags: ['tsan'] 825 header-template: [] 826 code-template: | 827 .function i32 f1(i64 a0, i64 a1, i64 a2, i64 a3) { 828 mov.64 v1, a0 829 ldai.64 %s 830 cmp.64 v1 831 jeqz f1_check1 832 # 1st arg does not match, exit 833 ldai 1 834 return 835 f1_check1: 836 mov.64 v1, a1 837 ldai.64 %s 838 cmp.64 v1 839 jeqz f1_check2 840 # 1st arg does not match, exit 841 ldai 1 842 return 843 f1_check2: 844 mov.64 v1, a2 845 ldai.64 %s 846 cmp.64 v1 847 jeqz f1_check3 848 # 1st arg does not match, exit 849 ldai 1 850 return 851 f1_check3: 852 853 mov.64 v1, a3 854 ldai.64 %s 855 cmp.64 v1 856 return 857 } 858 .function i32 main() { 859 movi.64 v0, %s 860 movi.64 v1, %s 861 movi.64 v2, %s 862 movi.64 v3, %s 863 call.range f1, v0 864 865 check-type: no-check 866 cases: 867 - values: ["0", "0", "0", "0", "0", "0", "0", "0"] 868 - values: ["0", "1", "0", "1", "0", "1", "0", "1"] 869 - values: ["1", "0", "1", "0", "1", "0", "1", "0"] 870 - values: ["0x1234567890ABCDEF", "0x234567890ABCDEF1", "0x34567890ABCDEF12", "0x4567890ABCDEF123", "0x1234567890ABCDEF", "0x234567890ABCDEF1", "0x34567890ABCDEF12", "0x4567890ABCDEF123"] 871 - values: ["0x7FFFFFFFFFFFFFFF", "0", "0x7FFFFFFFFFFFFFFF", "0", "0x7FFFFFFFFFFFFFFF", "0", "0x7FFFFFFFFFFFFFFF", "0"] 872 - values: ["0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000", "0x8000000000000000"] 873 - values: ["0xFEDCBA0987654321", "0xEDCBA0987654321F", "0xDCBA0987654321FE", "0xCBA0987654321FED", "0xFEDCBA0987654321", "0xEDCBA0987654321F", "0xDCBA0987654321FE", "0xCBA0987654321FED"] 874 875 - file-name: arg_1_obj_acc 876 isa: 877 instructions: 878 - sig: call.range method_id, v:in:top 879 acc: out:top 880 format: [op_v_8_id_16] 881 description: Check correctness of passed arguments. Load parameter to accumulator. Check object type of arguments. 882 tags: ['tsan'] 883 header-template: [obj_ctor] 884 code-template: | 885 .function Obj fnc(Obj a0) { 886 lda.obj a0 887 return.obj 888 } 889 890 .function i32 main() { 891 %s 892 sta.obj v0 893 ldai 0 # acc is i32 894 call.range fnc, v0 # acc contains returned Obj 895 jne.obj v0, return_ne_num 896 ldai 0 897 return 898 return_ne_num: 899 ldai 1 900 return 901 902 check-type: no-check 903 cases: 904 - values: 905 - "lda.null" 906 - values: 907 - "initobj Obj.ctor" 908 909 - file-name: arg_2_obj_acc 910 isa: 911 instructions: 912 - sig: call.range method_id, v:in:top 913 acc: out:top 914 format: [op_v_8_id_16] 915 description: Check correctness of passed arguments. Load parameter to accumulator. Check object type. 916 tags: ['irtoc_ignore'] 917 header-template: [obj_ctor] 918 code-template: | 919 .record ObjTuple { 920 Obj o0 921 Obj o1 922 Obj o2 923 Obj o3 924 } 925 926 .function void ObjTuple.ctor(ObjTuple a0, Obj a1, Obj a2, Obj a3, Obj a4) <ctor> { 927 lda.obj a1 928 stobj.obj a0, ObjTuple.o0 929 lda.obj a2 930 stobj.obj a0, ObjTuple.o1 931 lda.obj a3 932 stobj.obj a0, ObjTuple.o2 933 lda.obj a4 934 stobj.obj a0, ObjTuple.o3 935 return.void 936 } 937 938 .function ObjTuple getObjTuple(Obj a0, Obj a1, Obj a2, Obj a3) { 939 mov.obj v0, a0 940 mov.obj v1, a1 941 mov.obj v2, a2 942 mov.obj v3, a3 943 initobj ObjTuple.ctor, v0, v1, v2, v3 944 return.obj 945 } 946 947 .function i32 main() { 948 %s 949 call.range getObjTuple, v0 950 sta.obj v4 951 952 # check ObjTuple.o0 contains correct value (v0) 953 ldobj.obj v4, ObjTuple.o0 954 jeq.obj v0, tuple_2_check_1 955 ldai 1 956 return 957 tuple_2_check_1: 958 # check ObjTuple.o1 contains correct value (v1) 959 ldobj.obj v4, ObjTuple.o1 960 jeq.obj v1, tuple_2_check_2 961 ldai 1 962 return 963 tuple_2_check_2: 964 # check ObjTuple.o2 contains correct value (v2) 965 ldobj.obj v4, ObjTuple.o2 966 jeq.obj v2, tuple_2_check_3 967 ldai 1 968 return 969 tuple_2_check_3: 970 # check ObjTuple.o3 contains correct value (v3) 971 ldobj.obj v4, ObjTuple.o3 972 jne.obj v3, return_ne_num 973 ldai 0 974 return 975 return_ne_num: 976 ldai 1 977 return 978 979 check-type: no-check 980 cases: 981 - values: 982 - | 983 # 984 mov.null v0 985 mov.null v1 986 mov.null v2 987 mov.null v3 988 - values: 989 - | 990 # 991 initobj.short Obj.ctor 992 sta.obj v0 993 initobj.short Obj.ctor 994 sta.obj v1 995 initobj.short Obj.ctor 996 sta.obj v2 997 initobj.short Obj.ctor 998 sta.obj v3 999 - values: 1000 - | 1001 # 1002 mov.null v0 1003 initobj.short Obj.ctor 1004 sta.obj v1 1005 initobj.short Obj.ctor 1006 sta.obj v2 1007 initobj.short Obj.ctor 1008 sta.obj v3 1009 - values: 1010 - | 1011 # 1012 initobj.short Obj.ctor 1013 sta.obj v0 1014 mov.null v1 1015 initobj.short Obj.ctor 1016 sta.obj v2 1017 initobj.short Obj.ctor 1018 sta.obj v3 1019 - values: 1020 - | 1021 # 1022 initobj.short Obj.ctor 1023 sta.obj v0 1024 initobj.short Obj.ctor 1025 sta.obj v1 1026 mov.null v2 1027 initobj.short Obj.ctor 1028 sta.obj v3 1029 - values: 1030 - | 1031 # 1032 initobj.short Obj.ctor 1033 sta.obj v0 1034 initobj.short Obj.ctor 1035 sta.obj v1 1036 initobj.short Obj.ctor 1037 sta.obj v2 1038 mov.null v3 1039 1040 - file-name: arg_2_str_acc 1041 isa: 1042 instructions: 1043 - sig: call.range method_id, v:in:top 1044 acc: out:top 1045 format: [op_v_8_id_16] 1046 description: Check correctness of passed arguments. Load parameter to accumulator. Check String type. 1047 tags: ['tsan', 'irtoc_ignore'] 1048 header-template: [panda_string] 1049 code-template: | 1050 .record ObjTuple { 1051 panda.String o0 1052 panda.String o1 1053 panda.String o2 1054 panda.String o3 1055 } 1056 1057 .function void ObjTuple.ctor(ObjTuple a0, panda.String a1, panda.String a2, panda.String a3, panda.String a4) <ctor> { 1058 lda.obj a1 1059 stobj.obj a0, ObjTuple.o0 1060 lda.obj a2 1061 stobj.obj a0, ObjTuple.o1 1062 lda.obj a3 1063 stobj.obj a0, ObjTuple.o2 1064 lda.obj a4 1065 stobj.obj a0, ObjTuple.o3 1066 return.void 1067 } 1068 1069 .function ObjTuple getObjTuple(panda.String a0, panda.String a1, panda.String a2, panda.String a3) { 1070 mov.obj v0, a0 1071 mov.obj v1, a1 1072 mov.obj v2, a2 1073 mov.obj v3, a3 1074 initobj ObjTuple.ctor, v0, v1, v2, v3 1075 return.obj 1076 } 1077 1078 .function i32 main() { 1079 %s 1080 call.range getObjTuple, v0 1081 sta.obj v4 1082 1083 # check ObjTuple.o0 contains correct value (v0) 1084 ldobj.obj v4, ObjTuple.o0 1085 jeq.obj v0, tuple_2_check_1 1086 ldai 1 1087 return 1088 tuple_2_check_1: 1089 # check ObjTuple.o1 contains correct value (v1) 1090 ldobj.obj v4, ObjTuple.o1 1091 jeq.obj v1, tuple_2_check_2 1092 ldai 1 1093 return 1094 tuple_2_check_2: 1095 # check ObjTuple.o2 contains correct value (v2) 1096 ldobj.obj v4, ObjTuple.o2 1097 jeq.obj v2, tuple_2_check_3 1098 ldai 1 1099 return 1100 tuple_2_check_3: 1101 # check ObjTuple.o3 contains correct value (v3) 1102 ldobj.obj v4, ObjTuple.o3 1103 jne.obj v3, return_ne_num 1104 ldai 0 1105 return 1106 return_ne_num: 1107 ldai 1 1108 return 1109 1110 check-type: no-check 1111 cases: 1112 - values: 1113 - | 1114 # 1115 mov.null v0 1116 mov.null v1 1117 mov.null v2 1118 mov.null v3 1119 - values: 1120 - | 1121 # 1122 lda.str "some string 1" 1123 sta.obj v0 1124 lda.str "some string 2" 1125 sta.obj v1 1126 lda.str "some string 3" 1127 sta.obj v2 1128 lda.str "some string 4" 1129 sta.obj v3 1130 - values: 1131 - | 1132 # 1133 mov.null v0 1134 lda.str "some string 2" 1135 sta.obj v1 1136 lda.str "some string 3" 1137 sta.obj v2 1138 lda.str "some string 4" 1139 sta.obj v3 1140 - values: 1141 - | 1142 # 1143 lda.str "some string 1" 1144 sta.obj v0 1145 mov.null v1 1146 lda.str "some string 3" 1147 sta.obj v2 1148 lda.str "some string 4" 1149 sta.obj v3 1150 - values: 1151 - | 1152 # 1153 lda.str "some string 1" 1154 sta.obj v0 1155 lda.str "some string 2" 1156 sta.obj v1 1157 mov.null v2 1158 lda.str "some string 4" 1159 sta.obj v3 1160 - values: 1161 - | 1162 # 1163 lda.str "some string 1" 1164 sta.obj v0 1165 lda.str "some string 2" 1166 sta.obj v1 1167 lda.str "some string 3" 1168 sta.obj v2 1169 mov.null v3 1170 1171 - file-name: method_id_not_static_p 1172 tags: ['verifier'] 1173 runner-options: ['verifier-failure', 'verifier-config'] 1174 isa: 1175 instructions: 1176 - sig: call.range method_id, v:in:top 1177 acc: out:top 1178 format: [op_v_8_id_16] 1179 verification: 1180 - method_id_static 1181 - method_id_non_abstract 1182 description: Method_id must resolve to a static method in Panda Assembly context. Not static methods should be rejected by verifier. 1183 header-template: [] 1184 code-template: | 1185 .record A {} 1186 1187 .function void A.ctor(A a0) <ctor> { 1188 return.void 1189 } 1190 1191 .function i32 A.foo(A a0%s) *s 1192 1193 .function i32 main() { 1194 initobj A.ctor 1195 sta.obj v0 1196 %s 1197 call.range A.foo, v0 1198 check-type: exit-positive 1199 cases: 1200 - values: 1201 - | 1202 { 1203 ldai 0 1204 return 1205 } 1206 ignore: true 1207 bugid: ['3247'] 1208 - values: ['<noimpl>'] 1209 ignore: true 1210 bugid: ['3247'] 1211 - values: 1212 - | 1213 <static> { 1214 ldai 0 1215 return 1216 } 1217 runner-options: ['verifier-only', 'verifier-config'] 1218 template-cases: 1219 - values: ['', '##-'] 1220 - values: [', A a1', 'mov.obj v1, v0'] 1221 1222 - file-name: method_id_not_static_j 1223 tags: ['verifier', 'pa-verifier'] 1224 runner-options: [verifier-failure, use-pa, verifier-config] 1225 isa: 1226 instructions: 1227 - sig: call.range method_id, v:in:top 1228 acc: out:top 1229 format: [op_v_8_id_16] 1230 verification: 1231 - method_id_static 1232 - method_id_non_abstract 1233 description: Method_id must resolve to a static method in PandaAssembly context. Not static methods should be rejected by verifier. 1234 header-template: [PandaAssembly] 1235 code-template: | 1236 .record A {} 1237 1238 .function void A.ctor(A a0) <ctor> { 1239 return.void 1240 } 1241 1242 .function i32 A.foo(A a0%s) *s 1243 1244 .function i32 main() { 1245 initobj A.ctor 1246 sta.obj v0 1247 %s 1248 call.range A.foo, v0 1249 check-type: exit-positive 1250 cases: 1251 - values: 1252 - | 1253 { 1254 ldai 0 1255 return 1256 } 1257 ignore: true 1258 bugid: ['3247'] 1259 - values: ['<noimpl>'] 1260 ignore: true 1261 bugid: ['3247'] 1262 - values: 1263 - | 1264 <static> { 1265 ldai 0 1266 return 1267 } 1268 runner-options: [verifier-only, use-pa, verifier-config] 1269 template-cases: 1270 - values: ['', '##-'] 1271 - values: [', A a1', 'mov.obj v1, v0'] 1272 1273 1274 - file-name: method_id_not_static_j_2 1275 tags: ['verifier'] 1276 bugid: ['3247'] 1277 ignore: true 1278 runner-options: [verifier-failure, use-pa, verifier-config] 1279 isa: 1280 instructions: 1281 - sig: call.range method_id, v:in:top 1282 acc: out:top 1283 format: [op_v_8_id_16] 1284 verification: 1285 - method_id_static 1286 - method_id_non_abstract 1287 description: Method_id must resolve to a static method. 1288 header-template: [PandaAssembly] 1289 code-template: | 1290 .record A {} 1291 .function i32 A.foo(A a0) <noimpl> 1292 %s 1293 .function i32 %s.foo(%s a0) { 1294 ldai 0 1295 return 1296 } 1297 1298 .function i32 main() { 1299 newobj v0, %s 1300 call.range A.foo, v0 1301 1302 check-type: exit-positive 1303 cases: 1304 - values: 1305 - .record B <panda.extends=A> {} 1306 - B 1307 - B 1308 - B 1309 1310 - values: 1311 - | 1312 .record B <panda.extends=A> {} 1313 .record C <panda.extends=B> {} 1314 - C 1315 - C 1316 - C 1317 1318 - values: 1319 - | 1320 # 1321 .record B <panda.extends=A> {} 1322 .record C <panda.extends=B> {} 1323 .record D <panda.extends=C> {} 1324 .record E <panda.extends=D> {} 1325 .record F <panda.extends=E> {} 1326 - F 1327 - F 1328 - F 1329 1330 - file-name: method_id_abstract 1331 isa: 1332 instructions: 1333 - sig: call.range method_id, v:in:top 1334 acc: out:top 1335 format: [op_v_8_id_16] 1336 verification: 1337 - method_id_static 1338 - method_id_non_abstract 1339 description: Check behavior when 'call.range' is used with abstract method. 1340 header-template: [] 1341 runner-options: [use-pa] 1342 code-template: | 1343 .language PandaAssembly 1344 1345 .record A {} 1346 .function i32 A.foo(A a0) <noimpl> 1347 1348 %s 1349 1350 .function i32 main() { 1351 call.range %s.foo, v0 1352 check-type: exit-positive 1353 cases: 1354 - values: 1355 - '' 1356 - A 1357 runner-options: [verifier-failure, use-pa, verifier-config] 1358 tags: ['verifier', 'pa-verifier'] 1359 bugid: ['3293', '5271'] 1360 - values: 1361 - .record B <panda.extends=A> {} 1362 - B 1363 runner-options: [compile-failure] 1364 1365 - values: 1366 - | 1367 # 1368 .record B <panda.extends=A> {} 1369 .record C <panda.extends=B> {} 1370 .record D <panda.extends=C> {} 1371 .record E <panda.extends=D> {} 1372 .record F <panda.extends=E> {} 1373 - F 1374 runner-options: [compile-failure] 1375 1376