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 A {
15    i32 a1
16}
17
18.record Asm{
19    i32 asm1
20    i64 asm2
21}
22
23.record Asm2{
24    i32 asm1
25    i64 asm2
26    f64 asm3
27}
28
29.function i32 main() {
30    newobj v0, Asm
31    lda.obj v0
32    jnez.obj label_1
33    ldai 1
34    return
35label_1:
36
37    newobj v0, A
38    lda.obj v0
39    mov.null v0
40    jne.obj v0, label_2
41    ldai 2
42    return
43label_2:
44
45    newobj v0, Asm
46    lda.obj v0
47    isinstance Asm
48    jeqz label_3
49
50    newobj v0, Asm2
51    lda.obj v0
52    isinstance Asm
53    jnez label_3
54
55    lda.obj v0
56    checkcast Asm2
57    jeqz.obj label_4
58
59    newobj v0, A
60    newobj v1, A
61    lda.obj v1
62    jne.obj v0, label_5
63    ldai 5
64    return
65label_5:
66    ldai 0
67    return
68label_3:
69    ldai 3
70    return
71label_4:
72    ldai 4
73    return
74}
75