about summary refs log tree commit diff homepage
path: root/test/Expr/Parser
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-06-16 04:11:20 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-06-16 04:11:20 +0000
commite3a6923ecc6f6ca968399765492fe844d2da2f2b (patch)
treec2e7ce1259c2757e4bc7addd976a14356238c13f /test/Expr/Parser
parent2a05f46ae3bc3a0fb9fc0df78bb8b55a09e6e9a3 (diff)
downloadklee-e3a6923ecc6f6ca968399765492fe844d2da2f2b.tar.gz
Add basic constant folding / simplification for Eq.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@73467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Expr/Parser')
-rw-r--r--test/Expr/Parser/ConstantFolding.pc10
-rw-r--r--test/Expr/Parser/Simplify.pc7
2 files changed, 17 insertions, 0 deletions
diff --git a/test/Expr/Parser/ConstantFolding.pc b/test/Expr/Parser/ConstantFolding.pc
index bce6d5bb..56895e53 100644
--- a/test/Expr/Parser/ConstantFolding.pc
+++ b/test/Expr/Parser/ConstantFolding.pc
@@ -180,3 +180,13 @@ array a[64] : w32 -> w8 = symbolic
 # RUN: grep -A 2 \"# Query 34$\" %t > %t2
 # RUN: grep \"(query .. false .(Read w8 0 a).\" %t2
 (query [] false [(Xor w8 0 (Read w8 0 a))])
+
+# Check -- true == X ==> X
+# RUN: grep -A 2 \"# Query 35$\" %t > %t2
+# RUN: grep \"(query .. false .(Eq 0 (Read w8 0 a)).\" %t2
+(query [] false [(Eq true (Eq 0 (Read w8 0 a)))])
+
+# Check -- !!X ==> X
+# RUN: grep -A 2 \"# Query 36$\" %t > %t2
+# RUN: grep \"(query .. false .(Eq 0 (Read w8 0 a)).\" %t2
+(query [] false [(Not (Not (Eq 0 (Read w8 0 a))))])
diff --git a/test/Expr/Parser/Simplify.pc b/test/Expr/Parser/Simplify.pc
index cf6d90ab..e89d79ff 100644
--- a/test/Expr/Parser/Simplify.pc
+++ b/test/Expr/Parser/Simplify.pc
@@ -26,3 +26,10 @@ array a[64] : w32 -> w8 = symbolic
 # RUN: grep -A 2 \"# Query 5\" %t > %t2
 # RUN: grep \"(query .. false .(Not (Eq (Read w8 0 a) (Read w8 1 a))).)\" %t2
 (query [] false [(Ne (Read w8 0 a) (Read w8 1 a))])
+
+# Check -- !(X or Y) ==> !X and !Y
+# RUN: grep -A 3 \"# Query 6$\" %t > %t2
+# RUN: grep \"(query .. false .(And (Not (Eq 0 (Read w8 0 a)))\" %t2
+# RUN: grep                       \"(Not (Eq 1 (Read w8 1 a))))\" %t2
+(query [] false [(Not (Or (Eq 0 (Read w8 0 a))
+                          (Eq 1 (Read w8 1 a))))])