Skip to content

Commit 7ffbed5

Browse files
committed
test(clam): add configuration for clam
1 parent 3051a9e commit 7ffbed5

File tree

4 files changed

+58
-2
lines changed

4 files changed

+58
-2
lines changed

scripts/get_exper_res.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"--cex": "seahorn(cex).csv",
1818
"--cex --horn-bmc-solver=smt-y2": "seahorn(cex, smt-y2).csv",
1919
"klee": "klee.csv"}
20+
LLVM_VERSION=14
2021

2122

2223
def extra_to_filename(extra, suffix='.csv', prefix=''):
@@ -59,8 +60,8 @@ def make_new_cmake_conf():
5960
-DSMACK_ENABLE_NO_MEM_SPLIT={smack_enable_no_mem_split}'
6061
else:
6162
smack_args = ""
62-
return f'cmake -DSEA_LINK=llvm-link-10 -DCMAKE_C_COMPILER=clang-10\
63-
-DCMAKE_CXX_COMPILER=clang++-10 -DSEA_ENABLE_KLEE={use_klee} {smack_args}\
63+
return f'cmake -DSEA_LINK=llvm-link-{LLVM_VERSION} -DCMAKE_C_COMPILER=clang-{LLVM_VERSION}\
64+
-DCMAKE_CXX_COMPILER=clang++-{LLVM_VERSION} -DSEA_ENABLE_KLEE={use_klee} {smack_args}\
6465
-DSEA_WITH_BLEEDING_EDGE={use_bleeding_edge} -DSEA_ENABLE_CRAB={use_crab}\
6566
-DSEAHORN_ROOT={SEAHORN_ROOT} ../ -GNinja'
6667

seahorn/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ separate_arguments(VERIFY_FLAGS)
344344

345345
function(sea_add_unsat_test TARGET)
346346
sea_get_file_name(BC ${TARGET}.ir)
347+
add_test(NAME "${TARGET}_clam_test" COMMAND ${VERIFY_CMD} --clam ${BC})
347348
add_test(NAME "${TARGET}_unsat_test" COMMAND ${VERIFY_CMD} ${VERIFY_FLAGS} --expect=unsat ${BC})
348349
endfunction()
349350

@@ -395,6 +396,7 @@ configure_file(sea_crab_base.yaml sea.crab.yaml @ONLY)
395396
configure_file(sea_cex_base.yaml sea.cex.yaml @ONLY)
396397
configure_file(sea_vac.yaml sea.vac.yaml @ONLY)
397398
configure_file(sea_pcond.yaml sea.pcond.yaml @ONLY)
399+
configure_file(clam_base.yaml clam.base.yaml @ONLY)
398400

399401
# compilation recipes for aws-c-common library
400402
add_subdirectory(aws-c-common-stubs)
@@ -660,3 +662,4 @@ if(SEA_ENABLE_CRAB_JOBS)
660662
add_subdirectory(jobs_crab/byte_buf_advance_crab)
661663
add_subdirectory(jobs_crab/byte_buf_append_crab)
662664
endif()
665+
# add_subdirectory(jobs_unsafe/hash_table_mem_leak)

seahorn/clam_base.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
clam_options:
2+
# CLANG
3+
#
4+
'-g' : ''
5+
# Optimization level for seaopt
6+
'-O3': ''
7+
save-temps: ''
8+
temp-dir: /tmp/vc-crab
9+
#
10+
# PREPROCESSING
11+
#
12+
lower-unsigned-icmp : ''
13+
llvm-peel-loops: '1'
14+
devirt-functions: 'sea-dsa'
15+
crab-name-values: false
16+
#
17+
# ANALYSIS
18+
#
19+
crab-dom : 'int'
20+
crab-inter : ''
21+
crab-inter-recursive-functions : true
22+
crab-inter-exact-summary-reuse : false
23+
crab-inter-max-summaries : '9999999'
24+
crab-inter-entry-main : true
25+
crab-track : 'mem'
26+
crab-singleton-aliases : ''
27+
crab-heap-analysis : 'cs-sea-dsa-types'
28+
crab-narrowing-iterations: '1'
29+
crab-widening-delay: '2'
30+
crab-widening-jump-set: '0'
31+
crab-preserve-invariants: false
32+
crab-dom-param: "region.is_dereferenceable=true:object.reduce_everywhere=true"
33+
crab-check: 'bounds'
34+
#
35+
# OUTPUT
36+
#
37+
# crab-sanity-checks : ''
38+
crab-disable-warnings: ''
39+
# crab-print-invariants: false
40+
# crab-stats: ''
41+
# crab-verbose: 5
42+
# log: 'object-print:inter:object-forget:object-project:object-leq:object-meet:inter:object-join:object-copy:inter-group'
43+
# ocrab: 'clam.crabir'

verify.py.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def main(argv):
6161
help='Path condition mode')
6262
argp.add_argument('--crab', action='store_true', default=False,
6363
help='Using crab')
64+
argp.add_argument('--clam', action='store_true', default=False,
65+
help='Using clam as front end')
6466
argp.add_argument('input_file', nargs=1)
6567
argp.add_argument('--dry-run', dest='dry_run',
6668
action='store_true', default=False,
@@ -125,6 +127,13 @@ def main(argv):
125127
cmd.append('--dry-run')
126128

127129
cmd.append(args.command)
130+
# Clam config
131+
if args.clam:
132+
cmd = ['/home/ljgy/Works/seahorn/clam/build/run/bin/clam-yaml.py']
133+
clam_config = os.path.join(script_dir, 'seahorn',
134+
'clam.base.yaml')
135+
cmd.extend(['-y', clam_config])
136+
128137
cmd.extend(extra)
129138
cmd.append(input_file)
130139

0 commit comments

Comments
 (0)