|
| 1 | +class CbmcAT650 < Formula |
| 2 | + desc "C Bounded Model Checker" |
| 3 | + homepage "https://www.cprover.org/cbmc/" |
| 4 | + url "https://github.com/diffblue/cbmc.git", |
| 5 | + tag: "cbmc-6.5.0", |
| 6 | + revision: "cbmc-32143ddf8ae93e6bd0f52189de509662348c2373" |
| 7 | + license "BSD-4-Clause" |
| 8 | + |
| 9 | + bottle do |
| 10 | + root_url "https://github.com/diffblue/homebrew-cbmc/releases/download/bag-of-goodies" |
| 11 | + sha256 cellar: :any_skip_relocation, arm64_sonoma: "f259250d22a5f48cadda43e5a2dd2706fde38f53b4217d97b0307e996119dd30" |
| 12 | + sha256 cellar: :any_skip_relocation, arm64_ventura: "a93e85531279bc7ad21e820e14ab9dba7721fb672468ff06271376e38db951a4" |
| 13 | + sha256 cellar: :any_skip_relocation, sonoma: "46db7a0ff3cd5a19deef410745a316fc490b308fc32d54c3c345ae6cea74af7f" |
| 14 | + sha256 cellar: :any_skip_relocation, ventura: "816805e204ae857ec575e0204ebd2781c6c3fef8526096d022bfa5a7ab13198d" |
| 15 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "7f375f1f46d0b9d3d83d7f89a5476e08c16c260eb0fe3d04711972efe0eec25d" |
| 16 | + end |
| 17 | + |
| 18 | + depends_on "cmake" => :build |
| 19 | + depends_on "maven" => :build |
| 20 | + depends_on "openjdk" => :build |
| 21 | + depends_on "rust" => :build |
| 22 | + |
| 23 | + uses_from_macos "bison" => :build |
| 24 | + uses_from_macos "flex" => :build |
| 25 | + |
| 26 | + fails_with gcc: "5" |
| 27 | + |
| 28 | + def install |
| 29 | + system "cmake", "-S", ".", "-B", "build", "-Dsat_impl=minisat2;cadical", *std_cmake_args |
| 30 | + system "cmake", "--build", "build" |
| 31 | + system "cmake", "--install", "build" |
| 32 | + |
| 33 | + # lib contains only `jar` files |
| 34 | + libexec.install lib |
| 35 | + end |
| 36 | + |
| 37 | + test do |
| 38 | + # Find a pointer out of bounds error |
| 39 | + (testpath/"main.c").write <<~EOS |
| 40 | + #include <stdlib.h> |
| 41 | + int main() { |
| 42 | + char *ptr = malloc(10); |
| 43 | + char c = ptr[10]; |
| 44 | + } |
| 45 | + EOS |
| 46 | + assert_match "VERIFICATION FAILED", |
| 47 | + shell_output("#{bin}/cbmc --pointer-check main.c", 10) |
| 48 | + end |
| 49 | +end |
0 commit comments