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# Check cross-compiling only on amd64 15 16#! CHECKER Сompiling a method for arm/arm64 on amd64 in JIT 17#! SKIP_IF @architecture != "amd64" 18#! RUN force_jit: true, options: "--compiler-cross-arch=arm", entry: "_GLOBAL::main" 19#! EVENT /Compilation,_GLOBAL::main,.*DROPPED/ 20#! RUN force_jit: true, options: "--compiler-cross-arch=arm64", entry: "_GLOBAL::main" 21#! EVENT /Compilation,_GLOBAL::main,.*DROPPED/ 22 23#! CHECKER Сompiling a method arm/arm64 on amd64 in AOT 24#! SKIP_IF @architecture != "amd64" 25#! RUN_PAOC options: "--compiler-cross-arch=arm" 26#! RUN options: "", entry: "_GLOBAL::main" 27#! EVENT "AotEntrypointFound,_GLOBAL::main" 28#! RUN_PAOC options: "--compiler-cross-arch=arm64" 29#! RUN options: "", entry: "_GLOBAL::main" 30#! EVENT "AotEntrypointFound,_GLOBAL::main" 31 32 33# Check, that need second peephole for lowering 34 35#! CHECKER Check that lowering is applied for Return in JIT 36#! RUN force_jit: true, options: "", entry: "_GLOBAL::main" 37#! EVENT /Compilation,_GLOBAL::main,.*COMPILED/ 38#! METHOD "_GLOBAL::main" 39#! PASS_AFTER "DeoptimizeElimination" 40#! INST "Return " 41#! INST_NOT "ReturnI" 42#! PASS_AFTER "Lowering" 43#! INST "ReturnI" 44#! INST_NOT "Return " 45 46#! CHECKER Check that lowering is applied for Return in AOT 47#! SKIP_IF @architecture == "arm32" 48#! RUN_PAOC options:"" 49#! METHOD "_GLOBAL::main" 50#! PASS_AFTER "DeoptimizeElimination" 51#! INST "Return " 52#! INST_NOT "ReturnI" 53#! PASS_AFTER "Lowering" 54#! INST "ReturnI" 55#! INST_NOT "Return " 56#! RUN options: "", entry: "_GLOBAL::main" 57#! EVENT "AotEntrypointFound,_GLOBAL::main" 58 59# returns a1+abs(a2) 60.function i32 foo (i32 a0, i32 a1){ 61 lda a1 62 jltz lsub 63 add a0, a1 64 jmp ret 65lsub: 66 sub a0, a1 67ret: 68 return 69} 70 71.function u1 main (){ 72 movi v0, -42 73 movi v1, -42 74 call.short foo, v0, v1 75 return 76} 77