1# Copyright (c) 2021-2024 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.function i32 foo(i32 a0, i32 a1) { 15 lda a0 16 return 17} 18 19.function i32 bar(i32 a0, i32 a1) { 20 lda a1 21 return 22} 23 24.function i32 first(i32 a0, i32 a1, i32 a2, i32 a3) { 25 lda a0 26 return 27} 28 29.function i32 second(i32 a0, i32 a1, i32 a2, i32 a3) { 30 lda a1 31 return 32} 33 34.function i32 third(i32 a0, i32 a1, i32 a2, i32 a3) { 35 lda a2 36 return 37} 38 39.function i32 fourth(i32 a0, i32 a1, i32 a2, i32 a3) { 40 lda a3 41 return 42} 43 44.function i32 main() { 45 ldai 0 46 movi v0, 1 47 call.acc.short foo, v0, 0x0 48 jnez fail 49 call.acc.short bar, v0, 0x1 50 jnez fail 51 call.acc first, v0, v0, v0, 0x0 52 jnez fail 53 call.acc second, v0, v0, v0, 0x1 54 jnez fail 55 call.acc third, v0, v0, v0, 0x2 56 jnez fail 57 call.acc fourth, v0, v0, v0, 0x3 58 jnez fail 59 return 60fail: 61 ldai 1 62 return 63} 64