File tree 10 files changed +54
-7
lines changed
tests/regression/29-svcomp
10 files changed +54
-7
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ dev-repo: "git+https://github.com/goblint/analyzer.git"
97
97
# also remember to generate/adjust goblint.opam.locked!
98
98
available: os-family != "bsd" & os-distribution != "alpine" & (arch != "arm64" | os = "macos")
99
99
pin-depends: [
100
- [ "goblint-cil.2.0.4" "git+https://github.com/goblint/cil.git#04b8a45a7d20425c7b6c8abe1ad094abc063922b " ]
100
+ [ "goblint-cil.2.0.4" "git+https://github.com/goblint/cil.git#9f4fac450c02bc61a13717784515056b185794cd " ]
101
101
]
102
102
depexts: [
103
103
["libgraph-easy-perl"] {os-distribution = "ubuntu" & with-test}
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ post-messages: [
140
140
pin-depends: [
141
141
[
142
142
"goblint-cil.2.0.4"
143
- "git+https://github.com/goblint/cil.git#04b8a45a7d20425c7b6c8abe1ad094abc063922b "
143
+ "git+https://github.com/goblint/cil.git#9f4fac450c02bc61a13717784515056b185794cd "
144
144
]
145
145
]
146
146
depexts: ["libgraph-easy-perl"] {os-distribution = "ubuntu" & with-test}
Original file line number Diff line number Diff line change 2
2
# also remember to generate/adjust goblint.opam.locked!
3
3
available: os-family != "bsd" & os-distribution != "alpine" & (arch != "arm64" | os = "macos")
4
4
pin-depends: [
5
- [ "goblint-cil.2.0.4" "git+https://github.com/goblint/cil.git#04b8a45a7d20425c7b6c8abe1ad094abc063922b " ]
5
+ [ "goblint-cil.2.0.4" "git+https://github.com/goblint/cil.git#9f4fac450c02bc61a13717784515056b185794cd " ]
6
6
]
7
7
depexts: [
8
8
["libgraph-easy-perl"] {os-distribution = "ubuntu" & with-test}
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ struct
171
171
* Abstract evaluation functions
172
172
**************************************************************************)
173
173
174
- let iDtoIdx = ID. cast_to (Cilfacade. ptrdiff_ikind () )
174
+ let iDtoIdx x = ID. cast_to (Cilfacade. ptrdiff_ikind () ) x
175
175
176
176
let unop_ID = function
177
177
| Neg -> ID. neg
Original file line number Diff line number Diff line change 834
834
let array_oob_check ( type a ) (module Idx: IntDomain.Z with type t = a ) (x , l ) (e , v ) =
835
835
if GobConfig. get_bool " ana.arrayoob" then (* The purpose of the following 2 lines is to give the user extra info about the array oob *)
836
836
let idx_before_end = Idx. to_bool (Idx. lt v l) (* check whether index is before the end of the array *)
837
- and idx_after_start = Idx. to_bool (Idx. ge v (Idx. of_int Cil. ILong Z. zero)) in (* check whether the index is non-negative *)
837
+ and idx_after_start = Idx. to_bool (Idx. ge v (Idx. of_int ( Cilfacade. ptrdiff_ikind () ) Z. zero)) in (* check whether the index is non-negative *)
838
838
(* For an explanation of the warning types check the Pull Request #255 *)
839
839
match (idx_after_start, idx_before_end) with
840
840
| Some true , Some true -> (* Certainly in bounds on both sides.*)
Original file line number Diff line number Diff line change @@ -47,7 +47,20 @@ let init_options () =
47
47
Mergecil. merge_inlines := get_bool " cil.merge.inlines" ;
48
48
Cil. cstd := Cil. cstd_of_string (get_string " cil.cstd" );
49
49
Cil. gnu89inline := get_bool " cil.gnu89inline" ;
50
- Cabs2cil. addNestedScopeAttr := get_bool " cil.addNestedScopeAttr"
50
+ Cabs2cil. addNestedScopeAttr := get_bool " cil.addNestedScopeAttr" ;
51
+
52
+ if get_bool " ana.sv-comp.enabled" then (
53
+ let machine = match get_string " exp.architecture" with
54
+ | "32bit" -> Machdep. gcc32
55
+ | "64bit" -> Machdep. gcc64
56
+ | _ -> assert false
57
+ in
58
+ match machine with
59
+ | Some _ -> Cil. envMachine := machine
60
+ | None ->
61
+ GobRef. wrap AnalysisState. should_warn true (fun () -> Messages. msg_final Error ~category: Unsound " Machine definition not available for selected architecture" );
62
+ Logs. error " Machine definition not available for selected architecture, defaulting to host"
63
+ )
51
64
52
65
let init () =
53
66
initCIL () ;
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ open Maingoblint
5
5
(* * the main function *)
6
6
let main () =
7
7
try
8
- Cilfacade. init () ;
9
8
Maingoblint. parse_arguments () ;
9
+ Cilfacade. init () ;
10
10
11
11
(* Timing. *)
12
12
Maingoblint. reset_stats () ;
Original file line number Diff line number Diff line change
1
+ // CRAM
2
+ #include <limits.h>
3
+
4
+ int main () {
5
+ long k = INT_MAX ;
6
+ long n = k * k ;
7
+ return 0 ;
8
+ }
Original file line number Diff line number Diff line change
1
+ There should be overflow on ILP32:
2
+
3
+ $ goblint -- enable ana. sv-comp. enabled -- set ana. specification " CHECK( init(main()), LTL(G ! overflow) )" -- set exp . architecture 32 bit 36 -svcomp-arch. c
4
+ [Info] Setting " ana.int.interval" to true
5
+ [Info] SV-COMP specification: CHECK ( init(main()), LTL(G ! overflow) )
6
+ [Warning][Integer > Overflow][CWE-190] Signed integer overflow (36 -svcomp-arch. c: 6 : 8 -6: 17 )
7
+ [Info][Deadcode] Logical lines of code (LLoC) summary:
8
+ live: 4
9
+ dead: 0
10
+ total lines : 4
11
+ SV-COMP result: unknown
12
+
13
+ There shouldn't be an overflow on LP64:
14
+
15
+ $ goblint -- enable ana. sv-comp. enabled -- set ana. specification " CHECK( init(main()), LTL(G ! overflow) )" -- set exp . architecture 64 bit 36 -svcomp-arch. c
16
+ [Info] Setting " ana.int.interval" to true
17
+ [Info] SV-COMP specification: CHECK ( init(main()), LTL(G ! overflow) )
18
+ [Info][Deadcode] Logical lines of code (LLoC) summary:
19
+ live: 4
20
+ dead: 0
21
+ total lines : 4
22
+ SV-COMP result: true
Original file line number Diff line number Diff line change 14
14
15
15
(cram
16
16
(deps (glob_files *.c)))
17
+
18
+ (cram
19
+ (applies_to 36-svcomp-arch)
20
+ (enabled_if (<> %{system} macosx))) ; https://dune.readthedocs.io/en/stable/reference/boolean-language.html
You can’t perform that action at this time.
0 commit comments