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 @addr = global i8* null
7 define void @test_blockaddress() nounwind {
8 ; RV32I-LABEL: test_blockaddress:
10 ; RV32I-NEXT: addi sp, sp, -16
11 ; RV32I-NEXT: sw ra, 12(sp)
12 ; RV32I-NEXT: lui a0, %hi(.Ltmp0)
13 ; RV32I-NEXT: addi a0, a0, %lo(.Ltmp0)
14 ; RV32I-NEXT: lui a1, %hi(addr)
15 ; RV32I-NEXT: sw a0, %lo(addr)(a1)
16 ; RV32I-NEXT: lw a0, %lo(addr)(a1)
18 ; RV32I-NEXT: .Ltmp0: # Block address taken
19 ; RV32I-NEXT: .LBB0_1: # %block
20 ; RV32I-NEXT: lw ra, 12(sp)
21 ; RV32I-NEXT: addi sp, sp, 16
23 store volatile i8* blockaddress(@test_blockaddress, %block), i8** @addr
24 %val = load volatile i8*, i8** @addr
25 indirectbr i8* %val, [label %block]