-
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.
- Loading branch information
1 parent
66f9fe1
commit e03304b
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 CbmcAT5600 < Formula | ||
desc "C Bounded Model Checker" | ||
homepage "https://www.cprover.org/cbmc/" | ||
url "https://github.com/diffblue/cbmc.git", | ||
tag: "cbmc-5.60.0", | ||
revision: "026931f0c5892bb5037299fb1afda38632f2e050" | ||
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 |