Merging r259740:
[oota-llvm.git] / test / CodeGen / PowerPC / byval-aliased.ll
1 ; RUN: llc -mcpu=ppc64 < %s | FileCheck %s
2 target datalayout = "E-m:o-p:32:32-f64:32:64-n32"
3 target triple = "powerpc-apple-macosx10.5.0"
4  
5 %struct.sm = type { i8, i8 }
6  
7 ; Function Attrs: nounwind ssp
8 define void @foo(%struct.sm* byval %s) #0 {
9 entry:
10   %a = getelementptr inbounds %struct.sm, %struct.sm* %s, i32 0, i32 0
11   %0 = load i8, i8* %a, align 1
12   %conv2 = zext i8 %0 to i32
13   %add = add nuw nsw i32 %conv2, 3
14   %conv1 = trunc i32 %add to i8
15   store i8 %conv1, i8* %a, align 1
16   call void @bar(%struct.sm* byval %s, %struct.sm* byval %s) #1
17   ret void
18 }
19
20 ; CHECK-LABEL: @foo
21 ; CHECK: stb {{r[0-9]+}}, [[OFF:[0-9]+]]({{r[3]?1}})
22 ; CHECK: lhz r3, [[OFF]]({{r[3]?1}})
23 ; CHECK: bl _bar
24 ; CHECK: blr
25  
26 declare void @bar(%struct.sm* byval, %struct.sm* byval)
27  
28 attributes #0 = { nounwind ssp }
29 attributes #1 = { nounwind }
30