about summary refs log tree commit diff homepage
path: root/tools
diff options
context:
space:
mode:
authorAlastair Reid <adreid@google.com>2020-06-16 16:57:46 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-06-29 22:22:48 +0100
commit67ea19efc36bbf8885f32e85d11f920342a7949c (patch)
tree17d329f3901bc349d92a4e8ab570b10d6f066ad8 /tools
parent51e28268a927e1e40899ff2df11faa553d3c2e79 (diff)
downloadklee-67ea19efc36bbf8885f32e85d11f920342a7949c.tar.gz
Implement fshr/fshl intrinsics
Changes:
- IntrinsicCleaner accepts fshr/fshl as accepted intrinsics
- Executor::executeCall converts fshr/fshl to urem/zext/concat/shift/extract
- Klee/main suppresses warnings about externals that are LLVM reserved
  (i.e., begin with "llvm.")
- New test exercises 32 and 7 bit versions including oversize shift values
  Test values are based on LLVM's test for fshl/fshr
- Changes that depend on existence of fshr/fshl are guarded by
  #if LLVM_VERSION_CODE >= LLVM_VERSION(7, 0)
  or
  ; REQUIRES: geq-llvm-7.0
Diffstat (limited to 'tools')
-rw-r--r--tools/klee/main.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index ada08550..87d7ccf9 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -948,12 +948,14 @@ void externalsAndGlobalsCheck(const llvm::Module *m) {
     const std::string &ext = it->first;
     if (!modelled.count(ext) && (WarnAllExternals ||
                                  !dontCare.count(ext))) {
-      if (unsafe.count(ext)) {
-        foundUnsafe.insert(*it);
-      } else {
-        klee_warning("undefined reference to %s: %s",
-                     it->second ? "variable" : "function",
-                     ext.c_str());
+      if (ext.compare(0, 5, "llvm.") != 0) { // not an LLVM reserved name
+        if (unsafe.count(ext)) {
+          foundUnsafe.insert(*it);
+        } else {
+          klee_warning("undefined reference to %s: %s",
+                       it->second ? "variable" : "function",
+                       ext.c_str());
+        }
       }
     }
   }