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.record panda.Object <external> 15 16#Assert that operation isinstance works fine 17.record Asm{ 18 i32 asm1 19 i64 asm2 20} 21.record Asm2{ 22 i32 asm1 23 i64 asm2 24 f64 asm3 25} 26 27.function i32 main(){ 28 newobj v0, Asm 29 lda.obj v0 30 isinstance Asm 31 jeqz exit_failure 32 newobj v0, Asm2 33 lda.obj v0 34 isinstance Asm 35 jnez exit_failure 36 lda.obj v0 37 isinstance panda.Object 38 jeqz exit_failure 39 ldai 0 40 return 41exit_failure: 42 ldai 1 43 return 44} 45