about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--.travis.yml26
-rw-r--r--.travis/stp-r940-smtlib2.y.patch24
-rwxr-xr-x.travis/stp.sh32
-rw-r--r--Dockerfile2
-rw-r--r--lib/Solver/IndependentSolver.cpp6
-rw-r--r--test/regression/2015-08-30-empty-constraints.c22
6 files changed, 45 insertions, 67 deletions
diff --git a/.travis.yml b/.travis.yml
index 1979f1ef..be30c1e2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,7 +19,7 @@ env:
 
     # Check the matrix of:
     #   LLVM  : {2.9, 3.4}
-    #   STP   : {r950, UPSTREAM}
+    #   STP   : {2.1.0, master}
     #   UCLIBC: {ENABLED, DISABLED}
     # with Asserts enabled.
 
@@ -27,22 +27,22 @@ env:
 
     # FIXME: Enable when we want to test LLVM3.5
     matrix:
-    #- LLVM_VERSION=3.5 STP_VERSION=UPSTREAM KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
-    #- LLVM_VERSION=3.5 STP_VERSION=UPSTREAM KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
-    - LLVM_VERSION=3.4 STP_VERSION=UPSTREAM KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=1
-    - LLVM_VERSION=3.4 STP_VERSION=UPSTREAM KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
-    - LLVM_VERSION=2.9 STP_VERSION=UPSTREAM KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
-    - LLVM_VERSION=2.9 STP_VERSION=UPSTREAM KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
-    - LLVM_VERSION=3.4 STP_VERSION=r940 KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
-    - LLVM_VERSION=3.4 STP_VERSION=r940 KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
-    - LLVM_VERSION=2.9 STP_VERSION=r940 KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
-    - LLVM_VERSION=2.9 STP_VERSION=r940 KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
+    #- LLVM_VERSION=3.5 STP_VERSION=master KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
+    #- LLVM_VERSION=3.5 STP_VERSION=master KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
+    - LLVM_VERSION=3.4 STP_VERSION=master KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=1
+    - LLVM_VERSION=3.4 STP_VERSION=master KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
+    - LLVM_VERSION=2.9 STP_VERSION=master KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
+    - LLVM_VERSION=2.9 STP_VERSION=master KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
+    - LLVM_VERSION=3.4 STP_VERSION=2.1.0 KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
+    - LLVM_VERSION=3.4 STP_VERSION=2.1.0 KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
+    - LLVM_VERSION=2.9 STP_VERSION=2.1.0 KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
+    - LLVM_VERSION=2.9 STP_VERSION=2.1.0 KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
 
     # Check at least one build with Asserts disabled.
-    - LLVM_VERSION=2.9 STP_VERSION=r940 KLEE_UCLIBC=1 DISABLE_ASSERTIONS=1 ENABLE_OPTIMIZED=1 COVERAGE=0
+    - LLVM_VERSION=2.9 STP_VERSION=2.1.0 KLEE_UCLIBC=1 DISABLE_ASSERTIONS=1 ENABLE_OPTIMIZED=1 COVERAGE=0
 
     # Check at least one Debug+Asserts build
-    - LLVM_VERSION=3.4 STP_VERSION=UPSTREAM KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=0 COVERAGE=0
+    - LLVM_VERSION=3.4 STP_VERSION=master KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=0 COVERAGE=0
     global:
     - secure: EF/WAc4BdIRUchF3mjATN3/UwtGWtGaRgb5oIIJHjKhgZFdPsgWsXFgaOB0jaK2hfO/svj/LvlasuRIGxeePVjeaiX8ZlVpuHiX67vdYLY+0kCDRwkusRjm60/GbPU9O/Xjgb/d4aWAEkoq5OnsprVTEvU8iY2JHtAqgwR+wW9I=
     - secure: Hrp1MRSxDUH2GTQg3QR/yUttY/3KmgbFb5e+zyy551dKpHjxJdsNe8bquY9oFoT7KmPQYl0HNNjEv4qWW8RK+HWHOCB55nL1KlGpOG7vAJcUEZg7ScbliGgiovMB6jIQVfeP9FhYngfc13vNZQ5PGlqzfSsHSAbvkwEogBToHVw=
diff --git a/.travis/stp-r940-smtlib2.y.patch b/.travis/stp-r940-smtlib2.y.patch
deleted file mode 100644
index 212c0180..00000000
--- a/.travis/stp-r940-smtlib2.y.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/src/parser/smtlib2.y b/src/parser/smtlib2.y
-index a94bd6c..5263bf5 100644
---- a/src/parser/smtlib2.y
-+++ b/src/parser/smtlib2.y
-@@ -64,6 +64,7 @@
-     FatalError("");
-     return 1;
-   }
-+  int yyerror(void* AssertsQuery, const char* s) { return yyerror(s); }
- 
-   ASTNode querysmt2;
-   ASTVec assertionsSMT2;
-@@ -72,9 +73,10 @@
- #define YYMAXDEPTH 104857600
- #define YYERROR_VERBOSE 1
- #define YY_EXIT_FAILURE -1
--#define YYPARSE_PARAM AssertsQuery
-   %}
- 
-+%parse-param {void* AssertsQuery}
-+
- %union {  
-   unsigned uintval;                  /* for numerals in types. */
-   //ASTNode,ASTVec
diff --git a/.travis/stp.sh b/.travis/stp.sh
index d2b4f1f1..53b7b6bc 100755
--- a/.travis/stp.sh
+++ b/.travis/stp.sh
@@ -5,7 +5,7 @@ set -e
 
 STP_LOG="$(pwd)/stp-build.log"
 
-if [ "${STP_VERSION}" == "UPSTREAM" ]; then
+if [ "x${STP_VERSION}" != "x" ]; then
     # Build minisat
     git clone https://github.com/stp/minisat
     cd minisat
@@ -18,7 +18,7 @@ if [ "${STP_VERSION}" == "UPSTREAM" ]; then
     cd ../../
 
     # Build STP
-    git clone --depth 1 git://github.com/stp/stp.git src
+    git clone --depth 1 -b "${STP_VERSION}" git://github.com/stp/stp.git src
     mkdir build
     cd build
     # Disabling building of shared libs is a workaround.
@@ -27,34 +27,8 @@ if [ "${STP_VERSION}" == "UPSTREAM" ]; then
 
     set +e # Do not exit if build fails because we need to display the log
     make >> "${STP_LOG}" 2>&1
-
-elif [ "${STP_VERSION}" == "r940" ]; then
-    # Building the old "r940" version that for some reason we love so much!
-    git clone git://github.com/stp/stp.git src_build
-    mkdir build # This is actually the install directory
-    cd src_build/
-    git checkout bc78d1f9f06fc095bd1ddad90eacdd1f05f64dae # r940
-
-    # Fixes for GCC
-    # We don't try to fix clang compilation because there too many things that need
-    # fixing and it isn't really r940 anymore if we start doing that
-    git config --global user.name "travis"
-    git config --global  user.email "travis@travis.123"
-    git cherry-pick ece1a55fb367bd905078baca38476e35b4df06c3
-    patch -p1 -i ${KLEE_SRC}/.travis/stp-r940-smtlib2.y.patch
-
-    # Oh man this project is so broken. The binary build directory is missing
-    mkdir -p bin
-
-    export CC=gcc
-    export CXX=g++
-    ./scripts/configure --with-prefix=${BUILD_DIR}/stp/build --with-cryptominisat2
-    echo "WARNING FORCING GCC TO BE USED TO COMPILE STP"
-
-    set +e # Do not exit if build fails because we need to display the log
-    make OPTIMIZE=-O2 CFLAGS_M32=    install >> "${STP_LOG}" 2>&1
 else
-    echo "Unsupported STP_VERSION"
+    echo "No STP_VERSION given or empty"
     exit 1
 fi
 
diff --git a/Dockerfile b/Dockerfile
index d9fdd02d..c15d7034 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -6,7 +6,7 @@ MAINTAINER Dan Liew <daniel.liew@imperial.ac.uk>
 # the resulting image is unnecessarily large!
 
 ENV LLVM_VERSION=3.4 \
-    STP_VERSION=UPSTREAM \
+    STP_VERSION=master \
     DISABLE_ASSERTIONS=0 \
     ENABLE_OPTIMIZED=1 \
     KLEE_UCLIBC=1 \
diff --git a/lib/Solver/IndependentSolver.cpp b/lib/Solver/IndependentSolver.cpp
index cfe1bb16..a7685e46 100644
--- a/lib/Solver/IndependentSolver.cpp
+++ b/lib/Solver/IndependentSolver.cpp
@@ -454,6 +454,12 @@ bool IndependentSolver::computeInitialValues(const Query& query,
                                              std::vector< std::vector<unsigned char> > &values,
                                              bool &hasSolution){
   std::list<IndependentElementSet> * factors = new std::list<IndependentElementSet>;
+
+  // We assume the query has a solution except proven differently
+  // This is important in case we don't have any constraints but
+  // we need initial values for requested array objects.
+  hasSolution = true;
+
   getAllIndependentConstraintsSets(query, factors);
   //Used to rearrange all of the answers into the correct order
   std::map<const Array*, std::vector<unsigned char> > retMap;
diff --git a/test/regression/2015-08-30-empty-constraints.c b/test/regression/2015-08-30-empty-constraints.c
new file mode 100644
index 00000000..81439e21
--- /dev/null
+++ b/test/regression/2015-08-30-empty-constraints.c
@@ -0,0 +1,22 @@
+// RUN: %llvmgcc %s -emit-llvm -g -O0 -c -o %t.bc
+// RUN: rm -rf %t.klee-out
+// RUN: %klee --output-dir=%t.klee-out %t.bc 2> %t.log
+// RUN: FileCheck -input-file=%t.log %s
+
+/**
+ * This test generates one execution state without constraints.
+ *
+ * The state gets terminated (in this case return) and initial values
+ * are generated.
+ * Make sure we are able to generate an input.
+ */
+int main() {
+  int d;
+
+  klee_make_symbolic( &d, sizeof(d) );
+
+  // CHECK-NOT: unable to compute initial values (invalid constraints?)!
+  if ((d & 2) / 4)
+    return 1;
+  return 0;
+}