1 ; RUN: llvm-as < %s | llc | grep {movq %rdi, %rax}
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
4 target triple = "x86_64-apple-darwin8"
5 %struct.foo = type { [4 x i64] }
7 define void @bar(%struct.foo* noalias sret %agg.result, %struct.foo* %d) nounwind {
9 %d_addr = alloca %struct.foo* ; <%struct.foo**> [#uses=2]
10 %memtmp = alloca %struct.foo, align 8 ; <%struct.foo*> [#uses=1]
11 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
12 store %struct.foo* %d, %struct.foo** %d_addr
13 %tmp = load %struct.foo** %d_addr, align 8 ; <%struct.foo*> [#uses=1]
14 %tmp1 = getelementptr %struct.foo* %agg.result, i32 0, i32 0 ; <[4 x i64]*> [#uses=4]
15 %tmp2 = getelementptr %struct.foo* %tmp, i32 0, i32 0 ; <[4 x i64]*> [#uses=4]
16 %tmp3 = getelementptr [4 x i64]* %tmp1, i32 0, i32 0 ; <i64*> [#uses=1]
17 %tmp4 = getelementptr [4 x i64]* %tmp2, i32 0, i32 0 ; <i64*> [#uses=1]
18 %tmp5 = load i64* %tmp4, align 8 ; <i64> [#uses=1]
19 store i64 %tmp5, i64* %tmp3, align 8
20 %tmp6 = getelementptr [4 x i64]* %tmp1, i32 0, i32 1 ; <i64*> [#uses=1]
21 %tmp7 = getelementptr [4 x i64]* %tmp2, i32 0, i32 1 ; <i64*> [#uses=1]
22 %tmp8 = load i64* %tmp7, align 8 ; <i64> [#uses=1]
23 store i64 %tmp8, i64* %tmp6, align 8
24 %tmp9 = getelementptr [4 x i64]* %tmp1, i32 0, i32 2 ; <i64*> [#uses=1]
25 %tmp10 = getelementptr [4 x i64]* %tmp2, i32 0, i32 2 ; <i64*> [#uses=1]
26 %tmp11 = load i64* %tmp10, align 8 ; <i64> [#uses=1]
27 store i64 %tmp11, i64* %tmp9, align 8
28 %tmp12 = getelementptr [4 x i64]* %tmp1, i32 0, i32 3 ; <i64*> [#uses=1]
29 %tmp13 = getelementptr [4 x i64]* %tmp2, i32 0, i32 3 ; <i64*> [#uses=1]
30 %tmp14 = load i64* %tmp13, align 8 ; <i64> [#uses=1]
31 store i64 %tmp14, i64* %tmp12, align 8
32 %tmp15 = getelementptr %struct.foo* %memtmp, i32 0, i32 0 ; <[4 x i64]*> [#uses=4]
33 %tmp16 = getelementptr %struct.foo* %agg.result, i32 0, i32 0 ; <[4 x i64]*> [#uses=4]
34 %tmp17 = getelementptr [4 x i64]* %tmp15, i32 0, i32 0 ; <i64*> [#uses=1]
35 %tmp18 = getelementptr [4 x i64]* %tmp16, i32 0, i32 0 ; <i64*> [#uses=1]
36 %tmp19 = load i64* %tmp18, align 8 ; <i64> [#uses=1]
37 store i64 %tmp19, i64* %tmp17, align 8
38 %tmp20 = getelementptr [4 x i64]* %tmp15, i32 0, i32 1 ; <i64*> [#uses=1]
39 %tmp21 = getelementptr [4 x i64]* %tmp16, i32 0, i32 1 ; <i64*> [#uses=1]
40 %tmp22 = load i64* %tmp21, align 8 ; <i64> [#uses=1]
41 store i64 %tmp22, i64* %tmp20, align 8
42 %tmp23 = getelementptr [4 x i64]* %tmp15, i32 0, i32 2 ; <i64*> [#uses=1]
43 %tmp24 = getelementptr [4 x i64]* %tmp16, i32 0, i32 2 ; <i64*> [#uses=1]
44 %tmp25 = load i64* %tmp24, align 8 ; <i64> [#uses=1]
45 store i64 %tmp25, i64* %tmp23, align 8
46 %tmp26 = getelementptr [4 x i64]* %tmp15, i32 0, i32 3 ; <i64*> [#uses=1]
47 %tmp27 = getelementptr [4 x i64]* %tmp16, i32 0, i32 3 ; <i64*> [#uses=1]
48 %tmp28 = load i64* %tmp27, align 8 ; <i64> [#uses=1]
49 store i64 %tmp28, i64* %tmp26, align 8
52 return: ; preds = %entry