Skip to content

Commit

Permalink
Add formula for CBMC 6.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tautschnig authored and github-actions[bot] committed Sep 21, 2024
1 parent 4cc7933 commit b49c87f
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions Formula/cbmc@6.3.1.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
class CbmcAT631 < Formula
desc "C Bounded Model Checker"
homepage "https://www.cprover.org/cbmc/"
url "https://github.com/diffblue/cbmc.git",
tag: "cbmc-6.3.1",
revision: "cbmc-d2b4455a109383562735cfb8b52ed8a6d2b6e197"
license "BSD-4-Clause"

bottle do
root_url "https://github.com/diffblue/homebrew-cbmc/releases/download/bag-of-goodies"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "595c9fd280844670008b35d7b9866175de39a40020849b8eb4fa3875a6b792d3"
sha256 cellar: :any_skip_relocation, arm64_ventura: "44f0bc3172d42fe36909fee2dadcef87c2f7dfa8ad359b6c9773ef6652204b3e"
sha256 cellar: :any_skip_relocation, sonoma: "758d9bb3e20a3c6e300234beb956c14760cb9c0a42ad609d1017bccc598430ff"
sha256 cellar: :any_skip_relocation, ventura: "83d43e155d6f9bff69e684456f45a8a1b54739a4f02fb053c9b83f6a82fd1acb"
sha256 cellar: :any_skip_relocation, x86_64_linux: "341911d11fb56cdc9e88c00157b1751fb13a026a154a2acff1c09ec0a4542d11"
end

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

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

fails_with gcc: "5"

def install
system "cmake", "-S", ".", "-B", "build", "-Dsat_impl=minisat2;cadical", *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 b49c87f

Please sign in to comment.