1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s -check-prefix=RV32I
5 define i32 @indirectbr(i8* %target) nounwind {
6 ; RV32I-LABEL: indirectbr:
8 ; RV32I-NEXT: addi sp, sp, -16
9 ; RV32I-NEXT: sw ra, 12(sp)
11 ; RV32I-NEXT: .LBB0_1: # %test_label
12 ; RV32I-NEXT: mv a0, zero
13 ; RV32I-NEXT: lw ra, 12(sp)
14 ; RV32I-NEXT: addi sp, sp, 16
16 indirectbr i8* %target, [label %test_label]
23 define i32 @indirectbr_with_offset(i8* %a) nounwind {
24 ; RV32I-LABEL: indirectbr_with_offset:
26 ; RV32I-NEXT: addi sp, sp, -16
27 ; RV32I-NEXT: sw ra, 12(sp)
28 ; RV32I-NEXT: jr 1380(a0)
29 ; RV32I-NEXT: .LBB1_1: # %test_label
30 ; RV32I-NEXT: mv a0, zero
31 ; RV32I-NEXT: lw ra, 12(sp)
32 ; RV32I-NEXT: addi sp, sp, 16
34 %target = getelementptr inbounds i8, i8* %a, i32 1380
35 indirectbr i8* %target, [label %test_label]