1 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 < %s | FileCheck %s
2 target datalayout = "e-m:e-i64:64-n32:64"
3 target triple = "powerpc64le-unknown-linux-gnu"
5 ; Make sure that we don't generate a std r, 0(0) -- the memory address cannot
8 ; CHECK-NOT: std {{[0-9]+}}, 0(0)
11 define void @test1({ ptr, ptr } %fn_arg) {
12 %fn = alloca { ptr, ptr }
13 %sp = alloca ptr, align 8
14 %regs = alloca [18 x i64], align 8
15 store { ptr, ptr } %fn_arg, ptr %fn
16 call void asm sideeffect "std 14, $0", "=*m"(ptr elementtype(i64) %regs)
17 %1 = getelementptr i8, ptr %regs, i32 8
18 call void asm sideeffect "std 15, $0", "=*m"(ptr elementtype(i64) %1)
19 %2 = getelementptr i8, ptr %regs, i32 16
20 call void asm sideeffect "std 16, $0", "=*m"(ptr elementtype(i64) %2)
21 %3 = getelementptr i8, ptr %regs, i32 24
22 call void asm sideeffect "std 17, $0", "=*m"(ptr elementtype(i64) %3)
23 %4 = getelementptr i8, ptr %regs, i32 32
24 call void asm sideeffect "std 18, $0", "=*m"(ptr elementtype(i64) %4)
25 %5 = getelementptr i8, ptr %regs, i32 40
26 call void asm sideeffect "std 19, $0", "=*m"(ptr elementtype(i64) %5)
27 %6 = getelementptr i8, ptr %regs, i32 48
28 call void asm sideeffect "std 20, $0", "=*m"(ptr elementtype(i64) %6)
29 %7 = getelementptr i8, ptr %regs, i32 56
30 call void asm sideeffect "std 21, $0", "=*m"(ptr elementtype(i64) %7)
31 %8 = getelementptr i8, ptr %regs, i32 64
32 call void asm sideeffect "std 22, $0", "=*m"(ptr elementtype(i64) %8)
33 %9 = getelementptr i8, ptr %regs, i32 72
34 call void asm sideeffect "std 23, $0", "=*m"(ptr elementtype(i64) %9)
35 %10 = getelementptr i8, ptr %regs, i32 80
36 call void asm sideeffect "std 24, $0", "=*m"(ptr elementtype(i64) %10)
37 %11 = getelementptr i8, ptr %regs, i32 88
38 call void asm sideeffect "std 25, $0", "=*m"(ptr elementtype(i64) %11)
39 %12 = getelementptr i8, ptr %regs, i32 96
40 call void asm sideeffect "std 26, $0", "=*m"(ptr elementtype(i64) %12)
41 %13 = getelementptr i8, ptr %regs, i32 104
42 call void asm sideeffect "std 27, $0", "=*m"(ptr elementtype(i64) %13)
43 %14 = getelementptr i8, ptr %regs, i32 112
44 call void asm sideeffect "std 28, $0", "=*m"(ptr elementtype(i64) %14)
45 %15 = getelementptr i8, ptr %regs, i32 120
46 call void asm sideeffect "std 29, $0", "=*m"(ptr elementtype(i64) %15)
47 %16 = getelementptr i8, ptr %regs, i32 128
48 call void asm sideeffect "std 30, $0", "=*m"(ptr elementtype(i64) %16)
49 %17 = getelementptr i8, ptr %regs, i32 136
50 call void asm sideeffect "std 31, $0", "=*m"(ptr elementtype(i64) %17)
51 %18 = getelementptr { ptr, ptr }, ptr %fn, i32 0, i32 1
52 %.funcptr = load ptr, ptr %18
53 %19 = getelementptr { ptr, ptr }, ptr %fn, i32 0, i32 0
54 %.ptr = load ptr, ptr %19
55 %20 = load ptr, ptr %sp
56 call void %.funcptr(ptr %.ptr, ptr %20)