Fix a typo 'iff' => 'if'
[oota-llvm.git] / test / Transforms / InstCombine / add.ll
index 6ff2187474f75cf0bb566e7ec0687823a903263f..68e2433644da17ccf029ba8b2100804694e01313 100644 (file)
@@ -1,6 +1,6 @@
 ; This test makes sure that add instructions are properly eliminated.
 
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
+; RUN: opt < %s -instcombine -S | \
 ; RUN:    grep -v OK | not grep add
 
 define i32 @test1(i32 %A) {
@@ -49,7 +49,7 @@ define i32 @test7(i32 %A) {
         ret i32 %C
 }
 
-; (A & C1)+(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
+; (A & C1)+(B & C2) -> (A & C1)|(B & C2) if C1&C2 == 0
 define i32 @test8(i32 %A, i32 %B) {
         %A1 = and i32 %A, 7             ; <i32> [#uses=1]
         %B1 = and i32 %B, 128           ; <i32> [#uses=1]
@@ -275,3 +275,27 @@ define i32 @test36(i32 %a) {
        %q = and i32 %z, 1  ; always zero
        ret i32 %q
 }
+
+define i1 @test37(i32 %a, i32 %b) nounwind readnone {
+  %add = add i32 %a, %b
+  %cmp = icmp eq i32 %add, %a
+  ret i1 %cmp
+}
+
+define i1 @test38(i32 %a, i32 %b) nounwind readnone {
+  %add = add i32 %a, %b
+  %cmp = icmp eq i32 %add, %b
+  ret i1 %cmp
+}
+
+define i1 @test39(i32 %a, i32 %b) nounwind readnone {
+  %add = add i32 %b, %a
+  %cmp = icmp eq i32 %add, %a
+  ret i1 %cmp
+}
+
+define i1 @test40(i32 %a, i32 %b) nounwind readnone {
+  %add = add i32 %b, %a
+  %cmp = icmp eq i32 %add, %b
+  ret i1 %cmp
+}