# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=riscv64 -run-pass=instruction-select -simplify-mir \
# RUN: -verify-machineinstrs %s -o - | FileCheck -check-prefix=RV64I %s
---
name: indirectbr
legalized: true
regBankSelected: true
tracksRegLiveness: true
body: |
; RV64I-LABEL: name: indirectbr
; RV64I: bb.0:
; RV64I-NEXT: successors: %bb.1, %bb.2
; RV64I-NEXT: liveins: $x10
; RV64I-NEXT: {{ $}}
; RV64I-NEXT: [[COPY:%[0-9]+]]:gprjalr = COPY $x10
; RV64I-NEXT: PseudoBRIND [[COPY]], 0
; RV64I-NEXT: {{ $}}
; RV64I-NEXT: bb.1:
; RV64I-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x0
; RV64I-NEXT: $x10 = COPY [[COPY1]]
; RV64I-NEXT: PseudoRET implicit $x10
; RV64I-NEXT: {{ $}}
; RV64I-NEXT: bb.2:
; RV64I-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, 1
; RV64I-NEXT: $x10 = COPY [[ADDI]]
; RV64I-NEXT: PseudoRET implicit $x10
bb.1:
successors: %bb.2, %bb.3
liveins: $x10
%0:gprb(p0) = COPY $x10
G_BRINDIRECT %0(p0)
bb.2:
%4:gprb(s64) = G_CONSTANT i64 0
$x10 = COPY %4(s64)
PseudoRET implicit $x10
bb.3:
%2:gprb(s64) = G_CONSTANT i64 1
$x10 = COPY %2(s64)
PseudoRET implicit $x10
...