Hello community,

here is the log from the commit of package klee for openSUSE:Factory checked in 
at 2017-10-23 16:44:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/klee (Old)
 and      /work/SRC/openSUSE:Factory/.klee.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "klee"

Mon Oct 23 16:44:02 2017 rev:5 rq:534467 version:1.4.0+20171009

Changes:
--------
--- /work/SRC/openSUSE:Factory/klee/klee.changes        2017-07-08 
12:34:23.750484402 +0200
+++ /work/SRC/openSUSE:Factory/.klee.new/klee.changes   2017-10-23 
16:44:10.910265688 +0200
@@ -1,0 +2,118 @@
+Tue Oct 10 12:45:08 UTC 2017 - [email protected]
+
+- Update to version 1.4.0+20171009:
+  * Added support for hiding command-line options
+  * Removed "llvm::" and reformatting in CmdLineOptions.cpp
+  * Remove unnecessary null pointer checks
+  * Removed dead link, fixes #754
+  * [CMake] Fix initialisation order of `KLEE_COMPONENT_*` and 
`KLEE_SOLVER_LIBRARIES` variables. The code to add `NDEBUG` to 
`KLEE_COMPONENT_CXX_DEFINES` did so before initialisation and would be silently 
overwritten.
+  * [CMake] Report the value of some important variables during configure to 
aid debugging.
+  * Silenced some warnings about unused variables when assertions are disabled.
+  * Remove Autoconf/Makefile build system and adjust the TravisCI 
configuration, TravisCI scripts and Dockerfile build appropriately.
+  * Fix TravisCI `METASMT_DEFAULT` setting.
+  * [CMake] Fix bug when doing non-assert builds.
+  * [CMake] Add global clean target `clean_all`. Fixes #718.
+  * [CMake] Add `clean_doxygen` rule to clean up doxygen build tree and add 
this as a dependency of `clean_all`.
+  * enforce c++11
+  * Removed the word 'unsigned' from integer overflow error messages
+  * Silenced warnings on comparison of integers of different signs in 
TreeStreamTest
+  * Fixed initialization of distance to uncovered instructions when KLEE 
relies on default searchers
+- removed:
+  * 0004-cmake-expand-library-dependencies-with-USE_CMAKE_FIN.patch
+- renamed:
+  * 0005-llvm37-handle-GetElementPtrInst-Create-s-new-paramet.patch ->
+      0004-llvm37-handle-getRegisteredOptions.patch
+  * 0006-llvm-make-KLEE-compile-against-LLVM-3.8.patch ->
+      0005-llvm-make-KLEE-compile-against-LLVM-3.8.patch
+  * 0007-llvm-make-KLEE-compile-against-LLVM-3.9.patch ->
+      0006-llvm-make-KLEE-compile-against-LLVM-3.9.patch
+  * 0008-llvm37-handle-GetElementPtrInst-Create-s-new-paramet.patch ->
+      0007-llvm40-handle-different-header-names.patch
+  * 0009-llvm40-handle-different-header-names.patch ->
+      0007-llvm40-handle-different-header-names.patch
+  * 0010-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch ->
+      0008-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch
+  * 0011-llvm40-errorOr-and-similar.patch ->
+      0009-llvm40-errorOr-and-similar.patch
+  * 0012-llvm-use-chrono-helpers-from-LLVM-4.0.patch ->
+      0010-llvm-use-chrono-helpers-from-LLVM-4.0.patch
+  * 0013-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch ->
+      0011-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch
+
+-------------------------------------------------------------------
+Thu Aug 17 12:05:26 UTC 2017 - [email protected]
+
+- Update to version 1.4.0+20170811:
+  * Removing flaky test Vararg.c from Darwin build until we find a proper fix
+  * Fixed typos in comments related to vararg support.
+  * llvm: don't use clEnumValEnd for LLVM 4.0
+  * llvm: get rid of static_casts from iterators
+  * llvm37: do not copy DILocation to getDSPIPath
+  * Added location info for external calls and improved a message.
+  * llvm37: introduce type for PassManager
+  * move module loading into external function
+  * Corrected comment of Z3Solver class
+  * Added caching of Homebrew downloads
+  * Use assembly line for printing debug information
+  * Fixes bug in TreeStreamWriter::write reported by @gladtbx in #562.  Also 
removes commented out code from that function.
+  * Implement basic support for vectorized instructions.
+  * Added some unit tests for TreeStream: one testing some basic behaviour, 
the other a regression test for #562
+  * Core: TimingSolver, use TimerStatIncrementer
+  * Replace assertions of types on LLVM instructions in the Executor with a 
pass that checks these assertions. This improves several things.
+  * Switching version to 1.4.0
+  * Release notes for 1.4.0
+  * Remove support for LLVM < 3.4
+  * Updated test cases to reflect removal of LLVM 2.9
+  * Cleanup Travis builder
+  * Remove klee-gcc
+  * Remove LLVM 2.9 from Makefiles
+  * [CMake] Fix bug where the runtime build system would not rebuild bitcode 
archive/modules when the list of source files that constitute it changes.
+  * [CMake] Add a sanity check to the runtime build system so that we provide 
a better error message (and stop earlier) when no C source files are found.
+  * llvm: get rid of static_casts from iterators (take 2)
+  * more portable shebangs
+  * Moved klee_choose from klee-libc to KLEE intrinsics.
+  * Re-enable parts of `FloatingPointOps.ll`. The message about failures 
doesn't seem relevant anymore given that LLVM 3.4 is the minimum version KLEE 
supports. Also do minor clean up. This was spotted by @andreamattavelli.
+  * Added the const qualifier to the keys in the constantMap
+  * This commit simply moves evalConstant to ExecutorUtil (where 
evalConstantExpr also resides), as suggested by an old comment.
+  * [CMake] Fix bug where we would inherit LLVM's `-DNDEBUG` define when LLVM 
was built without assertions. This prevented `ENABLE_KLEE_ASSERTS` from working 
correctly.
+  * [CMake] Emit warning when mixing assert and non assert builds.
+  * Cleanup tests for last LLVM 2.9 references
+  * Added regression test for bug reported by @kren1 in #262
+  * This reverts incorrect patch 
https://github.com/klee/klee/commit/db29a0bba74b672cdf4b8fef4d94ffa6ab845e6d 
__fprintf_chk has a different prototype than fprintf
+  * Now that LLVM 2.9 is gone, we can use cl::bits instead of cl::list
+  * [CMake] Refactor STP detection and change the default value of 
`ENABLE_SOLVER_STP` to be set dynamically based on whether STP is available. 
Previously the default was always off.
+  * [CMake] Refactor Z3 detection and change the default value of 
`ENABLE_SOLVER_Z3` to be set dynamically based on whether Z3 is available. 
Previously the default was always off.
+  * [CMake] Add `ENABLE_ZLIB` option to control whether KLEE uses zlib. The 
default is `ON` if zlib is found on first configure and `OFF` if zlib is not 
found on first configure.
+  * [CMake] Change the default value of `ENABLE_SOLVER_METASMT` to be set 
dynamically based on whether MetaSMT is available. Previously the default was 
always off.
+  * [TravisCI] Make sure when building with CMake that only the solvers 
requested get used.
+  * Modified Travis-CI script to compile STP with BOOST support
+  * Fixed script for STP in Travis-CI: Build now exits on errors
+  * Added another variant of printFileLine in KInstruction that returns the 
location as a string.  Also added const qualifier to the printFileLine functions
+  * Added an optional KInstruction* argument to evalConstant and 
evalConstantExpr which allows us to print the location associated with the 
constant in any error messages.  Added a test case for the unsupported features 
for taking the address of a label, which exercises the patch.
+  * Fix build for FreeBSD.
+  * Fixed test case counter: Previously the number of test cases generated by 
KLEE was always incremented, even if a symbolic solution was not found.
+  * Removed merging searchers
+  * Added checks for div/mod by zero and overshifts in constant expressions.  
Such div/mod by zero expressions would previously crash KLEE.  Added two test 
cases, one for div/mod by zero, the other for overshift.  This fixes the bug 
reported in #268.
+  * Untabify this file, which was using a mix of spaces and tabs for alignment.
+  * Fixed a compiler warning (unused variable)
+  * Fixed a bug causing KLEE to generate files with no  permissions bits set.  
This was introduced when we added the --readable-posix-inputs option.
+  * Added a basic test for klee-replay
+- reshuffle with patches
+  * A 0001-llvm37-handle-GetElementPtrInst-Create-s-new-paramet.patch
+  * A 0002-llvm-make-KLEE-compile-against-LLVM-3.7.patch
+  * A 0003-test-add-versions-of-some-tests-for-LLVM-3.7.patch
+  * A 0004-cmake-expand-library-dependencies-with-USE_CMAKE_FIN.patch
+  * A 0005-llvm37-handle-GetElementPtrInst-Create-s-new-paramet.patch
+  * A 0006-llvm-make-KLEE-compile-against-LLVM-3.8.patch
+  * A 0007-llvm-make-KLEE-compile-against-LLVM-3.9.patch
+  * A 0008-llvm37-handle-GetElementPtrInst-Create-s-new-paramet.patch
+  * D 0001-llvm-don-t-use-clEnumValEnd-for-LLVM-4.0.patch
+  * D 0002-llvm-get-rid-of-static_casts-from-iterators.patch
+  * D 0003-Core-TimingSolver-use-WallTimer.patch
+  * D 0004-llvm-make-KLEE-compile-against-LLVM-3.7.patch
+  * D 0005-llvm-make-KLEE-compile-against-LLVM-3.8.patch
+  * D 0006-llvm-make-KLEE-compile-against-LLVM-3.9.patch
+  * D 0007-test-add-versions-of-some-tests-for-LLVM-3.8.patch
+  * D 0008-travis-CI-add-LLVM-3.8-build-tests.patch
+
+-------------------------------------------------------------------

Old:
----
  0001-llvm-don-t-use-clEnumValEnd-for-LLVM-4.0.patch
  0002-llvm-get-rid-of-static_casts-from-iterators.patch
  0003-Core-TimingSolver-use-WallTimer.patch
  0004-llvm-make-KLEE-compile-against-LLVM-3.7.patch
  0007-test-add-versions-of-some-tests-for-LLVM-3.8.patch
  0008-travis-CI-add-LLVM-3.8-build-tests.patch
  0009-llvm40-handle-different-header-names.patch
  0010-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch
  0011-llvm40-errorOr-and-similar.patch
  0012-llvm-use-chrono-helpers-from-LLVM-4.0.patch
  0013-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch
  klee-1.3.0+20170607.tar.xz

New:
----
  0001-llvm37-handle-GetElementPtrInst-Create-s-new-paramet.patch
  0002-llvm-make-KLEE-compile-against-LLVM-3.7.patch
  0003-test-add-versions-of-some-tests-for-LLVM-3.7.patch
  0004-llvm37-handle-getRegisteredOptions.patch
  0007-llvm40-handle-different-header-names.patch
  0008-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch
  0009-llvm40-errorOr-and-similar.patch
  0010-llvm-use-chrono-helpers-from-LLVM-4.0.patch
  0011-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch
  klee-1.4.0+20171009.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ klee.spec ++++++
--- /var/tmp/diff_new_pack.eQhzzd/_old  2017-10-23 16:44:11.954216831 +0200
+++ /var/tmp/diff_new_pack.eQhzzd/_new  2017-10-23 16:44:11.954216831 +0200
@@ -19,7 +19,7 @@
 %define llvm_version_minor 0
 %define llvm_version %{llvm_version_major}
 
-%define version_unconverted 1.3.0+20170607
+%define version_unconverted 1.4.0+20171009
 
 %ifarch %{ix86} x86_64
 %define with_uclibc 1
@@ -31,7 +31,7 @@
 Summary:        LLVM Execution Engine
 License:        NCSA
 Group:          Development/Languages/Other
-Version:        1.3.0+20170607
+Version:        1.4.0+20171009
 Release:        0
 Url:            http://klee.github.io/
 Source0:        %{name}-%{version}.tar.xz
@@ -39,20 +39,18 @@
 Source2:        
https://raw.githubusercontent.com/llvm-mirror/llvm/release_%{llvm_version_major}%{llvm_version_minor}/utils/not/not.cpp
 Source3:        
https://raw.githubusercontent.com/llvm-mirror/llvm/release_%{llvm_version_major}%{llvm_version_minor}/utils/FileCheck/FileCheck.cpp
 Patch0:         0001-errno-define-__errno_location.patch
-Patch1:         0001-test-DirSeek-make-it-XFAIL-temporarily.patch
-Patch2:         0001-llvm-don-t-use-clEnumValEnd-for-LLVM-4.0.patch
-Patch3:         0002-llvm-get-rid-of-static_casts-from-iterators.patch
-Patch4:         0003-Core-TimingSolver-use-WallTimer.patch
-Patch5:         0004-llvm-make-KLEE-compile-against-LLVM-3.7.patch
-Patch6:         0005-llvm-make-KLEE-compile-against-LLVM-3.8.patch
-Patch7:         0006-llvm-make-KLEE-compile-against-LLVM-3.9.patch
-Patch8:         0007-test-add-versions-of-some-tests-for-LLVM-3.8.patch
-Patch9:         0008-travis-CI-add-LLVM-3.8-build-tests.patch
-Patch10:        0009-llvm40-handle-different-header-names.patch
-Patch11:        0010-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch
-Patch12:        0011-llvm40-errorOr-and-similar.patch
-Patch13:        0012-llvm-use-chrono-helpers-from-LLVM-4.0.patch
-Patch14:        0013-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch
+Patch1:         0001-llvm37-handle-GetElementPtrInst-Create-s-new-paramet.patch
+Patch2:         0002-llvm-make-KLEE-compile-against-LLVM-3.7.patch
+Patch3:         0003-test-add-versions-of-some-tests-for-LLVM-3.7.patch
+Patch4:         0004-llvm37-handle-getRegisteredOptions.patch
+Patch5:         0005-llvm-make-KLEE-compile-against-LLVM-3.8.patch
+Patch6:         0006-llvm-make-KLEE-compile-against-LLVM-3.9.patch
+Patch7:         0007-llvm40-handle-different-header-names.patch
+Patch8:         0008-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch
+Patch9:         0009-llvm40-errorOr-and-similar.patch
+Patch10:        0010-llvm-use-chrono-helpers-from-LLVM-4.0.patch
+Patch11:        0011-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch
+Patch14:        0001-test-DirSeek-make-it-XFAIL-temporarily.patch
 
 BuildRequires:  clang%{llvm_version}
 BuildRequires:  cmake
@@ -90,8 +88,6 @@
 %patch9 -p1
 %patch10 -p1
 %patch11 -p1
-%patch12 -p1
-%patch13 -p1
 %patch14 -p1
 mkdir -p build/test/
 cp %{SOURCE2} build/test/

++++++ 0001-llvm37-handle-GetElementPtrInst-Create-s-new-paramet.patch ++++++
From: Jiri Slaby <[email protected]>
Date: Thu, 15 Jun 2017 15:20:49 +0200
Subject: llvm37: handle GetElementPtrInst::Create's new parameter
Patch-mainline: no

LLVM 3.7 added a PointeeType parameter to GetElementPtrInst::Create.
Let's handle that by a macro called KLEE_LLVM_GEP_TYPE, defined in
Version.h.

Signed-off-by: Jiri Slaby <[email protected]>
---
 include/klee/Config/Version.h   |  6 ++++++
 lib/Core/ExternalDispatcher.cpp |  1 +
 lib/Module/IntrinsicCleaner.cpp | 12 ++++++++----
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/include/klee/Config/Version.h b/include/klee/Config/Version.h
index ccf54ae13092..532051602fe3 100644
--- a/include/klee/Config/Version.h
+++ b/include/klee/Config/Version.h
@@ -15,6 +15,12 @@
 #define LLVM_VERSION(major, minor) (((major) << 8) | (minor))
 #define LLVM_VERSION_CODE LLVM_VERSION(LLVM_VERSION_MAJOR, LLVM_VERSION_MINOR)
 
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+#  define KLEE_LLVM_GEP_TYPE(x) (x),
+#else
+#  define KLEE_LLVM_GEP_TYPE(x)
+#endif
+
 #if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
 #  define KLEE_LLVM_CL_VAL_END
 #else
diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp
index 6c54d34b82bb..7d0707ddfab2 100644
--- a/lib/Core/ExternalDispatcher.cpp
+++ b/lib/Core/ExternalDispatcher.cpp
@@ -319,6 +319,7 @@ Function *ExternalDispatcherImpl::createDispatcher(Function 
*target,
     Type *argTy =
         (i < FTy->getNumParams() ? FTy->getParamType(i) : (*ai)->getType());
     Instruction *argI64p = GetElementPtrInst::Create(
+        KLEE_LLVM_GEP_TYPE(nullptr)
         argI64s, ConstantInt::get(Type::getInt32Ty(ctx), idx), "", dBB);
 
     Instruction *argp =
diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp
index b02605208bbb..54bda16013b6 100644
--- a/lib/Module/IntrinsicCleaner.cpp
+++ b/lib/Module/IntrinsicCleaner.cpp
@@ -82,11 +82,15 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, 
Module &M) {
           Value *pSrc = CastInst::CreatePointerCast(src, i64p, 
"vacopy.cast.src", ii);
           Value *val = new LoadInst(pSrc, std::string(), ii); new 
StoreInst(val, pDst, ii);
           Value *off = ConstantInt::get(Type::getInt64Ty(ctx), 1);
-          pDst = GetElementPtrInst::Create(pDst, off, std::string(), ii);
-          pSrc = GetElementPtrInst::Create(pSrc, off, std::string(), ii);
+          pDst = GetElementPtrInst::Create(KLEE_LLVM_GEP_TYPE(nullptr)
+              pDst, off, std::string(), ii);
+          pSrc = GetElementPtrInst::Create(KLEE_LLVM_GEP_TYPE(nullptr)
+              pSrc, off, std::string(), ii);
           val = new LoadInst(pSrc, std::string(), ii); new StoreInst(val, 
pDst, ii);
-          pDst = GetElementPtrInst::Create(pDst, off, std::string(), ii);
-          pSrc = GetElementPtrInst::Create(pSrc, off, std::string(), ii);
+          pDst = GetElementPtrInst::Create(KLEE_LLVM_GEP_TYPE(nullptr)
+              pDst, off, std::string(), ii);
+          pSrc = GetElementPtrInst::Create(KLEE_LLVM_GEP_TYPE(nullptr)
+              pSrc, off, std::string(), ii);
           val = new LoadInst(pSrc, std::string(), ii); new StoreInst(val, 
pDst, ii);
         }
         ii->removeFromParent();
-- 
2.14.2

++++++ 0001-test-DirSeek-make-it-XFAIL-temporarily.patch ++++++
--- /var/tmp/diff_new_pack.eQhzzd/_old  2017-10-23 16:44:11.986215334 +0200
+++ /var/tmp/diff_new_pack.eQhzzd/_new  2017-10-23 16:44:11.986215334 +0200
@@ -7,10 +7,28 @@
 
 Signed-off-by: Jiri Slaby <[email protected]>
 ---
- test/Runtime/POSIX/DirSeek.c |    1 +
- test/Runtime/POSIX/Ioctl.c   |    1 +
- 2 files changed, 2 insertions(+)
+ test/Feature/BitcastAlias.llvm37.ll     |    1 +
+ test/Feature/BitcastAliasMD2U.llvm37.ll |    1 +
+ test/Runtime/POSIX/DirSeek.c            |    1 +
+ test/Runtime/POSIX/Ioctl.c              |    1 +
+ 4 files changed, 4 insertions(+)
 
+--- a/test/Feature/BitcastAlias.llvm37.ll
++++ b/test/Feature/BitcastAlias.llvm37.ll
+@@ -1,4 +1,5 @@
+ ; REQUIRES: geq-llvm-3.7
++; REQUIRES: lt-llvm-4.0
+ ; RUN: llvm-as %s -f -o %t1.bc
+ ; RUN: rm -rf %t.klee-out
+ ; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2
+--- a/test/Feature/BitcastAliasMD2U.llvm37.ll
++++ b/test/Feature/BitcastAliasMD2U.llvm37.ll
+@@ -1,4 +1,5 @@
+ ; REQUIRES: geq-llvm-3.7
++; REQUIRES: lt-llvm-4.0
+ ; RUN: llvm-as %s -f -o %t1.bc
+ ; RUN: rm -rf %t.klee-out
+ ; RUN: %klee --output-dir=%t.klee-out -disable-opt -search=nurs:md2u %t1.bc > 
%t2
 --- a/test/Runtime/POSIX/DirSeek.c
 +++ b/test/Runtime/POSIX/DirSeek.c
 @@ -8,6 +8,7 @@

++++++ 0004-llvm-make-KLEE-compile-against-LLVM-3.7.patch -> 
0002-llvm-make-KLEE-compile-against-LLVM-3.7.patch ++++++
--- 
/work/SRC/openSUSE:Factory/klee/0004-llvm-make-KLEE-compile-against-LLVM-3.7.patch
  2017-06-12 15:32:12.762214235 +0200
+++ 
/work/SRC/openSUSE:Factory/.klee.new/0002-llvm-make-KLEE-compile-against-LLVM-3.7.patch
     2017-10-23 16:44:10.270295638 +0200
@@ -5,16 +5,13 @@
 
 Signed-off-by: Jiri Slaby <[email protected]>
 ---
- include/klee/Internal/Support/FloatEvaluation.h |  7 +++++++
- lib/Core/ExternalDispatcher.cpp                 |  3 +++
- lib/Module/InstructionInfoTable.cpp             |  8 +++++++-
- lib/Module/IntrinsicCleaner.cpp                 | 14 ++++++++++++++
- lib/Module/KModule.cpp                          | 13 ++++++++++++-
- lib/Module/ModuleUtil.cpp                       | 22 +++++++++++++++++++---
- lib/Module/Optimize.cpp                         | 21 +++++++++++++++++++--
+ include/klee/Internal/Support/FloatEvaluation.h |  7 ++++++
+ lib/Module/InstructionInfoTable.cpp             |  6 +++++
+ lib/Module/ModuleUtil.cpp                       | 30 +++++++++++++++++++++----
+ lib/Module/Optimize.cpp                         |  4 +++-
  lib/Module/RaiseAsm.cpp                         |  5 ++++-
- tools/klee/main.cpp                             |  6 +++++-
- 9 files changed, 90 insertions(+), 9 deletions(-)
+ tools/klee/main.cpp                             |  1 +
+ 6 files changed, 47 insertions(+), 6 deletions(-)
 
 diff --git a/include/klee/Internal/Support/FloatEvaluation.h 
b/include/klee/Internal/Support/FloatEvaluation.h
 index 6d9092f2ea37..436e0dc8152f 100644
@@ -36,34 +33,11 @@
    default: llvm::report_fatal_error("unsupported floating point width");
    }
  }
-diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp
-index df0dd9a9a12f..380c97e62db8 100644
---- a/lib/Core/ExternalDispatcher.cpp
-+++ b/lib/Core/ExternalDispatcher.cpp
-@@ -331,6 +331,9 @@ Function 
*ExternalDispatcherImpl::createDispatcher(Function *target,
-     LLVM_TYPE_Q Type *argTy =
-         (i < FTy->getNumParams() ? FTy->getParamType(i) : (*ai)->getType());
-     Instruction *argI64p = GetElementPtrInst::Create(
-+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
-+        nullptr,
-+#endif
-         argI64s, ConstantInt::get(Type::getInt32Ty(ctx), idx), "", dBB);
- 
-     Instruction *argp =
 diff --git a/lib/Module/InstructionInfoTable.cpp 
b/lib/Module/InstructionInfoTable.cpp
-index 8e58c19b0bb2..44addc762daa 100644
+index e2f05205a633..3d9bf5ae66af 100644
 --- a/lib/Module/InstructionInfoTable.cpp
 +++ b/lib/Module/InstructionInfoTable.cpp
-@@ -87,7 +87,7 @@ static void buildInstructionToLineMap(Module *m,
-   }
- }
- 
--static std::string getDSPIPath(DILocation Loc) {
-+static std::string getDSPIPath(const DILocation &Loc) {
-   std::string dir = Loc.getDirectory();
-   std::string file = Loc.getFilename();
-   if (dir.empty() || file[0] == '/') {
-@@ -103,9 +103,15 @@ bool InstructionInfoTable::getInstructionDebugInfo(const 
llvm::Instruction *I,
+@@ -94,9 +94,15 @@ bool InstructionInfoTable::getInstructionDebugInfo(const 
llvm::Instruction *I,
                                                     const std::string *&File,
                                                     unsigned &Line) {
    if (MDNode *N = I->getMetadata("dbg")) {
@@ -79,82 +53,11 @@
      return true;
    }
  
-diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp
-index 3f7644af3d37..9af6f9f40f21 100644
---- a/lib/Module/IntrinsicCleaner.cpp
-+++ b/lib/Module/IntrinsicCleaner.cpp
-@@ -110,11 +110,25 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock 
&b, Module &M) {
-           Value *pSrc = CastInst::CreatePointerCast(src, i64p, 
"vacopy.cast.src", ii);
-           Value *val = new LoadInst(pSrc, std::string(), ii); new 
StoreInst(val, pDst, ii);
-           Value *off = ConstantInt::get(Type::getInt64Ty(ctx), 1);
-+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
-+          pDst = GetElementPtrInst::Create(nullptr, pDst, off, std::string(),
-+            ii);
-+          pSrc = GetElementPtrInst::Create(nullptr, pSrc, off, std::string(),
-+            ii);
-+#else
-           pDst = GetElementPtrInst::Create(pDst, off, std::string(), ii);
-           pSrc = GetElementPtrInst::Create(pSrc, off, std::string(), ii);
-+#endif
-           val = new LoadInst(pSrc, std::string(), ii); new StoreInst(val, 
pDst, ii);
-+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
-+          pDst = GetElementPtrInst::Create(nullptr, pDst, off, std::string(),
-+            ii);
-+          pSrc = GetElementPtrInst::Create(nullptr, pSrc, off, std::string(),
-+            ii);
-+#else
-           pDst = GetElementPtrInst::Create(pDst, off, std::string(), ii);
-           pSrc = GetElementPtrInst::Create(pSrc, off, std::string(), ii);
-+#endif
-           val = new LoadInst(pSrc, std::string(), ii); new StoreInst(val, 
pDst, ii);
-         }
-         ii->removeFromParent();
-diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp
-index bb74a71579c0..b31b7fd5a56d 100644
---- a/lib/Module/KModule.cpp
-+++ b/lib/Module/KModule.cpp
-@@ -46,8 +46,11 @@
- #else
- #include "llvm/IR/CallSite.h"
- #endif
--
-+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
-+#include "llvm/IR/LegacyPassManager.h"
-+#else
- #include "llvm/PassManager.h"
-+#endif
- #include "llvm/Support/CommandLine.h"
- #include "llvm/Support/raw_ostream.h"
- #include "llvm/Support/raw_os_ostream.h"
-@@ -305,7 +308,11 @@ void KModule::prepare(const Interpreter::ModuleOptions 
&opts,
-   // invariant transformations that we will end up doing later so that
-   // optimize is seeing what is as close as possible to the final
-   // module.
-+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
-+  legacy::PassManager pm;
-+#else
-   PassManager pm;
-+#endif
-   pm.add(new RaiseAsmPass());
-   if (opts.CheckDivZero) pm.add(new DivCheckPass());
-   if (opts.CheckOvershift) pm.add(new OvershiftCheckPass());
-@@ -373,7 +380,11 @@ void KModule::prepare(const Interpreter::ModuleOptions 
&opts,
-   // linked in something with intrinsics but any external calls are
-   // going to be unresolved. We really need to handle the intrinsics
-   // directly I think?
-+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
-+  legacy::PassManager pm3;
-+#else
-   PassManager pm3;
-+#endif
-   pm3.add(createCFGSimplificationPass());
-   switch(SwitchType) {
-   case eSwitchTypeInternal: break;
 diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp
-index c7f1c6d9d4a7..de0130a2632c 100644
+index a86adc98a1b1..b07d3d2fe348 100644
 --- a/lib/Module/ModuleUtil.cpp
 +++ b/lib/Module/ModuleUtil.cpp
-@@ -274,13 +274,21 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
+@@ -258,13 +258,21 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
          Module *Result = 0;
          // FIXME: Maybe load bitcode file lazily? Then if we need to link, 
materialise the module
  #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
@@ -178,7 +81,7 @@
  #else
          Result = ParseBitcodeFile(buff.get(), composite->getContext(),
            &errorMessage);
-@@ -439,7 +447,12 @@ Module *klee::linkWithLibrary(Module *module,
+@@ -421,7 +429,12 @@ Module *klee::linkWithLibrary(Module *module,
    if (magic == sys::fs::file_magic::bitcode) {
      Module *Result = 0;
  #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
@@ -192,7 +95,18 @@
      if ((ec = ResultErr.getError())) {
        ErrorMessage = ec.message();
  #else
-@@ -464,7 +477,10 @@ Module *klee::linkWithLibrary(Module *module,
+@@ -432,7 +445,9 @@ Module *klee::linkWithLibrary(Module *module,
+           ErrorMessage.c_str());
+     }
+ 
+-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
++    Result = ResultErr->release();
++#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
+     Result = ResultErr.get();
+ #endif
+ 
+@@ -446,7 +461,10 @@ Module *klee::linkWithLibrary(Module *module,
            ErrorMessage.c_str());
      }
  
@@ -203,59 +117,23 @@
  
    } else if (magic == sys::fs::file_magic::archive) {
  #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
-diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp
-index c0f3f34ca8e8..68acd2b17dda 100644
---- a/lib/Module/Optimize.cpp
-+++ b/lib/Module/Optimize.cpp
-@@ -16,7 +16,11 @@
- 
//===----------------------------------------------------------------------===//
- 
- #include "klee/Config/Version.h"
+@@ -615,7 +633,11 @@ Module *klee::loadModule(LLVMContext &ctx, const 
std::string &path, std::string
+   // The module has taken ownership of the MemoryBuffer so release it
+   // from the std::unique_ptr
+   buffer->release();
 +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
-+#include "llvm/IR/LegacyPassManager.h"
++  auto module = errorOrModule->release();
 +#else
- #include "llvm/PassManager.h"
+   auto module = *errorOrModule;
 +#endif
- #include "llvm/Analysis/Passes.h"
- #include "llvm/Analysis/LoopPass.h"
- #include "llvm/Support/CommandLine.h"
-@@ -80,7 +84,11 @@ static cl::alias A1("S", cl::desc("Alias for 
--strip-debug"),
  
- // A utility function that adds a pass to the pass manager but will also add
- // a verifier pass after if we're supposed to verify.
-+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
-+static inline void addPass(legacy::PassManager &PM, Pass *P) {
-+#else
- static inline void addPass(PassManager &PM, Pass *P) {
-+#endif
-   // Add the pass to the pass manager...
-   PM.add(P);
- 
-@@ -91,8 +99,11 @@ static inline void addPass(PassManager &PM, Pass *P) {
- 
- namespace llvm {
- 
--
-+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
-+static void AddStandardCompilePasses(legacy::PassManager &PM) {
-+#else
- static void AddStandardCompilePasses(PassManager &PM) {
-+#endif
-   PM.add(createVerifierPass());                  // Verify that input is 
correct
- 
- #if LLVM_VERSION_CODE < LLVM_VERSION(3, 0)
-@@ -166,14 +177,20 @@ static void AddStandardCompilePasses(PassManager &PM) {
- void Optimize(Module *M, const std::string &EntryPoint) {
- 
-   // Instantiate the pass manager to organize the passes.
-+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
-+  legacy::PassManager Passes;
-+#else
-   PassManager Passes;
-+#endif
- 
-   // If we're verifying, start off with a verification pass.
-   if (VerifyEach)
+   if (auto ec = module->materializeAllPermanently()) {
+     errorMsg = ec.message();
+diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp
+index 02ab446a8d63..64e4863f70b3 100644
+--- a/lib/Module/Optimize.cpp
++++ b/lib/Module/Optimize.cpp
+@@ -154,7 +154,9 @@ void Optimize(Module *M, const std::string &EntryPoint) {
      Passes.add(createVerifierPass());
  
    // Add an appropriate DataLayout instance for this module...
@@ -267,10 +145,10 @@
    dlpass->doInitialization(*M);
    addPass(Passes, dlpass);
 diff --git a/lib/Module/RaiseAsm.cpp b/lib/Module/RaiseAsm.cpp
-index 113dcc621ae2..668ce4853cca 100644
+index 13e4f7d47e58..c597fa2a7b82 100644
 --- a/lib/Module/RaiseAsm.cpp
 +++ b/lib/Module/RaiseAsm.cpp
-@@ -103,7 +103,10 @@ bool RaiseAsmPass::runOnModule(Module &M) {
+@@ -81,7 +81,10 @@ bool RaiseAsmPass::runOnModule(Module &M) {
      klee_warning("Warning: unable to select native target: %s", Err.c_str());
      TLI = 0;
    } else {
@@ -281,32 +159,19 @@
 +#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
      TM = NativeTarget->createTargetMachine(HostTriple, "", "", 
TargetOptions());
      TLI = TM->getSubtargetImpl()->getTargetLowering();
- #elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 1)
+ #else
 diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
-index e5b8fa6c1b96..dd78d5410e28 100644
+index f1def38c90e5..5d1d0c22495c 100644
 --- a/tools/klee/main.cpp
 +++ b/tools/klee/main.cpp
-@@ -47,6 +47,7 @@
+@@ -35,6 +35,7 @@
  #include "llvm/Support/CommandLine.h"
  #include "llvm/Support/ManagedStatic.h"
  #include "llvm/Support/MemoryBuffer.h"
 +#include "llvm/Support/Path.h"
  #include "llvm/Support/raw_ostream.h"
  
- #if LLVM_VERSION_CODE < LLVM_VERSION(3, 0)
-@@ -1278,8 +1279,11 @@ int main(int argc, char **argv, char **envp) {
-     // from the std::unique_ptr
-     Buffer->release();
-   }
--
-+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
-+  mainModule = mainModuleOrError->release();
-+#else
-   mainModule = *mainModuleOrError;
-+#endif
-   if (auto ec = mainModule->materializeAllPermanently()) {
-     klee_error("error loading program '%s': %s", InputFile.c_str(),
-                ec.message().c_str());
+ #include "llvm/Support/TargetSelect.h"
 -- 
-2.13.1
+2.14.2
 

++++++ 0007-test-add-versions-of-some-tests-for-LLVM-3.8.patch -> 
0003-test-add-versions-of-some-tests-for-LLVM-3.7.patch ++++++
--- 
/work/SRC/openSUSE:Factory/klee/0007-test-add-versions-of-some-tests-for-LLVM-3.8.patch
     2017-06-12 15:32:13.218149931 +0200
+++ 
/work/SRC/openSUSE:Factory/.klee.new/0003-test-add-versions-of-some-tests-for-LLVM-3.7.patch
        2017-10-23 16:44:10.650277854 +0200
@@ -1,76 +1,79 @@
 From: =?UTF-8?q?Richard=20Trembeck=C3=BD?= <[email protected]>
 Date: Fri, 29 Apr 2016 22:33:41 +0200
-Subject: test: add versions of some tests for LLVM 3.8
+Subject: test: add versions of some tests for LLVM 3.7
 Patch-mainline: no
 
-Clone some tests to have their 3.8 version. 'call's, 'load's and
+Clone some tests to have their 3.7 version. 'call's, 'load's and
 'getelementptr's match the new specification in them.
 
+@andreamattavelli: Fixed test cases: BitCastAlias test cases included
+modification to alias specifications that require LLVM 3.8
+
 Signed-off-by: Jiri Slaby <[email protected]>
 ---
  test/Concrete/BoolReadWrite.ll                     |   1 +
- test/Concrete/BoolReadWrite.llvm38.ll              |  16 +
+ test/Concrete/BoolReadWrite.llvm37.ll              |  16 +
  test/Concrete/ConstantExpr.ll                      |   1 +
- test/Concrete/ConstantExpr.llvm38.ll               | 165 +++++
+ test/Concrete/ConstantExpr.llvm37.ll               | 165 +++++
  test/Concrete/FloatingPointOps.ll                  |   1 +
- test/Concrete/FloatingPointOps.llvm38.ll           | 680 +++++++++++++++++++++
+ test/Concrete/FloatingPointOps.llvm37.ll           | 680 +++++++++++++++++++++
  test/Concrete/GlobalInitializers.ll                |   1 +
- test/Concrete/GlobalInitializers.llvm38.ll         |  48 ++
+ test/Concrete/GlobalInitializers.llvm37.ll         |  48 ++
  test/Concrete/SimpleStoreAndLoad.ll                |   1 +
- test/Concrete/SimpleStoreAndLoad.llvm38.ll         |  20 +
+ test/Concrete/SimpleStoreAndLoad.llvm37.ll         |  20 +
  test/Feature/BitcastAlias.ll                       |   1 +
- test/Feature/BitcastAlias.llvm38.ll                |  35 ++
+ test/Feature/BitcastAlias.llvm37.ll                |  35 ++
  test/Feature/BitcastAliasMD2U.ll                   |   1 +
- test/Feature/BitcastAliasMD2U.llvm38.ll            |  35 ++
+ test/Feature/BitcastAliasMD2U.llvm37.ll            |  35 ++
  test/Feature/ConstantStruct.ll                     |   1 +
- test/Feature/ConstantStruct.llvm38.ll              |  34 ++
+ test/Feature/ConstantStruct.llvm37.ll              |  34 ++
  test/Feature/GetElementPtr.ll                      |   1 +
- test/Feature/GetElementPtr.llvm38.ll               |  30 +
+ test/Feature/GetElementPtr.llvm37.ll               |  30 +
  test/Feature/InsertExtractValue.ll                 |   1 +
- test/Feature/InsertExtractValue.llvm38.ll          |  34 ++
+ test/Feature/InsertExtractValue.llvm37.ll          |  34 ++
  test/Feature/Overflow.ll                           |   1 +
- test/Feature/Overflow.llvm38.ll                    |  45 ++
+ test/Feature/Overflow.llvm37.ll                    |  45 ++
  test/Feature/OverflowMul.ll                        |   1 +
- test/Feature/OverflowMul.llvm38.ll                 |  45 ++
- test/Feature/_utils.llvm38._ll                     |  71 +++
- test/Intrinsics/objectsize.ll                      |   2 +-
- test/Intrinsics/objectsize.llvm38.ll               |  36 ++
+ test/Feature/OverflowMul.llvm37.ll                 |  45 ++
+ test/Feature/_utils.llvm37._ll                     |  71 +++
+ test/Intrinsics/objectsize.ll                      |   1 +
+ test/Intrinsics/objectsize.llvm37.ll               |  36 ++
  test/lit.cfg                                       |   2 +-
  .../regression/2007-08-16-invalid-constant-value.c |   1 +
- .../2007-08-16-invalid-constant-value.llvm38.c     |  33 +
- 30 files changed, 1342 insertions(+), 2 deletions(-)
- create mode 100644 test/Concrete/BoolReadWrite.llvm38.ll
- create mode 100644 test/Concrete/ConstantExpr.llvm38.ll
- create mode 100644 test/Concrete/FloatingPointOps.llvm38.ll
- create mode 100755 test/Concrete/GlobalInitializers.llvm38.ll
- create mode 100644 test/Concrete/SimpleStoreAndLoad.llvm38.ll
- create mode 100644 test/Feature/BitcastAlias.llvm38.ll
- create mode 100644 test/Feature/BitcastAliasMD2U.llvm38.ll
- create mode 100644 test/Feature/ConstantStruct.llvm38.ll
- create mode 100644 test/Feature/GetElementPtr.llvm38.ll
- create mode 100644 test/Feature/InsertExtractValue.llvm38.ll
- create mode 100644 test/Feature/Overflow.llvm38.ll
- create mode 100644 test/Feature/OverflowMul.llvm38.ll
- create mode 100644 test/Feature/_utils.llvm38._ll
- create mode 100644 test/Intrinsics/objectsize.llvm38.ll
- create mode 100644 test/regression/2007-08-16-invalid-constant-value.llvm38.c
+ .../2007-08-16-invalid-constant-value.llvm37.c     |  33 +
+ 30 files changed, 1342 insertions(+), 1 deletion(-)
+ create mode 100644 test/Concrete/BoolReadWrite.llvm37.ll
+ create mode 100644 test/Concrete/ConstantExpr.llvm37.ll
+ create mode 100644 test/Concrete/FloatingPointOps.llvm37.ll
+ create mode 100755 test/Concrete/GlobalInitializers.llvm37.ll
+ create mode 100644 test/Concrete/SimpleStoreAndLoad.llvm37.ll
+ create mode 100644 test/Feature/BitcastAlias.llvm37.ll
+ create mode 100644 test/Feature/BitcastAliasMD2U.llvm37.ll
+ create mode 100644 test/Feature/ConstantStruct.llvm37.ll
+ create mode 100644 test/Feature/GetElementPtr.llvm37.ll
+ create mode 100644 test/Feature/InsertExtractValue.llvm37.ll
+ create mode 100644 test/Feature/Overflow.llvm37.ll
+ create mode 100644 test/Feature/OverflowMul.llvm37.ll
+ create mode 100644 test/Feature/_utils.llvm37._ll
+ create mode 100644 test/Intrinsics/objectsize.llvm37.ll
+ create mode 100644 test/regression/2007-08-16-invalid-constant-value.llvm37.c
 
 diff --git a/test/Concrete/BoolReadWrite.ll b/test/Concrete/BoolReadWrite.ll
-index f818ecafacd5..f2d76227c545 100644
+index f818ecafacd5..34a50447db99 100644
 --- a/test/Concrete/BoolReadWrite.ll
 +++ b/test/Concrete/BoolReadWrite.ll
 @@ -1,3 +1,4 @@
-+; REQUIRES: lt-llvm-3.8
++; REQUIRES: lt-llvm-3.7
  ; RUN: %S/ConcreteTest.py --klee='%klee' --lli=%lli %s
  
  declare void @print_i1(i1)
-diff --git a/test/Concrete/BoolReadWrite.llvm38.ll 
b/test/Concrete/BoolReadWrite.llvm38.ll
+diff --git a/test/Concrete/BoolReadWrite.llvm37.ll 
b/test/Concrete/BoolReadWrite.llvm37.ll
 new file mode 100644
-index 000000000000..d2c6c88aff32
+index 000000000000..9141987e97a0
 --- /dev/null
-+++ b/test/Concrete/BoolReadWrite.llvm38.ll
++++ b/test/Concrete/BoolReadWrite.llvm37.ll
 @@ -0,0 +1,16 @@
-+; REQUIRES: geq-llvm-3.8
++; REQUIRES: geq-llvm-3.7
 +; RUN: %S/ConcreteTest.py --klee='%klee' --lli=%lli %s
 +
 +declare void @print_i1(i1)
@@ -87,21 +90,21 @@
 +      ret i32 0
 +}
 diff --git a/test/Concrete/ConstantExpr.ll b/test/Concrete/ConstantExpr.ll
-index d00c59a637e9..84cf1ad0f517 100644
+index d00c59a637e9..2d8e5bc65721 100644
 --- a/test/Concrete/ConstantExpr.ll
 +++ b/test/Concrete/ConstantExpr.ll
 @@ -1,3 +1,4 @@
-+; REQUIRES: lt-llvm-3.8
++; REQUIRES: lt-llvm-3.7
  ; RUN: %S/ConcreteTest.py --klee='%klee' --lli=%lli %s
  
  ; Most of the test below use the *address* of gInt as part of their 
computation,
-diff --git a/test/Concrete/ConstantExpr.llvm38.ll 
b/test/Concrete/ConstantExpr.llvm38.ll
+diff --git a/test/Concrete/ConstantExpr.llvm37.ll 
b/test/Concrete/ConstantExpr.llvm37.ll
 new file mode 100644
-index 000000000000..dc9dce931ba8
+index 000000000000..fa634c497a4b
 --- /dev/null
-+++ b/test/Concrete/ConstantExpr.llvm38.ll
++++ b/test/Concrete/ConstantExpr.llvm37.ll
 @@ -0,0 +1,165 @@
-+; REQUIRES: geq-llvm-3.8
++; REQUIRES: geq-llvm-3.7
 +; RUN: %S/ConcreteTest.py --klee='%klee' --lli=%lli %s
 +
 +; Most of the test below use the *address* of gInt as part of their 
computation,
@@ -267,21 +270,21 @@
 +declare void @print_i32(i32)
 +declare void @print_i64(i64)
 diff --git a/test/Concrete/FloatingPointOps.ll 
b/test/Concrete/FloatingPointOps.ll
-index 5dd6d2feb41e..12d8cd241d2f 100644
+index 00d4e877b562..b81a3b8df1f4 100644
 --- a/test/Concrete/FloatingPointOps.ll
 +++ b/test/Concrete/FloatingPointOps.ll
 @@ -1,3 +1,4 @@
-+; REQUIRES: lt-llvm-3.8
++; REQUIRES: lt-llvm-3.7
  ; RUN: %S/ConcreteTest.py --klee='%klee' --lli=%lli %s
  
  ; casting error messages
-diff --git a/test/Concrete/FloatingPointOps.llvm38.ll 
b/test/Concrete/FloatingPointOps.llvm38.ll
+diff --git a/test/Concrete/FloatingPointOps.llvm37.ll 
b/test/Concrete/FloatingPointOps.llvm37.ll
 new file mode 100644
-index 000000000000..3dbbb49aef4b
+index 000000000000..3e21f0f12408
 --- /dev/null
-+++ b/test/Concrete/FloatingPointOps.llvm38.ll
++++ b/test/Concrete/FloatingPointOps.llvm37.ll
 @@ -0,0 +1,680 @@
-+; REQUIRES: geq-llvm-3.8
++; REQUIRES: geq-llvm-3.7
 +; RUN: %S/ConcreteTest.py --klee='%klee' --lli=%lli %s
 +
 +; casting error messages
@@ -962,21 +965,21 @@
 +  ret i32 0
 +}
 diff --git a/test/Concrete/GlobalInitializers.ll 
b/test/Concrete/GlobalInitializers.ll
-index e3657dad19e5..b883ad40d940 100755
+index e3657dad19e5..ba7e53eb7cd7 100755
 --- a/test/Concrete/GlobalInitializers.ll
 +++ b/test/Concrete/GlobalInitializers.ll
 @@ -1,3 +1,4 @@
-+; REQUIRES: lt-llvm-3.8
++; REQUIRES: lt-llvm-3.7
  ; RUN: %S/ConcreteTest.py --klee='%klee' --lli=%lli %s
  
  declare void @print_i32(i32)
-diff --git a/test/Concrete/GlobalInitializers.llvm38.ll 
b/test/Concrete/GlobalInitializers.llvm38.ll
+diff --git a/test/Concrete/GlobalInitializers.llvm37.ll 
b/test/Concrete/GlobalInitializers.llvm37.ll
 new file mode 100755
-index 000000000000..98f5b6787f80
+index 000000000000..2303a6974712
 --- /dev/null
-+++ b/test/Concrete/GlobalInitializers.llvm38.ll
++++ b/test/Concrete/GlobalInitializers.llvm37.ll
 @@ -0,0 +1,48 @@
-+; REQUIRES: geq-llvm-3.8
++; REQUIRES: geq-llvm-3.7
 +; RUN: %S/ConcreteTest.py --klee='%klee' --lli=%lli %s
 +
 +declare void @print_i32(i32)
@@ -1025,21 +1028,21 @@
 +      ret i32 0
 +}
 diff --git a/test/Concrete/SimpleStoreAndLoad.ll 
b/test/Concrete/SimpleStoreAndLoad.ll
-index 1edad0386916..6e8542f8f5fd 100644
+index 1edad0386916..7bb65ea7dfc9 100644
 --- a/test/Concrete/SimpleStoreAndLoad.ll
 +++ b/test/Concrete/SimpleStoreAndLoad.ll
 @@ -1,3 +1,4 @@
-+; REQUIRES: lt-llvm-3.8
++; REQUIRES: lt-llvm-3.7
  ; RUN: %S/ConcreteTest.py --klee='%klee' --lli=%lli %s
  
  declare void @print_i32(i32)
-diff --git a/test/Concrete/SimpleStoreAndLoad.llvm38.ll 
b/test/Concrete/SimpleStoreAndLoad.llvm38.ll
+diff --git a/test/Concrete/SimpleStoreAndLoad.llvm37.ll 
b/test/Concrete/SimpleStoreAndLoad.llvm37.ll
 new file mode 100644
-index 000000000000..1a36c674c36d
+index 000000000000..bd081a4a2bcc
 --- /dev/null
-+++ b/test/Concrete/SimpleStoreAndLoad.llvm38.ll
++++ b/test/Concrete/SimpleStoreAndLoad.llvm37.ll
 @@ -0,0 +1,20 @@
-+; REQUIRES: geq-llvm-3.8
++; REQUIRES: geq-llvm-3.7
 +; RUN: %S/ConcreteTest.py --klee='%klee' --lli=%lli %s
 +
 +declare void @print_i32(i32)
@@ -1060,21 +1063,21 @@
 +      ret i32 0
 +}
 diff --git a/test/Feature/BitcastAlias.ll b/test/Feature/BitcastAlias.ll
-index e0e3653feebc..f29e739c9e75 100644
+index e0e3653feebc..d203e52c4bcb 100644
 --- a/test/Feature/BitcastAlias.ll
 +++ b/test/Feature/BitcastAlias.ll
 @@ -1,3 +1,4 @@
-+; REQUIRES: lt-llvm-3.8
++; REQUIRES: lt-llvm-3.7
  ; RUN: llvm-as %s -f -o %t1.bc
  ; RUN: rm -rf %t.klee-out
  ; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2
-diff --git a/test/Feature/BitcastAlias.llvm38.ll 
b/test/Feature/BitcastAlias.llvm38.ll
+diff --git a/test/Feature/BitcastAlias.llvm37.ll 
b/test/Feature/BitcastAlias.llvm37.ll
 new file mode 100644
-index 000000000000..ff7009b7711b
+index 000000000000..0d6e72604d6b
 --- /dev/null
-+++ b/test/Feature/BitcastAlias.llvm38.ll
++++ b/test/Feature/BitcastAlias.llvm37.ll
 @@ -0,0 +1,35 @@
-+; REQUIRES: geq-llvm-3.8
++; REQUIRES: geq-llvm-3.7
 +; RUN: llvm-as %s -f -o %t1.bc
 +; RUN: rm -rf %t.klee-out
 +; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2
@@ -1083,7 +1086,7 @@
 +target datalayout = 
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
 +target triple = "x86_64-unknown-linux-gnu"
 +
-+@foo = alias i32 (i32), i32 (i32)* @__foo
++@foo = alias i32 (i32)* @__foo
 +
 +define i32 @__foo(i32 %i) nounwind {
 +entry:
@@ -1110,21 +1113,21 @@
 +  ret i32 0
 +}
 diff --git a/test/Feature/BitcastAliasMD2U.ll 
b/test/Feature/BitcastAliasMD2U.ll
-index 24eabaa57c8c..322012882f01 100644
+index 24eabaa57c8c..cef8ac5459ca 100644
 --- a/test/Feature/BitcastAliasMD2U.ll
 +++ b/test/Feature/BitcastAliasMD2U.ll
 @@ -1,3 +1,4 @@
-+; REQUIRES: lt-llvm-3.8
++; REQUIRES: lt-llvm-3.7
  ; RUN: llvm-as %s -f -o %t1.bc
  ; RUN: rm -rf %t.klee-out
  ; RUN: %klee --output-dir=%t.klee-out -disable-opt -search=nurs:md2u %t1.bc > 
%t2
-diff --git a/test/Feature/BitcastAliasMD2U.llvm38.ll 
b/test/Feature/BitcastAliasMD2U.llvm38.ll
+diff --git a/test/Feature/BitcastAliasMD2U.llvm37.ll 
b/test/Feature/BitcastAliasMD2U.llvm37.ll
 new file mode 100644
-index 000000000000..f4e41293c347
+index 000000000000..12abf09373f8
 --- /dev/null
-+++ b/test/Feature/BitcastAliasMD2U.llvm38.ll
++++ b/test/Feature/BitcastAliasMD2U.llvm37.ll
 @@ -0,0 +1,35 @@
-+; REQUIRES: geq-llvm-3.8
++; REQUIRES: geq-llvm-3.7
 +; RUN: llvm-as %s -f -o %t1.bc
 +; RUN: rm -rf %t.klee-out
 +; RUN: %klee --output-dir=%t.klee-out -disable-opt -search=nurs:md2u %t1.bc > 
%t2
@@ -1133,7 +1136,7 @@
 +target datalayout = 
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
 +target triple = "x86_64-unknown-linux-gnu"
 +
-+@foo = alias i32 (i32), i32 (i32)* @__foo
++@foo = alias i32 (i32)* @__foo
 +
 +define i32 @__foo(i32 %i) nounwind {
 +entry:
@@ -1160,21 +1163,21 @@
 +  ret i32 0
 +}
 diff --git a/test/Feature/ConstantStruct.ll b/test/Feature/ConstantStruct.ll
-index 4fe6b5d0e041..cb7ce2541bad 100644
+index 4fe6b5d0e041..073544d38d2f 100644
 --- a/test/Feature/ConstantStruct.ll
 +++ b/test/Feature/ConstantStruct.ll
 @@ -1,3 +1,4 @@
-+; REQUIRES: lt-llvm-3.8
++; REQUIRES: lt-llvm-3.7
  ; RUN: llvm-as %s -f -o %t1.bc
  ; RUN: rm -rf %t.klee-out
  ; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2
-diff --git a/test/Feature/ConstantStruct.llvm38.ll 
b/test/Feature/ConstantStruct.llvm38.ll
+diff --git a/test/Feature/ConstantStruct.llvm37.ll 
b/test/Feature/ConstantStruct.llvm37.ll
 new file mode 100644
-index 000000000000..b0e6ea835e1e
+index 000000000000..802dfbf74f6e
 --- /dev/null
-+++ b/test/Feature/ConstantStruct.llvm38.ll
++++ b/test/Feature/ConstantStruct.llvm37.ll
 @@ -0,0 +1,34 @@
-+; REQUIRES: geq-llvm-3.8
++; REQUIRES: geq-llvm-3.7
 +; RUN: llvm-as %s -f -o %t1.bc
 +; RUN: rm -rf %t.klee-out
 +; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2
@@ -1209,21 +1212,21 @@
 +  ret i32 0
 +}
 diff --git a/test/Feature/GetElementPtr.ll b/test/Feature/GetElementPtr.ll
-index da94441c685e..cf3cc20d6dc2 100644
+index da94441c685e..43f33e27aaf1 100644
 --- a/test/Feature/GetElementPtr.ll
 +++ b/test/Feature/GetElementPtr.ll
 @@ -1,3 +1,4 @@
-+; REQUIRES: lt-llvm-3.8
++; REQUIRES: lt-llvm-3.7
  ; RUN: llvm-as %s -f -o %t1.bc
  ; RUN: rm -rf %t.klee-out
  ; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2
-diff --git a/test/Feature/GetElementPtr.llvm38.ll 
b/test/Feature/GetElementPtr.llvm38.ll
+diff --git a/test/Feature/GetElementPtr.llvm37.ll 
b/test/Feature/GetElementPtr.llvm37.ll
 new file mode 100644
-index 000000000000..72c71f2b14d0
+index 000000000000..b4c3ea445729
 --- /dev/null
-+++ b/test/Feature/GetElementPtr.llvm38.ll
++++ b/test/Feature/GetElementPtr.llvm37.ll
 @@ -0,0 +1,30 @@
-+; REQUIRES: geq-llvm-3.8
++; REQUIRES: geq-llvm-3.7
 +; RUN: llvm-as %s -f -o %t1.bc
 +; RUN: rm -rf %t.klee-out
 +; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2
@@ -1254,21 +1257,21 @@
 +  ret i32 0
 +}
 diff --git a/test/Feature/InsertExtractValue.ll 
b/test/Feature/InsertExtractValue.ll
-index 83e8f851ccea..a52222e2232a 100644
+index 83e8f851ccea..431e14c4225a 100644
 --- a/test/Feature/InsertExtractValue.ll
 +++ b/test/Feature/InsertExtractValue.ll
 @@ -1,3 +1,4 @@
-+; REQUIRES: lt-llvm-3.8
++; REQUIRES: lt-llvm-3.7
  ; RUN: llvm-as %s -f -o %t1.bc
  ; RUN: rm -rf %t.klee-out
  ; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2
-diff --git a/test/Feature/InsertExtractValue.llvm38.ll 
b/test/Feature/InsertExtractValue.llvm38.ll
+diff --git a/test/Feature/InsertExtractValue.llvm37.ll 
b/test/Feature/InsertExtractValue.llvm37.ll
 new file mode 100644
-index 000000000000..2b80b9385cb5
+index 000000000000..16dcfd9d0002
 --- /dev/null
-+++ b/test/Feature/InsertExtractValue.llvm38.ll
++++ b/test/Feature/InsertExtractValue.llvm37.ll
 @@ -0,0 +1,34 @@
-+; REQUIRES: geq-llvm-3.8
++; REQUIRES: geq-llvm-3.7
 +; RUN: llvm-as %s -f -o %t1.bc
 +; RUN: rm -rf %t.klee-out
 +; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2
@@ -1303,21 +1306,21 @@
 +  ret i32 0
 +}
 diff --git a/test/Feature/Overflow.ll b/test/Feature/Overflow.ll
-index 35dfbd10fe02..08ece1189a54 100644
+index 35dfbd10fe02..2ab047727817 100644
 --- a/test/Feature/Overflow.ll
 +++ b/test/Feature/Overflow.ll
 @@ -1,3 +1,4 @@
-+; REQUIRES: lt-llvm-3.8
++; REQUIRES: lt-llvm-3.7
  ; RUN: llvm-as %s -f -o %t1.bc
  ; RUN: rm -rf %t.klee-out
  ; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2
-diff --git a/test/Feature/Overflow.llvm38.ll b/test/Feature/Overflow.llvm38.ll
+diff --git a/test/Feature/Overflow.llvm37.ll b/test/Feature/Overflow.llvm37.ll
 new file mode 100644
-index 000000000000..c84aeb26bc23
+index 000000000000..80313a777149
 --- /dev/null
-+++ b/test/Feature/Overflow.llvm38.ll
++++ b/test/Feature/Overflow.llvm37.ll
 @@ -0,0 +1,45 @@
-+; REQUIRES: geq-llvm-3.8
++; REQUIRES: geq-llvm-3.7
 +; RUN: llvm-as %s -f -o %t1.bc
 +; RUN: rm -rf %t.klee-out
 +; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2
@@ -1363,21 +1366,21 @@
 +  ret i32 0
 +}
 diff --git a/test/Feature/OverflowMul.ll b/test/Feature/OverflowMul.ll
-index 7026aa74bfbe..422672e37f51 100644
+index 7026aa74bfbe..1b14d3806cf6 100644
 --- a/test/Feature/OverflowMul.ll
 +++ b/test/Feature/OverflowMul.ll
 @@ -1,3 +1,4 @@
-+; REQUIRES: lt-llvm-3.8
++; REQUIRES: lt-llvm-3.7
  ; RUN: llvm-as %s -f -o %t1.bc
  ; RUN: rm -rf %t.klee-out
  ; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2
-diff --git a/test/Feature/OverflowMul.llvm38.ll 
b/test/Feature/OverflowMul.llvm38.ll
+diff --git a/test/Feature/OverflowMul.llvm37.ll 
b/test/Feature/OverflowMul.llvm37.ll
 new file mode 100644
-index 000000000000..84f5242e9e92
+index 000000000000..8dd93778728a
 --- /dev/null
-+++ b/test/Feature/OverflowMul.llvm38.ll
++++ b/test/Feature/OverflowMul.llvm37.ll
 @@ -0,0 +1,45 @@
-+; REQUIRES: geq-llvm-3.8
++; REQUIRES: geq-llvm-3.7
 +; RUN: llvm-as %s -f -o %t1.bc
 +; RUN: rm -rf %t.klee-out
 +; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2
@@ -1422,11 +1425,11 @@
 +  %1 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* 
@.failstr, i64 0, i64 0)) nounwind
 +  ret i32 0
 +}
-diff --git a/test/Feature/_utils.llvm38._ll b/test/Feature/_utils.llvm38._ll
+diff --git a/test/Feature/_utils.llvm37._ll b/test/Feature/_utils.llvm37._ll
 new file mode 100644
 index 000000000000..7114daabb6c2
 --- /dev/null
-+++ b/test/Feature/_utils.llvm38._ll
++++ b/test/Feature/_utils.llvm37._ll
 @@ -0,0 +1,71 @@
 +define i32 @util_make_and_i1(i32 %a, i32 %b) {
 +        %a_i1 = icmp ne i32 %a, 0
@@ -1500,28 +1503,24 @@
 +        ret i32 %res
 +}
 diff --git a/test/Intrinsics/objectsize.ll b/test/Intrinsics/objectsize.ll
-index 8b75ce8feda5..08dd81460a6e 100644
+index 4bb59596ad2f..7ad4b6fc4fad 100644
 --- a/test/Intrinsics/objectsize.ll
 +++ b/test/Intrinsics/objectsize.ll
-@@ -1,7 +1,7 @@
- ; Unfortunately LLVM 2.9 has a different suffix for the ``llvm.objectsize`` 
instrinsic
- ; so this LLVM IR fails to verify for that version.
- ;
--; REQUIRES: not-llvm-2.9
-+; REQUIRES: not-llvm-2.9, lt-llvm-3.8
+@@ -1,3 +1,4 @@
++; REQUIRES: lt-llvm-3.7
  ; RUN: %llvmas %s -o=%t.bc
  ; RUN: rm -rf %t.klee-out
  ; RUN: %klee -exit-on-error --output-dir=%t.klee-out -disable-opt %t.bc
-diff --git a/test/Intrinsics/objectsize.llvm38.ll 
b/test/Intrinsics/objectsize.llvm38.ll
+diff --git a/test/Intrinsics/objectsize.llvm37.ll 
b/test/Intrinsics/objectsize.llvm37.ll
 new file mode 100644
-index 000000000000..d3f733ef6758
+index 000000000000..ba3e706a301a
 --- /dev/null
-+++ b/test/Intrinsics/objectsize.llvm38.ll
++++ b/test/Intrinsics/objectsize.llvm37.ll
 @@ -0,0 +1,36 @@
 +; Unfortunately LLVM 2.9 has a different suffix for the ``llvm.objectsize`` 
instrinsic
 +; so this LLVM IR fails to verify for that version.
 +;
-+; REQUIRES: geq-llvm-3.8
++; REQUIRES: geq-llvm-3.7
 +; RUN: %llvmas %s -o=%t.bc
 +; RUN: rm -rf %t.klee-out
 +; RUN: %klee -exit-on-error --output-dir=%t.klee-out -disable-opt %t.bc
@@ -1555,37 +1554,37 @@
 +
 +declare void @abort() noreturn nounwind
 diff --git a/test/lit.cfg b/test/lit.cfg
-index 9c557a78cc8f..6922cbce3313 100644
+index 00b429b697a5..e570f9b227e3 100644
 --- a/test/lit.cfg
 +++ b/test/lit.cfg
-@@ -158,7 +158,7 @@ if int(config.llvm_version_major) == 2:
+@@ -161,7 +161,7 @@ if int(config.llvm_version_major) == 2:
  
  # Add feature for the LLVM version in use, so it can be tested in REQUIRES and
  # XFAIL checks. We also add "not-XXX" variants, for the same reason.
--known_llvm_versions = set(["2.9", "3.4", "3.5", "3.6"])
-+known_llvm_versions = set(["2.9", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9"])
+-known_llvm_versions = set(["3.4", "3.5", "3.6"])
++known_llvm_versions = set(["3.4", "3.5", "3.6", "3.7", "3.8", "3.9"])
  current_llvm_version = "%s.%s" % (config.llvm_version_major,
                                    config.llvm_version_minor)
  config.available_features.add("llvm-" + current_llvm_version)
 diff --git a/test/regression/2007-08-16-invalid-constant-value.c 
b/test/regression/2007-08-16-invalid-constant-value.c
-index e0b304f40b01..2b428f643ec5 100644
+index e0b304f40b01..73fe8689d53c 100644
 --- a/test/regression/2007-08-16-invalid-constant-value.c
 +++ b/test/regression/2007-08-16-invalid-constant-value.c
 @@ -1,3 +1,4 @@
-+// REQUIRES: lt-llvm-3.8
++// REQUIRES: lt-llvm-3.7
  // RUN: rm -f %t4.out %t4.err %t4.log
  // RUN: %llvmgcc %s -emit-llvm -O2 -c -o %t1.bc
  // RUN: llvm-as -f %p/../Feature/_utils._ll -o %t2.bc
-diff --git a/test/regression/2007-08-16-invalid-constant-value.llvm38.c 
b/test/regression/2007-08-16-invalid-constant-value.llvm38.c
+diff --git a/test/regression/2007-08-16-invalid-constant-value.llvm37.c 
b/test/regression/2007-08-16-invalid-constant-value.llvm37.c
 new file mode 100644
-index 000000000000..71daeac5b523
+index 000000000000..aa6b42ed6b9f
 --- /dev/null
-+++ b/test/regression/2007-08-16-invalid-constant-value.llvm38.c
++++ b/test/regression/2007-08-16-invalid-constant-value.llvm37.c
 @@ -0,0 +1,33 @@
-+// REQUIRES: geq-llvm-3.8
++// REQUIRES: geq-llvm-3.7
 +// RUN: rm -f %t4.out %t4.err %t4.log
 +// RUN: %llvmgcc %s -emit-llvm -O2 -c -o %t1.bc
-+// RUN: llvm-as -f %p/../Feature/_utils.llvm38._ll -o %t2.bc
++// RUN: llvm-as -f %p/../Feature/_utils.llvm37._ll -o %t2.bc
 +// RUN: llvm-link %t1.bc %t2.bc -o %t3.bc
 +// RUN: rm -rf %t.klee-out
 +// RUN: %klee --output-dir=%t.klee-out %t3.bc
@@ -1616,5 +1615,5 @@
 +  return 0;
 +}
 -- 
-2.13.1
+2.14.2
 

++++++ 0004-llvm37-handle-getRegisteredOptions.patch ++++++
From: Jiri Slaby <[email protected]>
Date: Tue, 10 Oct 2017 14:52:57 +0200
Subject: llvm37: handle getRegisteredOptions
Patch-mainline: no

In LLVM 3.7 and later, getRegisteredOptions takes no arguments and
return the map.

Signed-off-by: Jiri Slaby <[email protected]>
---
 lib/Basic/CmdLineOptions.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/Basic/CmdLineOptions.cpp b/lib/Basic/CmdLineOptions.cpp
index bffd3a4f7c00..ce09edde90ea 100644
--- a/lib/Basic/CmdLineOptions.cpp
+++ b/lib/Basic/CmdLineOptions.cpp
@@ -86,8 +86,12 @@ 
UseAssignmentValidatingSolver("debug-assignment-validating-solver",
                               cl::init(false));
 
 void KCommandLine::HideUnrelatedOptions(cl::OptionCategory &Category) {
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+  StringMap<cl::Option*> &map = cl::getRegisteredOptions();
+#else
   StringMap<cl::Option *> map;
   cl::getRegisteredOptions(map);
+#endif
   for (StringMap<cl::Option *>::iterator i = map.begin(), e = map.end(); i != 
e;
        i++) {
     if (i->second->Category != &Category) {
-- 
2.14.2

++++++ 0005-llvm-make-KLEE-compile-against-LLVM-3.8.patch ++++++
--- /var/tmp/diff_new_pack.eQhzzd/_old  2017-10-23 16:44:12.022213649 +0200
+++ /var/tmp/diff_new_pack.eQhzzd/_new  2017-10-23 16:44:12.022213649 +0200
@@ -9,18 +9,18 @@
  lib/Core/StatsTracker.cpp       |  4 ++++
  lib/Module/IntrinsicCleaner.cpp | 10 +++++++++-
  lib/Module/LowerSwitch.cpp      |  8 ++++++++
- lib/Module/ModuleUtil.cpp       | 38 ++++++++++++++++++++++++++++++--------
+ lib/Module/ModuleUtil.cpp       | 39 +++++++++++++++++++++++++++++++++------
  lib/Module/Optimize.cpp         | 13 ++++++++++++-
- tools/klee/main.cpp             | 11 ++++++++++-
- 7 files changed, 78 insertions(+), 11 deletions(-)
+ tools/klee/main.cpp             |  7 ++++++-
+ 7 files changed, 77 insertions(+), 9 deletions(-)
 
 diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
-index 2c0fc0d1290c..70354edc37ea 100644
+index 673476f61042..cb8862813133 100644
 --- a/lib/Core/Executor.cpp
 +++ b/lib/Core/Executor.cpp
-@@ -2300,8 +2300,13 @@ void Executor::executeInstruction(ExecutionState 
&state, KInstruction *ki) {
+@@ -2127,8 +2127,13 @@ void Executor::executeInstruction(ExecutionState 
&state, KInstruction *ki) {
+         !fpWidthToSemantics(right->getWidth()))
        return terminateStateOnExecError(state, "Unsupported FRem operation");
- #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 3)
      llvm::APFloat Res(*fpWidthToSemantics(left->getWidth()), 
left->getAPValue());
 +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8)
 +    Res.mod(
@@ -29,16 +29,16 @@
      
Res.mod(APFloat(*fpWidthToSemantics(right->getWidth()),right->getAPValue()),
              APFloat::rmNearestTiesToEven);
 +#endif
- #else
-     llvm::APFloat Res(left->getAPValue());
-     Res.mod(APFloat(right->getAPValue()), APFloat::rmNearestTiesToEven);
+     bindLocal(ki, state, ConstantExpr::alloc(Res.bitcastToAPInt()));
+     break;
+   }
 diff --git a/lib/Core/StatsTracker.cpp b/lib/Core/StatsTracker.cpp
-index 86de9586bd3f..798318ae8992 100644
+index 6dc13df86440..e931dcef8b2e 100644
 --- a/lib/Core/StatsTracker.cpp
 +++ b/lib/Core/StatsTracker.cpp
-@@ -641,7 +641,11 @@ static std::vector<Instruction*> getSuccs(Instruction *i) 
{
+@@ -629,7 +629,11 @@ static std::vector<Instruction*> getSuccs(Instruction *i) 
{
      for (succ_iterator it = succ_begin(bb), ie = succ_end(bb); it != ie; ++it)
-       res.push_back(&*it->begin());
+       res.push_back(&*(it->begin()));
    } else {
 +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8)
 +    res.push_back(&*(++(i->getIterator())));
@@ -49,10 +49,10 @@
  
    return res;
 diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp
-index 9af6f9f40f21..1e43463e6a5c 100644
+index 54bda16013b6..2b93319f2615 100644
 --- a/lib/Module/IntrinsicCleaner.cpp
 +++ b/lib/Module/IntrinsicCleaner.cpp
-@@ -80,6 +80,10 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, 
Module &M) {
+@@ -52,6 +52,10 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, 
Module &M) {
    for (BasicBlock::iterator i = b.begin(), ie = b.end();
         (i != ie) && (block_split == false);) {
      IntrinsicInst *ii = dyn_cast<IntrinsicInst>(&*i);
@@ -63,7 +63,7 @@
      // increment now since LowerIntrinsic deletion makes iterator invalid.
      ++i;  
      if(ii) {
-@@ -142,8 +146,12 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, 
Module &M) {
+@@ -104,8 +108,12 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, 
Module &M) {
        case Intrinsic::uadd_with_overflow:
        case Intrinsic::usub_with_overflow:
        case Intrinsic::umul_with_overflow: {
@@ -78,10 +78,10 @@
          Value *op2 = ii->getArgOperand(1);
          
 diff --git a/lib/Module/LowerSwitch.cpp b/lib/Module/LowerSwitch.cpp
-index b20c21ab34e4..147b5acb6d25 100644
+index 1a194245a09a..b61da111908b 100644
 --- a/lib/Module/LowerSwitch.cpp
 +++ b/lib/Module/LowerSwitch.cpp
-@@ -68,7 +68,11 @@ void LowerSwitchPass::switchConvert(CaseItr begin, CaseItr 
end,
+@@ -64,7 +64,11 @@ void LowerSwitchPass::switchConvert(CaseItr begin, CaseItr 
end,
    // iterate through all the cases, creating a new BasicBlock for each
    for (CaseItr it = begin; it < end; ++it) {
      BasicBlock *newBlock = BasicBlock::Create(F->getContext(), "NodeBlock");
@@ -93,7 +93,7 @@
      F->getBasicBlockList().insert(++FI, newBlock);
      
      ICmpInst *cmpInst = 
-@@ -105,7 +109,11 @@ void LowerSwitchPass::processSwitchInst(SwitchInst *SI) {
+@@ -101,7 +105,11 @@ void LowerSwitchPass::processSwitchInst(SwitchInst *SI) {
    // if-then statements go to this and the PHI nodes are happy.
    BasicBlock* newDefault = BasicBlock::Create(F->getContext(), "newDefault");
  
@@ -106,10 +106,10 @@
  
    // If there is an entry in any PHI nodes for the default edge, make sure
 diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp
-index de0130a2632c..6b50b037bc65 100644
+index b07d3d2fe348..e6d592b135b6 100644
 --- a/lib/Module/ModuleUtil.cpp
 +++ b/lib/Module/ModuleUtil.cpp
-@@ -223,8 +223,19 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
+@@ -207,8 +207,19 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
  
      StringRef memberName;
  #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
@@ -131,7 +131,7 @@
      if (!ec) {
        memberName = memberNameErr.get();
  #else
-@@ -242,7 +253,8 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
+@@ -226,7 +237,8 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
      }
  
  #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
@@ -141,7 +141,7 @@
      ec = child.getError();
  #else
      OwningPtr<object::Binary> child;
-@@ -251,7 +263,7 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
+@@ -235,7 +247,7 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
      if (ec) {
        // If we can't open as a binary object file its hopefully a bitcode file
  #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
@@ -150,7 +150,7 @@
        ec = buff.getError();
  #elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
        ErrorOr<std::unique_ptr<MemoryBuffer> > buffErr = AI->getMemoryBuffer();
-@@ -359,7 +371,9 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
+@@ -343,7 +355,9 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
            KLEE_DEBUG_WITH_TYPE("klee_linker", dbgs() << "Found " << 
GV->getName() <<
                " in " << M->getModuleIdentifier() << "\n");
  
@@ -161,7 +161,7 @@
            if (Linker::LinkModules(composite, M))
  #else
            if (Linker::LinkModules(composite, M, Linker::DestroySource, 
&errorMessage))
-@@ -376,8 +390,10 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
+@@ -360,8 +374,10 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
              // Link succeed, now clean up
              modulesLoadedOnPass++;
              KLEE_DEBUG_WITH_TYPE("klee_linker", dbgs() << "Linking 
succeeded.\n");
@@ -173,7 +173,7 @@
              archiveModules[i] = 0;
  
              // We need to recompute the undefined symbols in the composite 
module
-@@ -445,7 +461,9 @@ Module *klee::linkWithLibrary(Module *module,
+@@ -427,7 +443,9 @@ Module *klee::linkWithLibrary(Module *module,
    std::string ErrorMessage;
  
    if (magic == sys::fs::file_magic::bitcode) {
@@ -183,29 +183,42 @@
  #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
  #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
      ErrorOr<std::unique_ptr<Module> > ResultErr =
-@@ -463,11 +481,15 @@ Module *klee::linkWithLibrary(Module *module,
+@@ -445,6 +463,10 @@ Module *klee::linkWithLibrary(Module *module,
            ErrorMessage.c_str());
      }
  
--#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
-+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5) && \
-+    LLVM_VERSION_CODE < LLVM_VERSION(3, 8)
-     Result = ResultErr.get();
- #endif
- 
--#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
 +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8)
 +    if (Linker::linkModules(*module, std::move(ResultErr.get()))) {
 +      ErrorMessage = "linking error";
-+#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
-     if (Linker::LinkModules(module, Result)) {
++#else
+ #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+     Result = ResultErr->release();
+ #elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
+@@ -456,6 +478,7 @@ Module *klee::linkWithLibrary(Module *module,
        ErrorMessage = "linking error";
  #else
+     if (Linker::LinkModules(module, Result, Linker::DestroySource, 
&ErrorMessage)) {
++#endif
+ #endif
+       klee_error("Link with library %s failed: %s", libraryName.c_str(),
+           ErrorMessage.c_str());
+@@ -639,7 +662,11 @@ Module *klee::loadModule(LLVMContext &ctx, const 
std::string &path, std::string
+   auto module = *errorOrModule;
+ #endif
+ 
++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8)
++  if (auto ec = module->materializeAll()) {
++#else
+   if (auto ec = module->materializeAllPermanently()) {
++#endif
+     errorMsg = ec.message();
+     return nullptr;
+   }
 diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp
-index 68acd2b17dda..46ab7d028224 100644
+index 64e4863f70b3..944f51ef336d 100644
 --- a/lib/Module/Optimize.cpp
 +++ b/lib/Module/Optimize.cpp
-@@ -126,7 +126,12 @@ static void AddStandardCompilePasses(PassManager &PM) {
+@@ -102,7 +102,12 @@ static void 
AddStandardCompilePasses(klee::LegacyLLVMPassManagerTy &PM) {
    addPass(PM, createCFGSimplificationPass());    // Clean up after IPCP & DAE
  
    addPass(PM, createPruneEHPass());              // Remove dead EH info
@@ -219,7 +232,7 @@
  
    if (!DisableInline)
      addPass(PM, createFunctionInliningPass());   // Inline small functions
-@@ -257,8 +262,14 @@ void Optimize(Module *M, const std::string &EntryPoint) {
+@@ -217,8 +222,14 @@ void Optimize(Module *M, const std::string &EntryPoint) {
      addPass(Passes, createScalarReplAggregatesPass()); // Break up allocas
  
      // Run a few AA driven optimizations here and now, to cleanup the code.
@@ -235,10 +248,10 @@
      addPass(Passes, createLICMPass());               // Hoist loop invariants
      addPass(Passes, createGVNPass());                // Remove redundancies
 diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
-index dd78d5410e28..78ea1a6eb569 100644
+index 5d1d0c22495c..c48570799a7f 100644
 --- a/tools/klee/main.cpp
 +++ b/tools/klee/main.cpp
-@@ -311,7 +311,12 @@ KleeHandler::KleeHandler(int argc, char **argv)
+@@ -291,7 +291,12 @@ KleeHandler::KleeHandler(int argc, char **argv)
      for (; i <= INT_MAX; ++i) {
        SmallString<128> d(directory);
        llvm::sys::path::append(d, "klee-out-");
@@ -252,18 +265,6 @@
  
        // create directory and try to link klee-last
        if (mkdir(d.c_str(), 0775) == 0) {
-@@ -1284,7 +1289,11 @@ int main(int argc, char **argv, char **envp) {
- #else
-   mainModule = *mainModuleOrError;
- #endif
-+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8)
-+  if (auto ec = mainModule->materializeAll()) {
-+#else
-   if (auto ec = mainModule->materializeAllPermanently()) {
-+#endif
-     klee_error("error loading program '%s': %s", InputFile.c_str(),
-                ec.message().c_str());
-   }
 -- 
-2.13.1
+2.14.2
 

++++++ 0006-llvm-make-KLEE-compile-against-LLVM-3.9.patch ++++++
--- /var/tmp/diff_new_pack.eQhzzd/_old  2017-10-23 16:44:12.034213087 +0200
+++ /var/tmp/diff_new_pack.eQhzzd/_new  2017-10-23 16:44:12.034213087 +0200
@@ -8,17 +8,17 @@
  lib/Core/Executor.cpp      | 16 ++++++++++++++++
  lib/Core/MemoryManager.cpp |  5 ++++-
  lib/Module/ModuleUtil.cpp  | 33 ++++++++++++++++++++++++++++++---
- lib/Module/Optimize.cpp    | 29 ++++++++++++++++++++++++++++-
- lib/Module/RaiseAsm.cpp    | 11 +++++++++--
+ lib/Module/Optimize.cpp    | 28 ++++++++++++++++++++++++++++
+ lib/Module/RaiseAsm.cpp    | 10 +++++++++-
  tools/kleaver/main.cpp     |  4 ++++
  tools/klee/main.cpp        |  4 ++++
- 7 files changed, 95 insertions(+), 7 deletions(-)
+ 7 files changed, 95 insertions(+), 5 deletions(-)
 
 diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
-index 70354edc37ea..841734573abc 100644
+index cb8862813133..aee0974c7792 100644
 --- a/lib/Core/Executor.cpp
 +++ b/lib/Core/Executor.cpp
-@@ -1399,10 +1399,18 @@ void Executor::executeCall(ExecutionState &state,
+@@ -1299,10 +1299,18 @@ void Executor::executeCall(ExecutionState &state,
            //
            // Alignment requirements for scalar types is the same as their size
            if (argWidth > Expr::Int64) {
@@ -37,7 +37,7 @@
          }
        }
  
-@@ -1435,10 +1443,18 @@ void Executor::executeCall(ExecutionState &state,
+@@ -1335,10 +1343,18 @@ void Executor::executeCall(ExecutionState &state,
  
              Expr::Width argWidth = arguments[i]->getWidth();
              if (argWidth > Expr::Int64) {
@@ -75,10 +75,10 @@
      // Handle the case of 0-sized allocations as 1-byte allocations.
      // This way, we make sure we have this allocation between its own red 
zones
 diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp
-index 6b50b037bc65..14d48b026d14 100644
+index e6d592b135b6..8acada93c2cd 100644
 --- a/lib/Module/ModuleUtil.cpp
 +++ b/lib/Module/ModuleUtil.cpp
-@@ -212,7 +212,11 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
+@@ -196,7 +196,11 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
  
    KLEE_DEBUG_WITH_TYPE("klee_linker", dbgs() << "Loading modules\n");
    // Load all bitcode files in to memory so we can examine their symbols
@@ -91,7 +91,7 @@
    for (object::Archive::child_iterator AI = archive->child_begin(),
         AE = archive->child_end(); AI != AE; ++AI)
  #else
-@@ -252,7 +256,14 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
+@@ -236,7 +240,14 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
        return false;
      }
  
@@ -107,7 +107,7 @@
      ErrorOr<std::unique_ptr<llvm::object::Binary> > child =
        childErr->getAsBinary();
      ec = child.getError();
-@@ -335,6 +346,13 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
+@@ -319,6 +330,13 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
      }
  
    }
@@ -121,7 +121,7 @@
  
    KLEE_DEBUG_WITH_TYPE("klee_linker", dbgs() << "Loaded " << 
archiveModules.size() << " modules\n");
  
-@@ -505,7 +523,12 @@ Module *klee::linkWithLibrary(Module *module,
+@@ -490,7 +508,12 @@ Module *klee::linkWithLibrary(Module *module,
  #endif
  
    } else if (magic == sys::fs::file_magic::archive) {
@@ -135,7 +135,7 @@
      ErrorOr<std::unique_ptr<object::Binary> > arch =
          object::createBinary(Buffer, &Context);
      ec = arch.getError();
-@@ -575,7 +598,11 @@ Function *klee::getDirectCallTarget(CallSite cs, bool 
moduleIsFullyLinked) {
+@@ -548,7 +571,11 @@ Function *klee::getDirectCallTarget(CallSite cs, bool 
moduleIsFullyLinked) {
      if (Function *f = dyn_cast<Function>(v)) {
        return f;
      } else if (llvm::GlobalAlias *ga = dyn_cast<GlobalAlias>(v)) {
@@ -148,30 +148,22 @@
        } else {
          v = NULL;
 diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp
-index 46ab7d028224..745d89f70027 100644
+index 944f51ef336d..ae1d4839f772 100644
 --- a/lib/Module/Optimize.cpp
 +++ b/lib/Module/Optimize.cpp
-@@ -16,6 +16,9 @@
- 
//===----------------------------------------------------------------------===//
+@@ -35,6 +35,11 @@
+ #include "llvm/Analysis/Verifier.h"
+ #endif
  
- #include "klee/Config/Version.h"
 +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9)
 +#include "llvm/Transforms/IPO/FunctionAttrs.h"
-+#endif
- #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
- #include "llvm/IR/LegacyPassManager.h"
- #else
-@@ -47,6 +50,9 @@
- #include "llvm/Target/TargetMachine.h"
- #include "llvm/Transforms/IPO.h"
- #include "llvm/Transforms/Scalar.h"
-+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9)
 +#include "llvm/Transforms/Scalar/GVN.h"
 +#endif
- #include "llvm/Support/PluginLoader.h"
++
  using namespace llvm;
  
-@@ -127,7 +133,11 @@ static void AddStandardCompilePasses(PassManager &PM) {
+ // Don't verify at the end
+@@ -103,7 +108,11 @@ static void 
AddStandardCompilePasses(klee::LegacyLLVMPassManagerTy &PM) {
  
    addPass(PM, createPruneEHPass());              // Remove dead EH info
  #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8)
@@ -183,7 +175,7 @@
    addPass(PM, createReversePostOrderFunctionAttrsPass());
  #else
    addPass(PM, createFunctionAttrsPass()); // Deduce function attrs
-@@ -143,7 +153,11 @@ static void AddStandardCompilePasses(PassManager &PM) {
+@@ -116,7 +125,11 @@ static void 
AddStandardCompilePasses(klee::LegacyLLVMPassManagerTy &PM) {
    addPass(PM, createInstructionCombiningPass()); // Cleanup for scalarrepl.
    addPass(PM, createJumpThreadingPass());        // Thread jumps.
    addPass(PM, createCFGSimplificationPass());    // Merge & remove BBs
@@ -195,21 +187,23 @@
    addPass(PM, createInstructionCombiningPass()); // Combine silly seq's
  
    addPass(PM, createTailCallEliminationPass());  // Eliminate tail calls
-@@ -215,7 +229,12 @@ void Optimize(Module *M, const std::string &EntryPoint) {
+@@ -179,8 +192,15 @@ void Optimize(Module *M, const std::string &EntryPoint) {
      // for a main function.  If main is defined, mark all other functions
      // internal.
      if (!DisableInternalize) {
--#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 2)
 +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9)
 +      auto PreserveEP = [=](const GlobalValue &GV) {
 +      return GV.getName().equals(EntryPoint);
 +      };
 +      ModulePass *pass = createInternalizePass(PreserveEP);
-+#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 2)
++#else
        ModulePass *pass = createInternalizePass(
            std::vector<const char *>(1, EntryPoint.c_str()));
- #else
-@@ -259,11 +278,19 @@ void Optimize(Module *M, const std::string &EntryPoint) {
++#endif
+       addPass(Passes, pass);
+     }
+ 
+@@ -219,11 +239,19 @@ void Optimize(Module *M, const std::string &EntryPoint) {
      // The IPO passes may leave cruft around.  Clean up after them.
      addPass(Passes, createInstructionCombiningPass());
      addPass(Passes, createJumpThreadingPass());        // Thread jumps.
@@ -230,22 +224,22 @@
      // addPass(Passes, createGlobalsAAWrapperPass());
  #else
 diff --git a/lib/Module/RaiseAsm.cpp b/lib/Module/RaiseAsm.cpp
-index 668ce4853cca..08e78748d30c 100644
+index c597fa2a7b82..d9b3e40154ba 100644
 --- a/lib/Module/RaiseAsm.cpp
 +++ b/lib/Module/RaiseAsm.cpp
-@@ -75,7 +75,10 @@ bool RaiseAsmPass::runOnInstruction(Module &M, Instruction 
*I) {
-        triple.getOS() == llvm::Triple::Darwin)) {
+@@ -60,7 +60,11 @@ bool RaiseAsmPass::runOnInstruction(Module &M, Instruction 
*I) {
  
      if (ia->getAsmString() == "" && ia->hasSideEffects()) {
--#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 3)
+       IRBuilder<> Builder(I);
 +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9)
-+      IRBuilder<> Builder(I);
 +      Builder.CreateFence(llvm::AtomicOrdering::SequentiallyConsistent);
-+#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 3)
-       IRBuilder<> Builder(I);
++#else
        Builder.CreateFence(llvm::SequentiallyConsistent);
- #endif
-@@ -103,7 +106,11 @@ bool RaiseAsmPass::runOnModule(Module &M) {
++#endif
+       I->eraseFromParent();
+       return true;
+     }
+@@ -81,7 +85,11 @@ bool RaiseAsmPass::runOnModule(Module &M) {
      klee_warning("Warning: unable to select native target: %s", Err.c_str());
      TLI = 0;
    } else {
@@ -275,10 +269,10 @@
    llvm::cl::ParseCommandLineOptions(argc, argv);
  
 diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
-index 78ea1a6eb569..eac69ada30e0 100644
+index c48570799a7f..d193d8341e93 100644
 --- a/tools/klee/main.cpp
 +++ b/tools/klee/main.cpp
-@@ -1170,7 +1170,11 @@ int main(int argc, char **argv, char **envp) {
+@@ -1128,7 +1128,11 @@ int main(int argc, char **argv, char **envp) {
    llvm::InitializeNativeTarget();
  
    parseArguments(argc, argv);
@@ -291,5 +285,5 @@
    if (Watchdog) {
      if (MaxTime==0) {
 -- 
-2.13.1
+2.14.2
 

++++++ 0009-llvm40-handle-different-header-names.patch -> 
0007-llvm40-handle-different-header-names.patch ++++++
--- 
/work/SRC/openSUSE:Factory/klee/0009-llvm40-handle-different-header-names.patch 
    2017-06-12 15:32:13.422121163 +0200
+++ 
/work/SRC/openSUSE:Factory/.klee.new/0007-llvm40-handle-different-header-names.patch
        2017-10-23 16:44:10.726274298 +0200
@@ -9,12 +9,12 @@
 Signed-off-by: Jiri Slaby <[email protected]>
 ---
  lib/Module/KModule.cpp    | 4 ++++
- lib/Module/ModuleUtil.cpp | 6 ++++++
+ lib/Module/ModuleUtil.cpp | 9 ++++++++-
  tools/klee/main.cpp       | 7 ++++++-
- 3 files changed, 16 insertions(+), 1 deletion(-)
+ 3 files changed, 18 insertions(+), 2 deletions(-)
 
 diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp
-index b31b7fd5a56d..a47e0a43615a 100644
+index 0439431b3bc8..ff76cd53c895 100644
 --- a/lib/Module/KModule.cpp
 +++ b/lib/Module/KModule.cpp
 @@ -21,7 +21,11 @@
@@ -26,49 +26,53 @@
 +#else
  #include "llvm/Bitcode/ReaderWriter.h"
 +#endif
- #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 3)
  #include "llvm/IR/Instructions.h"
  #include "llvm/IR/LLVMContext.h"
+ #include "llvm/IR/Module.h"
 diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp
-index 14d48b026d14..6bdea479ee06 100644
+index 8acada93c2cd..63d3913a08f2 100644
 --- a/lib/Module/ModuleUtil.cpp
 +++ b/lib/Module/ModuleUtil.cpp
-@@ -19,7 +19,11 @@
+@@ -26,7 +26,9 @@
+ #include "llvm/Object/Error.h"
+ #include "llvm/Support/FileSystem.h"
+ #include "llvm/Support/SourceMgr.h"
++#if LLVM_VERSION_CODE < LLVM_VERSION(4, 0)
+ #include "llvm/Support/DataStream.h"
++#endif
+ 
+ #if LLVM_VERSION_CODE < LLVM_VERSION(3, 5)
+ #include "llvm/Linker.h"
+@@ -36,8 +38,13 @@
+ #include "llvm/IR/AssemblyAnnotationWriter.h"
  #endif
  
- #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 3)
 +#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
 +#include <llvm/Bitcode/BitcodeReader.h>
 +#else
- #include "llvm/Bitcode/ReaderWriter.h"
-+#endif
- #include "llvm/IR/Function.h"
- #include "llvm/IR/Instructions.h"
- #include "llvm/IR/IntrinsicInst.h"
-@@ -31,7 +35,9 @@
- #include "llvm/Support/FileSystem.h"
- #include "llvm/IR/ValueSymbolTable.h"
- #include "llvm/Support/SourceMgr.h"
-+#if LLVM_VERSION_CODE < LLVM_VERSION(4, 0)
- #include "llvm/Support/DataStream.h"
++#include <llvm/Bitcode/ReaderWriter.h>
 +#endif
- #else
- #include "llvm/Function.h"
- #include "llvm/Instructions.h"
++
+ #include "llvm/Analysis/ValueTracking.h"
+-#include "llvm/Bitcode/ReaderWriter.h"
+ #include "llvm/Support/MemoryBuffer.h"
+ #include "llvm/Support/raw_ostream.h"
+ #include "llvm/Support/Path.h"
 diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
-index eac69ada30e0..eccc79776bb5 100644
+index d193d8341e93..cd54d8aab5af 100644
 --- a/tools/klee/main.cpp
 +++ b/tools/klee/main.cpp
-@@ -43,13 +43,18 @@
- #endif
+@@ -31,7 +31,6 @@
+ #include "llvm/IR/LLVMContext.h"
  #include "llvm/Support/Errno.h"
  #include "llvm/Support/FileSystem.h"
 -#include "llvm/Bitcode/ReaderWriter.h"
  #include "llvm/Support/CommandLine.h"
  #include "llvm/Support/ManagedStatic.h"
  #include "llvm/Support/MemoryBuffer.h"
- #include "llvm/Support/Path.h"
- #include "llvm/Support/raw_ostream.h"
+@@ -45,6 +44,12 @@
+ #include "llvm/Support/system_error.h"
+ #endif
  
 +#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
 +#include <llvm/Bitcode/BitcodeReader.h>
@@ -76,9 +80,9 @@
 +#include <llvm/Bitcode/ReaderWriter.h>
 +#endif
 +
- #if LLVM_VERSION_CODE < LLVM_VERSION(3, 0)
- #include "llvm/Target/TargetSelect.h"
- #else
+ #include <dirent.h>
+ #include <signal.h>
+ #include <unistd.h>
 -- 
-2.13.1
+2.14.2
 

++++++ 0010-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch -> 
0008-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch ++++++
--- 
/work/SRC/openSUSE:Factory/klee/0010-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch
   2017-06-12 15:32:13.450117215 +0200
+++ 
/work/SRC/openSUSE:Factory/.klee.new/0008-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch
      2017-10-23 16:44:10.738273736 +0200
@@ -9,10 +9,10 @@
  1 file changed, 9 insertions(+)
 
 diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
-index 841734573abc..4a0239dace49 100644
+index aee0974c7792..08474ae700ac 100644
 --- a/lib/Core/Executor.cpp
 +++ b/lib/Core/Executor.cpp
-@@ -1542,12 +1542,21 @@ static bool isDebugIntrinsic(const Function *f, 
KModule *KM) {
+@@ -1442,12 +1442,21 @@ static bool isDebugIntrinsic(const Function *f, 
KModule *KM) {
  
  static inline const llvm::fltSemantics * fpWidthToSemantics(unsigned width) {
    switch(width) {
@@ -35,5 +35,5 @@
      return 0;
    }
 -- 
-2.13.1
+2.14.2
 

++++++ 0011-llvm40-errorOr-and-similar.patch -> 
0009-llvm40-errorOr-and-similar.patch ++++++
--- /work/SRC/openSUSE:Factory/klee/0011-llvm40-errorOr-and-similar.patch       
2017-06-12 15:32:13.638090703 +0200
+++ /work/SRC/openSUSE:Factory/.klee.new/0009-llvm40-errorOr-and-similar.patch  
2017-10-23 16:44:10.750273175 +0200
@@ -5,15 +5,14 @@
 
 Signed-off-by: Jiri Slaby <[email protected]>
 ---
- lib/Module/ModuleUtil.cpp | 31 ++++++++++++++++++++++++++-----
- tools/klee/main.cpp       | 19 +++++++++++++++----
- 2 files changed, 41 insertions(+), 9 deletions(-)
+ lib/Module/ModuleUtil.cpp | 50 ++++++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 41 insertions(+), 9 deletions(-)
 
 diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp
-index 6bdea479ee06..a807ff79e95e 100644
+index 63d3913a08f2..e49896a06718 100644
 --- a/lib/Module/ModuleUtil.cpp
 +++ b/lib/Module/ModuleUtil.cpp
-@@ -219,7 +219,7 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
+@@ -204,7 +204,7 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
    KLEE_DEBUG_WITH_TYPE("klee_linker", dbgs() << "Loading modules\n");
    // Load all bitcode files in to memory so we can examine their symbols
  #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9)
@@ -22,7 +21,7 @@
    for (object::Archive::child_iterator AI = archive->child_begin(Err),
         AE = archive->child_end(); AI != AE; ++AI)
  #elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
-@@ -244,8 +244,14 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
+@@ -229,8 +229,14 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
  #else
      object::Archive::child_iterator childErr = AI;
  #endif
@@ -37,7 +36,7 @@
      if (!ec) {
        memberName = memberNameErr.get();
  #else
-@@ -279,7 +285,10 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
+@@ -264,7 +270,10 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
  #endif
      if (ec) {
        // If we can't open as a binary object file its hopefully a bitcode file
@@ -49,7 +48,7 @@
        ErrorOr<MemoryBufferRef> buff = childErr->getMemoryBufferRef();
        ec = buff.getError();
  #elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
-@@ -303,13 +312,20 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
+@@ -288,13 +297,20 @@ static bool linkBCA(object::Archive* archive, Module* 
composite, std::string& er
          Module *Result = 0;
          // FIXME: Maybe load bitcode file lazily? Then if we need to link, 
materialise the module
  #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
@@ -72,7 +71,7 @@
          if (ec)
            errorMessage = ec.message();
          else
-@@ -488,7 +504,12 @@ Module *klee::linkWithLibrary(Module *module,
+@@ -471,7 +487,12 @@ Module *klee::linkWithLibrary(Module *module,
  #if LLVM_VERSION_CODE < LLVM_VERSION(3, 8)
      Module *Result = 0;
  #endif
@@ -86,49 +85,44 @@
  #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
      ErrorOr<std::unique_ptr<Module> > ResultErr =
  #else
-diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
-index eccc79776bb5..098f9308d130 100644
---- a/tools/klee/main.cpp
-+++ b/tools/klee/main.cpp
-@@ -1278,15 +1278,23 @@ int main(int argc, char **argv, char **envp) {
-     klee_error("error loading program '%s': %s", InputFile.c_str(),
-                Buffer.getError().message().c_str());
+@@ -677,14 +698,22 @@ Module *klee::loadModule(LLVMContext &ctx, const 
std::string &path, std::string
+     return nullptr;
+   }
  
 -#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
 +  std::error_code ec;
 +#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
-+  Expected<std::unique_ptr<Module>> mainModuleOrError =
-+    getOwningLazyBitcodeModule(std::move(Buffer.get()), ctx);
-+  ec = mainModuleOrError ? std::error_code() :
-+    errorToErrorCode(mainModuleOrError.takeError());
++  Expected<std::unique_ptr<Module>> errorOrModule =
++    getOwningLazyBitcodeModule(std::move(buffer.get()), ctx);
++  ec = errorOrModule ? std::error_code() :
++    errorToErrorCode(errorOrModule.takeError());
 +#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
-   auto mainModuleOrError = getLazyBitcodeModule(std::move(Buffer.get()), ctx);
-+  ec = mainModuleOrError.getError();
+   auto errorOrModule = getLazyBitcodeModule(std::move(buffer.get()), ctx);
++  ec = errorOrModule.getError();
  #else
-   auto mainModuleOrError = getLazyBitcodeModule(Buffer->get(), ctx);
-+  ec = mainModuleOrError.getError();
+   auto errorOrModule = getLazyBitcodeModule(buffer->get(), ctx);
++  ec = errorOrModule.getError();
  #endif
  
--  if (!mainModuleOrError) {
+-  if (!errorOrModule) {
+-    errorMsg = errorOrModule.getError().message().c_str();
 +  if (ec) {
-     klee_error("error loading program '%s': %s", InputFile.c_str(),
--               mainModuleOrError.getError().message().c_str());
-+               ec.message().c_str());
++    errorMsg = ec.message();
+     return nullptr;
    }
-   else {
-     // The module has taken ownership of the MemoryBuffer so release it
-@@ -1298,7 +1306,10 @@ int main(int argc, char **argv, char **envp) {
- #else
-   mainModule = *mainModuleOrError;
+   // The module has taken ownership of the MemoryBuffer so release it
+@@ -696,7 +725,10 @@ Module *klee::loadModule(LLVMContext &ctx, const 
std::string &path, std::string
+   auto module = *errorOrModule;
  #endif
+ 
 -#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8)
 +#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
-+  if (llvm::Error err = mainModule->materializeAll()) {
++  if (llvm::Error err = module->materializeAll()) {
 +    std::error_code ec = errorToErrorCode(std::move(err));
 +#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 8)
-   if (auto ec = mainModule->materializeAll()) {
+   if (auto ec = module->materializeAll()) {
  #else
-   if (auto ec = mainModule->materializeAllPermanently()) {
+   if (auto ec = module->materializeAllPermanently()) {
 -- 
-2.13.1
+2.14.2
 

++++++ 0012-llvm-use-chrono-helpers-from-LLVM-4.0.patch -> 
0010-llvm-use-chrono-helpers-from-LLVM-4.0.patch ++++++
--- 
/work/SRC/openSUSE:Factory/klee/0012-llvm-use-chrono-helpers-from-LLVM-4.0.patch
    2017-06-12 15:32:14.102025271 +0200
+++ 
/work/SRC/openSUSE:Factory/.klee.new/0010-llvm-use-chrono-helpers-from-LLVM-4.0.patch
       2017-10-23 16:44:10.758272800 +0200
@@ -69,10 +69,10 @@
  }
  
 diff --git a/lib/Core/StatsTracker.cpp b/lib/Core/StatsTracker.cpp
-index 798318ae8992..abfc6bf823be 100644
+index e931dcef8b2e..c39c7d5bd7ba 100644
 --- a/lib/Core/StatsTracker.cpp
 +++ b/lib/Core/StatsTracker.cpp
-@@ -294,6 +294,29 @@ void StatsTracker::done() {
+@@ -282,6 +282,29 @@ void StatsTracker::done() {
  void StatsTracker::stepInstruction(ExecutionState &es) {
    if (OutputIStats) {
      if (TrackInstructionTime) {
@@ -102,7 +102,7 @@
        static sys::TimeValue lastNowTime(0,0),lastUserTime(0,0);
      
        if (lastUserTime.seconds()==0 && lastUserTime.nanoseconds()==0) {
-@@ -309,6 +332,7 @@ void StatsTracker::stepInstruction(ExecutionState &es) {
+@@ -297,6 +320,7 @@ void StatsTracker::stepInstruction(ExecutionState &es) {
          lastUserTime = user;
          lastNowTime = now;
        }
@@ -111,16 +111,16 @@
  
      Instruction *inst = es.pc->inst;
 diff --git a/lib/Support/Time.cpp b/lib/Support/Time.cpp
-index be5eaf186958..c931c058ffd0 100644
+index be5eaf186958..f508e6fa1bcb 100644
 --- a/lib/Support/Time.cpp
 +++ b/lib/Support/Time.cpp
 @@ -10,12 +10,43 @@
  #include "klee/Config/Version.h"
  #include "klee/Internal/System/Time.h"
  
++#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
 +#include <chrono>
 +
-+#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
 +#include <llvm/Support/Chrono.h>
 +#else
  #include "llvm/Support/TimeValue.h"
@@ -195,5 +195,5 @@
 +
 +#endif
 -- 
-2.13.1
+2.14.2
 

++++++ 0013-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch -> 
0011-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch ++++++
--- 
/work/SRC/openSUSE:Factory/klee/0013-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch
 2017-06-12 15:32:14.805925995 +0200
+++ 
/work/SRC/openSUSE:Factory/.klee.new/0011-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch
    2017-10-23 16:44:10.774272052 +0200
@@ -7,32 +7,31 @@
 
 Signed-off-by: Jiri Slaby <[email protected]>
 ---
- include/klee/util/GetElementPtrTypeIterator.h |  5 +++++
+ include/klee/util/GetElementPtrTypeIterator.h |  4 ++++
  lib/Core/Executor.cpp                         | 22 +++++++++++++++++++---
  lib/Core/ExecutorUtil.cpp                     | 17 ++++++++++++++---
- 3 files changed, 38 insertions(+), 6 deletions(-)
+ 3 files changed, 37 insertions(+), 6 deletions(-)
 
 diff --git a/include/klee/util/GetElementPtrTypeIterator.h 
b/include/klee/util/GetElementPtrTypeIterator.h
-index 2d145cd67f14..b551d772eaac 100644
+index 5fb9f4ec5c2f..bf7cb6ff0bea 100644
 --- a/include/klee/util/GetElementPtrTypeIterator.h
 +++ b/include/klee/util/GetElementPtrTypeIterator.h
-@@ -93,6 +93,11 @@ namespace klee {
-       if (LLVM_TYPE_Q llvm::CompositeType *CT =
-             dyn_cast<llvm::CompositeType>(CurTy)) {
+@@ -78,6 +78,10 @@ class generic_gep_type_iterator
+     generic_gep_type_iterator& operator++() {   // Preincrement
+       if (llvm::CompositeType *CT = dyn_cast<llvm::CompositeType>(CurTy)) {
          CurTy = CT->getTypeAtIndex(getOperand());
 +#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
-+      } else if (LLVM_TYPE_Q llvm::PointerType *ptr =
-+            dyn_cast<llvm::PointerType>(CurTy)) {
++      } else if (llvm::PointerType *ptr = dyn_cast<llvm::PointerType>(CurTy)) 
{
 +        CurTy = ptr->getElementType();
 +#endif
        } else {
          CurTy = 0;
        }
 diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
-index 4a0239dace49..fd5cb5e4e751 100644
+index 08474ae700ac..5a88f1ae3180 100644
 --- a/lib/Core/Executor.cpp
 +++ b/lib/Core/Executor.cpp
-@@ -2648,8 +2648,7 @@ void Executor::computeOffsets(KGEPInstruction *kgepi, 
TypeIt ib, TypeIt ie) {
+@@ -2520,8 +2520,7 @@ void Executor::computeOffsets(KGEPInstruction *kgepi, 
TypeIt ib, TypeIt ie) {
        uint64_t addend = sl->getElementOffset((unsigned) ci->getZExtValue());
        constantOffset = constantOffset->Add(ConstantExpr::alloc(addend,
                                                                 
Context::get().getPointerWidth()));
@@ -42,7 +41,7 @@
        uint64_t elementSize = 
          kmodule->targetData->getTypeStoreSize(set->getElementType());
        Value *operand = ii.getOperand();
-@@ -2663,7 +2662,24 @@ void Executor::computeOffsets(KGEPInstruction *kgepi, 
TypeIt ib, TypeIt ie) {
+@@ -2535,7 +2534,24 @@ void Executor::computeOffsets(KGEPInstruction *kgepi, 
TypeIt ib, TypeIt ie) {
        } else {
          kgepi->indices.push_back(std::make_pair(index, elementSize));
        }
@@ -69,10 +68,10 @@
    }
    kgepi->offset = constantOffset->getZExtValue();
 diff --git a/lib/Core/ExecutorUtil.cpp b/lib/Core/ExecutorUtil.cpp
-index b91b5deec173..a63b891bf925 100644
+index 53f4c5b85754..6d18e07425c5 100644
 --- a/lib/Core/ExecutorUtil.cpp
 +++ b/lib/Core/ExecutorUtil.cpp
-@@ -102,8 +102,7 @@ namespace klee {
+@@ -199,8 +199,7 @@ namespace klee {
            addend = ConstantExpr::alloc(sl->getElementOffset((unsigned)
                                                              
ci->getZExtValue()),
                                         Context::get().getPointerWidth());
@@ -80,9 +79,9 @@
 -          const SequentialType *set = cast<SequentialType>(*ii);
 +        } else if (const SequentialType *set = dyn_cast<SequentialType>(*ii)) 
{
            ref<ConstantExpr> index = 
-             evalConstant(cast<Constant>(ii.getOperand()));
+             evalConstant(cast<Constant>(ii.getOperand()), ki);
            unsigned elementSize = 
-@@ -112,7 +111,19 @@ namespace klee {
+@@ -209,7 +208,19 @@ namespace klee {
            index = index->ZExt(Context::get().getPointerWidth());
            addend = index->Mul(ConstantExpr::alloc(elementSize, 
                                                    
Context::get().getPointerWidth()));
@@ -104,5 +103,5 @@
          base = base->Add(addend);
        }
 -- 
-2.13.1
+2.14.2
 

++++++ _service ++++++
--- /var/tmp/diff_new_pack.eQhzzd/_old  2017-10-23 16:44:12.142208033 +0200
+++ /var/tmp/diff_new_pack.eQhzzd/_new  2017-10-23 16:44:12.142208033 +0200
@@ -3,7 +3,9 @@
     <param name="url">git://github.com/klee/klee.git</param>
     <param name="scm">git</param>
     <param name="changesgenerate">enable</param>
-    <param name="versionformat">1.3.0+%cd</param>
+    <param name="versionformat">@PARENT_TAG@+%cd</param>
+    <param name="versionrewrite-pattern">v(.*)</param>
+    <param name="versionrewrite-replacement">\1</param>
   </service>
   <service name="recompress" mode="disabled">
     <param name="file">klee-*.tar</param>

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.eQhzzd/_old  2017-10-23 16:44:12.162207097 +0200
+++ /var/tmp/diff_new_pack.eQhzzd/_new  2017-10-23 16:44:12.166206910 +0200
@@ -1,4 +1,4 @@
 <servicedata>
 <service name="tar_scm">
             <param name="url">git://github.com/klee/klee.git</param>
-          <param 
name="changesrevision">1310855836fb7e931371647f4464801c277b0f7c</param></service></servicedata>
\ No newline at end of file
+          <param 
name="changesrevision">9f11eababd767b012b623806b40fa0647affa47e</param></service></servicedata>
\ No newline at end of file

++++++ klee-1.3.0+20170607.tar.xz -> klee-1.4.0+20171009.tar.xz ++++++
++++ 23186 lines of diff (skipped)


Reply via email to