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 14definitions: [] 15tests: 16 - file-name: "mov.null" 17 isa: 18 title: Move null reference into register 19 description: Move null reference into a register. 20 exceptions: 21 - x_none 22 verification: 23 - none 24 commands: 25 - file-name: "op_vd_8" 26 description: Check mov.null moves null reference to register. 27 isa: 28 instructions: 29 - sig: mov.null v:out:ref 30 acc: none 31 format: [op_v_8] 32 check-type: none 33 tags: ['tsan'] 34 code-template: | 35 # 36 %s 37 lda.null 38 %s 39 ldai 0 40 return 41 err: 42 ldai 1 43 return 44 cases: 45 - values: 46 - "#{[*0..255].map do |i| \" mov.null v#{i}\\n\" end .join}" 47 - "#{[*0..255].map do |i| \" jne.obj v#{i}, err\\n\" end .join}" 48 49 50 - file-name: "err" 51 description: Check mov.null with incorrect register number. 52 isa: 53 instructions: 54 - sig: mov.null v:out:ref 55 acc: none 56 format: [op_v_8] 57 runner-options: [compile-failure] 58 check-type: none 59 code-template: | 60 # 61 mov.null %s 62 ldai 0 63 return 64 cases: 65 - values: 66 - v256 67 - values: 68 - 123 69 - values: 70 - a0 71