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 15#! CHECKER All methods found 16#! RUN_PAOC options: "--compiler-inlining false" 17#! RUN options: "", entry: "_GLOBAL::main", result: 52 18#! EVENT_NOT /Inline.*/ 19#! EVENT "AotEntrypointFound,_GLOBAL::func1" 20#! EVENT "AotEntrypointFound,_GLOBAL::func2" 21#! EVENT "AotEntrypointFound,_GLOBAL::func3" 22 23#! CHECKER Various methods compiled 24#! RUN_PAOC options: "--compiler-inlining false --compiler-regex '(_GLOBAL::func[13]|Test::f[23])'" 25#! RUN options: "", entry: "_GLOBAL::main2", result: 58 26#! EVENT "AotEntrypointFound,_GLOBAL::func1" 27#! EVENT "AotEntrypointFound,_GLOBAL::func3" 28#! EVENT_NOT "AotEntrypointFound,_GLOBAL::func2" 29#! EVENT "AotEntrypointFound,Test::f2" 30#! EVENT "AotEntrypointFound,Test::f3" 31#! EVENT_NOT "AotEntrypointFound,Test::f1" 32 33.record Test {} 34 35.function i32 Test.f1() { 36 ldai 1 37 return 38} 39 40.function i32 Test.f2() { 41 ldai 2 42 return 43} 44 45.function i32 Test.f3() { 46 ldai 3 47 return 48} 49 50.function i32 func1(i32 a0) { 51 ldai 2 52 add2 a0 53 return 54} 55 56.function i32 func2(i32 a0) { 57 ldai 2 58 mul2 a0 59 return 60} 61 62.function i32 func3(i32 a0) { 63 call.short func1, a0 64 sta a0 65 call.short func2, a0 66 return 67} 68 69.function i32 main() { 70 movi v1, 10 71 72 call.short func1, v1 73 sta v1 74 call.short func2, v1 75 sta v1 76 call.short func3, v1 77 78 return 79} 80 81.function i32 main2() { 82 call.short main, v1 83 sta v1 84 85 call.short Test.f1 86 add2 v1 87 sta v1 88 89 call.short Test.f2 90 add2 v1 91 sta v1 92 93 call.short Test.f3 94 add2 v1 95 sta v1 96 97 return 98} 99