• 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# Copy of arrays-02.pa but checks llvm aot options
15
16#! CHECKER     No LLVM assertion with compiler-non-optimizing=true
17#! RUN_LLVM    options: "--compiler-non-optimizing=true"
18
19.function i32 main(){
20    movi v0, 5
21    newarr v1, v0, i32[]
22    movi v2, 0
23    ldai 0
24loop:
25    jeq v0, loop_exit
26    starr v1, v2
27    inci v2, 1
28    lda v2
29    jmp loop
30loop_exit:
31    subi 1
32    sta v2
33loop2:
34    jltz loop2_exit
35    ldarr v1
36    jne v2, exit_failure
37    inci v2, -1
38    lda v2
39    jmp loop2
40loop2_exit:
41    ldai 0
42    return
43exit_failure:
44    ldai 1
45    return
46}
47