Fix a number of byval / memcpy / memset related codegen issues.
[oota-llvm.git] / test / CodeGen / X86 / byval3.ll
1 ; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsq | count 2
2 ; RUN: llvm-as < %s | llc -march=x86 | grep rep.movsl | count 2
3
4 %struct.s = type { i32, i32, i32, i32, i32, i32, i32, i32,
5                    i32, i32, i32, i32, i32, i32, i32, i32,
6                    i32, i32, i32, i32, i32, i32, i32, i32,
7                    i32, i32, i32, i32, i32, i32, i32, i32,
8                    i32 }
9
10 define void @g(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6) nounwind {
11 entry:
12         %d = alloca %struct.s, align 16
13         %tmp = getelementptr %struct.s* %d, i32 0, i32 0
14         store i32 %a1, i32* %tmp, align 16
15         %tmp2 = getelementptr %struct.s* %d, i32 0, i32 1
16         store i32 %a2, i32* %tmp2, align 16
17         %tmp4 = getelementptr %struct.s* %d, i32 0, i32 2
18         store i32 %a3, i32* %tmp4, align 16
19         %tmp6 = getelementptr %struct.s* %d, i32 0, i32 3
20         store i32 %a4, i32* %tmp6, align 16
21         %tmp8 = getelementptr %struct.s* %d, i32 0, i32 4
22         store i32 %a5, i32* %tmp8, align 16
23         %tmp10 = getelementptr %struct.s* %d, i32 0, i32 5
24         store i32 %a6, i32* %tmp10, align 16
25         call void @f( %struct.s* %d byval)
26         call void @f( %struct.s* %d byval)
27         ret void
28 }
29
30 declare void @f(%struct.s* byval)