about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorCristian Cadar <cristic@cs.stanford.edu>2009-06-04 02:59:28 +0000
committerCristian Cadar <cristic@cs.stanford.edu>2009-06-04 02:59:28 +0000
commit84d237a292f44022b0df6351dd2ffdc89785d214 (patch)
tree6bd264780f62177c84ba71d11b7108c379ca0437
parent0ebcdc8660b3996ff3cf0f8e48d68653f47f705b (diff)
downloadklee-84d237a292f44022b0df6351dd2ffdc89785d214.tar.gz
Added a couple of tests for ReadLSB/MSB. Changed kleaver to write to stdout.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72841 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Expr/Parser.cpp2
-rw-r--r--test/Expr/Printer/MultiByteReads.pc17
-rw-r--r--test/Expr/Printer/dg.exp3
3 files changed, 21 insertions, 1 deletions
diff --git a/lib/Expr/Parser.cpp b/lib/Expr/Parser.cpp
index 5f666269..9e1849ae 100644
--- a/lib/Expr/Parser.cpp
+++ b/lib/Expr/Parser.cpp
@@ -1291,7 +1291,7 @@ Decl::Decl() {}
 void QueryCommand::dump() {
   // FIXME: This is masking the difference between an actual query and
   // a query decl.
-  ExprPPrinter::printQuery(std::cerr, 
+  ExprPPrinter::printQuery(std::cout, 
                            ConstraintManager(Constraints), 
                            Query);
 }
diff --git a/test/Expr/Printer/MultiByteReads.pc b/test/Expr/Printer/MultiByteReads.pc
new file mode 100644
index 00000000..af94b516
--- /dev/null
+++ b/test/Expr/Printer/MultiByteReads.pc
@@ -0,0 +1,17 @@
+# RUN: %kleaver -print-ast -pc-multibyte-reads=true %s >log
+# RUN: grep -q "(ReadLSB w32 4 arr1)" log
+# RUN: grep -q "(ReadMSB w32 2 arr2)" log
+
+(query [(Not (Slt 100
+                  (Concat w32 (Read w8 7 arr1)
+                              (Concat w24 (Read w8 6 arr1)
+                                          (Concat w16 (Read w8 5 arr1) (Read w8 4 arr1))))))]
+       false)
+
+
+(query [(Not (Slt 100
+                  (Concat w32 (Read w8 2 arr2)
+                              (Concat w24 (Read w8 3 arr2)
+                                          (Concat w16 (Read w8 4 arr2) (Read w8 5 arr2))))))]
+       false)
+
diff --git a/test/Expr/Printer/dg.exp b/test/Expr/Printer/dg.exp
new file mode 100644
index 00000000..94fc4df8
--- /dev/null
+++ b/test/Expr/Printer/dg.exp
@@ -0,0 +1,3 @@
+load_lib llvm.exp
+
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{pc}]]