Merge or combine tests and convert to FileCheck.
[oota-llvm.git] / test / Transforms / InstSimplify / apint-or.ll
index ebbc7be98b09c1c526891daee988bb5a6e435696..36844289aaf0bf3bb30a40375e68d5bad360015a 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: opt < %s -instsimplify -S | not grep or
+; RUN: opt < %s -instsimplify -S | FileCheck %s
 
 ; Test the case where integer BitWidth <= 64 && BitWidth % 2 != 0.
 define i39 @test1(i39 %V, i39 %M) {
@@ -18,8 +18,22 @@ define i39 @test1(i39 %V, i39 %M) {
 ; CHECK-NEXT: ret
 }
 
+define i7 @test2(i7 %X) {
+    %Y = or i7 %X, 0
+    ret i7 %Y
+; CHECK-LABEL: @test2
+; CHECK-NEXT: ret i7 %X
+}
+
+define i17 @test3(i17 %X) {
+    %Y = or i17 %X, -1
+    ret i17 %Y
+; CHECK-LABEL: @test3
+; CHECK-NEXT: ret i17 -1
+}
+
 ; Test the case where Integer BitWidth > 64 && BitWidth <= 1024. 
-define i399 @test2(i399 %V, i399 %M) {
+define i399 @test4(i399 %V, i399 %M) {
     ;; If we have: ((V + N) & C1) | (V & C2)
     ;; .. and C2 = ~C1 and C2 is 0+1+ and (N & C2) == 0
     ;; replace with V+N.
@@ -30,8 +44,22 @@ define i399 @test2(i399 %V, i399 %M) {
     %D = and i399 %V, 274877906943
     %R = or i399 %B, %D
     ret i399 %R
-; CHECK-LABEL: @test2
+; CHECK-LABEL: @test4
 ; CHECK-NEXT: and {{.*}}, 18446742974197923840
 ; CHECK-NEXT: add
 ; CHECK-NEXT: ret
 }
+
+define i777 @test5(i777 %X) {
+    %Y = or i777 %X, 0
+    ret i777 %Y
+; CHECK-LABEL: @test5
+; CHECK-NEXT: ret i777 %X
+}
+
+define i117 @test6(i117 %X) {
+    %Y = or i117 %X, -1
+    ret i117 %Y
+; CHECK-LABEL: @test6
+; CHECK-NEXT: ret i117 -1
+}