Replace all instances of dg.exp file with lit.local.cfg, since all tests are run...
[oota-llvm.git] / test / Transforms / SimplifyLibCalls / iprintf.ll
index b99de6efb876035dbad4f6343044ed3e58172c0c..7f036fe3ab8bbc728b01dbb1d1573652ec10e465 100644 (file)
@@ -46,5 +46,26 @@ entry:
        ret i32 %0
 }
 
+; Verify fprintf with no floating point arguments is transformed to fiprintf
+define i32 @f4(i8* %p, i32 %x) nounwind {
+entry:
+; CHECK: define i32 @f4
+; CHECK: @fiprintf
+; CHECK: }
+       %0 = tail call i32 (i8*, i8*, ...)* @fprintf(i8 *%p, i8* getelementptr ([4 x i8]* @.str1, i32 0, i32 0), i32 %x)
+       ret i32 %0
+}
+
+; Verify we don't turn this into an fiprintf call
+define i32 @f5(i8* %p, double %x) nounwind {
+entry:
+; CHECK: define i32 @f5
+; CHECK: @fprintf
+; CHECK: }
+       %0 = tail call i32 (i8*, i8*, ...)* @fprintf(i8 *%p, i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), double %x)
+       ret i32 %0
+}
+
 declare i32 @printf(i8* nocapture, ...) nounwind
 declare i32 @sprintf(i8* nocapture, i8* nocapture, ...) nounwind
+declare i32 @fprintf(i8* nocapture, i8* nocapture, ...) nounwind