1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=PPC64
2 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-ibm-aix-xcoff -mcpu=pwr7 | FileCheck %s --check-prefix=PPC64
4 %struct.A = type { i32, [2 x [2 x i32]], i8, [3 x [3 x [3 x i32]]] }
5 %struct.B = type { i32, [2 x [2 x [2 x %struct.A]]] }
7 @arr = common global [2 x [2 x [2 x [2 x [2 x i32]]]]] zeroinitializer, align 4
8 @A = common global [3 x [3 x %struct.A]] zeroinitializer, align 4
9 @B = common global [2 x [2 x [2 x %struct.B]]] zeroinitializer, align 4
11 define ptr @t1() nounwind {
14 %addr = alloca ptr, align 4
15 store ptr getelementptr inbounds ([2 x [2 x [2 x [2 x [2 x i32]]]]], ptr @arr, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1), ptr %addr, align 4
16 ; PPC64: addi {{[0-9]+}}, {{[0-9]+}}, 124
17 %0 = load ptr, ptr %addr, align 4
21 define ptr @t2() nounwind {
24 %addr = alloca ptr, align 4
25 store ptr getelementptr inbounds ([3 x [3 x %struct.A]], ptr @A, i32 0, i32 2, i32 2, i32 3, i32 1, i32 2, i32 2), ptr %addr, align 4
26 ; PPC64: addi {{[0-9]+}}, {{[0-9]+}}, 1148
27 %0 = load ptr, ptr %addr, align 4
31 define ptr @t3() nounwind {
34 %addr = alloca ptr, align 4
35 store ptr getelementptr inbounds ([3 x [3 x %struct.A]], ptr @A, i32 0, i32 0, i32 1, i32 1, i32 0, i32 1), ptr %addr, align 4
36 ; PPC64: addi {{[0-9]+}}, {{[0-9]+}}, 140
37 %0 = load ptr, ptr %addr, align 4
41 define ptr @t4() nounwind {
44 %addr = alloca ptr, align 4
45 store ptr getelementptr inbounds ([2 x [2 x [2 x %struct.B]]], ptr @B, i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 3, i32 1, i32 2, i32 1), ptr %addr, align 4
46 ; PPC64: addi {{[0-9]+}}, {{[0-9]+}}, 1284
47 %0 = load ptr, ptr %addr, align 4