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.record panda.ArrayIndexOutOfBoundsException <external> 15 16.function i32 check() { 17 movi v0, 10 18 newarr v0, v0, i32[] 19 movi v1, 11 20 movi v2, 0 21try_begin_label_0: 22 call.short can_throw, v0, v1 23try_end_label_0: 24 movi v2, 0 25 jmp jump_label 26catch_block1_begin: 27jump_label: 28 lda v2 29 return 30 31.catch panda.ArrayIndexOutOfBoundsException, try_begin_label_0, try_end_label_0, catch_block1_begin 32} 33 34.function void can_throw(i32[] a0, i32 a1) { 35 mov.obj v0, a0 36 mov v1, a1 37 movi v2, 0x0 38 lda v2 39 starr v0, v1 40 return.void 41} 42 43.function i32 main() { 44 call.short check 45 return 46} 47