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