1
1
#! /bin/bash
2
2
3
+ # whether verify the program or not
4
+ CHECK=false
5
+
3
6
# paths to the benchmark repos
4
7
AWS_C_COMMON_PATH=" /home/ubuntu/aws-c-common"
5
8
AWS_IOT_SDK_PATH=" /home/ubuntu/aws-iot-device-sdk-embedded-C-tuttle"
6
9
7
10
# executables
8
11
MAKE=" make"
9
12
GOTO_INSTRUMENT=" goto-instrument"
13
+ CBMC=" cbmc"
14
+ CBMC_FLAGS=" --unwind 10
15
+ --bounds-check
16
+ --pointer-check
17
+ --unwinding-assertions
18
+ --nondet-static
19
+ --div-by-zero-check
20
+ --float-overflow-check
21
+ --nan-check
22
+ --pointer-overflow-check
23
+ --undefined-shift-check
24
+ --signed-overflow-check
25
+ --unsigned-overflow-check
26
+ --trace"
10
27
11
28
AWS_C_COMMON_TESTS=(
12
29
" aws_array_eq"
@@ -32,6 +49,15 @@ for test in ${AWS_C_COMMON_TESTS[@]}; do
32
49
$GOTO_INSTRUMENT --use-abstraction $cwd /$test .json \
33
50
$AWS_C_COMMON_PATH /.cbmc-batch/jobs/$test /${test} _harness.goto \
34
51
$AWS_C_COMMON_PATH /.cbmc-batch/jobs/$test /${test} _harness_abst.goto
52
+ # print the goto-programs into txts
53
+ rm $AWS_C_COMMON_PATH /.cbmc-batch/jobs/$test /${test} _harness_abst.txt
54
+ $GOTO_INSTRUMENT --print-internal-representation \
55
+ $AWS_C_COMMON_PATH /.cbmc-batch/jobs/$test /${test} _harness_abst.goto \
56
+ >> $AWS_C_COMMON_PATH /.cbmc-batch/jobs/$test /${test} _harness_abst.txt
57
+ # check the program
58
+ if [ $CHECK = true ]; then
59
+ $CBMC $CBMC_FLAGS $AWS_C_COMMON_PATH /.cbmc-batch/jobs/$test /${test} _harness_abst.goto
60
+ fi
35
61
done
36
62
37
63
echo " ===== $AWS_IOT_SDK_TEST ====="
@@ -43,3 +69,12 @@ cd $cwd
43
69
$GOTO_INSTRUMENT --use-abstraction $cwd /$AWS_IOT_SDK_TEST .json \
44
70
$AWS_IOT_SDK_PATH /cbmc/proofs/JsonParser/proofs/String.goto \
45
71
$AWS_IOT_SDK_PATH /cbmc/proofs/JsonParser/proofs/String_abst.goto
72
+ # print the goto-programs into txts
73
+ rm $AWS_IOT_SDK_PATH /cbmc/proofs/JsonParser/proofs/String_abst.txt
74
+ $GOTO_INSTRUMENT --print-internal-representation \
75
+ $AWS_IOT_SDK_PATH /cbmc/proofs/JsonParser/proofs/String_abst.goto \
76
+ >> $AWS_IOT_SDK_PATH /cbmc/proofs/JsonParser/proofs/String_abst.txt
77
+ # check the program
78
+ if [ $CHECK = true ]; then
79
+ $CBMC $CBMC_FLAGS $AWS_IOT_SDK_PATH /cbmc/proofs/JsonParser/proofs/String_abst.goto
80
+ fi
0 commit comments