• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
4
5@addr = global i8* null
6
7define void @test_blockaddress() nounwind {
8; RV32I-LABEL: test_blockaddress:
9; RV32I:       # %bb.0:
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)
15; RV32I-NEXT:    jr a0
16; RV32I-NEXT:  .Ltmp0: # Block address taken
17; RV32I-NEXT:  .LBB0_1: # %block
18; RV32I-NEXT:    ret
19  store volatile i8* blockaddress(@test_blockaddress, %block), i8** @addr
20  %val = load volatile i8*, i8** @addr
21  indirectbr i8* %val, [label %block]
22
23block:
24  ret void
25}
26