aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/Hexagon/pic-static.ll
blob: 8ef75a5f95d94020b342f069666712cbef7a45cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
; RUN: llc -mtriple=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 ptr

define i32 @foo(i32 %y) nounwind {
entry:
  store ptr @x, ptr @bar, align 4, !tbaa !0
  %0 = load i32, ptr @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}