xref: /llvm-project/llvm/test/CodeGen/Hexagon/pic-static.ll (revision a96f691985c8546e826012fdc3481c88f034a194)
1; RUN: llc -mtriple=hexagon-- -mcpu=hexagonv5 -relocation-model=pic < %s | FileCheck %s
2
3; CHECK-DAG: r{{[0-9]+}} = add({{pc|PC}},##_GLOBAL_OFFSET_TABLE_@PCREL)
4; CHECK-DAG: r{{[0-9]+}} = add({{pc|PC}},##x@PCREL)
5; CHECK: r{{[0-9]+}} = memw(r{{[0-9]+}}+##bar@GOT)
6
7@x = internal global i32 9, align 4
8@bar = external global ptr
9
10define i32 @foo(i32 %y) nounwind {
11entry:
12  store ptr @x, ptr @bar, align 4, !tbaa !0
13  %0 = load i32, ptr @x, align 4, !tbaa !3
14  %add = add nsw i32 %0, %y
15  ret i32 %add
16}
17
18!0 = !{!"any pointer", !1}
19!1 = !{!"omnipotent char", !2}
20!2 = !{!"Simple C/C++ TBAA"}
21!3 = !{!"int", !1}
22