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 d445cad
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: "4f4addae34b446b9b07f45ef8112a94c6190df8f009bb6aa5b0fd355e5836ed4"
sha256 cellar: :any_skip_relocation, arm64_ventura: "a0fff9e3e953c10ea572f99db4263832007fcc39bdca5628960a4f82ff73f66f"
sha256 cellar: :any_skip_relocation, sonoma: "05ba6a77eb9d1e7911975badecaceabaa8f49f126644fbec053129173206ca29"
sha256 cellar: :any_skip_relocation, ventura: "571b4f466c49d384753f4733860cc54c85660e9bc79911650df460b672c33e16"
sha256 cellar: :any_skip_relocation, x86_64_linux: "dc2c05897ecda7bca546e4a2dddb6b9d69398c728cb72b659a9affe3791aa8e7"
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 d445cad

Please sign in to comment.