# Copyright (c) 2021-2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # This is an auxiliary file with some basics classes that can be used in checked tests with inter-file communication # It is written in pure PandaAssembly i.e. some features are not available e.g. inheritance (it is available only with # java extension). # The file would be AOT compiled as well. # .record A { i32 data } #! CHECKER ExternalAOT #! RUN_PAOC options: "" .function i32 A.getConst() { ldai 1 return } .function i32 A.getConst_virt(A a0) { ldai 2 return } .function i32 A.getParam(i32 a0) { lda a0 return } .function i32 A.getParam_virt(A a0, i32 a1) { lda a1 return } .function void A.getVoid() { return.void } .function void A.getVoid_virt(A a0) { return.void } .function i32 A.getObj(A a0) { ldobj a0, A.data return } .function i32 A.getObj_virt(A a0) { ldobj a0, A.data return } .function void A.setObj(A a0, i32 a1) { lda a1 stobj a0, A.data return.void } .function void A.setObjConst_virt(A a0) { ldai 0x9 stobj a0, A.data return.void } .function void A.setObj_virt(A a0, i32 a1) { lda a1 stobj a0, A.data return.void } .function i32 A.getObj_wrong_virt(A a0, A a1) { ldobj a1, A.data return } .function void A.setObj_wrong_virt(A a0, i32 a1, A a2) { lda a1 stobj a2, A.data return.void } .function void A.setObj_multiple(A a0, i32 a1, i32 a2) { lda a1 stobj a0, A.data lda a2 stobj a0, A.data return.void } .function i32 A.complexMethod(A a0) { ldobj a0, A.data sta v0 ldai 42 jne v0, label_1 mul v0, v0 return label_1: movi v1, 42 add v0, v1 return }