2 ; RUN: llc -mtriple powerpc-ibm-aix-xcoff -verify-machineinstrs < %s \
3 ; RUN: -stop-before=ppc-ctr-loops-verify | FileCheck %s
4 ; RUN: llc -mtriple powerpc-ibm-aix-xcoff -verify-machineinstrs < %s | FileCheck %s --check-prefix TEST
6 @i = dso_local global i32 0, align 4 #0
7 @d = dso_local local_unnamed_addr global double 3.141590e+00, align 8
8 @f = dso_local local_unnamed_addr global float 0x4005BE76C0000000, align 4 #0
9 @ll = dso_local local_unnamed_addr global i64 55, align 8
10 @ilocal = internal global i32 0, align 4
12 define dso_local void @write_int(i32 signext %in) {
14 store i32 %in, i32* @i, align 4
17 ; CHECK: name: write_int
18 ; CHECK: %[[SCRATCH:[0-9]+]]:gprc_and_gprc_nor0 = ADDItoc @i, $r2
19 ; CHECK-NEXT: STW %{{[0-9]+}}, 0, killed %[[SCRATCH]] :: (store (s32) into @i)
22 ; TEST: la 4, i[TD](2)
23 ; TEST-NEXT: stw 3, 0(4)
25 define dso_local i64 @read_ll() {
27 %0 = load i64, i64* @ll, align 8
30 ; CHECK: name: read_ll
31 ; CHECK: LWZtoc @ll, $r2 :: (load (s32) from got)
34 ; TEST: lwz 4, L..C0(2)
35 ; TEST-NEXT: lwz 3, 0(4)
36 ; TEST-NEXT: lwz 4, 4(4)
38 define dso_local float @read_float() {
40 %0 = load float, float* @f, align 4
43 ; CHECK: name: read_float
44 ; CHECK: %[[SCRATCH:[0-9]+]]:gprc_and_gprc_nor0 = ADDItoc @f, $r2
45 ; CHECK: %{{[0-9]+}}:f4rc = LFS 0, killed %[[SCRATCH]] :: (dereferenceable load (s32) from @f)
48 ; TEST: la 3, f[TD](2)
49 ; TEST-NEXT: lfs 1, 0(3)
51 define dso_local void @write_double(double %in) {
53 store double %in, double* @d, align 8
56 ; CHECK: name: write_double
57 ; CHECK: LWZtoc @d, $r2 :: (load (s32) from got)
60 ; TEST: lwz 3, L..C1(2)
61 ; TEST-NEXT: stfd 1, 0(3)
63 define dso_local nonnull i32* @addr() {
68 ; CHECK: %[[SCRATCH:[0-9]+]]:gprc = ADDItoc @i, $r2
69 ; CHECK-NEXT: $r3 = COPY %[[SCRATCH]]
72 ; TEST: la 3, i[TD](2)
75 attributes #0 = { "toc-data" }