# 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. # Check cross-compiling only on amd64 #! CHECKER Сompiling a method for arm/arm64 on amd64 in JIT #! SKIP_IF @architecture != "amd64" #! RUN force_jit: true, options: "--compiler-cross-arch=arm", entry: "_GLOBAL::main" #! EVENT /Compilation,_GLOBAL::main,.*DROPPED/ #! RUN force_jit: true, options: "--compiler-cross-arch=arm64", entry: "_GLOBAL::main" #! EVENT /Compilation,_GLOBAL::main,.*DROPPED/ #! CHECKER Сompiling a method arm/arm64 on amd64 in AOT #! SKIP_IF @architecture != "amd64" #! RUN_PAOC options: "--compiler-cross-arch=arm" #! RUN options: "", entry: "_GLOBAL::main" #! EVENT "AotEntrypointFound,_GLOBAL::main" #! RUN_PAOC options: "--compiler-cross-arch=arm64" #! RUN options: "", entry: "_GLOBAL::main" #! EVENT "AotEntrypointFound,_GLOBAL::main" # Check, that need second peephole for lowering #! CHECKER Check that lowering is applied for Return in JIT #! RUN force_jit: true, options: "", entry: "_GLOBAL::main" #! EVENT /Compilation,_GLOBAL::main,.*COMPILED/ #! METHOD "_GLOBAL::main" #! PASS_AFTER "DeoptimizeElimination" #! INST "Return " #! INST_NOT "ReturnI" #! PASS_AFTER "Lowering" #! INST "ReturnI" #! INST_NOT "Return " #! CHECKER Check that lowering is applied for Return in AOT #! SKIP_IF @architecture == "arm32" #! RUN_PAOC options:"" #! METHOD "_GLOBAL::main" #! PASS_AFTER "DeoptimizeElimination" #! INST "Return " #! INST_NOT "ReturnI" #! PASS_AFTER "Lowering" #! INST "ReturnI" #! INST_NOT "Return " #! RUN options: "", entry: "_GLOBAL::main" #! EVENT "AotEntrypointFound,_GLOBAL::main" # returns a1+abs(a2) .function i32 foo (i32 a0, i32 a1){ lda a1 jltz lsub add a0, a1 jmp ret lsub: sub a0, a1 ret: return } .function u1 main (){ movi v0, -42 movi v1, -42 call.short foo, v0, v1 return }