TypeLegalizer: Add support for passing of vector-promoted types in registers (copyFro...
[oota-llvm.git] / test / CodeGen / X86 / 2008-08-23-X86-64AsmBug.ll
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin | grep movd | count 1
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin | grep movq
3 ; PR2677
4
5
6         %struct.Bigint = type { %struct.Bigint*, i32, i32, i32, i32, [1 x i32] }
7
8 define double @_Z7qstrtodPKcPS0_Pb(i8* %s00, i8** %se, i8* %ok) nounwind {
9 entry:
10         br label %bb163
11
12 bb151:          ; preds = %entry
13         br label %bb163
14
15 bb163:          ; preds = %bb151, %entry
16         %tmp366 = load double* null, align 8            ; <double> [#uses=1]
17         %tmp368 = fmul double %tmp366, 0.000000e+00             ; <double> [#uses=1]
18         %tmp368226 = bitcast double %tmp368 to i64              ; <i64> [#uses=1]
19         br label %bb5.i
20
21 bb5.i:          ; preds = %bb5.i57.i, %bb163
22         %b.0.i = phi %struct.Bigint* [ null, %bb163 ]           ; <%struct.Bigint*> [#uses=1]
23         %tmp3.i7.i728 = load i32* null, align 4         ; <i32> [#uses=1]
24         br label %bb.i27.i
25
26 bb.i27.i:               ; preds = %bb.i27.i, %bb5.i
27         %tmp23.i20.i = lshr i32 0, 16           ; <i32> [#uses=1]
28         br label %bb5.i57.i
29
30 bb5.i57.i:              ; preds = %bb.i27.i
31         %tmp50.i35.i = load i32* null, align 4          ; <i32> [#uses=1]
32         %tmp51.i36.i = add i32 %tmp50.i35.i, 1          ; <i32> [#uses=2]
33         %tmp2.i.i37.i = shl i32 1, %tmp51.i36.i         ; <i32> [#uses=2]
34         %tmp4.i.i38.i = shl i32 %tmp2.i.i37.i, 2                ; <i32> [#uses=1]
35         %tmp7.i.i39.i = add i32 %tmp4.i.i38.i, 28               ; <i32> [#uses=1]
36         %tmp8.i.i40.i = malloc i8, i32 %tmp7.i.i39.i            ; <i8*> [#uses=1]
37         %tmp9.i.i41.i = bitcast i8* %tmp8.i.i40.i to %struct.Bigint*            ; <%struct.Bigint*> [#uses=2]
38         store i32 %tmp51.i36.i, i32* null, align 8
39         store i32 %tmp2.i.i37.i, i32* null, align 4
40         free %struct.Bigint* %b.0.i
41         store i32 %tmp23.i20.i, i32* null, align 4
42         %tmp74.i61.i = add i32 %tmp3.i7.i728, 1         ; <i32> [#uses=1]
43         store i32 %tmp74.i61.i, i32* null, align 4
44         br label %bb7.i
45
46 bb7.i:          ; preds = %bb5.i57.i
47         %tmp514 = load i32* null, align 4               ; <i32> [#uses=1]
48         %tmp515 = sext i32 %tmp514 to i64               ; <i64> [#uses=1]
49         %tmp516 = shl i64 %tmp515, 2            ; <i64> [#uses=1]
50         %tmp517 = add i64 %tmp516, 8            ; <i64> [#uses=1]
51         %tmp519 = getelementptr %struct.Bigint* %tmp9.i.i41.i, i32 0, i32 3             ; <i32*> [#uses=1]
52         %tmp523 = bitcast i32* %tmp519 to i8*           ; <i8*> [#uses=1]
53         call void @llvm.memcpy.i64( i8* null, i8* %tmp523, i64 %tmp517, i32 1 )
54         %tmp524136 = bitcast i64 %tmp368226 to double           ; <double> [#uses=1]
55         store double %tmp524136, double* null
56         unreachable
57 }
58
59 declare void @llvm.memcpy.i64(i8*, i8*, i64, i32) nounwind