• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=riscv32 -filetype=obj --relocation-model=pic < %s\
2; RUN: | llvm-objdump --triple=riscv32 --mattr=+c -d -M no-aliases -\
3; RUN: | FileCheck -check-prefix=CHECK %s
4
5; This test demonstrates that .option nopic has no effect on codegen when
6; emitting an ELF directly.
7
8@symbol = global i32 zeroinitializer
9
10define i32 @get_symbol() nounwind {
11; CHECK-LABEL: <get_symbol>:
12; CHECK: auipc	a0, 0
13; CHECK: lw	a0, 0(a0)
14; CHECK: lw	a0, 0(a0)
15  tail call void asm sideeffect ".option nopic", ""()
16  %v = load i32, i32* @symbol
17  ret i32 %v
18}
19