1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+sse2 -pre-alloc-split | FileCheck %s
3 @.str = private constant [28 x i8] c"\0A\0ADOUBLE D = %f\0A\00", align 1 ; <[28 x i8]*> [#uses=1]
4 @.str1 = private constant [37 x i8] c"double to long l1 = %ld\09\09(0x%lx)\0A\00", align 8 ; <[37 x i8]*> [#uses=1]
5 @.str2 = private constant [35 x i8] c"double to uint ui1 = %u\09\09(0x%x)\0A\00", align 8 ; <[35 x i8]*> [#uses=1]
6 @.str3 = private constant [37 x i8] c"double to ulong ul1 = %lu\09\09(0x%lx)\0A\00", align 8 ; <[37 x i8]*> [#uses=1]
8 define i32 @main(i32 %argc, i8** nocapture %argv) nounwind ssp {
9 ; CHECK: movsd %xmm0, (%rsp)
11 %0 = icmp sgt i32 %argc, 4 ; <i1> [#uses=1]
12 br i1 %0, label %bb, label %bb2
15 %1 = getelementptr inbounds i8** %argv, i64 4 ; <i8**> [#uses=1]
16 %2 = load i8** %1, align 8 ; <i8*> [#uses=1]
17 %3 = tail call double @atof(i8* %2) nounwind ; <double> [#uses=1]
20 bb2: ; preds = %bb, %entry
21 %storemerge = phi double [ %3, %bb ], [ 2.000000e+00, %entry ] ; <double> [#uses=4]
22 %4 = fptoui double %storemerge to i32 ; <i32> [#uses=2]
23 %5 = fptoui double %storemerge to i64 ; <i64> [#uses=2]
24 %6 = fptosi double %storemerge to i64 ; <i64> [#uses=2]
25 %7 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([28 x i8]* @.str, i64 0, i64 0), double %storemerge) nounwind ; <i32> [#uses=0]
26 %8 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([37 x i8]* @.str1, i64 0, i64 0), i64 %6, i64 %6) nounwind ; <i32> [#uses=0]
27 %9 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([35 x i8]* @.str2, i64 0, i64 0), i32 %4, i32 %4) nounwind ; <i32> [#uses=0]
28 %10 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([37 x i8]* @.str3, i64 0, i64 0), i64 %5, i64 %5) nounwind ; <i32> [#uses=0]
32 declare double @atof(i8* nocapture) nounwind readonly
34 declare i32 @printf(i8* nocapture, ...) nounwind