Fix inserting new elements in a specified location.
[oota-llvm.git] / test / Transforms / InstCombine / sitofp.ll
index f7b1c91565977bd37322c8f0659884b4a6100d8b..bd31b89f7879afc5c7ae73046c8033c4d6341515 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sitofp
+; RUN: opt < %s -instcombine -S | not grep itofp
 
 define i1 @test1(i8 %A) {
   %B = sitofp i8 %A to double
@@ -31,3 +31,25 @@ define i32 @test5(i32 %A) {
   ret i32 %E
 }
 
+define i32 @test6(i32 %A) {
+       %B = and i32 %A, 7              ; <i32> [#uses=1]
+       %C = and i32 %A, 32             ; <i32> [#uses=1]
+       %D = sitofp i32 %B to double            ; <double> [#uses=1]
+       %E = sitofp i32 %C to double            ; <double> [#uses=1]
+       %F = fadd double %D, %E         ; <double> [#uses=1]
+       %G = fptosi double %F to i32            ; <i32> [#uses=1]
+       ret i32 %G
+}
+
+define i32 @test7(i32 %a) nounwind {
+       %b = sitofp i32 %a to double            ; <double> [#uses=1]
+       %c = fptoui double %b to i32            ; <i32> [#uses=1]
+       ret i32 %c
+}
+
+define i32 @test8(i32 %a) nounwind {
+       %b = uitofp i32 %a to double            ; <double> [#uses=1]
+       %c = fptosi double %b to i32            ; <i32> [#uses=1]
+       ret i32 %c
+}
+