|
| 1 | +class CbmcAT670 < 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.7.0", |
| 6 | + revision: "cbmc-5d1438a883201a8983b1449eb2485df0821c819d" |
| 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: "35eea2d62dae6e2e86d4dbf92ec5111edda05063ccda1ae0d9f4687c5cb9f0bf" |
| 12 | + sha256 cellar: :any_skip_relocation, arm64_ventura: "f640cb2bb99f19d886b8917b8c23a16a4ce1dcff0b9b381e010de7c701d42d0b" |
| 13 | + sha256 cellar: :any_skip_relocation, sonoma: "613b16605e01110616ea2d884c1f6a6dde735092e32b437146ca44c3c58d19bc" |
| 14 | + sha256 cellar: :any_skip_relocation, ventura: "b120f6cd2b28a57953da930c082ac21709f947b0692fa4032f8f556905944251" |
| 15 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "55dfcd2ddbebcee3cf6291a267cca66c6af5f8370a35d6fc62051a775df43066" |
| 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