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# - field_id_non_static 28 29## runner-option: verifier-failure 30## runner-option: bugid: 1833 31## runner-option: tags: verifier 32 33# Test description: 34# Check that verifier reports an error when the field doesn't resolve to a non-static valid object field 35 36 37.record W { 38 i64 static_field <static> 39} 40.function void W.ctor(W a0) <ctor> { 41 return.void 42} 43.record random_record_name { 44 i64 random_field_name 45} 46.function void random_function_name() { 47 return.void 48} 49 50.function i32 main() { 51 initobj.short W.ctor 52 sta.obj v0 53 ldobj.64 v0, random_record_name.random_field_name 54# 55 ldai 0 56 return 57} 58