Skip to content

Commit e03304b

Browse files
committed
Add CBMC v5.60.0 formula to the tap
1 parent 66f9fe1 commit e03304b

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

Formula/[email protected]

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
class CbmcAT5600 < 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-5.60.0",
6+
revision: "026931f0c5892bb5037299fb1afda38632f2e050"
7+
license "BSD-4-Clause"
8+
9+
depends_on "cmake" => :build
10+
depends_on "maven" => :build
11+
depends_on "openjdk" => :build
12+
13+
uses_from_macos "bison" => :build
14+
uses_from_macos "flex" => :build
15+
16+
on_linux do
17+
depends_on "gcc"
18+
end
19+
20+
fails_with gcc: "5"
21+
22+
def install
23+
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
24+
system "cmake", "--build", "build"
25+
system "cmake", "--install", "build"
26+
27+
# lib contains only `jar` files
28+
libexec.install lib
29+
end
30+
31+
test do
32+
# Find a pointer out of bounds error
33+
(testpath/"main.c").write <<~EOS
34+
#include <stdlib.h>
35+
int main() {
36+
char *ptr = malloc(10);
37+
char c = ptr[10];
38+
}
39+
EOS
40+
assert_match "VERIFICATION FAILED",
41+
shell_output("#{bin}/cbmc --pointer-check main.c", 10)
42+
end
43+
end

0 commit comments

Comments
 (0)