Skip to content

Commit

Permalink
Add CBMC version 5.59.0 to the tap
Browse files Browse the repository at this point in the history
  • Loading branch information
NlightNFotis committed Jun 10, 2022
1 parent 71461f7 commit 66f9fe1
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions Formula/cbmc@5.59.0.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
class CbmcAT5590 < Formula
desc "C Bounded Model Checker"
homepage "https://www.cprover.org/cbmc/"
url "https://github.com/diffblue/cbmc.git",
tag: "cbmc-5.59.0",
revision: "ae93642e6a329882f7a7066b824cc0946c56b127"
license "BSD-4-Clause"

depends_on "cmake" => :build
depends_on "maven" => :build
depends_on "openjdk" => :build

uses_from_macos "bison" => :build
uses_from_macos "flex" => :build

on_linux do
depends_on "gcc"
end

fails_with gcc: "5"

def install
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"

# lib contains only `jar` files
libexec.install lib
end

test do
# Find a pointer out of bounds error
(testpath/"main.c").write <<~EOS
#include <stdlib.h>
int main() {
char *ptr = malloc(10);
char c = ptr[10];
}
EOS
assert_match "VERIFICATION FAILED",
shell_output("#{bin}/cbmc --pointer-check main.c", 10)
end
end

0 comments on commit 66f9fe1

Please sign in to comment.