18 lines · plain
1; RUN: llc -mtriple=riscv32 -filetype=obj < %s\2; RUN: | llvm-objdump --triple=riscv32 --mattr=+c -d -M no-aliases -\3; RUN: | FileCheck -check-prefix=CHECK %s4 5; This test demonstrates that .option pic has no effect on codegen when6; emitting an ELF directly.7 8@symbol = global i32 zeroinitializer9 10define i32 @get_symbol() nounwind {11; CHECK-LABEL: <get_symbol>:12; CHECK: lui a0, 0x013; CHECK: lw a0, 0x0(a0)14 tail call void asm sideeffect ".option pic", ""()15 %v = load i32, ptr @symbol16 ret i32 %v17}18