More instcombine testcases
authorChris Lattner <sabre@nondot.org>
Wed, 9 Jun 2004 07:59:40 +0000 (07:59 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 9 Jun 2004 07:59:40 +0000 (07:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14094 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/select.ll

index 891f057d57a434757c3981ee021fcfc4bc2922db..fe89d93a664732701a0355206b7cdc34109699bd 100644 (file)
@@ -109,3 +109,30 @@ bool %test14b(bool %C, int %X) {
        ret bool %R
 }
 
+int %test15a(int %X) {       ;; Code sequence for (X & 16) ? 16 : 0
+        %t1 = and int %X, 16
+        %t2 = seteq int %t1, 0
+        %t3 = select bool %t2, int 0, int 16 ;; X & 16
+        ret int %t3
+}
+
+int %test15b(int %X) {       ;; Code sequence for (X & 32) ? 0 : 24
+        %t1 = and int %X, 32
+        %t2 = seteq int %t1, 0
+        %t3 = select bool %t2, int 32, int 0 ;; ~X & 32
+        ret int %t3
+}
+
+int %test15c(int %X) {       ;; Alternate code sequence for (X & 16) ? 16 : 0
+        %t1 = and int %X, 16
+        %t2 = seteq int %t1, 16
+        %t3 = select bool %t2, int 16, int 0 ;; X & 16
+        ret int %t3
+}
+
+int %test15d(int %X) {       ;; Alternate code sequence for (X & 16) ? 16 : 0
+        %t1 = and int %X, 16
+        %t2 = setne int %t1, 0
+        %t3 = select bool %t2, int 16, int 0 ;; X & 16
+        ret int %t3
+}