1 ; RUN: llc -mcpu=pwr7 < %s | FileCheck %s 2 target datalayout = "e-m:e-i64:64-n32:64" 3 target triple = "powerpc64le-unknown-linux-gnu" 4 5 ; Make sure that we don't generate a std r, 0(0) -- the memory address cannot 6 ; be stored in r0. 7 ; CHECK-LABEL: @test1 8 ; CHECK-NOT: std {{[0-9]+}}, 0(0) 9 ; CHECK: blr 10 11 define void @test1({ i8*, void (i8*, i8*)* } %fn_arg) { 12 %fn = alloca { i8*, void (i8*, i8*)* } 13 %sp = alloca i8*, align 8 14 %regs = alloca [18 x i64], align 8 15 store { i8*, void (i8*, i8*)* } %fn_arg, { i8*, void (i8*, i8*)* }* %fn 16 %1 = bitcast [18 x i64]* %regs to i64* 17 call void asm sideeffect "std 14, $0", "=*m"(i64* %1) 18 %2 = bitcast [18 x i64]* %regs to i8* 19 %3 = getelementptr i8, i8* %2, i32 8 20 %4 = bitcast i8* %3 to i64* 21 call void asm sideeffect "std 15, $0", "=*m"(i64* %4) 22 %5 = bitcast [18 x i64]* %regs to i8* 23 %6 = getelementptr i8, i8* %5, i32 16 24 %7 = bitcast i8* %6 to i64* 25 call void asm sideeffect "std 16, $0", "=*m"(i64* %7) 26 %8 = bitcast [18 x i64]* %regs to i8* 27 %9 = getelementptr i8, i8* %8, i32 24 28 %10 = bitcast i8* %9 to i64* 29 call void asm sideeffect "std 17, $0", "=*m"(i64* %10) 30 %11 = bitcast [18 x i64]* %regs to i8* 31 %12 = getelementptr i8, i8* %11, i32 32 32 %13 = bitcast i8* %12 to i64* 33 call void asm sideeffect "std 18, $0", "=*m"(i64* %13) 34 %14 = bitcast [18 x i64]* %regs to i8* 35 %15 = getelementptr i8, i8* %14, i32 40 36 %16 = bitcast i8* %15 to i64* 37 call void asm sideeffect "std 19, $0", "=*m"(i64* %16) 38 %17 = bitcast [18 x i64]* %regs to i8* 39 %18 = getelementptr i8, i8* %17, i32 48 40 %19 = bitcast i8* %18 to i64* 41 call void asm sideeffect "std 20, $0", "=*m"(i64* %19) 42 %20 = bitcast [18 x i64]* %regs to i8* 43 %21 = getelementptr i8, i8* %20, i32 56 44 %22 = bitcast i8* %21 to i64* 45 call void asm sideeffect "std 21, $0", "=*m"(i64* %22) 46 %23 = bitcast [18 x i64]* %regs to i8* 47 %24 = getelementptr i8, i8* %23, i32 64 48 %25 = bitcast i8* %24 to i64* 49 call void asm sideeffect "std 22, $0", "=*m"(i64* %25) 50 %26 = bitcast [18 x i64]* %regs to i8* 51 %27 = getelementptr i8, i8* %26, i32 72 52 %28 = bitcast i8* %27 to i64* 53 call void asm sideeffect "std 23, $0", "=*m"(i64* %28) 54 %29 = bitcast [18 x i64]* %regs to i8* 55 %30 = getelementptr i8, i8* %29, i32 80 56 %31 = bitcast i8* %30 to i64* 57 call void asm sideeffect "std 24, $0", "=*m"(i64* %31) 58 %32 = bitcast [18 x i64]* %regs to i8* 59 %33 = getelementptr i8, i8* %32, i32 88 60 %34 = bitcast i8* %33 to i64* 61 call void asm sideeffect "std 25, $0", "=*m"(i64* %34) 62 %35 = bitcast [18 x i64]* %regs to i8* 63 %36 = getelementptr i8, i8* %35, i32 96 64 %37 = bitcast i8* %36 to i64* 65 call void asm sideeffect "std 26, $0", "=*m"(i64* %37) 66 %38 = bitcast [18 x i64]* %regs to i8* 67 %39 = getelementptr i8, i8* %38, i32 104 68 %40 = bitcast i8* %39 to i64* 69 call void asm sideeffect "std 27, $0", "=*m"(i64* %40) 70 %41 = bitcast [18 x i64]* %regs to i8* 71 %42 = getelementptr i8, i8* %41, i32 112 72 %43 = bitcast i8* %42 to i64* 73 call void asm sideeffect "std 28, $0", "=*m"(i64* %43) 74 %44 = bitcast [18 x i64]* %regs to i8* 75 %45 = getelementptr i8, i8* %44, i32 120 76 %46 = bitcast i8* %45 to i64* 77 call void asm sideeffect "std 29, $0", "=*m"(i64* %46) 78 %47 = bitcast [18 x i64]* %regs to i8* 79 %48 = getelementptr i8, i8* %47, i32 128 80 %49 = bitcast i8* %48 to i64* 81 call void asm sideeffect "std 30, $0", "=*m"(i64* %49) 82 %50 = bitcast [18 x i64]* %regs to i8* 83 %51 = getelementptr i8, i8* %50, i32 136 84 %52 = bitcast i8* %51 to i64* 85 call void asm sideeffect "std 31, $0", "=*m"(i64* %52) 86 %53 = getelementptr { i8*, void (i8*, i8*)* }, { i8*, void (i8*, i8*)* }* %fn, i32 0, i32 1 87 %.funcptr = load void (i8*, i8*)*, void (i8*, i8*)** %53 88 %54 = getelementptr { i8*, void (i8*, i8*)* }, { i8*, void (i8*, i8*)* }* %fn, i32 0, i32 0 89 %.ptr = load i8*, i8** %54 90 %55 = load i8*, i8** %sp 91 call void %.funcptr(i8* %.ptr, i8* %55) 92 ret void 93 } 94 95