Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package klee for openSUSE:Factory checked in 
at 2021-10-26 20:13:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/klee (Old)
 and      /work/SRC/openSUSE:Factory/.klee.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "klee"

Tue Oct 26 20:13:59 2021 rev:29 rq:927481 version:2.2+20211017

Changes:
--------
--- /work/SRC/openSUSE:Factory/klee/klee.changes        2021-10-04 
18:42:36.178314636 +0200
+++ /work/SRC/openSUSE:Factory/.klee.new.1890/klee.changes      2021-10-26 
20:14:42.894042171 +0200
@@ -1,0 +2,18 @@
+Tue Oct 19 07:47:49 UTC 2021 - jsl...@suse.cz
+
+- Update to version 2.2+20211017:
+  * test/Runtime/POSIX/Futimesat: futimesat(2) requires _GNU_SOURCE on glibc 
platforms
+  * test/Runtime/POSIX/Futimesat: Compile with -std=c99
+  * test/Feature/FunctionAlias.c: Add missing CHECK-UNKNOWN prefix
+- add llvm 13 support
+  * 0001-Support-FileHandling.cpp-rewrite-to-C-14.patch
+  * 0002-llvm13-llvm-fs-F_None-has-been-removed.patch
+  * 0003-llvm13-llvm-cl-GeneralCategory-is-no-longer-a-global.patch
+  * 0004-llvm13-CreateLoad-API-with-implicit-types-has-been-d.patch
+  * 0005-llvm13-CreateGEP-no-longer-accepts-nullptr.patch
+  * 0006-llvm13-llvm-APInt-toString-has-been-moved-to-StringE.patch
+  * 0007-llvm13-Add-LLVM-13-to-lit.cfg.patch
+  * 0008-llvm13-Add-LLVM-13-to-Travis-CI-and-GitHub-Actions.patch
+- switch to llvm 13
+
+-------------------------------------------------------------------

Old:
----
  klee-2.2+20210915.obscpio

New:
----
  0001-Support-FileHandling.cpp-rewrite-to-C-14.patch
  0002-llvm13-llvm-fs-F_None-has-been-removed.patch
  0003-llvm13-llvm-cl-GeneralCategory-is-no-longer-a-global.patch
  0004-llvm13-CreateLoad-API-with-implicit-types-has-been-d.patch
  0005-llvm13-CreateGEP-no-longer-accepts-nullptr.patch
  0006-llvm13-llvm-APInt-toString-has-been-moved-to-StringE.patch
  0007-llvm13-Add-LLVM-13-to-lit.cfg.patch
  0008-llvm13-Add-LLVM-13-to-Travis-CI-and-GitHub-Actions.patch
  klee-2.2+20211017.obscpio

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

Other differences:
------------------
++++++ klee.spec ++++++
--- /var/tmp/diff_new_pack.tV4Ph9/_old  2021-10-26 20:14:43.606042547 +0200
+++ /var/tmp/diff_new_pack.tV4Ph9/_new  2021-10-26 20:14:43.610042549 +0200
@@ -16,7 +16,7 @@
 #
 
 
-%define llvm_version_major 12
+%define llvm_version_major 13
 %define llvm_version %{llvm_version_major}
 
 %ifarch x86_64
@@ -31,7 +31,7 @@
 Summary:        LLVM Execution Engine
 License:        NCSA
 Group:          Development/Languages/Other
-Version:        2.2+20210915
+Version:        2.2+20211017
 Release:        0
 URL:            http://klee.github.io/
 Source0:        %{name}-%{version}.tar.xz
@@ -39,6 +39,15 @@
 Source2:        
https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-%{llvm_version_major}.0.0/llvm/utils/not/not.cpp
 Source3:        
https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-%{llvm_version_major}.0.0/llvm/utils/FileCheck/FileCheck.cpp
 Patch0:         0001-test-disable-until-it-is-fixed.patch
+Patch1:         0001-Support-FileHandling.cpp-rewrite-to-C-14.patch
+Patch2:         0002-llvm13-llvm-fs-F_None-has-been-removed.patch
+Patch3:         0003-llvm13-llvm-cl-GeneralCategory-is-no-longer-a-global.patch
+Patch4:         0004-llvm13-CreateLoad-API-with-implicit-types-has-been-d.patch
+Patch5:         0005-llvm13-CreateGEP-no-longer-accepts-nullptr.patch
+Patch6:         0006-llvm13-llvm-APInt-toString-has-been-moved-to-StringE.patch
+Patch7:         0007-llvm13-Add-LLVM-13-to-lit.cfg.patch
+Patch8:         0008-llvm13-Add-LLVM-13-to-Travis-CI-and-GitHub-Actions.patch
+
 BuildRequires:  clang%{llvm_version}
 BuildRequires:  cmake
 BuildRequires:  gperftools-devel

++++++ 0001-Support-FileHandling.cpp-rewrite-to-C-14.patch ++++++
From: Lukas Zaoral <lzao...@redhat.com>
Date: Tue, 24 Aug 2021 13:59:21 +0200
Subject: Support/FileHandling.cpp: rewrite to C++14
Patch-mainline: no
References: llvm 13

Signed-off-by: Jiri Slaby <jirisl...@gmail.com>
---
 lib/Support/FileHandling.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/Support/FileHandling.cpp b/lib/Support/FileHandling.cpp
index bc65a641ce20..9809b87d0051 100644
--- a/lib/Support/FileHandling.cpp
+++ b/lib/Support/FileHandling.cpp
@@ -22,10 +22,10 @@ namespace klee {
 
 std::unique_ptr<llvm::raw_fd_ostream>
 klee_open_output_file(const std::string &path, std::string &error) {
-  error = "";
-  std::unique_ptr<llvm::raw_fd_ostream> f;
+  error.clear();
   std::error_code ec;
-  f = std::unique_ptr<llvm::raw_fd_ostream>(new 
llvm::raw_fd_ostream(path.c_str(), ec, llvm::sys::fs::F_None)); // FIXME C++14
+  auto f = std::make_unique<llvm::raw_fd_ostream>(path.c_str(), ec,
+                                                  llvm::sys::fs::F_None);
   if (ec)
     error = ec.message();
   if (!error.empty()) {
@@ -37,8 +37,8 @@ klee_open_output_file(const std::string &path, std::string 
&error) {
 #ifdef HAVE_ZLIB_H
 std::unique_ptr<llvm::raw_ostream>
 klee_open_compressed_output_file(const std::string &path, std::string &error) {
-  error = "";
-  std::unique_ptr<llvm::raw_ostream> f(new compressed_fd_ostream(path, error));
+  error.clear();
+  auto f = std::make_unique<compressed_fd_ostream>(path, error);
   if (!error.empty()) {
     f.reset(nullptr);
   }
-- 
2.33.1

++++++ 0002-llvm13-llvm-fs-F_None-has-been-removed.patch ++++++
From: Lukas Zaoral <lzao...@redhat.com>
Date: Tue, 24 Aug 2021 13:59:28 +0200
Subject: llvm13: llvm::fs::F_None has been removed
Patch-mainline: no
References: llvm 13

... and should be replaced with llvm::fs::OF_None since LLVM 7.

See: https://reviews.llvm.org/D101506
     
https://github.com/llvm/llvm-project/commit/1f67a3cba9b09636c56e2109d8a35ae96dc15782
Signed-off-by: Jiri Slaby <jirisl...@gmail.com>
---
 lib/Support/FileHandling.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/Support/FileHandling.cpp b/lib/Support/FileHandling.cpp
index 9809b87d0051..462055210df7 100644
--- a/lib/Support/FileHandling.cpp
+++ b/lib/Support/FileHandling.cpp
@@ -24,8 +24,15 @@ std::unique_ptr<llvm::raw_fd_ostream>
 klee_open_output_file(const std::string &path, std::string &error) {
   error.clear();
   std::error_code ec;
+
+#if LLVM_VERSION_CODE >= LLVM_VERSION(7, 0)
+  auto f = std::make_unique<llvm::raw_fd_ostream>(path.c_str(), ec,
+                                                  llvm::sys::fs::OF_None);
+#else
   auto f = std::make_unique<llvm::raw_fd_ostream>(path.c_str(), ec,
                                                   llvm::sys::fs::F_None);
+#endif
+
   if (ec)
     error = ec.message();
   if (!error.empty()) {
-- 
2.33.1

++++++ 0003-llvm13-llvm-cl-GeneralCategory-is-no-longer-a-global.patch ++++++
From: Lukas Zaoral <lzao...@redhat.com>
Date: Tue, 24 Aug 2021 13:59:29 +0200
Subject: llvm13: llvm::cl::GeneralCategory is no longer a global
Patch-mainline: no
References: llvm 13

Therefore, llvm::cl::getGeneralCategory() should be used instead.

See: https://reviews.llvm.org/D105959
Signed-off-by: Jiri Slaby <jirisl...@gmail.com>
---
 tools/kleaver/main.cpp | 5 ++++-
 tools/klee/main.cpp    | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/kleaver/main.cpp b/tools/kleaver/main.cpp
index 9a79474c77e6..0a4cfbffa945 100644
--- a/tools/kleaver/main.cpp
+++ b/tools/kleaver/main.cpp
@@ -387,8 +387,11 @@ static bool printInputAsSMTLIBv2(const char *Filename,
 }
 
 int main(int argc, char **argv) {
-
+#if LLVM_VERSION_CODE >= LLVM_VERSION(13, 0)
+  KCommandLine::HideOptions(llvm::cl::getGeneralCategory());
+#else
   KCommandLine::HideOptions(llvm::cl::GeneralCategory);
+#endif
 
   bool success = true;
 
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index f340e7438af2..506493152073 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -1157,7 +1157,11 @@ linkWithUclibc(StringRef libDir, std::string opt_suffix,
 int main(int argc, char **argv, char **envp) {
   atexit(llvm_shutdown);  // Call llvm_shutdown() on exit.
 
+#if LLVM_VERSION_CODE >= LLVM_VERSION(13, 0)
+  KCommandLine::HideOptions(llvm::cl::getGeneralCategory());
+#else
   KCommandLine::HideOptions(llvm::cl::GeneralCategory);
+#endif
 
   llvm::InitializeNativeTarget();
 
-- 
2.33.1

++++++ 0004-llvm13-CreateLoad-API-with-implicit-types-has-been-d.patch ++++++
From: Lukas Zaoral <lzao...@redhat.com>
Date: Tue, 24 Aug 2021 13:59:31 +0200
Subject: llvm13: CreateLoad API with implicit types has been deprecated
Patch-mainline: no
References: llvm 13

See: 
https://github.com/llvm/llvm-project/commit/6312c53870897435b38881795460ad9f34bf9819
Signed-off-by: Jiri Slaby <jirisl...@gmail.com>
---
 lib/Core/ExternalDispatcher.cpp |  6 ++++--
 lib/Module/IntrinsicCleaner.cpp | 13 +++++++++----
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp
index baa5327aad3d..b1bfff47c9e6 100644
--- a/lib/Core/ExternalDispatcher.cpp
+++ b/lib/Core/ExternalDispatcher.cpp
@@ -287,7 +287,8 @@ Function *ExternalDispatcherImpl::createDispatcher(Function 
*target,
       ConstantInt::get(Type::getInt64Ty(ctx), (uintptr_t)(void *)&gTheArgsP),
       PointerType::getUnqual(PointerType::getUnqual(Type::getInt64Ty(ctx))),
       "argsp");
-  auto argI64s = Builder.CreateLoad(argI64sp, "args");
+  auto argI64s = Builder.CreateLoad(
+      argI64sp->getType()->getPointerElementType(), argI64sp, "args");
 
   // Get the target function type.
   FunctionType *FTy = cast<FunctionType>(
@@ -306,7 +307,8 @@ Function *ExternalDispatcherImpl::createDispatcher(Function 
*target,
                           ConstantInt::get(Type::getInt32Ty(ctx), idx));
 
     auto argp = Builder.CreateBitCast(argI64p, PointerType::getUnqual(argTy));
-    args[i] = Builder.CreateLoad(argp);
+    args[i] =
+        Builder.CreateLoad(argp->getType()->getPointerElementType(), argp);
 
     unsigned argSize = argTy->getPrimitiveSizeInBits();
     idx += ((!!argSize ? argSize : 64) + 63) / 64;
diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp
index b3b356d2959d..5e720e45684a 100644
--- a/lib/Module/IntrinsicCleaner.cpp
+++ b/lib/Module/IntrinsicCleaner.cpp
@@ -96,24 +96,29 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, 
Module &M) {
               Builder.CreatePointerCast(dst, i8pp, "vacopy.cast.dst");
           auto castedSrc =
               Builder.CreatePointerCast(src, i8pp, "vacopy.cast.src");
-          auto load = Builder.CreateLoad(castedSrc, "vacopy.read");
+          auto load =
+              Builder.CreateLoad(castedSrc->getType()->getPointerElementType(),
+                                 castedSrc, "vacopy.read");
           Builder.CreateStore(load, castedDst, false /* isVolatile */);
         } else {
           assert(WordSize == 8 && "Invalid word size!");
           Type *i64p = PointerType::getUnqual(Type::getInt64Ty(ctx));
           auto pDst = Builder.CreatePointerCast(dst, i64p, "vacopy.cast.dst");
           auto pSrc = Builder.CreatePointerCast(src, i64p, "vacopy.cast.src");
-          auto val = Builder.CreateLoad(pSrc, std::string());
+
+          auto pType = pSrc->getType()->getPointerElementType();
+
+          auto val = Builder.CreateLoad(pType, pSrc);
           Builder.CreateStore(val, pDst, ii);
 
           auto off = ConstantInt::get(Type::getInt64Ty(ctx), 1);
           pDst = Builder.CreateGEP(nullptr, pDst, off, std::string());
           pSrc = Builder.CreateGEP(nullptr, pSrc, off, std::string());
-          val = Builder.CreateLoad(pSrc, std::string());
+          val = Builder.CreateLoad(pType, pSrc);
           Builder.CreateStore(val, pDst);
           pDst = Builder.CreateGEP(nullptr, pDst, off, std::string());
           pSrc = Builder.CreateGEP(nullptr, pSrc, off, std::string());
-          val = Builder.CreateLoad(pSrc, std::string());
+          val = Builder.CreateLoad(pType, pSrc);
           Builder.CreateStore(val, pDst);
         }
         ii->eraseFromParent();
-- 
2.33.1

++++++ 0005-llvm13-CreateGEP-no-longer-accepts-nullptr.patch ++++++
From: Lukas Zaoral <lzao...@redhat.com>
Date: Tue, 24 Aug 2021 13:59:32 +0200
Subject: llvm13: CreateGEP no longer accepts nullptr
Patch-mainline: no
References: llvm 13

See: https://reviews.llvm.org/D105653
Signed-off-by: Jiri Slaby <jirisl...@gmail.com>
---
 lib/Core/ExternalDispatcher.cpp |  2 +-
 lib/Module/IntrinsicCleaner.cpp | 17 +++++++++--------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp
index b1bfff47c9e6..e43a8a8368ef 100644
--- a/lib/Core/ExternalDispatcher.cpp
+++ b/lib/Core/ExternalDispatcher.cpp
@@ -303,7 +303,7 @@ Function *ExternalDispatcherImpl::createDispatcher(Function 
*target,
     auto argTy =
         (i < FTy->getNumParams() ? FTy->getParamType(i) : (*ai)->getType());
     auto argI64p =
-        Builder.CreateGEP(nullptr, argI64s,
+        Builder.CreateGEP(argI64s->getType()->getPointerElementType(), argI64s,
                           ConstantInt::get(Type::getInt32Ty(ctx), idx));
 
     auto argp = Builder.CreateBitCast(argI64p, PointerType::getUnqual(argTy));
diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp
index 5e720e45684a..f4b867e55316 100644
--- a/lib/Module/IntrinsicCleaner.cpp
+++ b/lib/Module/IntrinsicCleaner.cpp
@@ -106,19 +106,20 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, 
Module &M) {
           auto pDst = Builder.CreatePointerCast(dst, i64p, "vacopy.cast.dst");
           auto pSrc = Builder.CreatePointerCast(src, i64p, "vacopy.cast.src");
 
-          auto pType = pSrc->getType()->getPointerElementType();
+          auto pSrcType = pSrc->getType()->getPointerElementType();
+          auto pDstType = pDst->getType()->getPointerElementType();
 
-          auto val = Builder.CreateLoad(pType, pSrc);
+          auto val = Builder.CreateLoad(pSrcType, pSrc);
           Builder.CreateStore(val, pDst, ii);
 
           auto off = ConstantInt::get(Type::getInt64Ty(ctx), 1);
-          pDst = Builder.CreateGEP(nullptr, pDst, off, std::string());
-          pSrc = Builder.CreateGEP(nullptr, pSrc, off, std::string());
-          val = Builder.CreateLoad(pType, pSrc);
+          pDst = Builder.CreateGEP(pDstType, pDst, off);
+          pSrc = Builder.CreateGEP(pSrcType, pSrc, off);
+          val = Builder.CreateLoad(pSrcType, pSrc);
           Builder.CreateStore(val, pDst);
-          pDst = Builder.CreateGEP(nullptr, pDst, off, std::string());
-          pSrc = Builder.CreateGEP(nullptr, pSrc, off, std::string());
-          val = Builder.CreateLoad(pType, pSrc);
+          pDst = Builder.CreateGEP(pDstType, pDst, off);
+          pSrc = Builder.CreateGEP(pSrcType, pSrc, off);
+          val = Builder.CreateLoad(pSrcType, pSrc);
           Builder.CreateStore(val, pDst);
         }
         ii->eraseFromParent();
-- 
2.33.1

++++++ 0006-llvm13-llvm-APInt-toString-has-been-moved-to-StringE.patch ++++++
From: Lukas Zaoral <lzao...@redhat.com>
Date: Tue, 24 Aug 2021 13:59:33 +0200
Subject: llvm13: llvm::APInt::toString has been moved to StringExtras.h
Patch-mainline: no
References: llvm 13

See: https://reviews.llvm.org/D103888
Signed-off-by: Jiri Slaby <jirisl...@gmail.com>
---
 lib/Expr/Expr.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp
index db05e8423d67..2b9eab0dbc37 100644
--- a/lib/Expr/Expr.cpp
+++ b/lib/Expr/Expr.cpp
@@ -17,6 +17,9 @@
 #include "klee/Support/IntEvaluation.h"
 
 #include "llvm/ADT/Hashing.h"
+#if LLVM_VERSION_CODE >= LLVM_VERSION(13, 0)
+#include "llvm/ADT/StringExtras.h"
+#endif
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/raw_ostream.h"
 
@@ -366,7 +369,11 @@ void ConstantExpr::toMemory(void *address) {
 }
 
 void ConstantExpr::toString(std::string &Res, unsigned radix) const {
+#if LLVM_VERSION_CODE >= LLVM_VERSION(13, 0)
+  Res = llvm::toString(value, radix, false);
+#else
   Res = value.toString(radix, false);
+#endif
 }
 
 ref<ConstantExpr> ConstantExpr::Concat(const ref<ConstantExpr> &RHS) {
-- 
2.33.1

++++++ 0007-llvm13-Add-LLVM-13-to-lit.cfg.patch ++++++
From: Lukas Zaoral <lzao...@redhat.com>
Date: Wed, 13 Oct 2021 13:02:46 +0200
Subject: llvm13: Add LLVM 13 to lit.cfg
Patch-mainline: no
References: llvm 13

Signed-off-by: Jiri Slaby <jirisl...@gmail.com>
---
 test/lit.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/lit.cfg b/test/lit.cfg
index bf20c15e60f2..60bcb781bbd5 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -158,7 +158,7 @@ config.substitutions.append(
 # 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 = { "3.8", "3.9", "4.0", "5.0", "6.0", "7.0", "7.1", "8.0",
-                        "9.0", "10.0", "11.0", "11.1", "12.0" }
+                        "9.0", "10.0", "11.0", "11.1", "12.0", "13.0" }
 current_llvm_version_tuple = (int(config.llvm_version_major), 
int(config.llvm_version_minor))
 current_llvm_version = "%s.%s" % current_llvm_version_tuple
 
-- 
2.33.1

++++++ 0008-llvm13-Add-LLVM-13-to-Travis-CI-and-GitHub-Actions.patch ++++++
From: Lukas Zaoral <lzao...@redhat.com>
Date: Sat, 16 Oct 2021 17:26:01 +0200
Subject: llvm13: Add LLVM 13 to Travis CI and GitHub Actions
Patch-mainline: no
References: llvm 13

Signed-off-by: Jiri Slaby <jirisl...@gmail.com>
---
 .github/workflows/build.yaml | 4 ++++
 .travis.yml                  | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 9aaa99c71e95..c542781532d4 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -36,6 +36,7 @@ jobs:
     strategy:
       matrix:
         name: [
+                "LLVM 13",
                 "LLVM 12",
                 "LLVM 11",
                 "LLVM 10",
@@ -59,6 +60,9 @@ jobs:
                 "No TCMalloc, optimised runtime",
             ]
         include:
+          - name: "LLVM 13"
+            env:
+              LLVM_VERSION: 13
           - name: "LLVM 12"
             env:
               LLVM_VERSION: 12
diff --git a/.travis.yml b/.travis.yml
index 8c7598aad7cb..111ba1a0a3ba 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -53,6 +53,9 @@ env:
 jobs:
     include:
     # Check supported LLVM versions
+    - name: "LLVM 13"
+      env: LLVM_VERSION=13.0
+
     - name: "LLVM 12"
       env: LLVM_VERSION=12.0
 
-- 
2.33.1

++++++ FileCheck.cpp ++++++
--- /var/tmp/diff_new_pack.tV4Ph9/_old  2021-10-26 20:14:43.722042608 +0200
+++ /var/tmp/diff_new_pack.tV4Ph9/_new  2021-10-26 20:14:43.722042608 +0200
@@ -22,6 +22,7 @@
 #include "llvm/Support/WithColor.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cmath>
+#include <map>
 using namespace llvm;
 
 static cl::extrahelp FileCheckOptsEnv(
@@ -78,7 +79,7 @@
              "checks that some error message does not occur, for example."));
 
 static cl::opt<bool> AllowUnusedPrefixes(
-    "allow-unused-prefixes", cl::init(true),
+    "allow-unused-prefixes", cl::init(false), cl::ZeroOrMore,
     cl::desc("Allow prefixes to be specified but not appear in the test."));
 
 static cl::opt<bool> MatchFullLines(
@@ -212,11 +213,20 @@
   case FileCheckDiag::MatchFoundButDiscarded:
     return MarkerStyle('!', raw_ostream::CYAN,
                        "discard: overlaps earlier match");
+  case FileCheckDiag::MatchFoundErrorNote:
+    // Note should always be overridden within the FileCheckDiag.
+    return MarkerStyle('!', raw_ostream::RED,
+                       "error: unknown error after match",
+                       /*FiltersAsError=*/true);
   case FileCheckDiag::MatchNoneAndExcluded:
     return MarkerStyle('X', raw_ostream::GREEN);
   case FileCheckDiag::MatchNoneButExpected:
     return MarkerStyle('X', raw_ostream::RED, "error: no match found",
                        /*FiltersAsError=*/true);
+  case FileCheckDiag::MatchNoneForInvalidPattern:
+    return MarkerStyle('X', raw_ostream::RED,
+                       "error: match failed for invalid pattern",
+                       /*FiltersAsError=*/true);
   case FileCheckDiag::MatchFuzzy:
     return MarkerStyle('?', raw_ostream::MAGENTA, "possible intended match",
                        /*FiltersAsError=*/true);
@@ -248,7 +258,10 @@
   // Labels for input lines.
   OS << "  - ";
   WithColor(OS, raw_ostream::SAVEDCOLOR, true) << "L:";
-  OS << "     labels line number L of the input file\n";
+  OS << "     labels line number L of the input file\n"
+     << "           An extra space is added after each input line to represent"
+     << " the\n"
+     << "           newline character\n";
 
   // Labels for annotation lines.
   OS << "  - ";
@@ -366,16 +379,25 @@
                       const std::vector<FileCheckDiag> &Diags,
                       std::vector<InputAnnotation> &Annotations,
                       unsigned &LabelWidth) {
-  // How many diagnostics have we seen so far?
-  unsigned DiagCount = 0;
-  // How many diagnostics has the current check seen so far?
-  unsigned CheckDiagCount = 0;
+  struct CompareSMLoc {
+    bool operator()(const SMLoc &LHS, const SMLoc &RHS) const {
+      return LHS.getPointer() < RHS.getPointer();
+    }
+  };
+  // How many diagnostics does each pattern have?
+  std::map<SMLoc, unsigned, CompareSMLoc> DiagCountPerPattern;
+  for (auto Diag : Diags)
+    ++DiagCountPerPattern[Diag.CheckLoc];
+  // How many diagnostics have we seen so far per pattern?
+  std::map<SMLoc, unsigned, CompareSMLoc> DiagIndexPerPattern;
+  // How many total diagnostics have we seen so far?
+  unsigned DiagIndex = 0;
   // What's the widest label?
   LabelWidth = 0;
   for (auto DiagItr = Diags.begin(), DiagEnd = Diags.end(); DiagItr != DiagEnd;
        ++DiagItr) {
     InputAnnotation A;
-    A.DiagIndex = DiagCount++;
+    A.DiagIndex = DiagIndex++;
 
     // Build label, which uniquely identifies this check result.
     unsigned CheckBufferID = SM.FindBufferContainingLoc(DiagItr->CheckLoc);
@@ -391,17 +413,8 @@
     else
       llvm_unreachable("expected diagnostic's check location to be either in "
                        "the check file or for an implicit pattern");
-    unsigned CheckDiagIndex = UINT_MAX;
-    auto DiagNext = std::next(DiagItr);
-    if (DiagNext != DiagEnd && DiagItr->CheckTy == DiagNext->CheckTy &&
-        DiagItr->CheckLoc == DiagNext->CheckLoc)
-      CheckDiagIndex = CheckDiagCount++;
-    else if (CheckDiagCount) {
-      CheckDiagIndex = CheckDiagCount;
-      CheckDiagCount = 0;
-    }
-    if (CheckDiagIndex != UINT_MAX)
-      Label << "'" << CheckDiagIndex;
+    if (DiagCountPerPattern[DiagItr->CheckLoc] > 1)
+      Label << "'" << DiagIndexPerPattern[DiagItr->CheckLoc]++;
     Label.flush();
     LabelWidth = std::max((std::string::size_type)LabelWidth, A.Label.size());
 
@@ -418,6 +431,11 @@
           DiagItr->InputStartCol == DiagItr->InputEndCol)
         A.Marker.Lead = ' ';
     }
+    if (DiagItr->MatchTy == FileCheckDiag::MatchFoundErrorNote) {
+      assert(!DiagItr->Note.empty() &&
+             "expected custom note for MatchFoundErrorNote");
+      A.Marker.Note = "error: " + A.Marker.Note;
+    }
     A.FoundAndExpectedMatch =
         DiagItr->MatchTy == FileCheckDiag::MatchFoundAndExpected;
 
@@ -662,15 +680,16 @@
           COS.resetColor();
         else if (WasInMatch && !InMatch)
           COS.changeColor(raw_ostream::CYAN, true, true);
-        if (*InputFilePtr == '\n')
+        if (*InputFilePtr == '\n') {
           Newline = true;
-        else
+          COS << ' ';
+        } else
           COS << *InputFilePtr;
         ++InputFilePtr;
       }
     }
     *LineOS << '\n';
-    unsigned InputLineWidth = InputFilePtr - InputFileLine - Newline;
+    unsigned InputLineWidth = InputFilePtr - InputFileLine;
 
     // Print any annotations.
     while (AnnotationItr != AnnotationEnd &&
@@ -745,14 +764,11 @@
   }
 
   FileCheckRequest Req;
-  for (StringRef Prefix : CheckPrefixes)
-    Req.CheckPrefixes.push_back(Prefix);
+  append_range(Req.CheckPrefixes, CheckPrefixes);
 
-  for (StringRef Prefix : CommentPrefixes)
-    Req.CommentPrefixes.push_back(Prefix);
+  append_range(Req.CommentPrefixes, CommentPrefixes);
 
-  for (StringRef CheckNot : ImplicitCheckNot)
-    Req.ImplicitCheckNot.push_back(CheckNot);
+  append_range(Req.ImplicitCheckNot, ImplicitCheckNot);
 
   bool GlobalDefineError = false;
   for (StringRef G : GlobalDefines) {
@@ -806,7 +822,7 @@
 
   // Read the expected strings from the check file.
   ErrorOr<std::unique_ptr<MemoryBuffer>> CheckFileOrErr =
-      MemoryBuffer::getFileOrSTDIN(CheckFilename);
+      MemoryBuffer::getFileOrSTDIN(CheckFilename, /*IsText=*/true);
   if (std::error_code EC = CheckFileOrErr.getError()) {
     errs() << "Could not open check file '" << CheckFilename
            << "': " << EC.message() << '\n';
@@ -828,7 +844,7 @@
 
   // Open the file to check and add it to SourceMgr.
   ErrorOr<std::unique_ptr<MemoryBuffer>> InputFileOrErr =
-      MemoryBuffer::getFileOrSTDIN(InputFilename);
+      MemoryBuffer::getFileOrSTDIN(InputFilename, /*IsText=*/true);
   if (InputFilename == "-")
     InputFilename = "<stdin>"; // Overwrite for improved diagnostic messages
   if (std::error_code EC = InputFileOrErr.getError()) {

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.tV4Ph9/_old  2021-10-26 20:14:43.754042626 +0200
+++ /var/tmp/diff_new_pack.tV4Ph9/_new  2021-10-26 20:14:43.758042627 +0200
@@ -1,4 +1,4 @@
 <servicedata>
 <service name="tar_scm">
             <param name="url">git://github.com/klee/klee.git</param>
-          <param 
name="changesrevision">57d81af893ed60abb6b1772532ce73ac5e489d4b</param></service></servicedata>
\ No newline at end of file
+          <param 
name="changesrevision">5ee3a54001fe4291a0a5c3ce3beb33f856836cbb</param></service></servicedata>
\ No newline at end of file

++++++ klee-2.2+20210915.obscpio -> klee-2.2+20211017.obscpio ++++++
/work/SRC/openSUSE:Factory/klee/klee-2.2+20210915.obscpio 
/work/SRC/openSUSE:Factory/.klee.new.1890/klee-2.2+20211017.obscpio differ: 
char 49, line 1

++++++ klee.obsinfo ++++++
--- /var/tmp/diff_new_pack.tV4Ph9/_old  2021-10-26 20:14:43.802042651 +0200
+++ /var/tmp/diff_new_pack.tV4Ph9/_new  2021-10-26 20:14:43.806042653 +0200
@@ -1,5 +1,5 @@
 name: klee
-version: 2.2+20210915
-mtime: 1631722460
-commit: 57d81af893ed60abb6b1772532ce73ac5e489d4b
+version: 2.2+20211017
+mtime: 1634506376
+commit: 5ee3a54001fe4291a0a5c3ce3beb33f856836cbb
 

Reply via email to