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 22, 2024
1 parent 4cc7933 commit d8ada8e
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions Formula/[email protected]
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: "8100b21e90f4be1871cce28329cd8d8513898f884528bd3675da13f90ae91ff9"
sha256 cellar: :any_skip_relocation, arm64_ventura: "83b414dcfc7b13ab25c5f67b731dc3410309c12e2334bc8de1afc7714dcf8342"
sha256 cellar: :any_skip_relocation, sonoma: "285d808d309483cd1751a8ecd64ec86be3b848b9293de92ec0fe279c95c484d7"
sha256 cellar: :any_skip_relocation, ventura: "7e61bd25579436bcd4710c6f42818e20edbe4a5e8159d839ed52e50a5e04ada2"
sha256 cellar: :any_skip_relocation, x86_64_linux: "764ce7c1a62fe581f8e94840eb59f76f70fc436d385485dcb7fd748d370f6515"
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 d8ada8e

Please sign in to comment.