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# The following comment until the empty line must be a valid YAML document 15# containing exact copies of ISA specification assertions relevant to this test. 16#--- 17#- title: Get field from object 18# description: 'Get field value from an object by field id and put it into accumulator. 19# 20#' 21# instructions: 22# - sig: ldobj.64 v:in:ref, field_id 23# acc: out:b64 24# format: 25# - op_v_8_id_32 26# verification: 27# - v1_object 28 29## runner-option: verifier-failure 30## runner-option: bugid: 1324, 1826 31## runner-option: tags: verifier, release, clang_release_sanitizer 32 33# Test description: 34# Check that verifier reports an error when the 1st operand is not a ref to an object (other than array) 35 36 37.language PandaAssembly 38 39.record panda.Object <external> 40 41.record Q {} 42.function void Q.ctor(Q a0) { 43 return.void 44} 45 46.record R { 47 u1 fu1 48 u8 fu8 49 i8 fi8 50 u16 fu16 51 i16 fi16 52 u32 fu32 53 i32 fi32 54 u64 fu64 55 i64 fi64 56 f32 ff32 57 f64 ff64 58 59 i32[] fi32Array 60 Q fQ 61 Q[] fQArray 62 panda.Object fObj 63 panda.Object[] fObjArray 64} 65.function void R.ctor(R a0) { 66 return.void 67} 68 69.function i32 main() { 70 movi v0, 0 71try_begin: 72 ldobj.64 v0, R.fi64 73try_end: 74 jmp ret 75catch_begin: 76 jmp ret 77ret: 78 ldai 0 79 return 80#.catchall try_begin, try_end, catch_begin 81} 82 83