xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/alias.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -code-model=medium| FileCheck --check-prefix=CHECK --check-prefix=MEDIUM %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -code-model=large | FileCheck --check-prefix=CHECK --check-prefix=LARGE %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker@foo = global i32 42
5*9880d681SAndroid Build Coastguard Worker@fooa = alias i32, i32* @foo
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker@foo2 = global i64 42
8*9880d681SAndroid Build Coastguard Worker@foo2a = alias i64, i64* @foo2
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: bar:
11*9880d681SAndroid Build Coastguard Workerdefine i32 @bar() {
12*9880d681SAndroid Build Coastguard Worker; MEDIUM: addis 3, 2, fooa@toc@ha
13*9880d681SAndroid Build Coastguard Worker; LARGE: addis 3, 2, .L[[L0:.*]]@toc@ha
14*9880d681SAndroid Build Coastguard Worker  %a = load i32, i32* @fooa
15*9880d681SAndroid Build Coastguard Worker  ret i32 %a
16*9880d681SAndroid Build Coastguard Worker}
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: bar2:
19*9880d681SAndroid Build Coastguard Workerdefine i64 @bar2() {
20*9880d681SAndroid Build Coastguard Worker; MEDIUM: addis 3, 2, foo2a@toc@ha
21*9880d681SAndroid Build Coastguard Worker; MEDIUM: addi 3, 3, foo2a@toc@l
22*9880d681SAndroid Build Coastguard Worker; LARGE: addis 3, 2, .L[[L1:.*]]@toc@ha
23*9880d681SAndroid Build Coastguard Worker  %a = load i64, i64* @foo2a
24*9880d681SAndroid Build Coastguard Worker  ret i64 %a
25*9880d681SAndroid Build Coastguard Worker}
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Worker; LARGE: .L[[L0]]:
28*9880d681SAndroid Build Coastguard Worker; LARGE-NEXT: .tc fooa[TC],fooa
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard Worker; LARGE: .L[[L1]]:
31*9880d681SAndroid Build Coastguard Worker; LARGE-NEXT: .tc foo2a[TC],foo2a
32