llvm/test/CodeGen/Hexagon/pic-static.ll
Krzysztof Parzyszek 311fb07b3b [Hexagon] Add PIC support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256025 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-18 20:19:30 +00:00

22 lines
625 B
LLVM

; RUN: llc -march=hexagon -mcpu=hexagonv5 -relocation-model=pic < %s | FileCheck %s
; CHECK-DAG: r{{[0-9]+}} = add({{pc|PC}}, ##_GLOBAL_OFFSET_TABLE_@PCREL)
; CHECK-DAG: r{{[0-9]+}} = add({{pc|PC}}, ##x@PCREL)
; CHECK: r{{[0-9]+}} = memw(r{{[0-9]+}}{{.*}}+{{.*}}##bar@GOT)
@x = internal global i32 9, align 4
@bar = external global i32*
define i32 @foo(i32 %y) nounwind {
entry:
store i32* @x, i32** @bar, align 4, !tbaa !0
%0 = load i32, i32* @x, align 4, !tbaa !3
%add = add nsw i32 %0, %y
ret i32 %add
}
!0 = !{!"any pointer", !1}
!1 = !{!"omnipotent char", !2}
!2 = !{!"Simple C/C++ TBAA"}
!3 = !{!"int", !1}