xref: /aosp_15_r20/external/llvm/test/CodeGen/Hexagon/pic-simple.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: r{{[0-9]+}} = add({{pc|PC}}, ##_GLOBAL_OFFSET_TABLE_@PCREL)
4*9880d681SAndroid Build Coastguard Worker; CHECK: r{{[0-9]+}} = memw(r{{[0-9]+}}{{.*}}+{{.*}}##src@GOT)
5*9880d681SAndroid Build Coastguard Worker; CHECK: r{{[0-9]+}} = memw(r{{[0-9]+}}{{.*}}+{{.*}}##dst@GOT)
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker@dst = external global i32
8*9880d681SAndroid Build Coastguard Worker@src = external global i32
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workerdefine i32 @foo() nounwind {
11*9880d681SAndroid Build Coastguard Workerentry:
12*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* @src, align 4, !tbaa !0
13*9880d681SAndroid Build Coastguard Worker  store i32 %0, i32* @dst, align 4, !tbaa !0
14*9880d681SAndroid Build Coastguard Worker  %call = tail call i32 @baz(i32 %0) nounwind
15*9880d681SAndroid Build Coastguard Worker  ret i32 0
16*9880d681SAndroid Build Coastguard Worker}
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerdeclare i32 @baz(i32)
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker!0 = !{!"int", !1}
21*9880d681SAndroid Build Coastguard Worker!1 = !{!"omnipotent char", !2}
22*9880d681SAndroid Build Coastguard Worker!2 = !{!"Simple C/C++ TBAA"}
23