diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Expr/Parser/ConstantFolding.pc | 10 | ||||
-rw-r--r-- | test/Expr/Parser/Simplify.pc | 7 |
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))))]) |