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