-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract version 5.57.0 from homebrew
- Loading branch information
1 parent
d3fc02f
commit 6aed9aa
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
class CbmcAT5570 < Formula | ||
desc "C Bounded Model Checker" | ||
homepage "https://www.cprover.org/cbmc/" | ||
url "https://github.com/diffblue/cbmc.git", | ||
tag: "cbmc-5.57.0", | ||
revision: "58d64d853a236a3f9eca46c1b60ed0cf9324fbfd" | ||
license "BSD-4-Clause" | ||
|
||
depends_on "cmake" => :build | ||
depends_on "maven" => :build | ||
depends_on "openjdk" => :build | ||
|
||
uses_from_macos "bison" => :build | ||
uses_from_macos "flex" => :build | ||
|
||
on_linux do | ||
depends_on "gcc" | ||
end | ||
|
||
fails_with gcc: "5" | ||
|
||
def install | ||
system "cmake", "-S", ".", "-B", "build", *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 |