Add tests for unary NOT operations.
authorVikram S. Adve <vadve@cs.uiuc.edu>
Thu, 15 Aug 2002 14:09:56 +0000 (14:09 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Thu, 15 Aug 2002 14:09:56 +0000 (14:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3340 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/Generic/select.ll
test/LLC/select.ll

index ed2e833ae9cfa13a34a0a49027a7584ee068c135..5976e5f88d42e2293e5432775b449b15ddf6b8ff 100644 (file)
@@ -149,3 +149,21 @@ bb2:               ;;<label>
        %reg160 = add long 7654321, %cast117    ;;  and here.
        ret int 0
 end
+
+
+; Test case for unary NOT operation constructed from XOR.
+; 
+void "checkNot"(bool %b, int %i)
+begin
+       %notB = xor bool %b, true
+       %notI = xor int %i, -1
+       %F    = setge int %notI, 100
+       %J    = add int %i, %i
+       %andNotB = and bool %F, %notB           ;; should get folded with notB
+       %andNotI = and int %J, %notI            ;; should get folded with notI
+
+       %notB2 = xor bool true, %b              ;; should become XNOR
+       %notI2 = xor int -1, %i                 ;; should become XNOR
+
+       ret void
+end
index ed2e833ae9cfa13a34a0a49027a7584ee068c135..5976e5f88d42e2293e5432775b449b15ddf6b8ff 100644 (file)
@@ -149,3 +149,21 @@ bb2:               ;;<label>
        %reg160 = add long 7654321, %cast117    ;;  and here.
        ret int 0
 end
+
+
+; Test case for unary NOT operation constructed from XOR.
+; 
+void "checkNot"(bool %b, int %i)
+begin
+       %notB = xor bool %b, true
+       %notI = xor int %i, -1
+       %F    = setge int %notI, 100
+       %J    = add int %i, %i
+       %andNotB = and bool %F, %notB           ;; should get folded with notB
+       %andNotI = and int %J, %notI            ;; should get folded with notI
+
+       %notB2 = xor bool true, %b              ;; should become XNOR
+       %notI2 = xor int -1, %i                 ;; should become XNOR
+
+       ret void
+end