diff --git a/Formula/cbmc@6.10.0.rb b/Formula/cbmc@6.10.0.rb new file mode 100644 index 0000000..d171658 --- /dev/null +++ b/Formula/cbmc@6.10.0.rb @@ -0,0 +1,45 @@ +class CbmcAT6100 < Formula + desc "C Bounded Model Checker" + homepage "https://www.cprover.org/cbmc/" + url "https://github.com/diffblue/cbmc.git", + tag: "cbmc-6.10.0", + revision: "cbmc-7483d0de40b2f39850f4f5ba5dd9c6e38f959e31" + license "BSD-4-Clause" + + bottle do + root_url "https://github.com/diffblue/homebrew-cbmc/releases/download/bag-of-goodies" + sha256 cellar: :any_skip_relocation, x86_64_linux: "ad6f6b96b22eb1be4d1109886f58c9ed2a5f1649d839f12ba0717ef552599066" + 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 + 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