• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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:
15  - name: java
16    template: |
17      .language Java
18
19tests:
20  - file-name: "jeq.obj"
21    isa:
22      title: Conditional object comparison jump
23      description: >
24        Transfer execution to an instruction at offset bytes from the beginning of the current instruction if
25        object references in accumulator and source register compare as specified. Offset is sign extended to the size of
26        instruction address.
27      exceptions:
28        - x_none
29      verification:
30        - branch_target
31        - acc_obj_or_null
32        - v1_obj_or_null
33      instructions:
34        - sig: jeq.obj v:in:ref, imm:i32
35          acc: in:ref
36          format: [op_v_8_imm_8, op_v_8_imm_16]
37    commands:
38
39      - file-name: "invalid_v_reg"
40        isa:
41          verification:
42            - v1_obj_or_null
43          instructions:
44            - sig: jeq.obj v:in:ref, imm:i32
45              acc: in:ref
46              format: [op_v_8_imm_8, op_v_8_imm_16]
47        runner-options: [compile-failure]
48        description: Check 'jeq.obj' instruction with invalid 'v' register.
49        header-template: []
50        code-template: |
51            .function i32 main() {
52                jeq.obj %s
53            lbl:
54        check-type: exit-positive
55        cases:
56          - values: ["v256, lbl"]
57          - values: ["v65535, lbl"]
58          - values: ["v65536, lbl"]
59          - values: ["a0, lbl"]
60          - values: ["a256, lbl"]
61          - values: ["a65535, lbl"]
62          - values: ["lbl"]
63          - values: [""]
64          - values: ["}"]
65          - values: ["# v1, lbl"]
66          - values: ["V1, lbl"]
67
68
69      - file-name: "invalid_a_reg"
70        isa:
71          verification:
72            - v1_obj_or_null
73          instructions:
74            - sig: jeq.obj v:in:ref, imm:i32
75              acc: in:ref
76              format: [op_v_8_imm_8, op_v_8_imm_16]
77        runner-options: [compile-failure]
78        description: Check 'jeq.obj' instruction with invalid 'a' register.
79        header-template: []
80        code-template: |
81            .record R {}
82            .function void foo(R a0, R a1, R a2, R a3, R a4, R a5) <static> {
83                jeq.obj %s
84            lbl:
85                return.void
86            }
87            .function i32 main() {
88                call.range foo, v0
89        check-type: exit-positive
90        cases:
91          - values: ["v256, lbl"]
92          - values: ["v65535, lbl"]
93          - values: ["v65536, lbl"]
94          - values: ["a6, lbl"]
95          - values: ["a256, lbl"]
96          - values: ["a65535, lbl"]
97          - values: ["lbl"]
98          - values: [""]
99          - values: ["}"]
100          - values: ["# v1, lbl"]
101          - values: ["V1, lbl"]
102
103
104      - file-name: "valid_v_reg"
105        isa:
106          verification:
107            - v1_obj_or_null
108          instructions:
109            - sig: jeq.obj v:in:ref, imm:i32
110              acc: in:ref
111              format: [op_v_8_imm_8, op_v_8_imm_16]
112        description: Check 'jeq.obj' instruction with valid 'v' register.
113        header-template: []
114        code-template: |
115            .function i32 main() {
116                mov.null %s
117                lda.null
118                jeq.obj %s, lbl
119                ldai 1
120                return
121            lbl:
122        check-type: exit-positive
123        cases:
124          - values: ["v0", "v0"]
125          - values: ["v7", "v7"]
126          - values: ["v8", "v8"]
127          - values: ["v15", "v15"]
128          - values: ["v16", "v16"]
129          - values: ["v254", "v254"]
130          - values: ["v255", "v255"]
131            tags: [tsan]
132
133
134      - file-name: "valid_a_reg"
135        isa:
136          verification:
137            - v1_obj_or_null
138          instructions:
139            - sig: jeq.obj v:in:ref, imm:i32
140              acc: in:ref
141              format: [op_v_8_imm_8, op_v_8_imm_16]
142        description: Check 'jeq.obj' instruction with valid 'a' register.
143        header-template: []
144        code-template: |
145            .record R {}
146            .function void R.ctor(R a0) <ctor> {
147                return.void
148            }
149            .function i32 foo(%s) <static> {
150                lda.obj a0
151                jeq.obj %s, lbl
152                ldai 1
153                return
154            lbl:
155                ldai 0
156                return
157            }
158            .function i32 main() {
159                initobj R.ctor
160            %s
161                call.range foo, v0
162        check-type: no-check
163        cases:
164          - values:
165            - R a0
166            - a0
167            - |
168              #
169                  sta.obj v0
170          - values:
171            - R a0, R a1
172            - a1
173            - |
174              #
175                  sta.obj v0
176                  sta.obj v1
177            tags: [tsan]
178          - values:
179            - "#{[*0..255].map do |i| \" R a#{i}\" end .join(\",\")}"
180            - a254
181            - "#{[*0..255].map do |i| \"    sta.obj v#{i}\\n\" end .join}"
182            bugid: ['3855']
183          - values:
184            - "#{[*0..255].map do |i| \" R a#{i}\" end .join(\",\")}"
185            - a255
186            - "#{[*0..255].map do |i| \"    sta.obj v#{i}\\n\" end .join}"
187            bugid: ['3855']
188
189
190      - file-name: "uninitialized_regs"
191        isa:
192          verification:
193            - acc_obj_or_null
194            - v1_obj_or_null
195        runner-options: ['verifier-failure', 'verifier-debug-config']
196        tags: [verifier]
197        description: Check 'jeq.obj' instruction with uninitialized registers.
198        header-template: []
199        code-template: |
200            .function i32 main() {
201                %s
202                jeq.obj v1, lbl
203                ldai 1
204                return
205            lbl:
206        check-type: exit-positive
207        cases:
208          - description: Accumulator is not initialized.
209            values:
210              - mov.null v1
211          - description: V register is not initialized.
212            values:
213              - lda.null
214          - description: Accumulator and 'v' register are both not initialized.
215            values:
216              - ""
217
218
219      - file-name: "invalid_branch_target"
220        isa:
221          verification:
222            - branch_target
223        runner-options: [compile-failure]
224        description: Check 'jeq.obj' instruction with invalid branch target.
225        header-template: []
226        code-template: |
227            .record R {}
228
229            .function void R.ctor(R a0) <ctor> {
230            lbl_ctor:
231                return.void
232            }
233
234            .function void R.cctor() <cctor> {
235            lbl_cctor:
236                return.void
237            }
238
239            .function i32 foo() <static> {
240                lda.obj a0
241                jeq.obj a1, %s
242            }
243
244            .function i32 bar() <static> {
245            lbl_bar:
246                ldai 1
247                return
248            }
249
250            .function i32 main() {
251                call.short foo
252            lbl_main:
253        check-type: exit-positive
254        cases:
255          - values: ["main"]
256          - values: ["foo"]
257          - values: ["bar"]
258          - values: ["baz"]
259          - values: ["R"]
260          - values: ["lbl_main"]
261          - values: ["lbl_bar"]
262          - values: ["lbl_ctor"]
263          - values: ["lbl_cctor"]
264
265
266      - file-name: "prohibited_branch_target_p"
267        isa:
268          verification:
269            - branch_target
270        runner-options: ['verifier-failure', 'verifier-debug-config']
271        tags: [verifier]
272        description: Check 'jeq.obj' instruction with prohibited branch target in PandaAssembly context.
273        header-template: []
274        code-template: |
275            .record E1 {}
276            .record E2 {}
277            .record R {}
278
279            .function void R.ctor(R a0) <ctor> {
280                return.void
281            }
282
283            .function i32 main() {
284                initobj R.ctor
285                sta.obj v0
286                jeq.obj v0, %s
287
288            begin:
289                ldai 0
290                return
291            mid:
292                ldai 1
293                return
294            end:
295                ldai 2
296                return
297
298            catch_E1_begin:
299                ldai 3
300                return
301            catch_E1_mid:
302                ldai 4
303                return
304            catch_E1_end:
305                ldai 5
306                return
307
308            catch_E2_begin:
309                ldai 6
310                return
311            catch_E2_mid:
312                ldai 7
313                return
314            catch_E2_end:
315
316            quit:
317                ldai 8
318                return
319
320            .catch E1, begin, end, catch_E1_begin, catch_E1_end
321            .catch E2, catch_E1_begin, catch_E1_end, catch_E2_begin, catch_E2_end
322            outside:
323        check-type: none
324        cases:
325          - values: ["begin"]
326            runner-options: ['verifier-only', 'verifier-debug-config']
327          - values: ["mid"]
328            runner-options: ['verifier-only', 'verifier-debug-config']
329          - values: ["end"]
330            runner-options: ['verifier-only', 'verifier-debug-config']
331          - values: ["quit"]
332            runner-options: ['verifier-only', 'verifier-debug-config']
333          - values: ["catch_E1_begin"]
334          - values: ["catch_E1_mid"]
335          - values: ["catch_E1_end"]
336            runner-options: ['verifier-only', 'verifier-debug-config']
337          - values: ["catch_E2_begin"]
338          - values: ["catch_E2_mid"]
339          - values: ["catch_E2_end"]
340            runner-options: ['verifier-only', 'verifier-debug-config']
341          - values: ["outside"]
342
343
344      - file-name: "invalid_acc_value"
345        isa:
346          verification:
347            - acc_obj_or_null
348        runner-options: ['verifier-failure', 'verifier-debug-config']
349        tags: [verifier]
350        description: Check 'jeq.obj' instruction with invalid accumulator value
351        header-template: []
352        code-template: |
353            .record R {}
354            .function void R.ctor(R a0) <ctor> {
355                return.void
356            }
357            .function i32 main() {
358                %s
359                *s
360                jeq.obj v1, ok
361                ldai 1
362                return
363            ok:
364        check-type: exit-positive
365        template-cases:
366          - values:
367            - |
368              #
369                  initobj R.ctor
370                  sta.obj v1
371          - values:
372            - mov.null v1
373        cases:
374          - values:
375            - ldai 0
376          - values:
377            - ldai 1
378          - values:
379            - ldai 0x7fffffff
380          - values:
381            - ldai 0xffffffff
382          - values:
383            - ldai 0x80000000
384          - values:
385            - ldai.64 0
386          - values:
387            - ldai.64 1
388          - values:
389            - ldai.64 0x7fffffffffffffff
390          - values:
391            - ldai.64 0xffffffffffffffff
392          - values:
393            - ldai.64 0x8000000000000000
394          - values:
395            - |
396              #
397                  fldai.64 0x0000000000000000 # Positive zero (+0.0, hexadecimal representation is `0x0000000000000000`)
398          - values:
399            - |
400              #
401                  fldai.64 0x8000000000000000 # Negative zero (-0.0, hexadecimal representation is `0x8000000000000000`)
402          - values:
403            - |
404              #
405                  fldai.64 0x0000000000000001 # Minimal positive value (4.9E-324, hexadecimal representation is `0x0000000000000001`)
406          - values:
407            - |
408              #
409                  fldai.64 0x8000000000000001 # Maximal negative value (-4.9E-324, hexadecimal representation is `0x8000000000000001`)
410          - values:
411            - |
412              #
413                  fldai.64 0x7fefffffffffffff # Maximal positive value (1.7976931348623157e308, hexadecimal representation is `0x7fefffffffffffff`)
414          - values:
415            - |
416              #
417                  fldai.64 0xffefffffffffffff # Minimal negative value (-1.7976931348623157e308, hexadecimal representation is `0xffefffffffffffff`)
418          - values:
419            - |
420              #
421                  fldai.64 0x7ff0000000000000 # Positive infinity (hexadecimal representation is `0x7ff0000000000000`)
422          - values:
423            - |
424              #
425                  fldai.64 0xfff0000000000000 # Negative infinity (hexadecimal representation is `0xfff0000000000000`)
426          - values:
427            - |
428              #
429                  fldai.64 0x7ff8000000000000 # NaN
430
431
432      - file-name: "invalid_v_value"
433        isa:
434          verification:
435            - v1_obj_or_null
436        runner-options: ['verifier-failure', 'verifier-debug-config']
437        tags: [verifier]
438        description: Check 'jeq.obj' instruction with invalid v register value
439        header-template: []
440        code-template: |
441            .record R {}
442            .function void R.ctor(R a0) <ctor> {
443                return.void
444            }
445            .function i32 main() {
446                *s
447                %s
448                jeq.obj v1, ok
449                ldai 1
450                return
451            ok:
452        check-type: exit-positive
453        template-cases:
454          - values:
455            - initobj R.ctor
456          - values:
457            - lda.null
458        cases:
459          - values:
460            - movi v1, 0
461          - values:
462            - movi v1, 1
463          - values:
464            - movi v1, 0x7fffffff
465          - values:
466            - movi v1, 0xffffffff
467          - values:
468            - movi v1, 0x80000000
469          - values:
470            - movi.64 v1, 0
471          - values:
472            - movi.64 v1, 1
473          - values:
474            - movi.64 v1, 0x7fffffffffffffff
475          - values:
476            - movi.64 v1, 0xffffffffffffffff
477          - values:
478            - movi.64 v1, 0x8000000000000000
479          - values:
480            - |
481              #
482                  fmovi.64 v1, 0x0000000000000000 # Positive zero (+0.0, hexadecimal representation is `0x0000000000000000`)
483          - values:
484            - |
485              #
486                  fmovi.64 v1, 0x8000000000000000 # Negative zero (-0.0, hexadecimal representation is `0x8000000000000000`)
487          - values:
488            - |
489              #
490                  fmovi.64 v1, 0x0000000000000001 # Minimal positive value (4.9E-324, hexadecimal representation is `0x0000000000000001`)
491          - values:
492            - |
493              #
494                  fmovi.64 v1, 0x8000000000000001 # Maximal negative value (-4.9E-324, hexadecimal representation is `0x8000000000000001`)
495          - values:
496            - |
497              #
498                  fmovi.64 v1, 0x7fefffffffffffff # Maximal positive value (1.7976931348623157e308, hexadecimal representation is `0x7fefffffffffffff`)
499          - values:
500            - |
501              #
502                  fmovi.64 v1, 0xffefffffffffffff # Minimal negative value (-1.7976931348623157e308, hexadecimal representation is `0xffefffffffffffff`)
503          - values:
504            - |
505              #
506                  fmovi.64 v1, 0x7ff0000000000000 # Positive infinity (hexadecimal representation is `0x7ff0000000000000`)
507          - values:
508            - |
509              #
510                  fmovi.64 v1, 0xfff0000000000000 # Negative infinity (hexadecimal representation is `0xfff0000000000000`)
511          - values:
512            - |
513              #
514                  fmovi.64 v1, 0x7ff8000000000000 # NaN
515
516
517      - file-name: "invalid_both_acc_and_v_value"
518        isa:
519          verification:
520            - v1_obj_or_null
521            - acc_obj_or_null
522        runner-options: ['verifier-failure', 'verifier-debug-config']
523        tags: [verifier]
524        description: Check 'jeq.obj' instruction with invalid accumulator and v register value
525        header-template: []
526        code-template: |
527            .record R {}
528            .function void R.ctor(R a0) <ctor> {
529                return.void
530            }
531            .function i32 main() {
532                *s
533                %s
534                jeq.obj v1, ok
535                ldai 1
536                return
537            ok:
538        check-type: exit-positive
539        template-cases:
540          - values:
541            - ldai 0
542          - values:
543            - ldai 1
544          - values:
545            - ldai 0x7fffffff
546          - values:
547            - ldai 0xffffffff
548          - values:
549            - ldai 0x80000000
550          - values:
551            - ldai.64 0
552          - values:
553            - ldai.64 1
554          - values:
555            - ldai.64 0x7fffffffffffffff
556          - values:
557            - ldai.64 0xffffffffffffffff
558          - values:
559            - ldai.64 0x8000000000000000
560          - values:
561            - |
562              #
563                  fldai.64 0x0000000000000000 # Positive zero (+0.0, hexadecimal representation is `0x0000000000000000`)
564          - values:
565            - |
566              #
567                  fldai.64 0x8000000000000000 # Negative zero (-0.0, hexadecimal representation is `0x8000000000000000`)
568          - values:
569            - |
570              #
571                  fldai.64 0x0000000000000001 # Minimal positive value (4.9E-324, hexadecimal representation is `0x0000000000000001`)
572          - values:
573            - |
574              #
575                  fldai.64 0x8000000000000001 # Maximal negative value (-4.9E-324, hexadecimal representation is `0x8000000000000001`)
576          - values:
577            - |
578              #
579                  fldai.64 0x7fefffffffffffff # Maximal positive value (1.7976931348623157e308, hexadecimal representation is `0x7fefffffffffffff`)
580          - values:
581            - |
582              #
583                  fldai.64 0xffefffffffffffff # Minimal negative value (-1.7976931348623157e308, hexadecimal representation is `0xffefffffffffffff`)
584          - values:
585            - |
586              #
587                  fldai.64 0x7ff0000000000000 # Positive infinity (hexadecimal representation is `0x7ff0000000000000`)
588          - values:
589            - |
590              #
591                  fldai.64 0xfff0000000000000 # Negative infinity (hexadecimal representation is `0xfff0000000000000`)
592          - values:
593            - |
594              #
595                  fldai.64 0x7ff8000000000000 # NaN
596        cases:
597          - values:
598            - movi v1, 0
599          - values:
600            - movi v1, 1
601          - values:
602            - movi v1, 0x7fffffff
603          - values:
604            - movi v1, 0xffffffff
605          - values:
606            - movi v1, 0x80000000
607          - values:
608            - movi.64 v1, 0
609          - values:
610            - movi.64 v1, 1
611          - values:
612            - movi.64 v1, 0x7fffffffffffffff
613          - values:
614            - movi.64 v1, 0xffffffffffffffff
615          - values:
616            - movi.64 v1, 0x8000000000000000
617          - values:
618            - |
619              #
620                  fmovi.64 v1, 0x0000000000000000 # Positive zero (+0.0, hexadecimal representation is `0x0000000000000000`)
621          - values:
622            - |
623              #
624                  fmovi.64 v1, 0x8000000000000000 # Negative zero (-0.0, hexadecimal representation is `0x8000000000000000`)
625          - values:
626            - |
627              #
628                  fmovi.64 v1, 0x0000000000000001 # Minimal positive value (4.9E-324, hexadecimal representation is `0x0000000000000001`)
629          - values:
630            - |
631              #
632                  fmovi.64 v1, 0x8000000000000001 # Maximal negative value (-4.9E-324, hexadecimal representation is `0x8000000000000001`)
633          - values:
634            - |
635              #
636                  fmovi.64 v1, 0x7fefffffffffffff # Maximal positive value (1.7976931348623157e308, hexadecimal representation is `0x7fefffffffffffff`)
637          - values:
638            - |
639              #
640                  fmovi.64 v1, 0xffefffffffffffff # Minimal negative value (-1.7976931348623157e308, hexadecimal representation is `0xffefffffffffffff`)
641          - values:
642            - |
643              #
644                  fmovi.64 v1, 0x7ff0000000000000 # Positive infinity (hexadecimal representation is `0x7ff0000000000000`)
645          - values:
646            - |
647              #
648                  fmovi.64 v1, 0xfff0000000000000 # Negative infinity (hexadecimal representation is `0xfff0000000000000`)
649          - values:
650            - |
651              #
652                  fmovi.64 v1, 0x7ff8000000000000 # NaN
653
654
655      - file-name: "valid_equal_values_p"
656        isa:
657          description: >
658            Transfer execution to an instruction at offset bytes from the beginning of the current instruction if
659            object references in accumulator and source register compare as specified. Offset is sign extended to the size of
660            instruction address.
661        description: Check 'jeq.obj' instruction with valid equal values in PandaAssembly context.
662        header-template: []
663        code-template: |
664            .record panda.String <external>
665            .record panda.Class <external>
666            .record panda.Object <external>
667            .record R {}
668            .function void R.ctor(R a0) <ctor> {
669                return.void
670            }
671            .function i32 main() {
672                %s
673                jeq.obj v1, ok
674                ldai 1
675                return
676            ok:
677        check-type: exit-positive
678        cases:
679          - values:
680            - |
681              #
682                  mov.null v1
683                  lda.null
684          - values:
685            - |
686              #
687                  initobj R.ctor
688                  sta.obj v1
689          - values:
690            - |
691              #
692                  lda.str "test"
693                  sta.obj v1
694                  lda.str "test"
695            tags: [tsan]
696          - values:
697            - |
698              #
699                  lda.type R
700                  sta.obj v1
701                  lda.type R
702          - values:
703            - |
704              #
705                  movi v1, 10
706                  newarr v1, v1, R[]
707                  lda.obj v1
708          - values:
709            - |
710              #
711                  movi v1, 10
712                  newarr v1, v1, panda.String[]
713                  lda.obj v1
714          - values:
715            - |
716              #
717                  movi v1, 10
718                  newarr v1, v1, panda.Class[]
719                  lda.obj v1
720          - values:
721            - |
722              #
723                  movi v1, 10
724                  newarr v1, v1, panda.Object[][]
725                  lda.obj v1
726            tags: [tsan]
727
728
729      - file-name: "valid_not_equal_values_p"
730        isa:
731          description: >
732            Transfer execution to an instruction at offset bytes from the beginning of the current instruction if
733            object references in accumulator and source register compare as specified. Offset is sign extended to the size of
734            instruction address.
735        description: Check 'jeq.obj' instruction with valid not equal values in PandaAssembly context.
736        header-template: []
737        code-template: |
738            .record panda.String <external>
739            .record panda.Class <external>
740            .record panda.Object <external>
741            .record R {}
742            .function void R.ctor(R a0) <ctor> {
743                return.void
744            }
745            .function i32 main() {
746                # set v1 register
747                *s
748                # set accumulator
749                %s
750                jeq.obj v1, eq
751                ldai 0
752                return
753            eq:
754                ldai 1
755                return
756        check-type: none
757        template-cases:
758          - values:
759            - lda.null
760            exclude: [nul]
761          - values:
762            - initobj R.ctor
763          - values:
764            - lda.str "test1"
765            exclude: [str1]
766          - values:
767            - lda.str "test2"
768            exclude: [str2]
769          - values:
770            - lda.type R
771            exclude: [tr]
772          - values:
773            - lda.type panda.Object
774            exclude: [to]
775          - values:
776            - |
777              #
778                  movi v2, 10
779                  newarr v2, v2, R[]
780                  lda.obj v2
781          - values:
782            - |
783              #
784                  movi v2, 10
785                  newarr v2, v2, R[][]
786                  lda.obj v2
787          - values:
788            - |
789              #
790                  movi v2, 10
791                  newarr v2, v2, panda.String[][][]
792                  lda.obj v2
793        cases:
794          - values:
795            - mov.null v1
796            id: nul
797          - values:
798            - |
799              #
800                  initobj R.ctor
801                  sta.obj v1
802          - values:
803            - |
804              #
805                  lda.str "test1"
806                  sta.obj v1
807            id: str1
808          - values:
809            - |
810              #
811                  lda.str "test2"
812                  sta.obj v1
813            id: str2
814          - values:
815            - |
816              #
817                  lda.type R
818                  sta.obj v1
819            id: tr
820          - values:
821            - |
822              #
823                  lda.type panda.Object
824                  sta.obj v1
825            id: to
826          - values:
827            - |
828              #
829                  movi v2, 10
830                  newarr v1, v2, R[]
831          - values:
832            - |
833              #
834                  movi v2, 10
835                  newarr v1, v2, R[][]
836          - values:
837            - |
838              #
839                  movi v2, 10
840                  newarr v1, v2, panda.String[][][]
841
842
843      - file-name: "valid_offset_values"
844        isa:
845          description: >
846            Transfer execution to an instruction at offset bytes from the beginning of the current instruction if
847            object references in accumulator and source register compare as specified. Offset is sign extended to the size of
848            instruction address.
849        description: Check 'jeq.obj' instruction with valid offset values.
850        header-template: []
851        code-template: |
852            .record R {}
853            .function void R.ctor(R a0) <ctor> {
854                return.void
855            }
856            .function i32 main() {
857                lda.null
858                sta.obj v1
859                %s
860                ldai 1      # 2-byte instruction
861                return      # 1-byte instruction
862            quit:
863        check-type: exit-positive
864        cases:
865          - description: Same instruction jump, offset imm8, 0 bytes
866            values:
867              - |
868                #
869                    initobj R.ctor
870                lbl:
871                    jeq.obj v1, lbl
872                    ldai 0
873                    return
874            tags: [tsan]
875          - description: Max forward jump for imm8, 3 + 110 + 10 + 1 + 3 = 127 bytes
876            values:
877              - |
878                #
879                    jeq.obj v1, quit      # 3-byte instruction
880                    movi.64 v0, 0 ##*11
881                    ldai 1      # 2-byte instruction
882                    ldai 1      # 2-byte instruction
883                    ldai 1      # 2-byte instruction
884                    ldai 1      # 2-byte instruction
885                    ldai 1      # 2-byte instruction
886                    return      # 1-byte instruction
887            tags: [tsan]
888          - description: Max backward jump for imm8, 3 + 120 + 2 + 2 + 1 = 128 bytes
889            values:
890              - |
891                #
892                    jmp lbl2
893                lbl1:
894                    jmp quit      # 3-byte instruction
895                    movi.64 v0, 0 ##*12
896                    ldai 1        # 2-byte instruction
897                    ldai 1        # 2-byte instruction
898                    return        # 1-byte instruction
899                lbl2:
900                    jeq.obj v1, lbl1
901          - description: Max forward jump for imm16, 32760 + 4 + 3 = 32767 bytes
902            values:
903              - |
904                #
905                    jeq.obj v1, quit      # 4-byte instruction
906                    movi.64 v0, 0 ##*3276
907          - description: Beyond max forward jump for imm16, 40000 + 4 + 3 = 40007 bytes. Converted to jne.obj + jmp by compiler.
908            values:
909              - |
910                #
911                    jeq.obj v1, quit      # 4-byte instruction
912                    movi.64 v0, 0 ##*4000
913          - description: Max backward jump for imm16, 5 + 32760 + 3 = 32768 bytes
914            values:
915              - |
916                #
917                    jmp lbl2
918                lbl1:
919                    jmp quit              # 5-byte instruction
920                    movi.64 v0, 0 ##*3276
921                    lda.null ##*3
922                lbl2:
923                    jeq.obj v1, lbl1
924          - description: Beyond max backward jump for imm16, 5 + 40000 = 40005 bytes. Converted to jne.obj + jmp by compiler.
925            values:
926              - |
927                #
928                    jmp lbl2
929                lbl1:
930                    jmp quit              # 5-byte instruction
931                    movi.64 v0, 0 ##*4000
932                lbl2:
933                    jeq.obj v1, lbl1
934          - description: Chain of forward jumps
935            values:
936              - |
937                #
938                    jeq.obj v1, lbl1
939                    ldai 2
940                    return
941                lbl1:
942                    jeq.obj v1, lbl2
943                    ldai 3
944                    return
945                lbl2:
946                    jeq.obj v1, lbl3
947                    ldai 4
948                    return
949                lbl3:
950                    jeq.obj v1, lbl4
951                    ldai 5
952                    return
953                lbl4:
954                    jeq.obj v1, quit
955            tags: [tsan]
956          - description: Chain of backward jumps
957            values:
958              - |
959                #
960                    jmp lbl1
961                lbl6:
962                    jmp quit
963                lbl5:
964                    jeq.obj v1, lbl6
965                    ldai 5
966                    return
967                lbl4:
968                    jeq.obj v1, lbl5
969                    ldai 4
970                    return
971                lbl3:
972                    jeq.obj v1, lbl4
973                    ldai 3
974                    return
975                lbl2:
976                    jeq.obj v1, lbl3
977                    ldai 2
978                    return
979                lbl1:
980                    jeq.obj v1, lbl2
981            tags: [tsan]
982