• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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#! CHECKER      Irreduceble loop test
15#! RUN_PAOC     options: "--compiler-regex=.*try_to_reproduce.*"
16#! RUN          options: "", entry: "_GLOBAL::main", result: 1
17#! EVENT        /AotEntrypointFound,_GLOBAL::try_to_reproduce/
18
19.function i32 try_to_reproduce(i32 a0, i32 a1, i32 a2, i32 a3) {
20    lda a0
21    jeqz _08
22    jmp _03
23
24_03:
25    jmp _13
26
27_08:
28    lda a1
29    jeqz _12
30    jmp _11
31
32_13:
33    lda a2
34    jeqz _15
35    jmp _11
36
37_15:
38    jmp _12
39
40_12:
41    lda a3
42    jeqz _13
43    jmp _14
44
45_11:
46    return
47
48_14:
49    return
50}
51
52.function i32 main() {
53    movi v0, 0
54    movi v1, 1
55    movi v2, 2
56    movi v3, 3
57    call try_to_reproduce, v0, v1, v2, v3
58    return
59}
60