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