diff --git a/includes/goblint.h b/includes/goblint.h new file mode 100644 index 0000000000..016b4ab9a3 --- /dev/null +++ b/includes/goblint.h @@ -0,0 +1,3 @@ +void __goblint_check(int); +void __goblint_assume(int); +void __goblint_assert(int); diff --git a/scripts/update_suite.rb b/scripts/update_suite.rb index 704535998e..7f32cc9c27 100755 --- a/scripts/update_suite.rb +++ b/scripts/update_suite.rb @@ -295,7 +295,7 @@ def parse_tests (lines) tests[i] = "fail" elsif obj =~ /UNKNOWN/ then tests[i] = "unknown" - elsif obj =~ /assert.*\(/ then + elsif obj =~ /(assert|__goblint_check).*\(/ then if obj =~ /FAIL/ then tests[i] = "fail" elsif obj =~ /UNKNOWN/ then diff --git a/src/analyses/apron/apronAnalysis.apron.ml b/src/analyses/apron/apronAnalysis.apron.ml index 9603d600f5..7584dc0df8 100644 --- a/src/analyses/apron/apronAnalysis.apron.ml +++ b/src/analyses/apron/apronAnalysis.apron.ml @@ -3,6 +3,7 @@ open Prelude.Ana open Analyses open ApronDomain +open GobConfig module M = Messages @@ -400,15 +401,26 @@ struct invalidate_one ask ctx st lval ) st rs + let assert_fn ctx e refine = + if not refine then + ctx.local + else + (* copied from branch *) + let st = ctx.local in + let res = assign_from_globals_wrapper (Analyses.ask_of_ctx ctx) ctx.global st e (fun apr' e' -> + (* not an assign, but must remove g#in-s still *) + AD.assert_inv apr' e' false + ) + in + if AD.is_bot_env res then raise Deadcode; + {st with apr = res} + let special ctx r f args = let ask = Analyses.ask_of_ctx ctx in let st = ctx.local in let desc = LibraryFunctions.find f in match desc.special args, f.vname with - (* TODO: assert handling from https://github.com/goblint/analyzer/pull/278 *) - | Assert expression, _ -> st - | Unknown, "__goblint_check" -> st - | Unknown, "__goblint_commit" -> st + | Assert { exp; refine; _ }, _ -> assert_fn ctx exp refine | ThreadJoin { thread = id; ret_var = retvar }, _ -> ( (* Forget value that thread return is assigned to *) diff --git a/src/analyses/assert.ml b/src/analyses/assert.ml new file mode 100644 index 0000000000..0fc150131e --- /dev/null +++ b/src/analyses/assert.ml @@ -0,0 +1,91 @@ +open Prelude.Ana +open Analyses +open GobConfig + +module Spec : Analyses.MCPSpec = +struct + include Analyses.DefaultSpec + + let name () = "assert" + module D = Lattice.Unit + module G = Lattice.Unit + module C = Lattice.Unit + + (* transfer functions *) + let assign ctx (lval:lval) (rval:exp) : D.t = + ctx.local + + let branch ctx (exp:exp) (tv:bool) : D.t = + ctx.local + + let body ctx (f:fundec) : D.t = + ctx.local + + let return ctx (exp:exp option) (f:fundec) : D.t = + ctx.local + + let enter ctx (lval: lval option) (fd:fundec) (args:exp list) : (D.t * D.t) list = + [ctx.local, ctx.local] + + let combine ctx (lval:lval option) fexp (fd:fundec) (args:exp list) fc (au:D.t) : D.t = + au + + let assert_fn ctx e check refine = + + let check_assert e st = + match ctx.ask (Queries.EvalInt e) with + | v when Queries.ID.is_bool v -> + begin match Queries.ID.to_bool v with + | Some false -> `Lifted false + | Some true -> `Lifted true + | _ -> `Top + end + | v when Queries.ID.is_bot v -> `Bot + | _ -> `Top + in + let expr = sprint d_exp e in + let warn warn_fn ?annot msg = if check then + if get_bool "dbg.regression" then ( (* This only prints unexpected results (with the difference) as indicated by the comment behind the assert (same as used by the regression test script). *) + let loc = !M.current_loc in + let line = List.at (List.of_enum @@ File.lines_of loc.file) (loc.line-1) in + let open Str in + let expected = if string_match (regexp ".+//.*\\(FAIL\\|UNKNOWN\\).*") line 0 then Some (matched_group 1 line) else None in + if expected <> annot then ( + let result = if annot = None && (expected = Some ("NOWARN") || (expected = Some ("UNKNOWN") && not (String.exists line "UNKNOWN!"))) then "improved" else "failed" in + (* Expressions with logical connectives like a && b are calculated in temporary variables by CIL. Instead of the original expression, we then see something like tmp___0. So we replace expr in msg by the original source if this is the case. *) + let assert_expr = if string_match (regexp ".*assert(\\(.+\\));.*") line 0 then matched_group 1 line else expr in + let msg = if expr <> assert_expr then String.nreplace ~str:msg ~sub:expr ~by:assert_expr else msg in + warn_fn (msg ^ " Expected: " ^ (expected |? "SUCCESS") ^ " -> " ^ result) + ) + ) else + warn_fn msg + in + (* TODO: use format instead of %s for the following messages *) + match check_assert e ctx.local with + | `Lifted false -> + warn (M.error ~category:Assert "%s") ~annot:"FAIL" ("Assertion \"" ^ expr ^ "\" will fail."); + if refine then raise Analyses.Deadcode else ctx.local + | `Lifted true -> + warn (M.success ~category:Assert "%s") ("Assertion \"" ^ expr ^ "\" will succeed"); + ctx.local + | `Bot -> + M.error ~category:Assert "%s" ("Assertion \"" ^ expr ^ "\" produces a bottom. What does that mean? (currently uninitialized arrays' content is bottom)"); + ctx.local + | `Top -> + warn (M.warn ~category:Assert "%s") ~annot:"UNKNOWN" ("Assertion \"" ^ expr ^ "\" is unknown."); + ctx.local + + let special ctx (lval: lval option) (f:varinfo) (args:exp list) : D.t = + let desc = LibraryFunctions.find f in + match desc.special args, f.vname with + | Assert { exp; check; refine }, _ -> assert_fn ctx exp check refine + | _, _ -> ctx.local + + let startstate v = D.bot () + let threadenter ctx lval f args = [D.top ()] + let threadspawn ctx lval f args fctx = ctx.local + let exitstate v = D.top () +end + +let _ = + MCP.register_analysis (module Spec : MCPSpec) diff --git a/src/analyses/base.ml b/src/analyses/base.ml index 256bb8440c..c054881d2e 100644 --- a/src/analyses/base.ml +++ b/src/analyses/base.ml @@ -1030,6 +1030,7 @@ struct let r = match eval_rv_no_ask_evalint ask gs st e with | `Int i -> `Lifted i (* cast should be unnecessary, eval_rv should guarantee right ikind already *) | `Bot -> Queries.ID.top () (* out-of-scope variables cause bot, but query result should then be unknown *) + | `Top -> Queries.ID.top () (* some float computations cause top (57-float/01-base), but query result should then be unknown *) | v -> M.debug ~category:Analyzer "Base EvalInt %a query answering bot instead of %a" d_exp e VD.pretty v; Queries.ID.bot () in if M.tracing then M.traceu "evalint" "base query_evalint %a -> %a\n" d_exp e Queries.ID.pretty r; @@ -2425,56 +2426,14 @@ struct if addrs <> [] then M.debug ~category:Analyzer "Spawning functions from unknown function: %a" (d_list ", " d_varinfo) addrs; List.filter_map (create_thread None None) addrs - let assert_fn ctx e should_warn change = - - let check_assert e st = - match eval_rv (Analyses.ask_of_ctx ctx) ctx.global st e with - | `Int v when ID.is_bool v -> - begin match ID.to_bool v with - | Some false -> `Lifted false - | Some true -> `Lifted true - | _ -> `Top - end - | `Bot -> `Bot - | _ -> `Top - in - let expr = sprint d_exp e in - let warn warn_fn ?annot msg = if should_warn then - if get_bool "dbg.regression" then ( (* This only prints unexpected results (with the difference) as indicated by the comment behind the assert (same as used by the regression test script). *) - let loc = !M.current_loc in - let line = List.at (List.of_enum @@ File.lines_of loc.file) (loc.line-1) in - let open Str in - let expected = if string_match (regexp ".+//.*\\(FAIL\\|UNKNOWN\\).*") line 0 then Some (matched_group 1 line) else None in - if expected <> annot then ( - let result = if annot = None && (expected = Some ("NOWARN") || (expected = Some ("UNKNOWN") && not (String.exists line "UNKNOWN!"))) then "improved" else "failed" in - (* Expressions with logical connectives like a && b are calculated in temporary variables by CIL. Instead of the original expression, we then see something like tmp___0. So we replace expr in msg by the original source if this is the case. *) - let assert_expr = if string_match (regexp ".*assert(\\(.+\\));.*") line 0 then matched_group 1 line else expr in - let msg = if expr <> assert_expr then String.nreplace ~str:msg ~sub:expr ~by:assert_expr else msg in - warn_fn (msg ^ " Expected: " ^ (expected |? "SUCCESS") ^ " -> " ^ result) - ) - ) else - warn_fn msg - in - (* TODO: use format instead of %s for the following messages *) - match check_assert e ctx.local with - | `Lifted false -> - warn (M.error ~category:Assert "%s") ~annot:"FAIL" ("Assertion \"" ^ expr ^ "\" will fail."); - if change then raise Analyses.Deadcode else ctx.local - | `Lifted true -> - warn (M.success ~category:Assert "%s") ("Assertion \"" ^ expr ^ "\" will succeed"); - ctx.local - | `Bot -> - M.error ~category:Assert "%s" ("Assertion \"" ^ expr ^ "\" produces a bottom. What does that mean? (currently uninitialized arrays' content is bottom)"); - ctx.local - | `Top -> - warn (M.warn ~category:Assert "%s") ~annot:"UNKNOWN" ("Assertion \"" ^ expr ^ "\" is unknown."); - (* make the state meet the assertion in the rest of the code *) - if not change then ctx.local else begin - let newst = invariant ctx (Analyses.ask_of_ctx ctx) ctx.global ctx.local e true in - (* if check_assert e newst <> `Lifted true then - M.warn ~category:Assert ~msg:("Invariant \"" ^ expr ^ "\" does not stick.") (); *) - newst - end + let assert_fn ctx e refine = + (* make the state meet the assertion in the rest of the code *) + if not refine then ctx.local else begin + let newst = invariant ctx (Analyses.ask_of_ctx ctx) ctx.global ctx.local e true in + (* if check_assert e newst <> `Lifted true then + M.warn ~category:Assert ~msg:("Invariant \"" ^ expr ^ "\" does not stick.") (); *) + newst + end let special_unknown_invalidate ctx ask gs st f args = (if CilType.Varinfo.equal f dummyFunDec.svar then M.warn ~category:Imprecise "Unknown function ptr called"); @@ -2721,10 +2680,7 @@ struct end (* Handling the assertions *) | Unknown, "__assert_rtn" -> raise Deadcode (* gcc's built-in assert *) - (* TODO: assert handling from https://github.com/goblint/analyzer/pull/278 *) - | Unknown, "__goblint_check" -> assert_fn ctx (List.hd args) true false - | Unknown, "__goblint_commit" -> assert_fn ctx (List.hd args) false true - | Assert e, _ -> assert_fn ctx e (get_bool "dbg.debug") (not (get_bool "dbg.debug")) (* __goblint_assert previously had [true true] and Assert should too, but cannot until #278 *) + | Assert { exp; refine; _ }, _ -> assert_fn ctx exp refine | _, _ -> begin let st = special_unknown_invalidate ctx (Analyses.ask_of_ctx ctx) gs st f args diff --git a/src/analyses/libraryDesc.ml b/src/analyses/libraryDesc.ml index f89947a89f..3fa521e02a 100644 --- a/src/analyses/libraryDesc.ml +++ b/src/analyses/libraryDesc.ml @@ -34,7 +34,7 @@ type special = | Malloc of Cil.exp | Calloc of { count: Cil.exp; size: Cil.exp; } | Realloc of { ptr: Cil.exp; size: Cil.exp; } - | Assert of Cil.exp + | Assert of { exp: Cil.exp; check: bool; refine: bool; } | Lock of { lock: Cil.exp; try_: bool; write: bool; return_on_success: bool; } | Unlock of Cil.exp | ThreadCreate of { thread: Cil.exp; start_routine: Cil.exp; arg: Cil.exp; } @@ -102,7 +102,6 @@ let special_of_old classify_name = fun args -> | `Malloc e -> Malloc e | `Calloc (count, size) -> Calloc { count; size; } | `Realloc (ptr, size) -> Realloc { ptr; size; } - | `Assert e -> Assert e | `Lock (try_, write, return_on_success) -> Lock { lock = List.hd args; try_; write; return_on_success; } | `Unlock -> Unlock (List.hd args) | `ThreadCreate (thread, start_routine, arg) -> ThreadCreate { thread; start_routine; arg; } diff --git a/src/analyses/libraryFunctions.ml b/src/analyses/libraryFunctions.ml index ac75253d34..bb6db9608a 100644 --- a/src/analyses/libraryFunctions.ml +++ b/src/analyses/libraryFunctions.ml @@ -46,9 +46,9 @@ let linux_descs_list: (string * LibraryDesc.t) list = (* LibraryDsl. *) [ (** Goblint functions. *) let goblint_descs_list: (string * LibraryDesc.t) list = LibraryDsl.[ ("__goblint_unknown", unknown [drop' [w]]); - ("__goblint_check", unknown [drop' []]); - ("__goblint_commit", unknown [drop' []]); - ("__goblint_assert", special [__ "cond" []] @@ fun cond -> Assert cond); + ("__goblint_check", special [__ "exp" []] @@ fun exp -> Assert { exp; check = true; refine = false }); + ("__goblint_assume", special [__ "exp" []] @@ fun exp -> Assert { exp; check = false; refine = true }); + ("__goblint_assert", special [__ "exp" []] @@ fun exp -> Assert { exp; check = true; refine = get_bool "sem.assert.refine" }); ] (** zstd functions. @@ -125,7 +125,6 @@ type categories = [ | `Malloc of exp | `Calloc of exp * exp | `Realloc of exp * exp - | `Assert of exp | `Lock of bool * bool * bool (* try? * write? * return on success *) | `Unlock | `ThreadCreate of exp * exp * exp (* id * f * x *) diff --git a/src/analyses/termination.ml b/src/analyses/termination.ml index 763dd06e47..d2a9079c68 100644 --- a/src/analyses/termination.ml +++ b/src/analyses/termination.ml @@ -91,7 +91,7 @@ let makeVar fd loc name = with Not_found -> let typ = intType in (* TODO the type should be the same as the one of the original loop counter *) Goblintutil.create_var (makeLocalVar fd id ~init:(SingleInit zero) typ) -let f_commit = Lval (var (emptyFunction "__goblint_commit").svar) +let f_assume = Lval (var (emptyFunction "__goblint_assume").svar) let f_check = Lval (var (emptyFunction "__goblint_check").svar) class loopInstrVisitor (fd : fundec) = object(self) inherit nopCilVisitor @@ -128,8 +128,8 @@ class loopInstrVisitor (fd : fundec) = object(self) let typ = intType in let e1 = BinOp (Eq, Lval t, BinOp (MinusA, Lval x, Lval d1, typ), typ) in let e2 = BinOp (Eq, Lval t, BinOp (MinusA, Lval d2, Lval x, typ), typ) in - let inv1 = mkStmtOneInstr @@ Call (None, f_commit, [e1], loc, eloc) in - let inv2 = mkStmtOneInstr @@ Call (None, f_commit, [e2], loc, eloc) in + let inv1 = mkStmtOneInstr @@ Call (None, f_assume, [e1], loc, eloc) in + let inv2 = mkStmtOneInstr @@ Call (None, f_assume, [e2], loc, eloc) in (match b.bstmts with | cont :: cond :: ss -> (* changing succs/preds directly doesn't work -> need to replace whole stmts *) diff --git a/src/maingoblint.ml b/src/maingoblint.ml index 0d544e061d..cc945fc8c6 100644 --- a/src/maingoblint.ml +++ b/src/maingoblint.ml @@ -220,6 +220,7 @@ let preprocess_files () = get_string_list "pre.includes" |> List.map Fpath.v |> List.iter (one_include_f identity); include_dirs := custom_include_dirs @ !include_dirs; + include_files := find_custom_include (Fpath.v "goblint.h") :: !include_files; (* If we analyze a kernel module, some special includes are needed. *) if get_bool "kernel" then ( diff --git a/src/util/options.schema.json b/src/util/options.schema.json index 22fb82f6a8..6c47488fc4 100644 --- a/src/util/options.schema.json +++ b/src/util/options.schema.json @@ -326,7 +326,8 @@ "items": { "type": "string" }, "default": [ "expRelation", "base", "threadid", "threadflag", "threadreturn", - "escape", "mutexEvents", "mutex", "access", "mallocWrapper", "mhp" + "escape", "mutexEvents", "mutex", "access", "mallocWrapper", "mhp", + "assert" ] }, "path_sens": { @@ -1125,6 +1126,19 @@ } }, "additionalProperties": false + }, + "assert": { + "title": "sem.assert", + "type": "object", + "properties": { + "refine": { + "title": "sem.assert.refine", + "description": "Standard assert refines state", + "type": "boolean", + "default": true + } + }, + "additionalProperties": false } }, "additionalProperties": false diff --git a/src/util/wideningThresholds.ml b/src/util/wideningThresholds.ml index 6f9c95a638..016d51d57f 100644 --- a/src/util/wideningThresholds.ml +++ b/src/util/wideningThresholds.ml @@ -41,8 +41,8 @@ class extractInvariantsVisitor (exps) = object | Call (_, Lval (Var f, NoOffset), args, _, _) -> let desc = LibraryFunctions.find f in begin match desc.special args with - | Assert e -> - EH.replace exps e (); + | Assert { exp; _ } -> + EH.replace exps exp (); DoChildren | _ -> DoChildren diff --git a/tests/incremental/00-basic/00-local.c b/tests/incremental/00-basic/00-local.c index 6fcd9d5217..0c931c4fe5 100644 --- a/tests/incremental/00-basic/00-local.c +++ b/tests/incremental/00-basic/00-local.c @@ -2,6 +2,6 @@ int main() { int x = 1; - assert(x == 1); // success before, success after + __goblint_check(x == 1); // success before, success after return 0; } \ No newline at end of file diff --git a/tests/incremental/00-basic/00-local.patch b/tests/incremental/00-basic/00-local.patch index 599fe1b257..bcf29a03bc 100644 --- a/tests/incremental/00-basic/00-local.patch +++ b/tests/incremental/00-basic/00-local.patch @@ -5,9 +5,9 @@ int main() { - int x = 1; -- assert(x == 1); // success before, success after +- __goblint_check(x == 1); // success before, success after + int x = 2; -+ assert(x == 2); // success before, success after ++ __goblint_check(x == 2); // success before, success after return 0; } \ No newline at end of file diff --git a/tests/incremental/00-basic/02-changed_start_state1.c b/tests/incremental/00-basic/02-changed_start_state1.c index a239fba4a9..87c72c5c1f 100644 --- a/tests/incremental/00-basic/02-changed_start_state1.c +++ b/tests/incremental/00-basic/02-changed_start_state1.c @@ -7,7 +7,7 @@ int main() { // If the change of the start state of main would not be propagated by the call to side on all start variables, the // asserts in the incremental run would wrongly fail. Side however only joins with the previous value instead of // overwriting, therefore the current imprecision. - assert(g == 1); - assert(g != 2); + __goblint_check(g == 1); + __goblint_check(g != 2); return 0; } diff --git a/tests/incremental/00-basic/02-changed_start_state1.patch b/tests/incremental/00-basic/02-changed_start_state1.patch index 5f24da951d..9eed9cb14f 100644 --- a/tests/incremental/00-basic/02-changed_start_state1.patch +++ b/tests/incremental/00-basic/02-changed_start_state1.patch @@ -11,9 +11,9 @@ // If the change of the start state of main would not be propagated by the call to side on all start variables, the // asserts in the incremental run would wrongly fail. Side however only joins with the previous value instead of // overwriting, therefore the current imprecision. -- assert(g == 1); -- assert(g != 2); -+ assert(g != 1); // TODO (restarting) -+ assert(g == 2); // TODO +- __goblint_check(g == 1); +- __goblint_check(g != 2); ++ __goblint_check(g != 1); // TODO (restarting) ++ __goblint_check(g == 2); // TODO return 0; } diff --git a/tests/incremental/00-basic/03-changed_start_state2.c b/tests/incremental/00-basic/03-changed_start_state2.c index a239fba4a9..87c72c5c1f 100644 --- a/tests/incremental/00-basic/03-changed_start_state2.c +++ b/tests/incremental/00-basic/03-changed_start_state2.c @@ -7,7 +7,7 @@ int main() { // If the change of the start state of main would not be propagated by the call to side on all start variables, the // asserts in the incremental run would wrongly fail. Side however only joins with the previous value instead of // overwriting, therefore the current imprecision. - assert(g == 1); - assert(g != 2); + __goblint_check(g == 1); + __goblint_check(g != 2); return 0; } diff --git a/tests/incremental/00-basic/03-changed_start_state2.patch b/tests/incremental/00-basic/03-changed_start_state2.patch index 5aa51b9cb7..e2399fa8f6 100644 --- a/tests/incremental/00-basic/03-changed_start_state2.patch +++ b/tests/incremental/00-basic/03-changed_start_state2.patch @@ -11,9 +11,9 @@ // If the change of the start state of main would not be propagated by the call to side on all start variables, the // asserts in the incremental run would wrongly fail. Side however only joins with the previous value instead of // overwriting, therefore the current imprecision. -- assert(g == 1); -- assert(g != 2); -+ assert(g != 1); // TODO (restarting) -+ assert(g == 2); // TODO +- __goblint_check(g == 1); +- __goblint_check(g != 2); ++ __goblint_check(g != 1); // TODO (restarting) ++ __goblint_check(g == 2); // TODO return 0; } diff --git a/tests/incremental/00-basic/05-sideeffects.c b/tests/incremental/00-basic/05-sideeffects.c index 85c864d033..7a90fee8d6 100644 --- a/tests/incremental/00-basic/05-sideeffects.c +++ b/tests/incremental/00-basic/05-sideeffects.c @@ -9,7 +9,7 @@ void f() { int main() { f(); - assert(g == 2); // UNKNOWN! - assert(g == 1); // UNKNOWN! (when wrongly overriding the start state of start functions this did succeed in the incremental run) + __goblint_check(g == 2); // UNKNOWN! + __goblint_check(g == 1); // UNKNOWN! (when wrongly overriding the start state of start functions this did succeed in the incremental run) return 0; } diff --git a/tests/incremental/01-force-reanalyze/00-int.c b/tests/incremental/01-force-reanalyze/00-int.c index 38187f1c06..15c10713ed 100644 --- a/tests/incremental/01-force-reanalyze/00-int.c +++ b/tests/incremental/01-force-reanalyze/00-int.c @@ -4,14 +4,14 @@ int f(int in){ while(in < 17) { in++; } - assert(in == 17); //UNKNOWN + __goblint_check(in == 17); //UNKNOWN return in; } int main() { int a = 0; - assert(a); // FAIL! + __goblint_check(a); // FAIL! a = f(a); - assert(a == 17); //UNKNOWN + __goblint_check(a == 17); //UNKNOWN return 0; } diff --git a/tests/incremental/01-force-reanalyze/00-int.patch b/tests/incremental/01-force-reanalyze/00-int.patch index b6b632ab16..9e84a968dd 100644 --- a/tests/incremental/01-force-reanalyze/00-int.patch +++ b/tests/incremental/01-force-reanalyze/00-int.patch @@ -4,17 +4,17 @@ while(in < 17) { in++; } -- assert(in == 17); //UNKNOWN -+ assert(in == 17); +- __goblint_check(in == 17); //UNKNOWN ++ __goblint_check(in == 17); return in; } @@ -12,6 +12,6 @@ int main() { int a = 0; - assert(a); // FAIL! + __goblint_check(a); // FAIL! a = f(a); -- assert(a == 17); //UNKNOWN -+ assert(a == 17); +- __goblint_check(a == 17); //UNKNOWN ++ __goblint_check(a == 17); return 0; } --- tests/incremental/01-force-reanalyze/00-int.json diff --git a/tests/incremental/02-cfg-comparison/00-infinite-loop.c b/tests/incremental/02-cfg-comparison/00-infinite-loop.c index 4655a22c65..9592769438 100644 --- a/tests/incremental/02-cfg-comparison/00-infinite-loop.c +++ b/tests/incremental/02-cfg-comparison/00-infinite-loop.c @@ -4,7 +4,7 @@ void main() { int x; int y = 0; - assert(y==0); + __goblint_check(y==0); while (1) { if (x) { diff --git a/tests/incremental/03-precision-annotation/01-change_precision.c b/tests/incremental/03-precision-annotation/01-change_precision.c index 47170c52e3..f8193e8bfb 100644 --- a/tests/incremental/03-precision-annotation/01-change_precision.c +++ b/tests/incremental/03-precision-annotation/01-change_precision.c @@ -22,9 +22,9 @@ int main(){ int x = rand() % 10; int a = foo(x); - assert(a == 0); //UNKNOWN + __goblint_check(a == 0); //UNKNOWN int b = bar(x); - assert(b == 0); //UNKNOWN + __goblint_check(b == 0); //UNKNOWN return 0; } diff --git a/tests/incremental/03-precision-annotation/01-change_precision.patch b/tests/incremental/03-precision-annotation/01-change_precision.patch index 735e9637ae..541588b7e3 100644 --- a/tests/incremental/03-precision-annotation/01-change_precision.patch +++ b/tests/incremental/03-precision-annotation/01-change_precision.patch @@ -4,18 +4,18 @@ index 47170c52e..4e7a04f88 100644 +++ tests/incremental/03-precision-annotation/01-change_precision2.c @@ -3,6 +3,7 @@ #include - + int main() __attribute__ ((goblint_precision("def_exc","interval"))); +int foo(int in) __attribute__ ((goblint_precision("def_exc", "interval"))); - + int foo(int x){ if(x < 10){ @@ -22,7 +23,7 @@ int main(){ int x = rand() % 10; - + int a = foo(x); -- assert(a == 0); //UNKNOWN -+ assert(a == 0); - +- __goblint_check(a == 0); //UNKNOWN ++ __goblint_check(a == 0); + int b = bar(x); - assert(b == 0); //UNKNOWN + __goblint_check(b == 0); //UNKNOWN diff --git a/tests/incremental/04-var-rename/04-renamed_assert.c b/tests/incremental/04-var-rename/04-renamed_assert.c index 4a4a9e7f21..525bff4eb5 100644 --- a/tests/incremental/04-var-rename/04-renamed_assert.c +++ b/tests/incremental/04-var-rename/04-renamed_assert.c @@ -2,8 +2,8 @@ int main() { int myVar = 0; - - assert(myVar < 11); + + __goblint_check(myVar < 11); return 0; } \ No newline at end of file diff --git a/tests/incremental/04-var-rename/04-renamed_assert.patch b/tests/incremental/04-var-rename/04-renamed_assert.patch index 9644dcf6a1..d7dfe6ae8e 100644 --- a/tests/incremental/04-var-rename/04-renamed_assert.patch +++ b/tests/incremental/04-var-rename/04-renamed_assert.patch @@ -4,10 +4,10 @@ int main() { - int myVar = 0; + int myRenamedVar = 0; - -- assert(myVar < 11); -+ assert(myRenamedVar < 11); - + +- __goblint_check(myVar < 11); ++ __goblint_check(myRenamedVar < 11); + return 0; } \ Kein Zeilenumbruch am Dateiende. diff --git a/tests/incremental/04-var-rename/multiple_incremental_runs/08-2_incremental_runs_1.c b/tests/incremental/04-var-rename/multiple_incremental_runs/08-2_incremental_runs_1.c index e522ad239a..d03e03e768 100644 --- a/tests/incremental/04-var-rename/multiple_incremental_runs/08-2_incremental_runs_1.c +++ b/tests/incremental/04-var-rename/multiple_incremental_runs/08-2_incremental_runs_1.c @@ -2,9 +2,9 @@ int main() { int varFirstIteration = 0; - + varFirstIteration++; - - assert(varFirstIteration < 10); + + __goblint_check(varFirstIteration < 10); return 0; } diff --git a/tests/incremental/04-var-rename/multiple_incremental_runs/08-2_incremental_runs_1.patch b/tests/incremental/04-var-rename/multiple_incremental_runs/08-2_incremental_runs_1.patch index 191b335f3c..1715a7c3d6 100644 --- a/tests/incremental/04-var-rename/multiple_incremental_runs/08-2_incremental_runs_1.patch +++ b/tests/incremental/04-var-rename/multiple_incremental_runs/08-2_incremental_runs_1.patch @@ -4,11 +4,11 @@ int main() { - int varFirstIteration = 0; + int varSecondIteration = 0; - + - varFirstIteration++; + varSecondIteration++; - -- assert(varFirstIteration < 10); -+ assert(varSecondIteration < 10); + +- __goblint_check(varFirstIteration < 10); ++ __goblint_check(varSecondIteration < 10); return 0; } diff --git a/tests/incremental/04-var-rename/multiple_incremental_runs/08-2_incremental_runs_2.patch b/tests/incremental/04-var-rename/multiple_incremental_runs/08-2_incremental_runs_2.patch index 0952f3a4bf..a32e5a8c24 100644 --- a/tests/incremental/04-var-rename/multiple_incremental_runs/08-2_incremental_runs_2.patch +++ b/tests/incremental/04-var-rename/multiple_incremental_runs/08-2_incremental_runs_2.patch @@ -4,11 +4,11 @@ int main() { - int varSecondIteration = 0; + int varThirdIteration = 0; - + - varSecondIteration++; + varThirdIteration++; - -- assert(varSecondIteration < 10); -+ assert(varThirdIteration < 10); + +- __goblint_check(varSecondIteration < 10); ++ __goblint_check(varThirdIteration < 10); return 0; } diff --git a/tests/incremental/04-var-rename/multiple_incremental_runs/09-2_ir_with_changes_1.c b/tests/incremental/04-var-rename/multiple_incremental_runs/09-2_ir_with_changes_1.c index e50f6d9beb..f9bc7c58f2 100644 --- a/tests/incremental/04-var-rename/multiple_incremental_runs/09-2_ir_with_changes_1.c +++ b/tests/incremental/04-var-rename/multiple_incremental_runs/09-2_ir_with_changes_1.c @@ -3,13 +3,13 @@ void foo() { int fooOne = 1; fooOne++; - assert(fooOne == 2); + __goblint_check(fooOne == 2); } void bar() { int barOne = 10; if (barOne < 11) barOne = 20; - assert(barOne == 20); + __goblint_check(barOne == 20); } int main() { diff --git a/tests/incremental/04-var-rename/multiple_incremental_runs/09-2_ir_with_changes_1.patch b/tests/incremental/04-var-rename/multiple_incremental_runs/09-2_ir_with_changes_1.patch index c640034ea4..d53031af00 100644 --- a/tests/incremental/04-var-rename/multiple_incremental_runs/09-2_ir_with_changes_1.patch +++ b/tests/incremental/04-var-rename/multiple_incremental_runs/09-2_ir_with_changes_1.patch @@ -4,20 +4,20 @@ void foo() { - int fooOne = 1; - fooOne++; -- assert(fooOne == 2); +- __goblint_check(fooOne == 2); + int fooTwo = 1; + fooTwo++; -+ assert(fooTwo == 2); ++ __goblint_check(fooTwo == 2); } - + void bar() { - int barOne = 10; - if (barOne < 11) barOne = 20; -- assert(barOne == 20); +- __goblint_check(barOne == 20); + int barTwo = 10; + int x = 3; + if (x < 11) barTwo = 13; -+ assert(x > 1); ++ __goblint_check(x > 1); } - + int main() { diff --git a/tests/incremental/04-var-rename/multiple_incremental_runs/09-2_ir_with_changes_2.patch b/tests/incremental/04-var-rename/multiple_incremental_runs/09-2_ir_with_changes_2.patch index ad44fd2303..d0f8e07a50 100644 --- a/tests/incremental/04-var-rename/multiple_incremental_runs/09-2_ir_with_changes_2.patch +++ b/tests/incremental/04-var-rename/multiple_incremental_runs/09-2_ir_with_changes_2.patch @@ -4,10 +4,10 @@ void foo() { - int fooTwo = 1; - fooTwo++; -- assert(fooTwo == 2); +- __goblint_check(fooTwo == 2); + int fooThree = 1; + fooThree++; -+ assert(fooThree == 2); ++ __goblint_check(fooThree == 2); } - + void bar() { diff --git a/tests/regression/00-sanity/01-assert.c b/tests/regression/00-sanity/01-assert.c index 282cf648c5..42c2d0e828 100644 --- a/tests/regression/00-sanity/01-assert.c +++ b/tests/regression/00-sanity/01-assert.c @@ -1,14 +1,15 @@ -// just a few sanity checks on the asserts -#include +// just a few sanity checks on asserts +#include int main() { int success = 1; int silence = 1; int fail = 0; int unknown; + // intentionally using assert, specific order to work with assert refine assert(success); - assert(fail); // FAIL! assert(unknown == 4); // UNKNOWN! + assert(fail); // FAIL! return 0; assert(silence); // NOWARN! } diff --git a/tests/regression/00-sanity/04-empty_if.c b/tests/regression/00-sanity/04-empty_if.c index 98da0b7800..efe73291e5 100644 --- a/tests/regression/00-sanity/04-empty_if.c +++ b/tests/regression/00-sanity/04-empty_if.c @@ -5,6 +5,6 @@ int main() int i; if (i); ++ i; - assert(i); // UNKNOWN! + __goblint_check(i); // UNKNOWN! return 0; } diff --git a/tests/regression/00-sanity/12-errno.c b/tests/regression/00-sanity/12-errno.c index 1c043308eb..26a1adaf83 100644 --- a/tests/regression/00-sanity/12-errno.c +++ b/tests/regression/00-sanity/12-errno.c @@ -3,6 +3,6 @@ int main(){ errno = 1; - assert(errno); // UNKNOWN! + __goblint_check(errno); // UNKNOWN! return 0; } diff --git a/tests/regression/00-sanity/13-sans_context.c b/tests/regression/00-sanity/13-sans_context.c index d20e5e7e9c..0fe9ba619c 100644 --- a/tests/regression/00-sanity/13-sans_context.c +++ b/tests/regression/00-sanity/13-sans_context.c @@ -1,9 +1,9 @@ -// PARAM: --set ana.activated "['escape', 'base','threadid','threadflag','mallocWrapper']" --set ana.ctx_insens[+] base --set ana.base.privatization none +// PARAM: --set ana.activated "['escape', 'base','threadid','threadflag','mallocWrapper','assert']" --set ana.ctx_insens[+] base --set ana.base.privatization none #include void f(int v, int i){ - assert(v == 2); - assert(i*i == 9); // UNKNOWN + __goblint_check(v == 2); + __goblint_check(i*i == 9); // UNKNOWN } int main(){ diff --git a/tests/regression/00-sanity/14-startstate.c b/tests/regression/00-sanity/14-startstate.c index 68fe369b97..1fcee2200e 100644 --- a/tests/regression/00-sanity/14-startstate.c +++ b/tests/regression/00-sanity/14-startstate.c @@ -5,6 +5,6 @@ int __init start (unsigned count) { if (count) return -1; - assert(0); // FAIL + __goblint_check(0); // FAIL return 0; } diff --git a/tests/regression/00-sanity/16-unknown_branches.c b/tests/regression/00-sanity/16-unknown_branches.c index 5d2079fe4f..8ea33d6b81 100644 --- a/tests/regression/00-sanity/16-unknown_branches.c +++ b/tests/regression/00-sanity/16-unknown_branches.c @@ -9,42 +9,42 @@ int main() { p = anIntPlease(); q = anIntPlease(); - assert(unknown); // UNKNOWN - assert(unknown == 0); // UNKNOWN + __goblint_check(unknown); // UNKNOWN + __goblint_check(unknown == 0); // UNKNOWN - assert(x); // UNKNOWN - assert(y); // UNKNOWN - assert(x == y); // UNKNOWN + __goblint_check(x); // UNKNOWN + __goblint_check(y); // UNKNOWN + __goblint_check(x == y); // UNKNOWN - assert(p); // UNKNOWN - assert(q); // UNKNOWN - assert(p == q); // UNKNOWN + __goblint_check(p); // UNKNOWN + __goblint_check(q); // UNKNOWN + __goblint_check(p == q); // UNKNOWN if (unknown) - assert(1); + __goblint_check(1); else - assert(1); + __goblint_check(1); if (x == y) - assert(1); + __goblint_check(1); else - assert(1); + __goblint_check(1); if (p == q) - assert(1); + __goblint_check(1); else - assert(1); + __goblint_check(1); p = &x; if (p == q) - assert(1); + __goblint_check(1); else - assert(1); + __goblint_check(1); - assert(p == &x); + __goblint_check(p == &x); if (q == p) - assert(1); + __goblint_check(1); else - assert(1); + __goblint_check(1); return 0; } diff --git a/tests/regression/00-sanity/17-constructors.c b/tests/regression/00-sanity/17-constructors.c index 3d285daeb3..7ddd6e61fa 100644 --- a/tests/regression/00-sanity/17-constructors.c +++ b/tests/regression/00-sanity/17-constructors.c @@ -8,6 +8,6 @@ void c(){ } int main(){ - assert(g==10); + __goblint_check(g==10); return 0; } \ No newline at end of file diff --git a/tests/regression/00-sanity/19-if-0.c b/tests/regression/00-sanity/19-if-0.c index eb563c0678..87861ce1d5 100644 --- a/tests/regression/00-sanity/19-if-0.c +++ b/tests/regression/00-sanity/19-if-0.c @@ -12,7 +12,7 @@ int main() { } else { // realnode finds this as immediate successor of entry, so problem is avoided - assert(1); // must be reachable + __goblint_check(1); // must be reachable } return 0; } \ No newline at end of file diff --git a/tests/regression/00-sanity/22-modulo.c b/tests/regression/00-sanity/22-modulo.c index 2857bf02db..2ce172a6db 100644 --- a/tests/regression/00-sanity/22-modulo.c +++ b/tests/regression/00-sanity/22-modulo.c @@ -3,18 +3,18 @@ int main() { int x = -1; int m = x % 5; int r = x /5; - assert(m == -1); - assert(r == 0); + __goblint_check(m == -1); + __goblint_check(r == 0); x = 1; m = x%-5; r = x/-5; - assert(m == 1); - assert(r == 0); + __goblint_check(m == 1); + __goblint_check(r == 0); x = -1; m = x%-5; r = x/-5; - assert(m == -1); - assert(r == 0); + __goblint_check(m == -1); + __goblint_check(r == 0); } diff --git a/tests/regression/00-sanity/23-modulo-interval.c b/tests/regression/00-sanity/23-modulo-interval.c index 81851ce6a2..c132c60644 100644 --- a/tests/regression/00-sanity/23-modulo-interval.c +++ b/tests/regression/00-sanity/23-modulo-interval.c @@ -4,18 +4,18 @@ int main() { int x = -1; int m = x % 5; int r = x /5; - assert(m == -1); - assert(r == 0); + __goblint_check(m == -1); + __goblint_check(r == 0); x = 1; m = x%-5; r = x/-5; - assert(m == 1); - assert(r ==0); + __goblint_check(m == 1); + __goblint_check(r ==0); x = -1; m = x%-5; r = x/-5; - assert(m == -1); - assert(r == 0); + __goblint_check(m == -1); + __goblint_check(r == 0); } diff --git a/tests/regression/00-sanity/24-update_suite.c b/tests/regression/00-sanity/24-update_suite.c index 55f2699e59..67d87410d4 100644 --- a/tests/regression/00-sanity/24-update_suite.c +++ b/tests/regression/00-sanity/24-update_suite.c @@ -4,7 +4,7 @@ int main() { int x = 42; // Should fail with: Expected unknown, but registered success - assert(x == 42); // UNKNOWN + __goblint_check(x == 42); // UNKNOWN return 0; } diff --git a/tests/regression/00-sanity/25-cfg-connect.c b/tests/regression/00-sanity/25-cfg-connect.c index 1a0af3fb05..6179a97d9a 100644 --- a/tests/regression/00-sanity/25-cfg-connect.c +++ b/tests/regression/00-sanity/25-cfg-connect.c @@ -41,7 +41,7 @@ int main() void single() { while (1) - assert(1); + __goblint_check(1); } void sequential_last() @@ -51,16 +51,16 @@ void sequential_last() i++; while (1) - assert(1); + __goblint_check(1); } void sequential_both() { while (1) - assert(1); + __goblint_check(1); while (1) - assert(1); // NOWARN (unreachable) + __goblint_check(1); // NOWARN (unreachable) } void branch_one() @@ -75,7 +75,7 @@ void branch_one() else { while (1) - assert(1); + __goblint_check(1); } } @@ -85,12 +85,12 @@ void branch_both() if (r) { while (1) - assert(1); + __goblint_check(1); } else { while (1) - assert(1); + __goblint_check(1); } } @@ -110,7 +110,7 @@ void nested_inner() while (i < 10) { while (1) - assert(1); + __goblint_check(1); i++; } } @@ -120,7 +120,7 @@ void nested_both() while (1) { while (1) - assert(1); + __goblint_check(1); } } @@ -133,7 +133,7 @@ void nested_both_switch() { case 0: while (1) - assert(1); + __goblint_check(1); } } } diff --git a/tests/regression/00-sanity/26-strict-loop-enter.c b/tests/regression/00-sanity/26-strict-loop-enter.c index c8c3e98684..d95380f5c1 100644 --- a/tests/regression/00-sanity/26-strict-loop-enter.c +++ b/tests/regression/00-sanity/26-strict-loop-enter.c @@ -17,6 +17,6 @@ int main() { for(int i=0; i<=0; i--){ g = 57; } - assert(1); // NOWARN (unreachable) + __goblint_check(1); // NOWARN (unreachable) } } \ No newline at end of file diff --git a/tests/regression/00-sanity/28-strict-multi-entry-loop.c b/tests/regression/00-sanity/28-strict-multi-entry-loop.c index 24db96e07e..936f8b2252 100644 --- a/tests/regression/00-sanity/28-strict-multi-entry-loop.c +++ b/tests/regression/00-sanity/28-strict-multi-entry-loop.c @@ -9,9 +9,9 @@ int cycle2_1() { goto cycle2_1_entry2; cycle2_1_entry1: - assert(1); // reachable + __goblint_check(1); // reachable cycle2_1_entry2: - assert(1); // reachable + __goblint_check(1); // reachable goto cycle2_1_entry1; return 0; @@ -26,9 +26,9 @@ int cycle2_0() { goto cycle2_0_entry2; cycle2_0_entry1: - assert(1); // reachable + __goblint_check(1); // reachable cycle2_0_entry2: - assert(1); // reachable + __goblint_check(1); // reachable goto cycle2_0_entry1; return 0; @@ -43,7 +43,7 @@ void loops_s3_min() { goto switch_1_default; if (0) { switch_1_12292: - assert(1); // reachable + __goblint_check(1); // reachable goto switch_1_break; @@ -68,11 +68,11 @@ int loop2() { goto loop2_entry2; loop2_entry1: - assert(1); // reachable - assert(1); // reachable + __goblint_check(1); // reachable + __goblint_check(1); // reachable loop2_entry2: - assert(1); // reachable - assert(1); // reachable + __goblint_check(1); // reachable + __goblint_check(1); // reachable goto loop2_entry1; return 0; diff --git a/tests/regression/00-sanity/30-both_branches.c b/tests/regression/00-sanity/30-both_branches.c index 27f60265fc..b3b2b55220 100644 --- a/tests/regression/00-sanity/30-both_branches.c +++ b/tests/regression/00-sanity/30-both_branches.c @@ -17,12 +17,12 @@ int main(int argc , char **argv ) { int rc = 0; - assert(sqlite3Config.blarg == 0); - assert(sqlite3Config.m.iValdue == 0); + __goblint_check(sqlite3Config.blarg == 0); + __goblint_check(sqlite3Config.m.iValdue == 0); if ((unsigned long )sqlite3Config.blarg == (unsigned long )((void *(*)(int ))0)) { rc = 5; } - assert(1); + __goblint_check(1); } diff --git a/tests/regression/00-sanity/31-assert-redefine.c b/tests/regression/00-sanity/31-assert-redefine.c index bda6171de0..7e7330ab8d 100644 --- a/tests/regression/00-sanity/31-assert-redefine.c +++ b/tests/regression/00-sanity/31-assert-redefine.c @@ -7,9 +7,10 @@ int main() { int silence = 1; int fail = 0; int unknown; + // intentionally using assert, specific order to work with assert refine assert(success); - assert(fail); // FAIL! assert(unknown == 4); // UNKNOWN! + assert(fail); // FAIL! return 0; assert(silence); // NOWARN! } diff --git a/tests/regression/00-sanity/32-check.c b/tests/regression/00-sanity/32-check.c new file mode 100644 index 0000000000..7a40faf543 --- /dev/null +++ b/tests/regression/00-sanity/32-check.c @@ -0,0 +1,13 @@ +// just a few sanity checks on checks + +int main() { + int success = 1; + int silence = 1; + int fail = 0; + int unknown; + __goblint_check(success); + __goblint_check(fail); // FAIL! + __goblint_check(unknown == 4); // UNKNOWN! + return 0; + __goblint_check(silence); // NOWARN! +} diff --git a/tests/regression/01-cpa/01-expressions.c b/tests/regression/01-cpa/01-expressions.c index 792f01b2a1..8ee9f5bd3c 100644 --- a/tests/regression/01-cpa/01-expressions.c +++ b/tests/regression/01-cpa/01-expressions.c @@ -11,78 +11,78 @@ int main() { i = 5; j = 6; k = i + j; - assert(i+j == 11); + __goblint_check(i+j == 11); // global variables glob1 = 5; - assert(glob1+glob2 == 14); + __goblint_check(glob1+glob2 == 14); // simple arithmetic i = -j; - assert(i == -6); + __goblint_check(i == -6); i = 10 + j; - assert(i == 16); + __goblint_check(i == 16); i = 10 - j; - assert(i == 4); + __goblint_check(i == 4); i = 3 * j; - assert(i == 18); + __goblint_check(i == 18); i = 47 / j; - assert(i == 7); - + __goblint_check(i == 7); + i = 8 % j; - assert(i == 2); + __goblint_check(i == 2); // comparison operators i = 3; j = 7; - assert(i < j); - assert(!(i < i)); - assert(!(j < i)); + __goblint_check(i < j); + __goblint_check(!(i < i)); + __goblint_check(!(j < i)); - assert(!(i > j)); - assert(!(i > i)); - assert(j > i); + __goblint_check(!(i > j)); + __goblint_check(!(i > i)); + __goblint_check(j > i); - assert(i <= j); - assert(i <= i); - assert(!(j <= i)); + __goblint_check(i <= j); + __goblint_check(i <= i); + __goblint_check(!(j <= i)); - assert(!(i >= j)); - assert(i >= i); - assert(j >= i); + __goblint_check(!(i >= j)); + __goblint_check(i >= i); + __goblint_check(j >= i); - assert(! (i==j)); - assert(i == i); + __goblint_check(! (i==j)); + __goblint_check(i == i); - assert(i != j); - assert(!(i != i)); + __goblint_check(i != j); + __goblint_check(!(i != i)); // boolean expressions i = 1; j = 0; - assert(i); - assert(!j); + __goblint_check(i); + __goblint_check(!j); k = ! i; k += ! j << 1; - assert(k == 2); + __goblint_check(k == 2); k = (i && j); k += (j && i) << 1; k += (i && i) << 2; k += (j && j) << 3; - assert(k == 4); + __goblint_check(k == 4); k = (i || j); k += (j || i) << 1; k += (i || i) << 2; k += (j || j) << 3; - assert(k == 7); + __goblint_check(k == 7); return 0; } diff --git a/tests/regression/01-cpa/02-branch.c b/tests/regression/01-cpa/02-branch.c index 5904606622..686dd67ab7 100644 --- a/tests/regression/01-cpa/02-branch.c +++ b/tests/regression/01-cpa/02-branch.c @@ -10,32 +10,32 @@ int main() { } if (x) { - assert(x != 0); + __goblint_check(x != 0); i = 5; j = 10; } else { - assert(x == 0); + __goblint_check(x == 0); i = 7; j = 10; } - assert(i==5); // UNKNOWN! - assert(i==7); // UNKNOWN! - assert(i != 0); - assert(j == 10); + __goblint_check(i==5); // UNKNOWN! + __goblint_check(i==7); // UNKNOWN! + __goblint_check(i != 0); + __goblint_check(j == 10); - if (j) + if (j) k = 7; - else + else k = 8; - assert(k == 7); + __goblint_check(k == 7); switch (x) { - case 5: k = 3 + x; assert (x == 5); break; - case 6: k = 2 + x; assert (x == 6); break; - default: k = 8; assert(x != 5); assert( x!= 6); + case 5: k = 3 + x; __goblint_check(x == 5); break; + case 6: k = 2 + x; __goblint_check(x == 6); break; + default: k = 8; __goblint_check(x != 5); __goblint_check( x!= 6); } - assert(k == 8); + __goblint_check(k == 8); return 0; } diff --git a/tests/regression/01-cpa/03-loops.c b/tests/regression/01-cpa/03-loops.c index 37a24c78c3..7c34ea9a0b 100644 --- a/tests/regression/01-cpa/03-loops.c +++ b/tests/regression/01-cpa/03-loops.c @@ -10,9 +10,9 @@ int main () { j = 7; k = 5; } - assert(i == 10); //UNKNOWN - assert(k); //UNKNOWN + __goblint_check(i == 10); //UNKNOWN + __goblint_check(k); //UNKNOWN // k is currenlty 0 \sqcup 5, if we unfolded the loops it would be 5 - assert(j==7); + __goblint_check(j==7); return 0; } diff --git a/tests/regression/01-cpa/04-functions.c b/tests/regression/01-cpa/04-functions.c index 2e167867ca..6765e29fdd 100644 --- a/tests/regression/01-cpa/04-functions.c +++ b/tests/regression/01-cpa/04-functions.c @@ -13,37 +13,37 @@ int main () { // check that function calls don't destroy the local state f(); - assert(i == 3); + __goblint_check(i == 3); //check parameter passing i = add1(5); - assert(i == 6); + __goblint_check(i == 6); i = add1(17); - assert(i == 18); + __goblint_check(i == 18); // Check some more... // How many different states are analyzed? i = add(6,4); - assert(i == 10); + __goblint_check(i == 10); i = add(3,8); - assert(i == 11); + __goblint_check(i == 11); i = add(6,4); - assert(i == 10); + __goblint_check(i == 10); i = add(3,8); - assert(i == 11); + __goblint_check(i == 11); // Check on global variables g_inc(); - assert(glob == 1); + __goblint_check(glob == 1); g_inc(); - assert(glob == 2); + __goblint_check(glob == 2); glob=0; g_inc(); - assert(glob == 1); + __goblint_check(glob == 1); return 0; } diff --git a/tests/regression/01-cpa/05-recursion.c b/tests/regression/01-cpa/05-recursion.c index 685d53ee53..317e5dce20 100644 --- a/tests/regression/01-cpa/05-recursion.c +++ b/tests/regression/01-cpa/05-recursion.c @@ -35,14 +35,14 @@ int main () { int a = 1; rec1(0); - assert(t == 5); + __goblint_check(t == 5); rec2(&a, 0); printf("a = %d\n", a); - assert(a == 0); + __goblint_check(a == 0); a = fact(6); - assert(a == 720); + __goblint_check(a == 720); return 0; } diff --git a/tests/regression/01-cpa/06-pointers.c b/tests/regression/01-cpa/06-pointers.c index ba69d435ba..312f242696 100644 --- a/tests/regression/01-cpa/06-pointers.c +++ b/tests/regression/01-cpa/06-pointers.c @@ -13,57 +13,57 @@ int main () { // reading through pointer i = 5; p = &i; - assert(*p == 5); + __goblint_check(*p == 5); // writing through pointer *p = 8; - assert(i == 8); + __goblint_check(i == 8); // reading from a set of addresses // if p -> {i,j} and both are 8: j = 8; if (k1) p = &j; - assert(*p == 8); + __goblint_check(*p == 8); // if j -> 7 and i -> 8, we don't know: j = 7; - assert(*p == 8); // UNKNOWN! + __goblint_check(*p == 8); // UNKNOWN! // writing to a set of addresses // p still points to i or j, writing to p should update both: i = 3; j = 7; *p = 3; - assert(i == 3); - assert(j == 7); // UNKNOWN! + __goblint_check(i == 3); + __goblint_check(j == 7); // UNKNOWN! // pointer to pointers i = 7; pp = &p; *pp = &i; - // assert(p == &i); wontfix! - assert(*p == 7); - assert(**pp == 7); + // __goblint_check(p == &i); wontfix! + __goblint_check(*p == 7); + __goblint_check(**pp == 7); **pp = 1; - assert(i == 1); + __goblint_check(i == 1); (**pp)++; - assert(i == 2); + __goblint_check(i == 2); // pointers to functions fp = fun_6; i = fp(); - assert(i == 6); + __goblint_check(i == 6); // pointer to a set of functions if (k2) fp = fun_5; else fp = fun_6; i = fp(); - assert(i == 5); // UNKNOWN! + __goblint_check(i == 5); // UNKNOWN! if (k3) fp = fun_5; else fp = fun_5b; i = fp(); - assert(i == 5); + __goblint_check(i == 5); return 0; } diff --git a/tests/regression/01-cpa/07-structs.c b/tests/regression/01-cpa/07-structs.c index d69a2cbe90..b2dbb26741 100644 --- a/tests/regression/01-cpa/07-structs.c +++ b/tests/regression/01-cpa/07-structs.c @@ -24,27 +24,27 @@ int main () { a.kaal = 5; a.hind = 300; - assert(a.kaal == 5); + __goblint_check(a.kaal == 5); // checking assignment of records b = a; - assert(b.kaal == 5); + __goblint_check(b.kaal == 5); // check that a and b are different a.kaal = 12; b.kaal = 13; - assert(a.kaal == 12); + __goblint_check(a.kaal == 12); // pointer to field p = & a.kaal; *p = 6; - assert(a.kaal == 6); + __goblint_check(a.kaal == 6); // pointer to struct kp = &a; - assert(kp->kaal == 6); + __goblint_check(kp->kaal == 6); kp->hind = 200; - assert(a.hind == 200); + __goblint_check(a.hind == 200); // wicked addresses @@ -55,46 +55,46 @@ int main () { if (k2) p = & b.kaal; // p points to a.hind, b.hind, b.kaal and i, invalidate them! *p = 666; - assert(a.hind == 666); // UNKNOWN! - assert(b.hind == 666); // UNKNOWN! - assert(b.kaal == 666); // UNKNOWN! - assert(i == 666); // UNKNOWN! + __goblint_check(a.hind == 666); // UNKNOWN! + __goblint_check(b.hind == 666); // UNKNOWN! + __goblint_check(b.kaal == 666); // UNKNOWN! + __goblint_check(i == 666); // UNKNOWN! // structs in structs a.hind = 13; a.kaal = 17; kalamaja.kala.hind = 5; - assert(kalamaja.kala.hind == 5); + __goblint_check(kalamaja.kala.hind == 5); kalamaja.kala = a; - assert(kalamaja.kala.hind == 13); + __goblint_check(kalamaja.kala.hind == 13); kalamaja.arv = 7; kalamaja.kala.kaal = 176; - assert(kalamaja.kala.kaal == 176); - assert(a.kaal != 176); + __goblint_check(kalamaja.kala.kaal == 176); + __goblint_check(a.kaal != 176); // just some more testing mp = &kalamaja; - assert(mp->kala.kaal == 176); + __goblint_check(mp->kala.kaal == 176); p = &mp->kala.hind; *p = 47; b = kalamaja.kala; - assert(b.hind == 47); + __goblint_check(b.hind == 47); // global struct - assert(glob.kaal == 3); - assert(glob.hind == 0); + __goblint_check(glob.kaal == 3); + __goblint_check(glob.hind == 0); glob.hind = 5; - assert(glob.hind == 5); + __goblint_check(glob.hind == 5); glob = a; - assert(glob.hind == 13); + __goblint_check(glob.hind == 13); // invalidation a.hind = 1; a.kaal = 2; scanf("%d", &a.hind); - assert(a.hind == 1); // UNKNOWN! - assert(a.kaal == 2); + __goblint_check(a.hind == 1); // UNKNOWN! + __goblint_check(a.kaal == 2); return 0; } diff --git a/tests/regression/01-cpa/08-unions.c b/tests/regression/01-cpa/08-unions.c index 64fa4a1851..30eb0c4a62 100644 --- a/tests/regression/01-cpa/08-unions.c +++ b/tests/regression/01-cpa/08-unions.c @@ -24,17 +24,17 @@ int main () { k.i = 5; k.j = 7; - assert(k.i == 7); - assert(k.p == 7.0); // UNKNOWN! + __goblint_check(k.i == 7); + __goblint_check(k.p == 7.0); // UNKNOWN! maja.arv = 8; maja.kala.i = 3; - assert(maja.kala.j == 3); - assert(maja.kala.p == 3.0); // UNKNOWN! + __goblint_check(maja.kala.j == 3); + __goblint_check(maja.kala.p == 3.0); // UNKNOWN! k.struk.x = 3; - assert(k.struk.x == 3); - assert(k.i == 3); // UNKNOWN! + __goblint_check(k.struk.x == 3); + __goblint_check(k.i == 3); // UNKNOWN! return 0; } diff --git a/tests/regression/01-cpa/09-arrays.c b/tests/regression/01-cpa/09-arrays.c index 43fdb52d09..04a9ea6162 100644 --- a/tests/regression/01-cpa/09-arrays.c +++ b/tests/regression/01-cpa/09-arrays.c @@ -24,95 +24,95 @@ int main () { int *ip; int (*iap)[]; - // really really top + // really really top if (i) top = (int) ⊤ else top = 5; - - assert(a[0] == 2); - assert(a[1] == 2); - assert(a[2] == 2); - - assert(a[((int)ip) % 2]==2); // strange, eh? - + + __goblint_check(a[0] == 2); + __goblint_check(a[1] == 2); + __goblint_check(a[2] == 2); + + __goblint_check(a[((int)ip) % 2]==2); // strange, eh? + // writing to unknown index: // NB! We assume the index is in bounds! if (k1) i=0; else i=1; a[i] = 0; - assert(a[0] == 0); // UNKNOWN - assert(a[1] == 0); // UNKNOWN - assert(a[2] == 0); // UNKNOWN - + __goblint_check(a[0] == 0); // UNKNOWN + __goblint_check(a[1] == 0); // UNKNOWN + __goblint_check(a[2] == 0); // UNKNOWN + // reading from unknown index: b[0] = 2; b[1] = 2; - assert(b[i] == 2); + __goblint_check(b[i] == 2); b[0] = 3; - assert(b[i] == 2); // UNKNOWN + __goblint_check(b[i] == 2); // UNKNOWN // function arrays t = f[i](); - assert(t == 5); // UNKNOWN + __goblint_check(t == 5); // UNKNOWN t = g[i](); - assert(t == 5); + __goblint_check(t == 5); // array has set of addresses: if (k2) f[i] = fun_5b; t = f[1](); - assert(t == 5); // UNKNOWN + __goblint_check(t == 5); // UNKNOWN // now we collect all the sets: fp = f[i]; t = fp(); - assert(t == 5); // UNKNOWN + __goblint_check(t == 5); // UNKNOWN fp = g[i]; t = fp(); - assert(t == 5); + __goblint_check(t == 5); // NASTY ARRAY OPS: c[0] = 5; c[1] = 5; c[2] = 5; // this is not usual: a pointer to an array (easy!) iap = &c; t = (*iap)[2]; - assert(t == 5); + __goblint_check(t == 5); // Typical C: a pointer to first element of array (difficult!) ip = c; // this means &c[0] // dereferencing... - assert(*ip == 5); + __goblint_check(*ip == 5); // pointing into the array ip = &c[1]; - assert(*ip == 5); - + __goblint_check(*ip == 5); + // and some pointer arithmetic (tests are meaningless) *ip = 6; ip++; - assert(*ip == 5); // UNKNOWN + __goblint_check(*ip == 5); // UNKNOWN // Now testing arrays inside structs. struct kala x; ip = x.a; x.a[0] = 7; - assert(*ip == 7); - + __goblint_check(*ip == 7); + // (typeless) Top index - assert(x.a[top] == 7); + __goblint_check(x.a[top] == 7); // And finally array of structs struct kala xs[5]; xs[0] = x; ip = &xs[0].a[0]; - assert(*ip == 7); - + __goblint_check(*ip == 7); + struct kass k[1]; k[0].v = 42; - assert(k[0].v == 42); - + __goblint_check(k[0].v == 42); + // multi-dim arrays int ma[1][1]; ma[0][0] = 42; - assert(ma[0][0] == 42); - + __goblint_check(ma[0][0] == 42); + //i = hash("kala"); //printf("Hash value: %d", i); @@ -125,7 +125,7 @@ int main () { int not_init[20]; if(not_init[5] == 0) { - assert(1==1); + __goblint_check(1==1); } diff --git a/tests/regression/01-cpa/10-posneg.c b/tests/regression/01-cpa/10-posneg.c index b4bf682a5f..32e64f397d 100644 --- a/tests/regression/01-cpa/10-posneg.c +++ b/tests/regression/01-cpa/10-posneg.c @@ -7,10 +7,10 @@ int main() { int i,k,j; if (k == 5) { - assert(k == 5); + __goblint_check(k == 5); return 0; } - assert(k != 5); + __goblint_check(k != 5); // Signed overflows might occur in some of the following operations (e.g. the first assignment k could be MAX_INT). // Signed overflows are undefined behavior, so by default we go to top when they might occur. @@ -18,15 +18,15 @@ int main() { // simple arithmetic i = k + 1; - assert(i != 6); + __goblint_check(i != 6); i = k - 1; - assert(i != 4); + __goblint_check(i != 4); i = k * 3; // multiplication with odd numbers is injective - assert(i != 15); + __goblint_check(i != 15); i = k * 2; // multiplication with even numbers is not injective - assert(i != 10); // UNKNOWN! k could be -2147483643; + __goblint_check(i != 10); // UNKNOWN! k could be -2147483643; i = k / 2; - assert(i != 2); // UNKNOWN! k could be 4 + __goblint_check(i != 2); // UNKNOWN! k could be 4 return 0; } diff --git a/tests/regression/01-cpa/11-fun_ptrargs.c b/tests/regression/01-cpa/11-fun_ptrargs.c index e53eb496b5..22c2aafa55 100644 --- a/tests/regression/01-cpa/11-fun_ptrargs.c +++ b/tests/regression/01-cpa/11-fun_ptrargs.c @@ -2,8 +2,8 @@ #include struct kala { int x; }; -void inc(int *x) { - (*x)++; +void inc(int *x) { + (*x)++; } void set(int *x, int i) { @@ -25,24 +25,24 @@ int main () { i = 0; inc(&i); - assert(i == 1); + __goblint_check(i == 1); i = 3; j = 7; swap(&i, &j); - assert(i == 7); - assert(j == 3); - + __goblint_check(i == 7); + __goblint_check(j == 3); + set(&i, 5); - assert(i == 5); + __goblint_check(i == 5); tes(6, &i); - assert(i == 6); + __goblint_check(i == 6); // struct pointer struct kala k; k.x = 3; inc(&k.x); - assert(k.x == 4); + __goblint_check(k.x == 4); return 0; } diff --git a/tests/regression/01-cpa/12-bool.c b/tests/regression/01-cpa/12-bool.c index 2e5da92fe6..686d5004dd 100644 --- a/tests/regression/01-cpa/12-bool.c +++ b/tests/regression/01-cpa/12-bool.c @@ -6,6 +6,6 @@ int main() { bool y; x = 4; y = true; - assert(y); + __goblint_check(y); return x; } diff --git a/tests/regression/01-cpa/13-scanf.c b/tests/regression/01-cpa/13-scanf.c index 2669e09b87..0c1b7a1997 100644 --- a/tests/regression/01-cpa/13-scanf.c +++ b/tests/regression/01-cpa/13-scanf.c @@ -9,7 +9,7 @@ struct kala { int main () { int i = 4; scanf("%d", &i); - assert(i == 4); // UNKNOWN + __goblint_check(i == 4); // UNKNOWN struct kala k; int x; @@ -17,23 +17,23 @@ int main () { k.x = 4; k.y = 7; scanf("%d\n",&k.x); - assert(k.x == 4); // UNKNOWN - assert(k.y == 7); + __goblint_check(k.x == 4); // UNKNOWN + __goblint_check(k.y == 7); k.x = 4; k.y = 7; - if (x) + if (x) ip = &k.x; - else + else ip = &k.y; scanf("%d\n",ip); - assert(k.x == 4); // UNKNOWN - assert(k.y == 7); // UNKNOWN + __goblint_check(k.x == 4); // UNKNOWN + __goblint_check(k.y == 7); // UNKNOWN k.x = 4; k.y = 7; scanf("%d%d\n", &k.x, &k.y); - assert(k.x == 4); // UNKNOWN - assert(k.y == 7); // UNKNOWN + __goblint_check(k.x == 4); // UNKNOWN + __goblint_check(k.y == 7); // UNKNOWN return 0; } diff --git a/tests/regression/01-cpa/14-vararg.c b/tests/regression/01-cpa/14-vararg.c index 57802ce53b..af838f69e4 100644 --- a/tests/regression/01-cpa/14-vararg.c +++ b/tests/regression/01-cpa/14-vararg.c @@ -9,10 +9,10 @@ int kala (int x, ...) { int main () { int i = 0; i = kala(3); - assert(i==3); + __goblint_check(i==3); i = kala(2, 5); - assert(i==2); - + __goblint_check(i==2); + return 0; } diff --git a/tests/regression/01-cpa/15-break.c b/tests/regression/01-cpa/15-break.c index 7bf623ddac..31b6392d31 100644 --- a/tests/regression/01-cpa/15-break.c +++ b/tests/regression/01-cpa/15-break.c @@ -11,7 +11,7 @@ main () { break; } printf("%d\n",sum); - assert(sum == 1); // UNKNOWN - assert(k == 7); + __goblint_check(sum == 1); // UNKNOWN + __goblint_check(k == 7); return 0; } diff --git a/tests/regression/01-cpa/16-exit.c b/tests/regression/01-cpa/16-exit.c index 41e0330ec4..58661f9966 100644 --- a/tests/regression/01-cpa/16-exit.c +++ b/tests/regression/01-cpa/16-exit.c @@ -10,6 +10,6 @@ main () { exit(0); } printf("The number was not zero.\n"); - assert(x == 7); + __goblint_check(x == 7); return 0; } diff --git a/tests/regression/01-cpa/17-ptr_aliasing.c b/tests/regression/01-cpa/17-ptr_aliasing.c index d2e575bcd2..6d4117293f 100644 --- a/tests/regression/01-cpa/17-ptr_aliasing.c +++ b/tests/regression/01-cpa/17-ptr_aliasing.c @@ -9,74 +9,74 @@ void evil (int *x, int *y, int *z) { (*x)++; *z = *y; } - + int main () { int z = 1; int k; int *x, *y; int a,b,c; - + // simple aliasing x = &z; y = &z; (*x)++; - assert(*y == 2); + __goblint_check(*y == 2); // may-aliasing if (k) x = &k; (*x)++; - assert(*y == 2); // UNKNOWN + __goblint_check(*y == 2); // UNKNOWN // Function call return test z = 7; proc(&z, &z); - assert(z == 10); + __goblint_check(z == 10); printf("%d\n",z); // Aliasing tests of fun args - a = 3; b = 5; c = 7; + a = 3; b = 5; c = 7; evil(&a, &b, &c); printf("%d %d %d\n",a,b,c); - assert(a == 4); - assert(b == 5); - assert(c == 5); + __goblint_check(a == 4); + __goblint_check(b == 5); + __goblint_check(c == 5); a = 3; b = 5; evil(&a, &a, &a); printf("%d %d\n",a,b); - assert(a == 4); - assert(b == 5); + __goblint_check(a == 4); + __goblint_check(b == 5); a = 3; b = 5; evil(&a, &b, &a); printf("%d %d\n",a,b); - assert(a == 5); - assert(b == 5); + __goblint_check(a == 5); + __goblint_check(b == 5); a = 3; b = 5; evil(&a, &a, &b); printf("%d %d\n",a,b); - assert(a == 4); - assert(b == 4); + __goblint_check(a == 4); + __goblint_check(b == 4); // may aliasing - a = 3; b = 3; c = 7; + a = 3; b = 3; c = 7; x = &a; if (k) x = &b; evil(x, x, &c); printf("%d %d %d\n",a,b,c); - assert(a == 3); // UNKNOWN - assert(b == 3); // UNKNOWN - assert(c == 4); // UNKNOWN + __goblint_check(a == 3); // UNKNOWN + __goblint_check(b == 3); // UNKNOWN + __goblint_check(c == 4); // UNKNOWN - a = 3; b = 5; c = 7; + a = 3; b = 5; c = 7; x = &a; if (k) x = &b; evil(x, &a, &c); printf("%d %d %d\n",a,b,c); - assert(a == 3); // UNKNOWN - assert(b == 5); // UNKNOWN - assert(c == 6); // UNKNOWN + __goblint_check(a == 3); // UNKNOWN + __goblint_check(b == 5); // UNKNOWN + __goblint_check(c == 6); // UNKNOWN return 0; } diff --git a/tests/regression/01-cpa/18-ptr_chains.c b/tests/regression/01-cpa/18-ptr_chains.c index ac3e90f32d..ec3573b9e4 100644 --- a/tests/regression/01-cpa/18-ptr_chains.c +++ b/tests/regression/01-cpa/18-ptr_chains.c @@ -26,31 +26,31 @@ int main () { struct node n1; struct node n2; - // Testing invalidation of nested ptrs + // Testing invalidation of nested ptrs i = 7; k.x =13; ip = &i; invalid(&ip); - assert(i == 7); // UNKNOWN + __goblint_check(i == 7); // UNKNOWN *ip = 3; - assert(i == 3); - + __goblint_check(i == 3); + ip = &k.x; invalid(&ip); - assert(k.x == 13); // UNKNOWN + __goblint_check(k.x == 13); // UNKNOWN *ip = 5; - assert(k.x == 5); + __goblint_check(k.x == 5); // Testing invalidation of linked structs n1.data = 1; n2.data = 2; n1.next = &n2; n2.next = &n1; - assert(n1.next->data == 2); - assert(n2.next->data == 1); + __goblint_check(n1.next->data == 2); + __goblint_check(n2.next->data == 1); update_list(&n1); - assert(n1.data == 1); // UNKNOWN - assert(n2.data == 2); // UNKNOWN + __goblint_check(n1.data == 1); // UNKNOWN + __goblint_check(n2.data == 2); // UNKNOWN return 0; } diff --git a/tests/regression/01-cpa/19-dangling_ptr.c b/tests/regression/01-cpa/19-dangling_ptr.c index 3b0653171e..bd545c0d6b 100644 --- a/tests/regression/01-cpa/19-dangling_ptr.c +++ b/tests/regression/01-cpa/19-dangling_ptr.c @@ -21,19 +21,19 @@ int main () { *p = 7; i = *p; printf("%d\n", i); // GCC: i = 7 - assert(i == 7); + __goblint_check(i == 7); dang(); i = *p; printf("%d\n", i); // GCC: i = 3 - assert(i == 3); // UNKNOWN + __goblint_check(i == 3); // UNKNOWN nestra(&p); *p = 8; nestra(&q); i = *p; printf("%d\n", i); // GCC: i = 5 - assert(i == 5); // UNKNOWN + __goblint_check(i == 5); // UNKNOWN return 0; } diff --git a/tests/regression/01-cpa/20-static_var.c b/tests/regression/01-cpa/20-static_var.c index a440cce894..2e7e757909 100644 --- a/tests/regression/01-cpa/20-static_var.c +++ b/tests/regression/01-cpa/20-static_var.c @@ -14,11 +14,11 @@ int main () { i = 0; // static variable (thanks to CIL) i = statinc(); - assert(i == 1); - assert(x == 0); + __goblint_check(i == 1); + __goblint_check(x == 0); i = statinc(); - assert(i == 2); - assert(x == 0); + __goblint_check(i == 2); + __goblint_check(x == 0); return 0; } diff --git a/tests/regression/01-cpa/21-strings.c b/tests/regression/01-cpa/21-strings.c index c7529bae4c..f82c343052 100644 --- a/tests/regression/01-cpa/21-strings.c +++ b/tests/regression/01-cpa/21-strings.c @@ -7,6 +7,6 @@ int main(){ strh = &str; c1 = (*strh)[1]; str[2] = '3'; - assert(c1 == '1'); // UNKNOWN + __goblint_check(c1 == '1'); // UNKNOWN return 0; } diff --git a/tests/regression/01-cpa/22-null_ptr.c b/tests/regression/01-cpa/22-null_ptr.c index 9ca65994fd..df99cf2d3b 100644 --- a/tests/regression/01-cpa/22-null_ptr.c +++ b/tests/regression/01-cpa/22-null_ptr.c @@ -13,37 +13,37 @@ int main(){ // setup if (rnd) x = &a; - else + else x = &b; - + if (rnd){ x = 0; - assert(x == 0); + __goblint_check(x == 0); } // tests - + // no information loss between int <-> T* - assert((int)0 == (int*)0); + __goblint_check((int)0 == (int*)0); // filtering out the null pointer possibility - if (x){ - // assert(x != 0); - assert(*x = 1); + if (x){ + // __goblint_check(x != 0); + __goblint_check(*x = 1); b = 2; - assert(*x != 0); + __goblint_check(*x != 0); b = 0; - assert(*x == 0); // UNKNOWN + __goblint_check(*x == 0); // UNKNOWN if (x != &b) { - assert(x == &a); - assert(*x == 1); + __goblint_check(x == &a); + __goblint_check(*x == 1); } } else { - assert(x == 0); - unknown_fn(x); // unknown fun warning but no unsound + __goblint_check(x == 0); + unknown_fn(x); // unknown fun warning but no unsound // or 0-ptr warning } - + unknown_fn(0); return 0; } diff --git a/tests/regression/01-cpa/23-std_funs.c b/tests/regression/01-cpa/23-std_funs.c index d3a218803d..bd3139c5ac 100644 --- a/tests/regression/01-cpa/23-std_funs.c +++ b/tests/regression/01-cpa/23-std_funs.c @@ -7,19 +7,19 @@ int main(void) { // scanf? scanf("%d", &k); - assert(k == 4); // UNKNOWN + __goblint_check(k == 4); // UNKNOWN // printf? printf("Your number is %d", k); - assert(k == 4); // UNKNOWN + __goblint_check(k == 4); // UNKNOWN k = 8; printf("Your number is %d", k); - assert(k == 8); + __goblint_check(k == 8); //scanf sscanf(x, "%d", &k); - assert(k == 8); // UNKNOWN + __goblint_check(k == 8); // UNKNOWN printf("This is %d", k); return 0; diff --git a/tests/regression/01-cpa/24-library_functions.c b/tests/regression/01-cpa/24-library_functions.c index c611f48fae..d742c136ec 100644 --- a/tests/regression/01-cpa/24-library_functions.c +++ b/tests/regression/01-cpa/24-library_functions.c @@ -10,20 +10,20 @@ void test_scanf() { int n = 0, m = 0; scanf("%d %d", &n, &m); - assert(n == 0); // UNKNOWN! - assert(m == 0); // UNKNOWN! + __goblint_check(n == 0); // UNKNOWN! + __goblint_check(m == 0); // UNKNOWN! } void test_memset() { int n = 0; memset(&n, 1, sizeof(int)); - assert(n == 0); // UNKNOWN! + __goblint_check(n == 0); // UNKNOWN! } void test_bzero() { int n = 1; bzero(&n, sizeof(int)); - assert(n == 0); + __goblint_check(n == 0); } void test_getopt() { @@ -46,7 +46,7 @@ void test_free() { int* n = malloc(sizeof(int)); *n = 0; free(n); - assert(n != 0); + __goblint_check(n != 0); } void test_memcpy() { @@ -55,8 +55,8 @@ void test_memcpy() { memcpy(&dest, &src, sizeof(int)); - assert(dest == 0); // UNKNOWN! - assert(src == 1); + __goblint_check(dest == 0); // UNKNOWN! + __goblint_check(src == 1); } void test_fopen() { @@ -67,7 +67,7 @@ void test_connect() { struct sockaddr sa; sa.sa_family = 0; connect(0, &sa, 0); - assert(sa.sa_family == 0); + __goblint_check(sa.sa_family == 0); } void test_sprintf() { @@ -81,13 +81,13 @@ void test_vsprintf() { void test_localtime() { time_t t = 1; localtime(&t); - assert(t == 1); + __goblint_check(t == 1); } void test_time() { time_t t = 1; time(&t); - assert(t == 1); // UNKNOWN! + __goblint_check(t == 1); // UNKNOWN! } void test_strftime() { @@ -101,19 +101,19 @@ void test_snprintf() { void test_send() { int n = 0; send(0, &n, sizeof(int), 0); - assert(n == 0); + __goblint_check(n == 0); } void test_recv() { int n = 0; recv(0, &n, sizeof(int), 0); - assert(n == 0); // UNKNOWN! + __goblint_check(n == 0); // UNKNOWN! } void test_fwrite() { int n = 0; fwrite(&n, sizeof(int), 1, stdout); - assert(n == 0); + __goblint_check(n == 0); } void test_atoi() { @@ -147,7 +147,7 @@ void test_strncmp() { void test_write() { int n = 0; write(0, &n, sizeof(int)); - assert(n == 0); + __goblint_check(n == 0); } void test_fclose() { @@ -157,13 +157,13 @@ void test_fclose() { void test_fread() { int n = 0; fread(&n, sizeof(int), 1, stdin); - assert(n == 0); // UNKNOWN! + __goblint_check(n == 0); // UNKNOWN! } void test_read() { int n = 0; read(0, &n, sizeof(int)); - assert(n == 0); // UNKNOWN! + __goblint_check(n == 0); // UNKNOWN! } void test_printf() { @@ -173,8 +173,8 @@ void test_printf() { void test_sscanf() { int n = 0, m = 0; sscanf("10 20", "%d %d", &n, &m); - assert(n == 0); // UNKNOWN! - assert(m == 0); // UNKNOWN! + __goblint_check(n == 0); // UNKNOWN! + __goblint_check(m == 0); // UNKNOWN! } int main () { @@ -211,6 +211,6 @@ int main () { test_vprintf(); test_vsprintf(); test_write(); - assert(0); // FAIL! + __goblint_check(0); // FAIL! return 0; } diff --git a/tests/regression/01-cpa/25-ptr_problem.c b/tests/regression/01-cpa/25-ptr_problem.c index 5488022d88..762d0834ed 100644 --- a/tests/regression/01-cpa/25-ptr_problem.c +++ b/tests/regression/01-cpa/25-ptr_problem.c @@ -1,18 +1,18 @@ // SKIP -// Out of bound accesses +// Out of bound accesses #include int main() { int x, y, z[2]; int *p = &x; ++ p; - assert(p == &y); // UNKNOWN - - p = &z[-1]; - assert(p == &y); // UNKNOWN + __goblint_check(p == &y); // UNKNOWN + + p = &z[-1]; + __goblint_check(p == &y); // UNKNOWN p = &z[y]; - assert(p == &z[y]); // UNKNOWN + __goblint_check(p == &z[y]); // UNKNOWN return 0; } diff --git a/tests/regression/01-cpa/26-const_ptr.c b/tests/regression/01-cpa/26-const_ptr.c index d1825ba277..a81996de25 100644 --- a/tests/regression/01-cpa/26-const_ptr.c +++ b/tests/regression/01-cpa/26-const_ptr.c @@ -7,7 +7,7 @@ int main() int* pn = &n; int* t = pn; f(&pn); - assert(n); // UNKNOWN! - assert(pn == t); + __goblint_check(n); // UNKNOWN! + __goblint_check(pn == t); return 0; } diff --git a/tests/regression/01-cpa/27-array_init.c b/tests/regression/01-cpa/27-array_init.c index 7e927593ea..cecb45916e 100644 --- a/tests/regression/01-cpa/27-array_init.c +++ b/tests/regression/01-cpa/27-array_init.c @@ -8,12 +8,12 @@ int main () { int a[] = {2,2,2}; int b[2]; - assert(a[0] == 2); - assert(a[1] == 2); - assert(a[2] == 2); + __goblint_check(a[0] == 2); + __goblint_check(a[1] == 2); + __goblint_check(a[2] == 2); b[0] = 3; - assert(b[1] == 3); // UNKNOWN + __goblint_check(b[1] == 3); // UNKNOWN return 0; } diff --git a/tests/regression/01-cpa/28-interval.c b/tests/regression/01-cpa/28-interval.c index 89ea8d09db..4a6ac986b4 100644 --- a/tests/regression/01-cpa/28-interval.c +++ b/tests/regression/01-cpa/28-interval.c @@ -11,22 +11,22 @@ int main () { int true = 42; if (x){ - assert(x != 0); + __goblint_check(x != 0); } else { - assert(x == 0); + __goblint_check(x == 0); } - assert(!! true); - assert(! false); + __goblint_check(!! true); + __goblint_check(! false); if (a){ a = a; } else - assert(0); // NOWARN + __goblint_check(0); // NOWARN if (!a) - assert(0); // NOWARN + __goblint_check(0); // NOWARN else a = a; @@ -38,22 +38,22 @@ int main () { b = 8; } - assert(a); - assert(a!=b); //UNKNOWN - assert(a<10); - assert(a<=9); - assert(!(a<8)); - assert(a==8); //UNKNOWN - assert(b>7); - assert(b>=8); - assert(!(a>9)); - assert(b==8); //UNKNOWN + __goblint_check(a); + __goblint_check(a!=b); //UNKNOWN + __goblint_check(a<10); + __goblint_check(a<=9); + __goblint_check(!(a<8)); + __goblint_check(a==8); //UNKNOWN + __goblint_check(b>7); + __goblint_check(b>=8); + __goblint_check(!(a>9)); + __goblint_check(b==8); //UNKNOWN for(x = 0; x < 10; x++){ - assert(x >= 0); - assert(x <= 9); + __goblint_check(x >= 0); + __goblint_check(x <= 9); } - assert(x == 10); + __goblint_check(x == 10); if (0 <= w) { @@ -65,8 +65,8 @@ int main () { if (w > 0) { - assert(1); + __goblint_check(1); } - + return 0; } diff --git a/tests/regression/01-cpa/29-fun_struct_array.c b/tests/regression/01-cpa/29-fun_struct_array.c index 5aabd9df08..cf25704011 100644 --- a/tests/regression/01-cpa/29-fun_struct_array.c +++ b/tests/regression/01-cpa/29-fun_struct_array.c @@ -14,8 +14,8 @@ int main(){ struct a A[1] = {50, (unsigned long)&QQ}; - assert(A[0].aa == 50); - assert(A[0].qq == (unsigned long)&QQ); // UNKNOWN + __goblint_check(A[0].aa == 50); + __goblint_check(A[0].qq == (unsigned long)&QQ); // UNKNOWN return 0; } diff --git a/tests/regression/01-cpa/30-extern_var.c b/tests/regression/01-cpa/30-extern_var.c index f4b4c36227..1e9cc7834a 100644 --- a/tests/regression/01-cpa/30-extern_var.c +++ b/tests/regression/01-cpa/30-extern_var.c @@ -5,6 +5,6 @@ extern int q; int main(){ int i = q ? 1 : 2 ; - assert(0); // FAIL + __goblint_check(0); // FAIL return 0; } diff --git a/tests/regression/01-cpa/31-unk-fn-ptrs.c b/tests/regression/01-cpa/31-unk-fn-ptrs.c index bcd73b28be..2fb4022782 100644 --- a/tests/regression/01-cpa/31-unk-fn-ptrs.c +++ b/tests/regression/01-cpa/31-unk-fn-ptrs.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mallocWrapper','assert']" --set ana.base.privatization none #include extern void f_everything_up(); @@ -10,7 +10,7 @@ struct s { void hello(){ //is it me your looking for ... - assert(1); + __goblint_check(1); } int g = 0; @@ -18,11 +18,11 @@ void (*fp)(void) = &hello; int main(){ s.f = &hello; - assert(s.f == &hello); - assert(fp == &hello); + __goblint_check(s.f == &hello); + __goblint_check(fp == &hello); f_everything_up(); s.f(); - assert(s.data == 0); // UNKNOWN!!1!one! - assert(fp == &hello);// UNKNOWN + __goblint_check(s.data == 0); // UNKNOWN!!1!one! + __goblint_check(fp == &hello);// UNKNOWN return 0; } diff --git a/tests/regression/01-cpa/32-earlyglobs.c b/tests/regression/01-cpa/32-earlyglobs.c index 6bb40b16d3..4241fbcb21 100644 --- a/tests/regression/01-cpa/32-earlyglobs.c +++ b/tests/regression/01-cpa/32-earlyglobs.c @@ -8,10 +8,10 @@ int main(void){ if(top) { g = 100; // This is only unknown because exp.earlyglobs is on - assert(g == 100); //UNKNOWN! + __goblint_check(g == 100); //UNKNOWN! } // This assert is also unknown in the concrete! - assert(g == 100); //UNKNOWN! + __goblint_check(g == 100); //UNKNOWN! return 0; } diff --git a/tests/regression/01-cpa/33-asserts.c b/tests/regression/01-cpa/33-asserts.c index d86729ba16..f8bf6c3132 100644 --- a/tests/regression/01-cpa/33-asserts.c +++ b/tests/regression/01-cpa/33-asserts.c @@ -1,10 +1,10 @@ -extern void __goblint_check(int); -extern void __goblint_commit(int); +extern void __goblint_check(int); // NOWARN +extern void __goblint_assume(int); extern void __goblint_assert(int); // NOWARN extern void __goblint_unknown(void*); -#define check(x) __goblint_check(x) -#define commit(x) __goblint_commit(x) +#define check(x) __goblint_check(x) // NOWARN +#define assume(x) __goblint_assume(x) #define assert(x) __goblint_assert(x) // NOWARN #define unknown(x) __goblint_unknown(x) @@ -15,8 +15,8 @@ int main(){ assert(n==0); // SUCCESS unknown(&i); - assert(i==8); // UNKNOWN - assert(i==8); // TODO: SUCCESS (refine with assert) + assert(i==8); // UNKNOWN (refines) + assert(i==8); // SUCCESS j=3; check(j==3); // assert @@ -26,13 +26,13 @@ int main(){ check(j==6); // assert UNKNOWN unknown(&k); - commit(k==4); // TODO? assert SUCCESS + assume(k==4); // TODO? assert SUCCESS check(k==4); // assert SUCCESS unknown(&k); - commit(k+1==n); // TODO? FAIL + assume(k+1==n); // TODO? FAIL - commit(n==5); // TODO? NOWARN + assume(n==5); // TODO? NOWARN assert(0); // NOWARN return 0; diff --git a/tests/regression/01-cpa/34-def-exc.c b/tests/regression/01-cpa/34-def-exc.c index 0a92e8893f..698df2f196 100644 --- a/tests/regression/01-cpa/34-def-exc.c +++ b/tests/regression/01-cpa/34-def-exc.c @@ -188,11 +188,11 @@ Hash_table *hash_initialize() int test(void const *ptr) { if(!ptr) { - assert(ptr == 0); + __goblint_check(ptr == 0); int f = 7; } else { - assert(ptr == 1); //UNKNOWN! - assert(ptr != 0); + __goblint_check(ptr == 1); //UNKNOWN! + __goblint_check(ptr != 0); int f= 38; } } diff --git a/tests/regression/01-cpa/35-intervals.c b/tests/regression/01-cpa/35-intervals.c index c9747d5eb8..a3b7f8cb9d 100644 --- a/tests/regression/01-cpa/35-intervals.c +++ b/tests/regression/01-cpa/35-intervals.c @@ -4,11 +4,11 @@ void main(){ int n = 7; for (; n; n--) { - assert(n==1); // UNKNOWN! + __goblint_check(n==1); // UNKNOWN! } int i; if(i-1){ - assert(i==2); // UNKNOWN! + __goblint_check(i==2); // UNKNOWN! } return; } diff --git a/tests/regression/01-cpa/36-interval-branching.c b/tests/regression/01-cpa/36-interval-branching.c index eb59b0042e..d3bd67bfff 100644 --- a/tests/regression/01-cpa/36-interval-branching.c +++ b/tests/regression/01-cpa/36-interval-branching.c @@ -4,9 +4,9 @@ int main(){ int i; if(i<0){ - assert(i<0); + __goblint_check(i<0); } else { - assert(i>=0); + __goblint_check(i>=0); } return 0; } diff --git a/tests/regression/01-cpa/37-div.c b/tests/regression/01-cpa/37-div.c index a4730355a9..8d13c6b4c3 100644 --- a/tests/regression/01-cpa/37-div.c +++ b/tests/regression/01-cpa/37-div.c @@ -29,7 +29,7 @@ int main(void) { // z = 7; // } while_beak: - assert(i == 3); + __goblint_check(i == 3); @@ -45,6 +45,6 @@ int main(void) { r = 2; } - assert(r == 1); //FAIL - assert(r == 2); + __goblint_check(r == 1); //FAIL + __goblint_check(r == 2); } diff --git a/tests/regression/01-cpa/39-interval-and-enums.c b/tests/regression/01-cpa/39-interval-and-enums.c index b748bdc34a..ab08bcba1c 100644 --- a/tests/regression/01-cpa/39-interval-and-enums.c +++ b/tests/regression/01-cpa/39-interval-and-enums.c @@ -11,22 +11,22 @@ int main () { int true = 42; if (x){ - assert(x != 0); + __goblint_check(x != 0); } else { - assert(x == 0); + __goblint_check(x == 0); } - assert(!! true); - assert(! false); + __goblint_check(!! true); + __goblint_check(! false); if (a){ a = a; } else - assert(0); // NOWARN + __goblint_check(0); // NOWARN if (!a) - assert(0); // NOWARN + __goblint_check(0); // NOWARN else a = a; @@ -38,24 +38,24 @@ int main () { b = 8; } - assert(a); - assert(a!=b); //UNKNOWN - assert(a<10); - assert(a<=9); - assert(!(a<8)); - assert(a==8); //UNKNOWN - assert(b>7); - assert(b>=8); - assert(!(a>9)); - assert(b==8); //UNKNOWN + __goblint_check(a); + __goblint_check(a!=b); //UNKNOWN + __goblint_check(a<10); + __goblint_check(a<=9); + __goblint_check(!(a<8)); + __goblint_check(a==8); //UNKNOWN + __goblint_check(b>7); + __goblint_check(b>=8); + __goblint_check(!(a>9)); + __goblint_check(b==8); //UNKNOWN for(x = 0; x < 10; x++){ - assert(x >= 0); + __goblint_check(x >= 0); // Because the false branch remained unreachable for more iterations, the analysis behaved differently, meaning // with ana.int.enums enabled, we didn't know (x >= 0) here - assert(x <= 9); + __goblint_check(x <= 9); } - assert(x == 10); + __goblint_check(x == 10); if (0 <= w) { @@ -67,7 +67,7 @@ int main () { if (w > 0) { - assert(1); + __goblint_check(1); } return 0; diff --git a/tests/regression/01-cpa/40-arithm.c b/tests/regression/01-cpa/40-arithm.c index 4bfd800ee6..dd9f13f989 100644 --- a/tests/regression/01-cpa/40-arithm.c +++ b/tests/regression/01-cpa/40-arithm.c @@ -11,7 +11,7 @@ int main(){ if(top != 3){ result = top * MULT; // if top == 7 then we have (2 + 1) * 2^30 == (4 + 2 + 1) * 2^30 (mod 2^32) - assert(result != 3221225472); // UNKNOWN! + __goblint_check(result != 3221225472); // UNKNOWN! printf("%u\n", result); } return result; diff --git a/tests/regression/01-cpa/41-cast_in_equal_comp.c b/tests/regression/01-cpa/41-cast_in_equal_comp.c index 9dcd189b3a..889f4d15a7 100644 --- a/tests/regression/01-cpa/41-cast_in_equal_comp.c +++ b/tests/regression/01-cpa/41-cast_in_equal_comp.c @@ -10,5 +10,5 @@ int main(){ // Unreachable x = 12; } - assert(x== -32); + __goblint_check(x== -32); } diff --git a/tests/regression/01-cpa/42-non-injective-mult-def-exc.c b/tests/regression/01-cpa/42-non-injective-mult-def-exc.c index 5c6588e5a2..b62cf90803 100644 --- a/tests/regression/01-cpa/42-non-injective-mult-def-exc.c +++ b/tests/regression/01-cpa/42-non-injective-mult-def-exc.c @@ -10,6 +10,6 @@ int main() { } x = top * 1073741824u; - assert(x != 3221225472u); // UNKNOWN! + __goblint_check(x != 3221225472u); // UNKNOWN! return 0; } diff --git a/tests/regression/01-cpa/43-large-n-div.c b/tests/regression/01-cpa/43-large-n-div.c index c985e53078..835863cfd0 100644 --- a/tests/regression/01-cpa/43-large-n-div.c +++ b/tests/regression/01-cpa/43-large-n-div.c @@ -11,8 +11,8 @@ int main(){ if(z == 4){ // Should be reachable - assert(1); + __goblint_check(1); } - assert(z == 4); + __goblint_check(z == 4); } diff --git a/tests/regression/01-cpa/44-large-n-div2.c b/tests/regression/01-cpa/44-large-n-div2.c index 77c828d0bc..17e88bd1ee 100644 --- a/tests/regression/01-cpa/44-large-n-div2.c +++ b/tests/regression/01-cpa/44-large-n-div2.c @@ -16,8 +16,8 @@ int main(){ if(z == 4){ // Should be reachable - assert(1); + __goblint_check(1); } - assert(z == 4); + __goblint_check(z == 4); } diff --git a/tests/regression/01-cpa/45-float.c b/tests/regression/01-cpa/45-float.c index cffe8c6900..18d5d11cb9 100644 --- a/tests/regression/01-cpa/45-float.c +++ b/tests/regression/01-cpa/45-float.c @@ -1,4 +1,4 @@ -// PARAM: --enable ana.int.interval --enable ana.int.def_exc --enable ana.sv-comp.functions --set ana.activated "['base','threadid','threadflag','mallocWrapper','var_eq','region','expRelation']" --set ana.base.privatization none +// PARAM: --enable ana.int.interval --enable ana.int.def_exc --enable ana.sv-comp.functions --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert','var_eq','region','expRelation']" --set ana.base.privatization none #include int isNan(float arg) { @@ -12,15 +12,15 @@ int main(){ float top; // float may be NaN here, therefore the comaprison should be unknown - assert(top == top); //UNKNOWN! - assert(s.f == s.f); //UNKNOWN! - assert(fs[1] == fs[1]); //UNKNOWN! + __goblint_check(top == top); //UNKNOWN! + __goblint_check(s.f == s.f); //UNKNOWN! + __goblint_check(fs[1] == fs[1]); //UNKNOWN! int r = isNan(top); if(r) { - assert(1); + __goblint_check(1); } else { - assert(1); + __goblint_check(1); } } diff --git a/tests/regression/01-cpa/46-funptr_path.c b/tests/regression/01-cpa/46-funptr_path.c index 5457393e3e..654eb0fcf3 100644 --- a/tests/regression/01-cpa/46-funptr_path.c +++ b/tests/regression/01-cpa/46-funptr_path.c @@ -6,11 +6,11 @@ extern int __VERIFIER_nondet_int(); pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; void fun1() { - assert(0); // FAIL + __goblint_check(0); // FAIL } void fun2() { - assert(0); // FAIL + __goblint_check(0); // FAIL } int main() { diff --git a/tests/regression/01-cpa/47-posneg-signed-overflow.c b/tests/regression/01-cpa/47-posneg-signed-overflow.c index f7d78294df..9b80c162a2 100644 --- a/tests/regression/01-cpa/47-posneg-signed-overflow.c +++ b/tests/regression/01-cpa/47-posneg-signed-overflow.c @@ -5,25 +5,25 @@ int main() { int i,k,j; if (k == 5) { - assert(k == 5); + __goblint_check(k == 5); return 0; } - assert(k != 5); + __goblint_check(k != 5); // Signed overflows might occur in some of the following operations (e.g. the first assignment k could be MAX_INT). // Signed overflows are undefined behavior, so by default we go to top when they might occur. // simple arithmetic i = k + 1; - assert(i != 6); // UNKNOWN! + __goblint_check(i != 6); // UNKNOWN! i = k - 1; - assert(i != 4); // UNKNOWN! + __goblint_check(i != 4); // UNKNOWN! i = k * 3; - assert(i != 15); // UNKNOWN! + __goblint_check(i != 15); // UNKNOWN! i = k * 2; - assert(i != 10); // UNKNOWN! k could be -2147483643; + __goblint_check(i != 10); // UNKNOWN! k could be -2147483643; i = k / 2; - assert(i != 2); // UNKNOWN! k could be 4 + __goblint_check(i != 2); // UNKNOWN! k could be 4 return 0; } diff --git a/tests/regression/01-cpa/49-earlyglobs-base.c b/tests/regression/01-cpa/49-earlyglobs-base.c index 0e6280ed6f..05e6dd5595 100644 --- a/tests/regression/01-cpa/49-earlyglobs-base.c +++ b/tests/regression/01-cpa/49-earlyglobs-base.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated ["'base'","'mallocWrapper'"] --enable exp.earlyglobs --set ana.base.privatization none +// PARAM: --set ana.activated ["'base'","'mallocWrapper'","'assert'"] --enable exp.earlyglobs --set ana.base.privatization none // same as 32-earlyglobs.c but only using the base analysis instead of all default analyses // earlyglobs was unsound without the threadflag analysis // https://github.com/goblint/analyzer/issues/177 @@ -11,10 +11,10 @@ int main(void){ if(top) { g = 100; // This is only unknown because exp.earlyglobs is on - assert(g == 100); //UNKNOWN! + __goblint_check(g == 100); //UNKNOWN! } // This assert is also unknown in the concrete! - assert(g == 100); //UNKNOWN! + __goblint_check(g == 100); //UNKNOWN! return 0; } diff --git a/tests/regression/01-cpa/50-earlyglobs_precious.c b/tests/regression/01-cpa/50-earlyglobs_precious.c index eb8d2fa2d2..fa070bb78a 100644 --- a/tests/regression/01-cpa/50-earlyglobs_precious.c +++ b/tests/regression/01-cpa/50-earlyglobs_precious.c @@ -4,6 +4,6 @@ int g = 10; int main(void){ g = 100; - assert(g==100); + __goblint_check(g==100); return 0; } diff --git a/tests/regression/01-cpa/51-marshal.c b/tests/regression/01-cpa/51-marshal.c index c2b0c25c32..88b8e70614 100644 --- a/tests/regression/01-cpa/51-marshal.c +++ b/tests/regression/01-cpa/51-marshal.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','assert']" --set ana.base.privatization none void callee(int j) { j++; } diff --git a/tests/regression/01-cpa/52-escaping-recursion.c b/tests/regression/01-cpa/52-escaping-recursion.c index 2b548fe093..3f5f5240a0 100644 --- a/tests/regression/01-cpa/52-escaping-recursion.c +++ b/tests/regression/01-cpa/52-escaping-recursion.c @@ -7,18 +7,18 @@ int rec(int i,int* ptr) { if(i == 0) { rec(5,&x); // Recursive call may have modified x - assert(x == 17); //UNKNOWN! + __goblint_check(x == 17); //UNKNOWN! // If we analyse this with int contexts, there is no other x that is reachable, so this // update is strong x = 17; - assert(x == 17); + __goblint_check(x == 17); } else { x = 31; // ptr points to the outer x, it is unaffected by this assignment // and should be 17 - assert(*ptr == 31); //UNKNOWN! + __goblint_check(*ptr == 31); //UNKNOWN! if(top) { ptr = &x; @@ -26,19 +26,19 @@ int rec(int i,int* ptr) { // ptr may now point to both the inner and the outer x *ptr = 12; - assert(*ptr == 12); //UNKNOWN! - assert(x == 12); //UNKNOWN! + __goblint_check(*ptr == 12); //UNKNOWN! + __goblint_check(x == 12); //UNKNOWN! if(*ptr == 12) { - assert(x == 12); //UNKNOWN! + __goblint_check(x == 12); //UNKNOWN! } // ptr may still point to the outer instance - assert(ptr == &x); //UNKNOWN! + __goblint_check(ptr == &x); //UNKNOWN! // Another copy of x is reachable, so we are conservative and do a weak update x = 31; - assert(x == 31); // UNKNOWN + __goblint_check(x == 31); // UNKNOWN } return 0; } diff --git a/tests/regression/01-cpa/53-escaping-recursion-varEq.c b/tests/regression/01-cpa/53-escaping-recursion-varEq.c index 911580f6ee..237011b558 100644 --- a/tests/regression/01-cpa/53-escaping-recursion-varEq.c +++ b/tests/regression/01-cpa/53-escaping-recursion-varEq.c @@ -8,18 +8,18 @@ int rec(int i,int* ptr) { if(i == 0) { rec(5,&x); // Recursive call may have modified x - assert(x == 17); //UNKNOWN! + __goblint_check(x == 17); //UNKNOWN! // If we analyse this with int contexts, there is no other x that is reachable, so this // update is strong x = 17; - assert(x == 17); + __goblint_check(x == 17); } else { x = 31; // ptr points to the outer x, it is unaffected by this assignment // and should be 17 - assert(*ptr == 31); //UNKNOWN! + __goblint_check(*ptr == 31); //UNKNOWN! if(top) { ptr = &x; @@ -27,19 +27,19 @@ int rec(int i,int* ptr) { // ptr may now point to both the inner and the outer x *ptr = 12; - assert(*ptr == 12); //UNKNOWN! - assert(x == 12); //UNKNOWN! + __goblint_check(*ptr == 12); //UNKNOWN! + __goblint_check(x == 12); //UNKNOWN! if(*ptr == 12) { - assert(x == 12); //UNKNOWN! + __goblint_check(x == 12); //UNKNOWN! } // ptr may still point to the outer instance - assert(ptr == &x); //UNKNOWN! + __goblint_check(ptr == &x); //UNKNOWN! // Another copy of x is reachable, so we are conservative and do a weak update x = 31; - assert(x == 31); // UNKNOWN + __goblint_check(x == 31); // UNKNOWN } return 0; } diff --git a/tests/regression/01-cpa/54-tid-invalidate.c b/tests/regression/01-cpa/54-tid-invalidate.c index 0d7a888117..dd369239cd 100644 --- a/tests/regression/01-cpa/54-tid-invalidate.c +++ b/tests/regression/01-cpa/54-tid-invalidate.c @@ -10,11 +10,11 @@ int main() { pthread_t id2; ret = pthread_create(&id2, NULL, t_benign, NULL); - assert(ret == 17); //UNKNOWN! + __goblint_check(ret == 17); //UNKNOWN! ret = 17; ret = pthread_join(id2,NULL); - assert(ret == 17); //UNKNOWN! + __goblint_check(ret == 17); //UNKNOWN! return 0; } diff --git a/tests/regression/02-base/01-thread_creation.c b/tests/regression/02-base/01-thread_creation.c index 3b88b7c724..1363205259 100644 --- a/tests/regression/02-base/01-thread_creation.c +++ b/tests/regression/02-base/01-thread_creation.c @@ -13,21 +13,21 @@ int main() { pthread_t id; // Check that initializers are working - assert(glob1 == 0); - assert(glob2 == 9); - assert(i == 7); + __goblint_check(glob1 == 0); + __goblint_check(glob2 == 9); + __goblint_check(i == 7); // Globals are not side-effected yet glob1 = 7; - assert(glob1 == 7); + __goblint_check(glob1 == 7); // Creat the thread pthread_create(&id, NULL, t_fun, NULL); // The values should remain the same - assert(glob1 == 7); - assert(glob2 == 9); - assert(i == 7); + __goblint_check(glob1 == 7); + __goblint_check(glob2 == 9); + __goblint_check(i == 7); return 0; } diff --git a/tests/regression/02-base/02-simple_assignments.c b/tests/regression/02-base/02-simple_assignments.c index 06d8562d32..3ffd438ac5 100644 --- a/tests/regression/02-base/02-simple_assignments.c +++ b/tests/regression/02-base/02-simple_assignments.c @@ -16,15 +16,15 @@ int main() { pthread_create(&id, NULL, t_fun, NULL); // Simple assignments to only locals - assert(i == 3); + __goblint_check(i == 3); i = 9; - assert(i == 9); + __goblint_check(i == 9); // simple assignments to globals glob1 = 5; - assert(glob1 == 5); + __goblint_check(glob1 == 5); glob2 = 5; - assert(glob2 == 5); // TODO + __goblint_check(glob2 == 5); // TODO return 0; } diff --git a/tests/regression/02-base/03-pthread_join.c b/tests/regression/02-base/03-pthread_join.c index 3ac4150d1c..3d55a386e5 100644 --- a/tests/regression/02-base/03-pthread_join.c +++ b/tests/regression/02-base/03-pthread_join.c @@ -34,14 +34,14 @@ int glob2 = 7; int main() { int i = 3; pthread_t id; - assert(i == 3); + __goblint_check(i == 3); // Create the thread pthread_create(&id, NULL, t_fun, NULL); // Join the thread pthread_join(id, (void**) &i); - assert(i == 7); + __goblint_check(i == 7); printf("%d\n", i); // Create the thread 2 @@ -49,7 +49,7 @@ int main() { // Join the thread 2 pthread_join(id, (void**) &i); - assert(i == 9); + __goblint_check(i == 9); printf("%d\n", i); // Create the thread 3 @@ -57,7 +57,7 @@ int main() { // Join the thread 3 pthread_join(id, (void**) &i); - assert(i == 11); + __goblint_check(i == 11); printf("%d\n", i); // Create the thread 4 @@ -65,7 +65,7 @@ int main() { // Join the thread 4 pthread_join(id, (void**) &i); - assert(i == 13); + __goblint_check(i == 13); printf("%d\n", i); // Another test diff --git a/tests/regression/02-base/04-branched_thread_creation.c b/tests/regression/02-base/04-branched_thread_creation.c index 429bd4c394..8db5376b8c 100644 --- a/tests/regression/02-base/04-branched_thread_creation.c +++ b/tests/regression/02-base/04-branched_thread_creation.c @@ -29,12 +29,12 @@ int main() { // If we are not multi-threaded, or are not sure if we are if(k==3) {} else { // This must be reachable - assert(1); + __goblint_check(1); } } k = glob2; - assert(k == 9); + __goblint_check(k == 9); return 0; } diff --git a/tests/regression/02-base/06-side_effect1.c b/tests/regression/02-base/06-side_effect1.c index 12f9339dbd..909628b21c 100644 --- a/tests/regression/02-base/06-side_effect1.c +++ b/tests/regression/02-base/06-side_effect1.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper']" +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper','assert']" #include #include @@ -10,24 +10,24 @@ int glob3 = 9; void *t_fun(void *arg) { glob3 = 9; - assert(glob3 == 9); // UNKNOWN! + __goblint_check(glob3 == 9); // UNKNOWN! return NULL; } int main() { pthread_t id; glob3 = 9; - assert(glob3 == 9); + __goblint_check(glob3 == 9); pthread_create(&id, NULL, t_fun, NULL); glob1 = 5; - assert(glob1 == 5); + __goblint_check(glob1 == 5); glob2 = 5; - assert(glob2 == 5); // TODO + __goblint_check(glob2 == 5); // TODO glob3 = 8; - assert(glob3 == 8); // UNKNOWN! + __goblint_check(glob3 == 8); // UNKNOWN! return 0; } diff --git a/tests/regression/02-base/07-side_effect2.c b/tests/regression/02-base/07-side_effect2.c index eeb8af62b5..a265eb7f19 100644 --- a/tests/regression/02-base/07-side_effect2.c +++ b/tests/regression/02-base/07-side_effect2.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper']" +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper','assert']" #include #include @@ -10,24 +10,24 @@ int glob3 = 9; void *t_fun(void *arg) { glob3 = 8; - assert(glob3 == 8); // UNKNOWN! + __goblint_check(glob3 == 8); // UNKNOWN! return NULL; } int main() { pthread_t id; glob3 = 9; - assert(glob3 == 9); + __goblint_check(glob3 == 9); pthread_create(&id, NULL, t_fun, NULL); glob1 = 5; - assert(glob1 == 5); + __goblint_check(glob1 == 5); glob2 = 5; - assert(glob2 == 5); // TODO + __goblint_check(glob2 == 5); // TODO glob3 = 9; - assert(glob3 == 9); // UNKNOWN! + __goblint_check(glob3 == 9); // UNKNOWN! return 0; } diff --git a/tests/regression/02-base/08-glob_interval.c b/tests/regression/02-base/08-glob_interval.c index 75991f6d28..4270453a9c 100644 --- a/tests/regression/02-base/08-glob_interval.c +++ b/tests/regression/02-base/08-glob_interval.c @@ -16,21 +16,21 @@ int main() { int i = 3; pthread_t id; - assert(glob == 0); + __goblint_check(glob == 0); // Create the thread pthread_create(&id, NULL, t_fun, NULL); // Simple assignments to only locals - assert(i == 3); + __goblint_check(i == 3); i = 9; - assert(i == 9); + __goblint_check(i == 9); glob = 10; i = glob; - assert(i >= 0); - assert(i > 100); // UNKNOWN + __goblint_check(i >= 0); + __goblint_check(i > 100); // UNKNOWN return 0; } diff --git a/tests/regression/02-base/09-ambigpointer.c b/tests/regression/02-base/09-ambigpointer.c index c23d9a00f8..e9aee792cd 100644 --- a/tests/regression/02-base/09-ambigpointer.c +++ b/tests/regression/02-base/09-ambigpointer.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper']" +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper','assert']" #include #include @@ -29,13 +29,13 @@ int main() { pthread_create(&id, NULL, t_fun, NULL); k = glob1; - assert(k == 1); // UNKNOWN + __goblint_check(k == 1); // UNKNOWN k = glob2; - assert(k == 2); // UNKNOWN + __goblint_check(k == 2); // UNKNOWN k = glob3; - assert(k == 3); + __goblint_check(k == 3); return 0; } diff --git a/tests/regression/02-base/10-init_allfuns.c b/tests/regression/02-base/10-init_allfuns.c index 0d2068f506..b27e78c4dc 100644 --- a/tests/regression/02-base/10-init_allfuns.c +++ b/tests/regression/02-base/10-init_allfuns.c @@ -1,4 +1,4 @@ -// PARAM: --enable allfuns --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper']" +// PARAM: --enable allfuns --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper','assert']" #include int glob1 = 5; @@ -10,7 +10,7 @@ int f() { } int g() { - assert(glob1 == 5); - assert(glob2 == 7); + __goblint_check(glob1 == 5); + __goblint_check(glob2 == 7); return 0; } diff --git a/tests/regression/02-base/11-init_mainfun.c b/tests/regression/02-base/11-init_mainfun.c index 3319c8cecf..d5141e1395 100644 --- a/tests/regression/02-base/11-init_mainfun.c +++ b/tests/regression/02-base/11-init_mainfun.c @@ -5,7 +5,7 @@ int glob; void f() { int i = glob; - assert(i == 0); + __goblint_check(i == 0); } int main(void *arg) { diff --git a/tests/regression/02-base/12-init_otherfun.c b/tests/regression/02-base/12-init_otherfun.c index b25897a548..28982e3626 100644 --- a/tests/regression/02-base/12-init_otherfun.c +++ b/tests/regression/02-base/12-init_otherfun.c @@ -1,13 +1,13 @@ -// SKIP PARAM: --set otherfun "['f']" --set ana.activated "['base','threadid','threadflag','escape','mallocWrapper','mutex','access']" +// SKIP PARAM: --set otherfun "['f']" --set ana.activated "['base','threadid','threadflag','escape','mallocWrapper','mutex','access','assert']" int glob1 = 5; int g() { - assert(glob1 == 5); + __goblint_check(glob1 == 5); return 0; } int main() { - assert(glob1 == 5); + __goblint_check(glob1 == 5); return 0; } diff --git a/tests/regression/02-base/20-malloc_int.c b/tests/regression/02-base/20-malloc_int.c index 5b859a3d06..16917e1448 100644 --- a/tests/regression/02-base/20-malloc_int.c +++ b/tests/regression/02-base/20-malloc_int.c @@ -9,12 +9,12 @@ int main() { *x = 0; *y = 1; - assert(*x == 0); - assert(*y == 1); + __goblint_check(*x == 0); + __goblint_check(*y == 1); p = x; x = y; y = p; - assert(*x == 1); - assert(*y == 0); + __goblint_check(*x == 1); + __goblint_check(*y == 0); return 0; } diff --git a/tests/regression/02-base/21-malloc_loop.c b/tests/regression/02-base/21-malloc_loop.c index de3f1a914b..c1d4339d84 100644 --- a/tests/regression/02-base/21-malloc_loop.c +++ b/tests/regression/02-base/21-malloc_loop.c @@ -10,7 +10,7 @@ int main() { *x[3] = 50; *x[7] = 100; - assert(*x[8] == 100); // UNKNOWN + __goblint_check(*x[8] == 100); // UNKNOWN return 0; } diff --git a/tests/regression/02-base/22-malloc_glob.c b/tests/regression/02-base/22-malloc_glob.c index fe7d610dc3..14a3d9f2e1 100644 --- a/tests/regression/02-base/22-malloc_glob.c +++ b/tests/regression/02-base/22-malloc_glob.c @@ -12,12 +12,12 @@ int main() { *x = 0; *y = 1; - assert(*x == 0); - assert(*y == 1); + __goblint_check(*x == 0); + __goblint_check(*y == 1); p = x; x = y; y = p; - assert(*x == 1); - assert(*y == 0); + __goblint_check(*x == 1); + __goblint_check(*y == 0); return 0; } diff --git a/tests/regression/02-base/23-malloc_globmt.c b/tests/regression/02-base/23-malloc_globmt.c index 66b8eb0047..c5a4c4e596 100644 --- a/tests/regression/02-base/23-malloc_globmt.c +++ b/tests/regression/02-base/23-malloc_globmt.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper']" +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper','assert']" #include #include #include @@ -20,13 +20,13 @@ int main() { *x = 0; *y = 1; - assert(*x == 0); - assert(*y == 1); + __goblint_check(*x == 0); + __goblint_check(*y == 1); pthread_create(&id, NULL, t_fun, NULL); - assert(*x == 0); // UNKNOWN - assert(*y == 1); + __goblint_check(*x == 0); // UNKNOWN + __goblint_check(*y == 1); return 0; } diff --git a/tests/regression/02-base/29-bot_vals.c b/tests/regression/02-base/29-bot_vals.c index a1c1dc9158..0db8656126 100644 --- a/tests/regression/02-base/29-bot_vals.c +++ b/tests/regression/02-base/29-bot_vals.c @@ -9,13 +9,13 @@ int main(void) { if (unknown){ x = atoi("10"); } - assert(x); // UNKNOWN + __goblint_check(x); // UNKNOWN // x = 8; // if (unknown) // x = y[0]; // -// assert(x != 8); +// __goblint_check(x != 8); return 0; } \ No newline at end of file diff --git a/tests/regression/02-base/30-escape_sound.c b/tests/regression/02-base/30-escape_sound.c index 1e72a4d044..a6422c4118 100644 --- a/tests/regression/02-base/30-escape_sound.c +++ b/tests/regression/02-base/30-escape_sound.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper']" +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper','assert']" #include #include @@ -8,19 +8,19 @@ void *t_fun(void *arg) { int *p = (int *) arg; int x = 10; (*p) = x; - assert(x == 10); + __goblint_check(x == 10); x = *p; - assert(x == 10); //UNKNOWN! + __goblint_check(x == 10); //UNKNOWN! return NULL; } int main(void) { pthread_t id; int i = 5; - assert(i == 5); + __goblint_check(i == 5); pthread_create(&id, NULL, t_fun, (void *) &i); i = 7; - assert(i == 7); //UNKNOWN! + __goblint_check(i == 7); //UNKNOWN! pthread_join (id, NULL); return 0; } diff --git a/tests/regression/02-base/33-assert-infinite-loop.c b/tests/regression/02-base/33-assert-infinite-loop.c index ec0a4e98b3..99bbeff554 100644 --- a/tests/regression/02-base/33-assert-infinite-loop.c +++ b/tests/regression/02-base/33-assert-infinite-loop.c @@ -1,12 +1,12 @@ -// PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.activated "['base','threadid','threadflag','mallocWrapper']" --set ana.base.privatization none -// This is a pattern we saw in some examples for SVCOMP, where instead of the assert(0) there was a call to verifier error. +// PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert']" --set ana.base.privatization none +// This is a pattern we saw in some examples for SVCOMP, where instead of the __goblint_check(0) there was a call to verifier error. // Because of the demand-driven nature of our solvers, we never looked at the code inside fail since there is no edge from the loop to the endpoint of f. -// However, the assert(0) (verifier error) is still reachable from main. +// However, the __goblint_check(0) (verifier error) is still reachable from main. #include void f(void) { fail: - assert(0); //FAIL + __goblint_check(0); //FAIL goto fail; } diff --git a/tests/regression/02-base/35-calloc_array.c b/tests/regression/02-base/35-calloc_array.c index 7d63e733cb..b95d429825 100644 --- a/tests/regression/02-base/35-calloc_array.c +++ b/tests/regression/02-base/35-calloc_array.c @@ -6,14 +6,14 @@ int main(void) { int *r = calloc(5,sizeof(int)); - assert(r[0] == 0); + __goblint_check(r[0] == 0); r[0] = 3; - assert(r[0] == 3); //UNKNOWN + __goblint_check(r[0] == 3); //UNKNOWN int z = r[1]; - assert(z == 0); //UNKNOWN - assert(z != 365); + __goblint_check(z == 0); //UNKNOWN + __goblint_check(z != 365); } diff --git a/tests/regression/02-base/36-calloc_struct.c b/tests/regression/02-base/36-calloc_struct.c index b99a03c367..43e13ac2c6 100644 --- a/tests/regression/02-base/36-calloc_struct.c +++ b/tests/regression/02-base/36-calloc_struct.c @@ -17,26 +17,26 @@ int main(void) { data e = {.x = 0, .y = 0}; - assert(d->x == e.x); - assert(d->y == e.y); + __goblint_check(d->x == e.x); + __goblint_check(d->y == e.y); int a = d -> x; int b = d -> y; - assert(a != 3); - assert(b != 4); + __goblint_check(a != 3); + __goblint_check(b != 4); d -> x = 3; d -> y = 4; data f = {.x = 3, .y = 3}; - assert(d->x == f.x); //UNKNOWN - assert(d->y == f.y); //UNKNOWN + __goblint_check(d->x == f.x); //UNKNOWN + __goblint_check(d->y == f.y); //UNKNOWN a = d -> x; b = d -> y; - assert(a == 3); //UNKNOWN - assert(b == 4); //UNKNOWN + __goblint_check(a == 3); //UNKNOWN + __goblint_check(b == 4); //UNKNOWN } diff --git a/tests/regression/02-base/37-calloc_glob.c b/tests/regression/02-base/37-calloc_glob.c index 8637746883..86cbfed651 100644 --- a/tests/regression/02-base/37-calloc_glob.c +++ b/tests/regression/02-base/37-calloc_glob.c @@ -16,12 +16,12 @@ int main() { *x = 0; *y = 1; - assert(*x == 0); - assert(*y == 1); //UNKNOWN + __goblint_check(*x == 0); + __goblint_check(*y == 1); //UNKNOWN p = x; x = y; y = p; - assert(*x == 1); //UNKNOWN - assert(*y == 0); + __goblint_check(*x == 1); //UNKNOWN + __goblint_check(*y == 0); return 0; } diff --git a/tests/regression/02-base/38-calloc_int.c b/tests/regression/02-base/38-calloc_int.c index 496ea6e6fb..37d6dcdfa5 100644 --- a/tests/regression/02-base/38-calloc_int.c +++ b/tests/regression/02-base/38-calloc_int.c @@ -7,13 +7,13 @@ int main(void) { r[0] = 0; - assert(r[0] != 5); - assert(r[0] == 0); + __goblint_check(r[0] != 5); + __goblint_check(r[0] == 0); r[0] = 5; - assert(r[0] == 5); //UNKNOWN - assert(r[0] != 0); //UNKNOWN - assert(r[0] != -10); - assert(r[0] != 100); + __goblint_check(r[0] == 5); //UNKNOWN + __goblint_check(r[0] != 0); //UNKNOWN + __goblint_check(r[0] != -10); + __goblint_check(r[0] != 100); } diff --git a/tests/regression/02-base/39-calloc_matrix.c b/tests/regression/02-base/39-calloc_matrix.c index 3923f88983..da05f092ab 100644 --- a/tests/regression/02-base/39-calloc_matrix.c +++ b/tests/regression/02-base/39-calloc_matrix.c @@ -8,5 +8,5 @@ int main(void) { r[0][1] = 3; int* z = &r[0][1]; - assert(*z == 3); //UNKNOWN + __goblint_check(*z == 3); //UNKNOWN } diff --git a/tests/regression/02-base/40-calloc_loop.c b/tests/regression/02-base/40-calloc_loop.c index 99482f23b2..d7a9d5637c 100644 --- a/tests/regression/02-base/40-calloc_loop.c +++ b/tests/regression/02-base/40-calloc_loop.c @@ -13,7 +13,7 @@ int main() { *x[3] = 50; *x[7] = 100; - assert(*x[8] == 100); // UNKNOWN + __goblint_check(*x[8] == 100); // UNKNOWN return 0; } diff --git a/tests/regression/02-base/41-calloc_globmt.c b/tests/regression/02-base/41-calloc_globmt.c index 7445dc1b85..a29a26a0c1 100644 --- a/tests/regression/02-base/41-calloc_globmt.c +++ b/tests/regression/02-base/41-calloc_globmt.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper']" --set ana.int.interval true --set ana.base.arrays.domain partitioned +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper','assert']" --set ana.int.interval true --set ana.base.arrays.domain partitioned #include #include #include @@ -20,13 +20,13 @@ int main() { *x = 0; *y = 1; - assert(*x == 0); - assert(*y == 1); // UNKNOWN + __goblint_check(*x == 0); + __goblint_check(*y == 1); // UNKNOWN pthread_create(&id, NULL, t_fun, NULL); - assert(*x == 0); // UNKNOWN - assert(*y == 1); // UNKNOWN + __goblint_check(*x == 0); // UNKNOWN + __goblint_check(*y == 1); // UNKNOWN return 0; } diff --git a/tests/regression/02-base/42-calloc_zero_init.c b/tests/regression/02-base/42-calloc_zero_init.c index d8485defd0..9310ee725b 100644 --- a/tests/regression/02-base/42-calloc_zero_init.c +++ b/tests/regression/02-base/42-calloc_zero_init.c @@ -5,9 +5,9 @@ int main(void) { int *ro = calloc(2,sizeof(int)); - assert(ro[0] == 0); - assert(ro[1] == 0); + __goblint_check(ro[0] == 0); + __goblint_check(ro[1] == 0); ro[0] = 3; - assert(ro[1] != 3); //UNKNOWN + __goblint_check(ro[1] != 3); //UNKNOWN } diff --git a/tests/regression/02-base/43-calloc_struct_array.c b/tests/regression/02-base/43-calloc_struct_array.c index f8ff8eefc6..671846ca73 100644 --- a/tests/regression/02-base/43-calloc_struct_array.c +++ b/tests/regression/02-base/43-calloc_struct_array.c @@ -16,5 +16,5 @@ int main(void) { struct h *b = a+1; a->a[1] = 3; int* ptr = &(b->a[1]); - assert(*ptr == 3); //UNKNOWN + __goblint_check(*ptr == 3); //UNKNOWN } diff --git a/tests/regression/02-base/44-malloc_array.c b/tests/regression/02-base/44-malloc_array.c index e9a48fd220..bb2b5b7f2c 100644 --- a/tests/regression/02-base/44-malloc_array.c +++ b/tests/regression/02-base/44-malloc_array.c @@ -7,7 +7,7 @@ int main(void) { r[3] = 2; - assert(r[4] == 2); + __goblint_check(r[4] == 2); /* Here we only test our implementation. Concretely, accessing the uninitialised r[4] is undefined behavior. In our implementation we keep the whole memory allocated by malloc as one Blob and the whole Blob contains 2 after it was assigned to r[3]. This is more useful than keeping the Blob unknown. */ diff --git a/tests/regression/02-base/45-branched_thread_creation_return.c b/tests/regression/02-base/45-branched_thread_creation_return.c index 18cffae4d2..c421a013ad 100644 --- a/tests/regression/02-base/45-branched_thread_creation_return.c +++ b/tests/regression/02-base/45-branched_thread_creation_return.c @@ -29,12 +29,12 @@ int main() { // If we are not multi-threaded, or are not sure if we are if(k==3) {} else { // This must be reachable - assert(1); + __goblint_check(1); } } k = glob2; - assert(k == 9); + __goblint_check(k == 9); // This would cause glob1=4 side effect to disappear // if it's side-effected only on return. diff --git a/tests/regression/02-base/46-spawn-global-funptrs.c b/tests/regression/02-base/46-spawn-global-funptrs.c index 3e94b49a77..c4c259e86c 100644 --- a/tests/regression/02-base/46-spawn-global-funptrs.c +++ b/tests/regression/02-base/46-spawn-global-funptrs.c @@ -2,11 +2,11 @@ #include void foo() { - assert(1); // assert reachable + __goblint_check(1); // assert reachable } void bar() { - assert(1); // assert reachable + __goblint_check(1); // assert reachable } void (*funs[2])() = { diff --git a/tests/regression/02-base/47-no-threadescape.c b/tests/regression/02-base/47-no-threadescape.c index a1abfd8d0e..a894e7f957 100644 --- a/tests/regression/02-base/47-no-threadescape.c +++ b/tests/regression/02-base/47-no-threadescape.c @@ -17,6 +17,6 @@ int main(void){ pthread_create(&tid, NULL, t, (void *)&l); pthread_join(tid, NULL); - assert(l==42); //UNKNOWN! + __goblint_check(l==42); //UNKNOWN! return 0; } diff --git a/tests/regression/02-base/48-unknown_func_struct.c b/tests/regression/02-base/48-unknown_func_struct.c index 800304babb..455a33a3c3 100644 --- a/tests/regression/02-base/48-unknown_func_struct.c +++ b/tests/regression/02-base/48-unknown_func_struct.c @@ -24,10 +24,10 @@ int main(){ // When passing a struct to an unknown function, reachable memory should be invalidated mutate_list(first); - assert(second.val == 2); //UNKNOWN! + __goblint_check(second.val == 2); //UNKNOWN! // Passing a pointer to the struct here. mutate_list2(&first); - assert(second.val == 2); //UNKNOWN! + __goblint_check(second.val == 2); //UNKNOWN! return 0; } diff --git a/tests/regression/02-base/49-unknown_func_union.c b/tests/regression/02-base/49-unknown_func_union.c index 499ccd1612..c7d1c7e231 100644 --- a/tests/regression/02-base/49-unknown_func_union.c +++ b/tests/regression/02-base/49-unknown_func_union.c @@ -33,6 +33,6 @@ int main(){ // When passing a union to an unknown function, reachable memory should be invalidated mutate_either(e); - assert(second.val == 2); //UNKNOWN! + __goblint_check(second.val == 2); //UNKNOWN! return 0; } diff --git a/tests/regression/02-base/50-unknown_func_array.c b/tests/regression/02-base/50-unknown_func_array.c index 0471850df4..e94b46d6b2 100644 --- a/tests/regression/02-base/50-unknown_func_array.c +++ b/tests/regression/02-base/50-unknown_func_array.c @@ -26,6 +26,6 @@ int main(){ // When passing an arrays to an unknown function, reachable memory should be invalidated mutate_array(a); - assert(xs[0] == 0); //UNKNOWN! + __goblint_check(xs[0] == 0); //UNKNOWN! return 0; } diff --git a/tests/regression/02-base/51-spawn-special.c b/tests/regression/02-base/51-spawn-special.c index 9ba39cb751..8c2ef172e8 100644 --- a/tests/regression/02-base/51-spawn-special.c +++ b/tests/regression/02-base/51-spawn-special.c @@ -8,6 +8,6 @@ int main() { pthread_t id; pthread_create(&id, NULL, magic, NULL); - assert(g == 0); // UNKNOWN! (magic may invalidate) + __goblint_check(g == 0); // UNKNOWN! (magic may invalidate) return 0; } diff --git a/tests/regression/02-base/52-otherfun-special.c b/tests/regression/02-base/52-otherfun-special.c index f208d02d51..589ea0243e 100644 --- a/tests/regression/02-base/52-otherfun-special.c +++ b/tests/regression/02-base/52-otherfun-special.c @@ -6,6 +6,6 @@ extern void* magic(void* arg); int g; int main() { - assert(g == 0); // UNKNOWN! (magic may invalidate) + __goblint_check(g == 0); // UNKNOWN! (magic may invalidate) return 0; } diff --git a/tests/regression/02-base/53-spawn-special-arg.c b/tests/regression/02-base/53-spawn-special-arg.c index 693758bf99..377bd9d353 100644 --- a/tests/regression/02-base/53-spawn-special-arg.c +++ b/tests/regression/02-base/53-spawn-special-arg.c @@ -8,6 +8,6 @@ int main() { pthread_t id; pthread_create(&id, NULL, magic, &x); - assert(x == 0); // UNKNOWN! (magic may invalidate) + __goblint_check(x == 0); // UNKNOWN! (magic may invalidate) return 0; } diff --git a/tests/regression/02-base/54-spawn-special-unknown.c b/tests/regression/02-base/54-spawn-special-unknown.c index 7ecf142f39..cc8aa3c8d7 100644 --- a/tests/regression/02-base/54-spawn-special-unknown.c +++ b/tests/regression/02-base/54-spawn-special-unknown.c @@ -9,6 +9,6 @@ int main() { pthread_t id; pthread_create(&id, NULL, unknown, NULL); - assert(g == 0); // UNKNOWN! (unknown thread may invalidate) + __goblint_check(g == 0); // UNKNOWN! (unknown thread may invalidate) return 0; } diff --git a/tests/regression/02-base/55-printf-n.c b/tests/regression/02-base/55-printf-n.c index 1bc442a8dc..b175c96204 100644 --- a/tests/regression/02-base/55-printf-n.c +++ b/tests/regression/02-base/55-printf-n.c @@ -5,7 +5,7 @@ int main() { int written = 0; printf("foo%n\n", &written); // invalidates written by setting written = 3 - assert(written != 0); // TODO (fail means written == 0, which is unsound) + __goblint_check(written != 0); // TODO (fail means written == 0, which is unsound) printf("%d\n", written); return 0; diff --git a/tests/regression/02-base/56-printf-ptr.c b/tests/regression/02-base/56-printf-ptr.c index 839dc79b47..d1e92cf63e 100644 --- a/tests/regression/02-base/56-printf-ptr.c +++ b/tests/regression/02-base/56-printf-ptr.c @@ -4,6 +4,6 @@ int main() { int x = 42; printf("&x = %p\n", &x); // doesn't invalidate x despite taking address - assert(x == 42); + __goblint_check(x == 42); return 0; } diff --git a/tests/regression/02-base/58-empty-not-dead.c b/tests/regression/02-base/58-empty-not-dead.c index 2ddbaecaae..9cc8a03f0e 100644 --- a/tests/regression/02-base/58-empty-not-dead.c +++ b/tests/regression/02-base/58-empty-not-dead.c @@ -1,10 +1,10 @@ -//PARAM: --set ana.activated '["base", "mallocWrapper"]' --set ana.base.privatization none +//PARAM: --set ana.activated '["base", "mallocWrapper", "assert"]' --set ana.base.privatization none // Copied & modified from 33/04. #include int main() { // state: {bot}, because no locals/globals - assert(1); // state: {bot}, because Hoare set add (in PathSensitive2 map) keeps bot, while reduce would remove - assert(1); // state: {bot}, because Hoare set add (in PathSensitive2 map) keeps bot, while reduce would remove + __goblint_check(1); // state: {bot}, because Hoare set add (in PathSensitive2 map) keeps bot, while reduce would remove + __goblint_check(1); // state: {bot}, because Hoare set add (in PathSensitive2 map) keeps bot, while reduce would remove return 0; } diff --git a/tests/regression/02-base/59-evalint-deep.c b/tests/regression/02-base/59-evalint-deep.c index 537c919af0..e5b9786793 100644 --- a/tests/regression/02-base/59-evalint-deep.c +++ b/tests/regression/02-base/59-evalint-deep.c @@ -19,7 +19,7 @@ int main() { c = 0; while (1) { - assert(-2*y*y*y*y*y*y - 6 * y*y*y*y*y - 5 * y*y*y*y + y*y + 12*x == 0); // UNKNOWN (by design) + __goblint_check(-2*y*y*y*y*y*y - 6 * y*y*y*y*y - 5 * y*y*y*y + y*y + 12*x == 0); // UNKNOWN (by design) if (!(c < k)) break; @@ -29,7 +29,7 @@ int main() { x = y * y * y * y * y + x; } - assert(-2*y*y*y*y*y*y - 6 * y*y*y*y*y - 5 * y*y*y*y + y*y + 12*x == 0); // UNKNOWN (by design) - assert(k*y == y*y); // UNKNOWN (by design) + __goblint_check(-2*y*y*y*y*y*y - 6 * y*y*y*y*y - 5 * y*y*y*y + y*y + 12*x == 0); // UNKNOWN (by design) + __goblint_check(k*y == y*y); // UNKNOWN (by design) return 0; } diff --git a/tests/regression/02-base/60-malloc-nonrefl.c b/tests/regression/02-base/60-malloc-nonrefl.c index 891fb1986c..c4ef0d41ff 100644 --- a/tests/regression/02-base/60-malloc-nonrefl.c +++ b/tests/regression/02-base/60-malloc-nonrefl.c @@ -11,15 +11,15 @@ int main() { int* ptr2 = malloc_2(sizeof(int)); // will fail in the concrete - assert(ptr1==ptr2); // UNKNOWN + __goblint_check(ptr1==ptr2); // UNKNOWN // CIL turns this into the following - assert((unsigned long) ptr1 == (unsigned long) ptr2); // UNKNOWN + __goblint_check((unsigned long) ptr1 == (unsigned long) ptr2); // UNKNOWN // Here, we do not claim it holds, as we cast our abstract values to the type for ints on assignment int i1 = (int)ptr1; int i2 = (int)ptr2; - assert(i1 == i2); // UNKNOWN! + __goblint_check(i1 == i2); // UNKNOWN! return 0; } diff --git a/tests/regression/02-base/61-no-int-context.c b/tests/regression/02-base/61-no-int-context.c index 332a4931c5..81a35288af 100644 --- a/tests/regression/02-base/61-no-int-context.c +++ b/tests/regression/02-base/61-no-int-context.c @@ -10,6 +10,6 @@ int f(int x) { int main () { int a = f(1); - assert(!a); + __goblint_check(!a); return 0; } diff --git a/tests/regression/02-base/62-no-int-context-attribute.c b/tests/regression/02-base/62-no-int-context-attribute.c index 34fb5bbaea..83031c5758 100644 --- a/tests/regression/02-base/62-no-int-context-attribute.c +++ b/tests/regression/02-base/62-no-int-context-attribute.c @@ -11,6 +11,6 @@ int f(int x) { int main () { int a = f(1); - assert(!a); + __goblint_check(!a); return 0; } diff --git a/tests/regression/02-base/63-int-context-attribute.c b/tests/regression/02-base/63-int-context-attribute.c index 06bd7bc45c..a44ce9c54f 100644 --- a/tests/regression/02-base/63-int-context-attribute.c +++ b/tests/regression/02-base/63-int-context-attribute.c @@ -11,6 +11,6 @@ int f(int x) { int main () { int a = f(10); - assert(a == 3628800); + __goblint_check(a == 3628800); return 0; } diff --git a/tests/regression/02-base/65-no-eval-on-write.c b/tests/regression/02-base/65-no-eval-on-write.c index 0546d0698f..a1c70ad9d5 100644 --- a/tests/regression/02-base/65-no-eval-on-write.c +++ b/tests/regression/02-base/65-no-eval-on-write.c @@ -18,7 +18,7 @@ void bar() { int main() { foo(); bar(); - assert(glob >= 1); - assert(glob <= 10); + __goblint_check(glob >= 1); + __goblint_check(glob <= 10); return 0; } diff --git a/tests/regression/02-base/66-no-eval-on-write-multi.c b/tests/regression/02-base/66-no-eval-on-write-multi.c index f438a35668..2390cc94c9 100644 --- a/tests/regression/02-base/66-no-eval-on-write-multi.c +++ b/tests/regression/02-base/66-no-eval-on-write-multi.c @@ -29,7 +29,7 @@ int main() { bar(); pthread_mutex_unlock(&mutex); pthread_join(t, NULL); - assert(glob >= 1); - assert(glob <= 10); + __goblint_check(glob >= 1); + __goblint_check(glob <= 10); return 0; } diff --git a/tests/regression/02-base/67-no-int-context-option.c b/tests/regression/02-base/67-no-int-context-option.c index 574f2ce88a..221c0819ef 100644 --- a/tests/regression/02-base/67-no-int-context-option.c +++ b/tests/regression/02-base/67-no-int-context-option.c @@ -10,6 +10,6 @@ int f(int x) { int main () { int a = f(1); - assert(!a); + __goblint_check(!a); return 0; } diff --git a/tests/regression/02-base/68-int-context-option.c b/tests/regression/02-base/68-int-context-option.c index 251a58030a..b0f9517890 100644 --- a/tests/regression/02-base/68-int-context-option.c +++ b/tests/regression/02-base/68-int-context-option.c @@ -10,6 +10,6 @@ int f(int x) { int main () { int a = f(10); - assert(a == 3628800); + __goblint_check(a == 3628800); return 0; } diff --git a/tests/regression/02-base/70-escape-unknown.c b/tests/regression/02-base/70-escape-unknown.c index 6f10598cd4..ce7aa0a33c 100644 --- a/tests/regression/02-base/70-escape-unknown.c +++ b/tests/regression/02-base/70-escape-unknown.c @@ -22,7 +22,7 @@ int main() { pthread_create(&id2, NULL, t_fun, p); // i should escape, even if p contains unknown - assert(i == 5); // UNKNOWN! + __goblint_check(i == 5); // UNKNOWN! return 0; } \ No newline at end of file diff --git a/tests/regression/02-base/71-pthread-once.c b/tests/regression/02-base/71-pthread-once.c index 9da4a0f9ee..b2f408d07f 100644 --- a/tests/regression/02-base/71-pthread-once.c +++ b/tests/regression/02-base/71-pthread-once.c @@ -6,7 +6,7 @@ int g; pthread_once_t once = PTHREAD_ONCE_INIT; void t_fun() { - assert(1); // reachable! + __goblint_check(1); // reachable! return NULL; } diff --git a/tests/regression/02-base/74-pcwd-deref-unknown-fp.c b/tests/regression/02-base/74-pcwd-deref-unknown-fp.c index 5ffd1fe5a6..34b3cf80fc 100644 --- a/tests/regression/02-base/74-pcwd-deref-unknown-fp.c +++ b/tests/regression/02-base/74-pcwd-deref-unknown-fp.c @@ -49,7 +49,7 @@ void call_cdev_functions() // concrete program void pcwd_ioctl() { - assert(1); // reachable + __goblint_check(1); // reachable } static const struct file_operations pcwd_fops = { diff --git a/tests/regression/02-base/75-memset.c b/tests/regression/02-base/75-memset.c index a143a77833..47c60c934f 100644 --- a/tests/regression/02-base/75-memset.c +++ b/tests/regression/02-base/75-memset.c @@ -9,19 +9,19 @@ struct s { int main() { int x; memset(&x, 0, sizeof(int)); - assert(x == 0); + __goblint_check(x == 0); memset(&x, x, sizeof(int)); - assert(x == 0); + __goblint_check(x == 0); memset(&x, 1, sizeof(int)); - assert(x == 0); // UNKNOWN + __goblint_check(x == 0); // UNKNOWN int *p; memset(&p, 0, sizeof(int*)); - assert(p == NULL); + __goblint_check(p == NULL); struct s s; memset(&s, 0, sizeof(struct s)); - assert(s.x == 0); - assert(s.p == NULL); + __goblint_check(s.x == 0); + __goblint_check(s.p == NULL); return 0; } \ No newline at end of file diff --git a/tests/regression/02-base/76-realloc.c b/tests/regression/02-base/76-realloc.c index 3edbb3fabc..7e65b7be46 100644 --- a/tests/regression/02-base/76-realloc.c +++ b/tests/regression/02-base/76-realloc.c @@ -4,7 +4,7 @@ #include void test1_f() { - assert(1); // reachable + __goblint_check(1); // reachable } void test1() { diff --git a/tests/regression/02-base/77-chrony-sched-array.c b/tests/regression/02-base/77-chrony-sched-array.c index f51d6c6975..bbe0ba8e93 100644 --- a/tests/regression/02-base/77-chrony-sched-array.c +++ b/tests/regression/02-base/77-chrony-sched-array.c @@ -62,7 +62,7 @@ ARR_CreateInstance(unsigned int elem_size) { ARR_Instance array; - assert(elem_size > 0); + __goblint_check(elem_size > 0); array = MallocNew(struct ARR_Instance_Record); @@ -77,14 +77,14 @@ ARR_CreateInstance(unsigned int elem_size) void * ARR_GetElement(ARR_Instance array, unsigned int index) { - assert(index < array->used); // UNKNOWN + __goblint_check(index < array->used); // UNKNOWN return (void *)((char *)array->data + (size_t)index * array->elem_size); } static void realloc_array(ARR_Instance array, unsigned int min_size) { - assert(min_size <= 2 * min_size); // UNKNOWN + __goblint_check(min_size <= 2 * min_size); // UNKNOWN if (array->allocated >= min_size && array->allocated <= 2 * min_size) return; @@ -148,7 +148,7 @@ SCH_AddFileHandler /* Don't want to allow the same fd to register a handler more than once without deleting a previous association - this suggests a bug somewhere else in the program. */ - assert(!ptr->handler); // UNKNOWN + __goblint_check(!ptr->handler); // UNKNOWN ptr->handler = handler; ptr->arg = arg; @@ -169,14 +169,14 @@ dispatch_filehandlers() // stub void foo(void *arg) { - assert(1); // reachable + __goblint_check(1); // reachable } void bar(void *arg) { int *p = arg; int y = *p; - assert(1); // reachable - assert(y); // TODO + __goblint_check(1); // reachable + __goblint_check(y); // TODO } int main() { diff --git a/tests/regression/02-base/78-realloc-free.c b/tests/regression/02-base/78-realloc-free.c index a34e112a03..91ddfccdd8 100644 --- a/tests/regression/02-base/78-realloc-free.c +++ b/tests/regression/02-base/78-realloc-free.c @@ -5,7 +5,7 @@ #include void test1_f() { - assert(1); // reachable + __goblint_check(1); // reachable } void test1() { diff --git a/tests/regression/02-base/79-unknown-spawn.c b/tests/regression/02-base/79-unknown-spawn.c index 5ca45b71ab..d0cb939810 100644 --- a/tests/regression/02-base/79-unknown-spawn.c +++ b/tests/regression/02-base/79-unknown-spawn.c @@ -3,7 +3,7 @@ #include void *t_fun(void *arg) { - assert(1); // reachable + __goblint_check(1); // reachable return NULL; } diff --git a/tests/regression/02-base/80-unknown-no-spawn.c b/tests/regression/02-base/80-unknown-no-spawn.c index dfea703f7c..c823c6a1a8 100644 --- a/tests/regression/02-base/80-unknown-no-spawn.c +++ b/tests/regression/02-base/80-unknown-no-spawn.c @@ -3,7 +3,7 @@ #include void *t_fun(void *arg) { - assert(1); // NOWARN (unreachable) + __goblint_check(1); // NOWARN (unreachable) return NULL; } diff --git a/tests/regression/02-base/81-invalidate_indirect_base.c b/tests/regression/02-base/81-invalidate_indirect_base.c index 117792f91e..95ee18b3e8 100644 --- a/tests/regression/02-base/81-invalidate_indirect_base.c +++ b/tests/regression/02-base/81-invalidate_indirect_base.c @@ -12,6 +12,6 @@ struct s { int main(void) { int *p = s.p; __goblint_unknown(&s); - assert(*p == 0); + __goblint_check(*p == 0); return 0; } diff --git a/tests/regression/02-base/82-eq-no-overflow.c b/tests/regression/02-base/82-eq-no-overflow.c index 75cc5c37c2..4b71e62885 100644 --- a/tests/regression/02-base/82-eq-no-overflow.c +++ b/tests/regression/02-base/82-eq-no-overflow.c @@ -9,9 +9,9 @@ int main() { b = x == 7; // NOWARN if (b) - assert(0); // NOWARN (unreachable) + __goblint_check(0); // NOWARN (unreachable) else - assert(1); // reachable + __goblint_check(1); // reachable return 0; } \ No newline at end of file diff --git a/tests/regression/02-base/83-evalint-mustbeequal.c b/tests/regression/02-base/83-evalint-mustbeequal.c index d1423d23d4..3cb210e89e 100644 --- a/tests/regression/02-base/83-evalint-mustbeequal.c +++ b/tests/regression/02-base/83-evalint-mustbeequal.c @@ -6,19 +6,19 @@ int main() { int x, y, z; // expRelation EvalInt - assert(x + y - z == x - z + y); + __goblint_check(x + y - z == x - z + y); // base eval_rv_ask_mustbeequal via expRelation - assert((x + y - z) - (x - z + y) == 0); - assert(x + y - z <= x - z + y); - assert(x + y - z >= x - z + y); - assert(!(x + y - z != x - z + y)); - assert(!(x + y - z < x - z + y)); - assert(!(x + y - z > x - z + y)); + __goblint_check((x + y - z) - (x - z + y) == 0); + __goblint_check(x + y - z <= x - z + y); + __goblint_check(x + y - z >= x - z + y); + __goblint_check(!(x + y - z != x - z + y)); + __goblint_check(!(x + y - z < x - z + y)); + __goblint_check(!(x + y - z > x - z + y)); int *p, *q; // base eval_rv_ask_mustbeequal via expRelation - assert(p - p == 0); + __goblint_check(p - p == 0); return 0; } \ No newline at end of file diff --git a/tests/regression/02-base/84-evalint-maybeequal.c b/tests/regression/02-base/84-evalint-maybeequal.c index c35c8f97da..2c0c75275a 100644 --- a/tests/regression/02-base/84-evalint-maybeequal.c +++ b/tests/regression/02-base/84-evalint-maybeequal.c @@ -6,9 +6,9 @@ int main() { int x; // expRelation EvalInt - assert(!(x + 1 == x)); - assert(!(x == x + 1)); - assert(!(x - 1 == x)); - assert(!(x == x - 1)); + __goblint_check(!(x + 1 == x)); + __goblint_check(!(x == x + 1)); + __goblint_check(!(x - 1 == x)); + __goblint_check(!(x == x - 1)); return 0; } \ No newline at end of file diff --git a/tests/regression/02-base/85-evalint-maybeless.c b/tests/regression/02-base/85-evalint-maybeless.c index 7ee7d3ad4d..3cd788cd62 100644 --- a/tests/regression/02-base/85-evalint-maybeless.c +++ b/tests/regression/02-base/85-evalint-maybeless.c @@ -6,9 +6,9 @@ int main() { int x; // expRelation EvalInt - assert(!(x + 1 < x)); - assert(!(x < x + (-1))); - assert(!(x - (-1) < x)); - assert(!(x < x - 1)); + __goblint_check(!(x + 1 < x)); + __goblint_check(!(x < x + (-1))); + __goblint_check(!(x - (-1) < x)); + __goblint_check(!(x < x - 1)); return 0; } \ No newline at end of file diff --git a/tests/regression/02-base/86-spurious.c b/tests/regression/02-base/86-spurious.c index 277d5c6f15..d4d7f5cd7f 100644 --- a/tests/regression/02-base/86-spurious.c +++ b/tests/regression/02-base/86-spurious.c @@ -14,7 +14,7 @@ void* consumer(void* param) { pthread_mutex_lock(&lock1); int bla = counter >= 0; // This should not produce a warning about the privatization being unsound - assert(counter >= 0); //NOWARN + __goblint_check(counter >= 0); //NOWARN pthread_mutex_unlock(&lock1); } diff --git a/tests/regression/03-practical/01-lval_eval.c b/tests/regression/03-practical/01-lval_eval.c index 04794c1af8..dcd97d9873 100644 --- a/tests/regression/03-practical/01-lval_eval.c +++ b/tests/regression/03-practical/01-lval_eval.c @@ -8,6 +8,6 @@ int main(void) { tmp = __ctype_b_loc(); i = (int)(*((*tmp) + 13)); - assert(i == 5); // UNKNOWN + __goblint_check(i == 5); // UNKNOWN return 0; } diff --git a/tests/regression/03-practical/02-index_nonstruct.c b/tests/regression/03-practical/02-index_nonstruct.c index 85673723ce..8741313f26 100644 --- a/tests/regression/03-practical/02-index_nonstruct.c +++ b/tests/regression/03-practical/02-index_nonstruct.c @@ -11,7 +11,7 @@ int main(){ s * K = malloc(sizeof(s)); K->i = 1; l = K->i; - assert(l == 17); // FAIL + __goblint_check(l == 17); // FAIL return 0; } diff --git a/tests/regression/03-practical/04-assign_to_ukwn.c b/tests/regression/03-practical/04-assign_to_ukwn.c index fc25d8bdb2..0887e9d459 100644 --- a/tests/regression/03-practical/04-assign_to_ukwn.c +++ b/tests/regression/03-practical/04-assign_to_ukwn.c @@ -6,7 +6,7 @@ int main(){ if (errno == ENOENT) { x = 9; } - assert(x == 5); // UNKNOWN + __goblint_check(x == 5); // UNKNOWN return 0; } diff --git a/tests/regression/03-practical/06-callback.c b/tests/regression/03-practical/06-callback.c index f3a5c75749..57c64cc7d2 100644 --- a/tests/regression/03-practical/06-callback.c +++ b/tests/regression/03-practical/06-callback.c @@ -16,6 +16,6 @@ void callfun(void (*fun)()) { int main() { callfun(& callme); - assert(x == 5); + __goblint_check(x == 5); return 0; } diff --git a/tests/regression/03-practical/09-nonterm2.c b/tests/regression/03-practical/09-nonterm2.c index d7524f02d2..e62f1db77f 100644 --- a/tests/regression/03-practical/09-nonterm2.c +++ b/tests/regression/03-practical/09-nonterm2.c @@ -1,7 +1,7 @@ #include int main() { - while (1) - assert(0); // FAIL! + while (1) + __goblint_check(0); // FAIL! return 0; } diff --git a/tests/regression/03-practical/11-extern.c b/tests/regression/03-practical/11-extern.c index 71b20571e0..e721e6fec0 100644 --- a/tests/regression/03-practical/11-extern.c +++ b/tests/regression/03-practical/11-extern.c @@ -7,9 +7,9 @@ int main() { int i=0; int j=5; mywrite(&i); - assert(i == 0); // UNKNOWN! - assert(glob == 5); - assert(j == 5); + __goblint_check(i == 0); // UNKNOWN! + __goblint_check(glob == 5); + __goblint_check(j == 5); return 0; } diff --git a/tests/regression/03-practical/12-aget_minimal.c b/tests/regression/03-practical/12-aget_minimal.c index 4dbedd6ad7..fbc1451842 100644 --- a/tests/regression/03-practical/12-aget_minimal.c +++ b/tests/regression/03-practical/12-aget_minimal.c @@ -8,7 +8,7 @@ */ void f(void) { - assert(0); // FAIL! + __goblint_check(0); // FAIL! printf("hello, this is \"void f(void)\"\n"); } diff --git a/tests/regression/03-practical/13-pfscan_minimal.c b/tests/regression/03-practical/13-pfscan_minimal.c index 4684015f85..4209f21ec9 100644 --- a/tests/regression/03-practical/13-pfscan_minimal.c +++ b/tests/regression/03-practical/13-pfscan_minimal.c @@ -4,11 +4,11 @@ extern int get(void); int init(void) { return 0; } -int main(int argc , char **argv ) +int main(int argc , char **argv ) { int tmp = 5; init(); tmp = get(); - assert(tmp == 5); // UNKNOWN + __goblint_check(tmp == 5); // UNKNOWN return 0; } diff --git a/tests/regression/03-practical/14-call_by_pointer.c b/tests/regression/03-practical/14-call_by_pointer.c index b409c3dad3..b2df1e6f61 100644 --- a/tests/regression/03-practical/14-call_by_pointer.c +++ b/tests/regression/03-practical/14-call_by_pointer.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper']" +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','mutexEvents','mutex','access','mallocWrapper','assert']" #include /** @@ -18,6 +18,6 @@ int main() { glob = 0; foo(reset_glob); - assert(glob == 0); // UNKNOWN + __goblint_check(glob == 0); // UNKNOWN return 0; } diff --git a/tests/regression/03-practical/17-struct_priv.c b/tests/regression/03-practical/17-struct_priv.c index bfa796e6a4..35eb3cfe10 100644 --- a/tests/regression/03-practical/17-struct_priv.c +++ b/tests/regression/03-practical/17-struct_priv.c @@ -14,7 +14,7 @@ void *t_fun(void *arg) { pthread_mutex_lock(&mtx); pq.y++; pq.y--; - assert(pq.x == 0); + __goblint_check(pq.x == 0); pthread_mutex_unlock(&mtx); return NULL; } @@ -25,7 +25,7 @@ int main(void) { pq.y = 0; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&mtx); - assert(pq.y == 0); + __goblint_check(pq.y == 0); pthread_mutex_unlock(&mtx); pthread_join (id, NULL); return 0; diff --git a/tests/regression/03-practical/19-unsignedlonglong.c b/tests/regression/03-practical/19-unsignedlonglong.c index 8f1efeeca4..52b9af4983 100644 --- a/tests/regression/03-practical/19-unsignedlonglong.c +++ b/tests/regression/03-practical/19-unsignedlonglong.c @@ -8,5 +8,5 @@ int main() { j = 100; j = (unsigned long long) i; - assert(j == 10); + __goblint_check(j == 10); } diff --git a/tests/regression/03-practical/20-extern_nonpriv_sound.c b/tests/regression/03-practical/20-extern_nonpriv_sound.c index b74e9ab05a..b7e32dcb4e 100644 --- a/tests/regression/03-practical/20-extern_nonpriv_sound.c +++ b/tests/regression/03-practical/20-extern_nonpriv_sound.c @@ -12,8 +12,8 @@ void *t_fun(void *arg) { int main() { pthread_t id; - assert(glob == 5); + __goblint_check(glob == 5); pthread_create(&id, NULL, t_fun, NULL); - assert(glob == 5); // UNKNOWN! + __goblint_check(glob == 5); // UNKNOWN! return 0; } diff --git a/tests/regression/03-practical/24-threshold.c b/tests/regression/03-practical/24-threshold.c index 268ad6285c..23a0106eb4 100644 --- a/tests/regression/03-practical/24-threshold.c +++ b/tests/regression/03-practical/24-threshold.c @@ -28,7 +28,7 @@ int main() { pthread_join(t1, 0); - assert(g <= 100); + __goblint_check(g <= 100); return 0; } diff --git a/tests/regression/03-practical/25-zstd-customMem.c b/tests/regression/03-practical/25-zstd-customMem.c index 1b0b211751..a3fde8e304 100644 --- a/tests/regression/03-practical/25-zstd-customMem.c +++ b/tests/regression/03-practical/25-zstd-customMem.c @@ -27,6 +27,6 @@ int* ZSTD_createCCtx_advanced(ZSTD_customMem customMem) int main() { int *p = ZSTD_createCCtx_advanced(ZSTD_defaultCMem); - assert(p != NULL); + __goblint_check(p != NULL); return 0; } diff --git a/tests/regression/04-mutex/08-pthread_arg.c b/tests/regression/04-mutex/08-pthread_arg.c index 7b1c48b94c..d9e582e416 100644 --- a/tests/regression/04-mutex/08-pthread_arg.c +++ b/tests/regression/04-mutex/08-pthread_arg.c @@ -2,9 +2,9 @@ #include #include -void *http_get(void *arg ) { +void *http_get(void *arg ) { int x = (int) arg; - assert(x == 43); + __goblint_check(x == 43); return NULL; } diff --git a/tests/regression/04-mutex/48-assign_spawn.c b/tests/regression/04-mutex/48-assign_spawn.c index f90888767a..03482bbfa2 100644 --- a/tests/regression/04-mutex/48-assign_spawn.c +++ b/tests/regression/04-mutex/48-assign_spawn.c @@ -8,7 +8,7 @@ static struct class *misc_class; static char *misc_devnode(struct device *dev, umode_t *mode) { - assert(false); // FAIL + __goblint_check(false); // FAIL return NULL; } diff --git a/tests/regression/04-mutex/57-thread_ret.c b/tests/regression/04-mutex/57-thread_ret.c index 89862c25c6..7a61df18ce 100644 --- a/tests/regression/04-mutex/57-thread_ret.c +++ b/tests/regression/04-mutex/57-thread_ret.c @@ -29,6 +29,6 @@ int main(void) { int v = *((int*) pptr); // If we don't have the threadreturn analysis running, all returns from all functions called by the t_fun thread, as well as of t_fun itself are joined together // But we still should get a value better than top! - assert(v!=2); + __goblint_check(v!=2); return 0; } diff --git a/tests/regression/04-mutex/61-allfuns-globs.c b/tests/regression/04-mutex/61-allfuns-globs.c index 5b8bd2c3be..0204479d03 100644 --- a/tests/regression/04-mutex/61-allfuns-globs.c +++ b/tests/regression/04-mutex/61-allfuns-globs.c @@ -12,7 +12,7 @@ void t1() { myglobal++; //RACE! pthread_mutex_unlock(&A_mutex); - assert(three == 3); + __goblint_check(three == 3); } void t2() { @@ -20,5 +20,5 @@ void t2() { myglobal++; //RACE! pthread_mutex_unlock(&B_mutex); - assert(three == 3); + __goblint_check(three == 3); } diff --git a/tests/regression/06-symbeq/01-symbeq_ints.c b/tests/regression/06-symbeq/01-symbeq_ints.c index a58d88838b..1a7c1d2a94 100644 --- a/tests/regression/06-symbeq/01-symbeq_ints.c +++ b/tests/regression/06-symbeq/01-symbeq_ints.c @@ -1,4 +1,4 @@ -// PARAM: --disable ana.mutex.disjoint_types --set dbg.debug true --set ana.activated[+] "'var_eq'" +// PARAM: --disable ana.mutex.disjoint_types --set dbg.debug true --set ana.activated[+] "'var_eq'" #include #include @@ -9,7 +9,7 @@ int main() { scanf("%d", &x); y = x; - assert(x==y); + __goblint_check(x==y); return 0; } diff --git a/tests/regression/06-symbeq/18-symbeq_addrs.c b/tests/regression/06-symbeq/18-symbeq_addrs.c index f99e3b61f2..ef19bc1569 100644 --- a/tests/regression/06-symbeq/18-symbeq_addrs.c +++ b/tests/regression/06-symbeq/18-symbeq_addrs.c @@ -13,17 +13,17 @@ int main () { x = y = z; - assert(x == y); - assert(x == z); - assert(z == y); + __goblint_check(x == y); + __goblint_check(x == z); + __goblint_check(z == y); x = uk+10; y = uk+20; z = uk+30; x = y; x = z; - assert(x == z); - assert(x == y); // UNKNOWN + __goblint_check(x == z); + __goblint_check(x == y); // UNKNOWN x = 40+uk; if (uk) { @@ -35,15 +35,15 @@ int main () { } y = *p; - assert(y == *p); + __goblint_check(y == *p); p = &z; - assert(y == *p); // UNKNOWN + __goblint_check(y == *p); // UNKNOWN p = NULL+10; r = &ps->x; - assert(r == &ps->x); + __goblint_check(r == &ps->x); ps = &a; - assert(r == &ps->x);//UNKNOWN + __goblint_check(r == &ps->x);//UNKNOWN return 0; } diff --git a/tests/regression/06-symbeq/19-symbeq_funcs.c b/tests/regression/06-symbeq/19-symbeq_funcs.c index d9b29ed4a7..d63f03aff0 100644 --- a/tests/regression/06-symbeq/19-symbeq_funcs.c +++ b/tests/regression/06-symbeq/19-symbeq_funcs.c @@ -1,4 +1,4 @@ -// PARAM: --disable ana.mutex.disjoint_types --set dbg.debug true --set ana.activated[+] "'var_eq'" +// PARAM: --disable ana.mutex.disjoint_types --set dbg.debug true --set ana.activated[+] "'var_eq'" #include void inc(int * a){ @@ -16,34 +16,34 @@ void test1(int *q, int *p){ int main () { int x, y, z, uk; - + x = y = z; - assert(x == y); - assert(z == y); - assert(x == z); - + __goblint_check(x == y); + __goblint_check(z == y); + __goblint_check(x == z); + test1(&x, &x); -// assert(x == y); wontfix? i think? - assert(z == y); -// assert(x == z); +// __goblint_check(x == y); wontfix? i think? + __goblint_check(z == y); +// __goblint_check(x == z); x = y = z; test1(&x, &y); - assert(x == y); -// assert(z == y); -// assert(x == z); + __goblint_check(x == y); +// __goblint_check(z == y); +// __goblint_check(x == z); x = y = z; inc(&x); - assert(x == y); // UNKNOWN - assert(z == y); - + __goblint_check(x == y); // UNKNOWN + __goblint_check(z == y); + y = four(); - assert(z == y); // UNKNOWN - assert(x == y); // UNKNOWN - + __goblint_check(z == y); // UNKNOWN + __goblint_check(x == y); // UNKNOWN + return 0; } diff --git a/tests/regression/06-symbeq/22-var_eq_types.c b/tests/regression/06-symbeq/22-var_eq_types.c index 06afe722e2..a0efddfc75 100644 --- a/tests/regression/06-symbeq/22-var_eq_types.c +++ b/tests/regression/06-symbeq/22-var_eq_types.c @@ -43,10 +43,10 @@ int t17(){ struct s ss[6], *ps; ps = &ss[i]; - assert(ps == &ss[i]); + __goblint_check(ps == &ss[i]); i = 2; - assert(ps == &ss[i]); // UNKNOWN + __goblint_check(ps == &ss[i]); // UNKNOWN return 0; } @@ -57,10 +57,10 @@ int t16(){ struct s ss,ss2; // UB: deref uninit ptr pt pt->ss->i = i; - assert(pt->ss->i == i); // UNKNOWN? + __goblint_check(pt->ss->i == i); // UNKNOWN? tt = tt2; - assert(pt->ss->i == i); // UNKNOWN + __goblint_check(pt->ss->i == i); // UNKNOWN return 0; } @@ -74,10 +74,10 @@ int t15(){ tt.ss = &ss; // UB: deref uninit ptr pt pt->ss->i = i; - assert(pt->ss->i == i); // UNKNOWN? + __goblint_check(pt->ss->i == i); // UNKNOWN? ss = ss2; - assert(pt->ss->i == i); // UNKNOWN + __goblint_check(pt->ss->i == i); // UNKNOWN return 0; } @@ -91,9 +91,9 @@ int t14(){ // tt.ss = &ss; // UB: deref uninit ptr pt pt->ss->i = i; - assert(pt->ss->i == i); // UNKNOWN? + __goblint_check(pt->ss->i == i); // UNKNOWN? ss.i = 1; - assert(pt->ss->i == i); // UNKNOWN + __goblint_check(pt->ss->i == i); // UNKNOWN return 0; } @@ -107,9 +107,9 @@ int t13(){ tt.ss = &ss; pt->ss->i = i; - assert(pt->ss->i == i); + __goblint_check(pt->ss->i == i); ss = ss2; - assert(pt->ss->i == i); // UNKNOWN + __goblint_check(pt->ss->i == i); // UNKNOWN return 0; } @@ -123,9 +123,9 @@ int t12(){ tt.ss = &ss; pt->ss->i = i; - assert(pt->ss->i == i); + __goblint_check(pt->ss->i == i); ss.i = 1; - assert(pt->ss->i == i); // UNKNOWN + __goblint_check(pt->ss->i == i); // UNKNOWN return 0; } @@ -141,9 +141,9 @@ int t11(){ z.i = 8; *(get_s()) = a; - assert(q == &a->i); // ??? - assert(y == a->cp); // UNKNOWN - assert(z.i == 8); + __goblint_check(q == &a->i); // ??? + __goblint_check(y == a->cp); // UNKNOWN + __goblint_check(z.i == 8); return 0; } @@ -159,9 +159,9 @@ int t10(){ z.i = 8; a = b; - assert(q == &a->i); // UNKNOWN - assert(y == a->cp); // UNKNOWN - assert(z.i == 8); + __goblint_check(q == &a->i); // UNKNOWN + __goblint_check(y == a->cp); // UNKNOWN + __goblint_check(z.i == 8); return 0; } @@ -177,8 +177,8 @@ int t9(){ y = b->cp; z.i = 8; - assert(q == &b->i); -// assert(y == b->cp); + __goblint_check(q == &b->i); +// __goblint_check(y == b->cp); return 0; } @@ -190,7 +190,7 @@ int t8(){ a = &z; x = 8; - assert(a == &z); + __goblint_check(a == &z); return 0; } @@ -202,7 +202,7 @@ int t7(){ x = y; a = b; - assert(x == y); + __goblint_check(x == y); return 0; } @@ -215,7 +215,7 @@ int t6(){ x = y; *a = *b; - assert(x == y); + __goblint_check(x == y); return 0; } @@ -227,7 +227,7 @@ int t5(){ x = y; *a = 3; - assert(x == y); // TODO (a and x or y may not alias) + __goblint_check(x == y); // TODO (a and x or y may not alias) return 0; } @@ -238,8 +238,8 @@ int t4(){ x = y; *a = 3; - assert(x == y); // TODO (a and x or y may not alias) - assert(a == &z); // UNKNOWN + __goblint_check(x == y); // TODO (a and x or y may not alias) + __goblint_check(a == &z); // UNKNOWN return 0; } @@ -252,8 +252,8 @@ int t3(){ x = y; *a = 3; - assert(x == y); - assert(a == &z); + __goblint_check(x == y); + __goblint_check(a == &z); return 0; @@ -266,10 +266,10 @@ int t2(){ a = &y; - x = y; assert(x == y); + x = y; __goblint_check(x == y); *a = 3; - assert(x == y); // UNKNOWN - assert(a == &y); + __goblint_check(x == y); // UNKNOWN + __goblint_check(a == &y); return 0; } @@ -281,10 +281,10 @@ int t1(){ a = &y; x = y; - assert(x == y); + __goblint_check(x == y); f(a); - assert(x == y); // UNKNOWN - assert(a == &y); + __goblint_check(x == y); // UNKNOWN + __goblint_check(a == &y); return 0; } diff --git a/tests/regression/06-symbeq/24-escape_rc.c b/tests/regression/06-symbeq/24-escape_rc.c index 744fac6f4f..245b05f913 100644 --- a/tests/regression/06-symbeq/24-escape_rc.c +++ b/tests/regression/06-symbeq/24-escape_rc.c @@ -20,7 +20,7 @@ int main(void) { int i = 0; pthread_create(&id, NULL, t_fun, (void *) &i); pthread_mutex_lock(&mutex2); - assert(i == 0); // UNKNOWN! + __goblint_check(i == 0); // UNKNOWN! pthread_mutex_unlock(&mutex2); pthread_join (id, NULL); return 0; diff --git a/tests/regression/06-symbeq/25-ptr_global.c b/tests/regression/06-symbeq/25-ptr_global.c index 6c25135511..1754d97c2b 100644 --- a/tests/regression/06-symbeq/25-ptr_global.c +++ b/tests/regression/06-symbeq/25-ptr_global.c @@ -9,7 +9,7 @@ int *global; void *t_fun(void *arg) { int *p = global; *p = 2; - assert(*p == 2); // UNKNOWN! + __goblint_check(*p == 2); // UNKNOWN! return NULL; } @@ -21,7 +21,7 @@ int main(void) { pthread_create(&id, NULL, t_fun, NULL); *p = 1; - assert(*p == 1); // UNKNOWN! + __goblint_check(*p == 1); // UNKNOWN! pthread_join (id, NULL); return 0; diff --git a/tests/regression/06-symbeq/31-zstd-thread-pool.c b/tests/regression/06-symbeq/31-zstd-thread-pool.c index 290a8a349d..ffc88e6a70 100644 --- a/tests/regression/06-symbeq/31-zstd-thread-pool.c +++ b/tests/regression/06-symbeq/31-zstd-thread-pool.c @@ -175,7 +175,7 @@ static void* POOL_thread(void* opaque) { ZSTD_pthread_mutex_unlock(&ctx->queueMutex); } } /* for (;;) */ - assert(0); //NOWARN (unreachable) + __goblint_check(0); //NOWARN (unreachable) } POOL_ctx* POOL_create(size_t numThreads, size_t queueSize) { diff --git a/tests/regression/06-symbeq/32-var_eq-unknown-invalidate.c b/tests/regression/06-symbeq/32-var_eq-unknown-invalidate.c index 540cd1013d..d14bdfdc9b 100644 --- a/tests/regression/06-symbeq/32-var_eq-unknown-invalidate.c +++ b/tests/regression/06-symbeq/32-var_eq-unknown-invalidate.c @@ -17,9 +17,9 @@ int main() { res = magic(); if (res == (struct resource *)0) - assert(1); // reachable + __goblint_check(1); // reachable else - assert(1); // reachable + __goblint_check(1); // reachable return 0; } \ No newline at end of file diff --git a/tests/regression/06-symbeq/35-zstd-thread-pool-multi.c b/tests/regression/06-symbeq/35-zstd-thread-pool-multi.c index 83d869a242..28d9940fab 100644 --- a/tests/regression/06-symbeq/35-zstd-thread-pool-multi.c +++ b/tests/regression/06-symbeq/35-zstd-thread-pool-multi.c @@ -175,7 +175,7 @@ static void* POOL_thread(void* opaque) { ZSTD_pthread_mutex_unlock(&ctx->queueMutex); } } /* for (;;) */ - assert(0); //NOWARN (unreachable) + __goblint_check(0); //NOWARN (unreachable) } POOL_ctx* POOL_create(size_t numThreads, size_t queueSize) { diff --git a/tests/regression/06-symbeq/36-zstd-thread-pool-add.c b/tests/regression/06-symbeq/36-zstd-thread-pool-add.c index 93ebc1b4b8..ad96decba1 100644 --- a/tests/regression/06-symbeq/36-zstd-thread-pool-add.c +++ b/tests/regression/06-symbeq/36-zstd-thread-pool-add.c @@ -176,7 +176,7 @@ static void* POOL_thread(void* opaque) { ZSTD_pthread_mutex_unlock(&ctx->queueMutex); } } /* for (;;) */ - assert(0); //NOWARN (unreachable) + __goblint_check(0); //NOWARN (unreachable) } POOL_ctx* POOL_create(size_t numThreads, size_t queueSize) { @@ -273,7 +273,7 @@ static void POOL_add_internal(POOL_ctx* ctx, POOL_function function, void *opaque) { POOL_job const job = {function, opaque}; - assert(ctx != NULL); + __goblint_check(ctx != NULL); if (ctx->shutdown) return; ctx->queueEmpty = 0; @@ -284,7 +284,7 @@ POOL_add_internal(POOL_ctx* ctx, POOL_function function, void *opaque) void POOL_add(POOL_ctx* ctx, POOL_function function, void* opaque) { - assert(ctx != NULL); + __goblint_check(ctx != NULL); ZSTD_pthread_mutex_lock(&ctx->queueMutex); /* Wait until there is space in the queue for the new job */ while (isQueueFull(ctx) && (!ctx->shutdown)) { @@ -295,7 +295,7 @@ void POOL_add(POOL_ctx* ctx, POOL_function function, void* opaque) } void foo(void *arg) { - assert(1); // reachable + __goblint_check(1); // reachable } int g; diff --git a/tests/regression/07-uninit/01-simple.c b/tests/regression/07-uninit/01-simple.c index 0b0e5da7a8..c52c66f6d0 100644 --- a/tests/regression/07-uninit/01-simple.c +++ b/tests/regression/07-uninit/01-simple.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none #include int main() { diff --git a/tests/regression/07-uninit/02-path_sense.c b/tests/regression/07-uninit/02-path_sense.c index dddc9f1f8b..3a086e4a84 100644 --- a/tests/regression/07-uninit/02-path_sense.c +++ b/tests/regression/07-uninit/02-path_sense.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none #include void f() {}; diff --git a/tests/regression/07-uninit/03-path_sense_bad.c b/tests/regression/07-uninit/03-path_sense_bad.c index a42e604e5e..66c232ec0e 100644 --- a/tests/regression/07-uninit/03-path_sense_bad.c +++ b/tests/regression/07-uninit/03-path_sense_bad.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none #include int main() { diff --git a/tests/regression/07-uninit/04-intent_out.c b/tests/regression/07-uninit/04-intent_out.c index 5499b4a501..1f1cb75ff8 100644 --- a/tests/regression/07-uninit/04-intent_out.c +++ b/tests/regression/07-uninit/04-intent_out.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none void some_function(int* x){ *x = 0; } diff --git a/tests/regression/07-uninit/05-struct-bad.c b/tests/regression/07-uninit/05-struct-bad.c index e7a824633a..3e3e486fa3 100644 --- a/tests/regression/07-uninit/05-struct-bad.c +++ b/tests/regression/07-uninit/05-struct-bad.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none typedef struct { int i; } S; diff --git a/tests/regression/07-uninit/06-struct-good.c b/tests/regression/07-uninit/06-struct-good.c index 1584d7d202..3398ad125c 100644 --- a/tests/regression/07-uninit/06-struct-good.c +++ b/tests/regression/07-uninit/06-struct-good.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none typedef struct { int i; } S; diff --git a/tests/regression/07-uninit/07-struct_return.c b/tests/regression/07-uninit/07-struct_return.c index c91f6767bb..1da4a2c245 100644 --- a/tests/regression/07-uninit/07-struct_return.c +++ b/tests/regression/07-uninit/07-struct_return.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none typedef struct { int i; } S; diff --git a/tests/regression/07-uninit/08-struct_intent_out.c b/tests/regression/07-uninit/08-struct_intent_out.c index ae7d356aea..5e9a8dc92d 100644 --- a/tests/regression/07-uninit/08-struct_intent_out.c +++ b/tests/regression/07-uninit/08-struct_intent_out.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none typedef struct { int i; } S; diff --git a/tests/regression/07-uninit/09-struct_deep_bad.c b/tests/regression/07-uninit/09-struct_deep_bad.c index 3b247a455b..f3bcfe2fd3 100644 --- a/tests/regression/07-uninit/09-struct_deep_bad.c +++ b/tests/regression/07-uninit/09-struct_deep_bad.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none typedef struct { int i; } S; diff --git a/tests/regression/07-uninit/10-struct_deep_good.c b/tests/regression/07-uninit/10-struct_deep_good.c index de2e45e134..c6e3dd40ad 100644 --- a/tests/regression/07-uninit/10-struct_deep_good.c +++ b/tests/regression/07-uninit/10-struct_deep_good.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none typedef struct { int i; } S; diff --git a/tests/regression/07-uninit/11-ptr_passtrough.c b/tests/regression/07-uninit/11-ptr_passtrough.c index 4345976d71..f6e535783f 100644 --- a/tests/regression/07-uninit/11-ptr_passtrough.c +++ b/tests/regression/07-uninit/11-ptr_passtrough.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none int* some_function(int * x){ return x; //NOWARN } diff --git a/tests/regression/07-uninit/12-struct_return_warn.c b/tests/regression/07-uninit/12-struct_return_warn.c index 6c00053f59..32dde3d04f 100644 --- a/tests/regression/07-uninit/12-struct_return_warn.c +++ b/tests/regression/07-uninit/12-struct_return_warn.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none typedef struct { int i, j; } S; diff --git a/tests/regression/07-uninit/13-struct_param_warn.c b/tests/regression/07-uninit/13-struct_param_warn.c index ce33eb47d2..f23a6be862 100644 --- a/tests/regression/07-uninit/13-struct_param_warn.c +++ b/tests/regression/07-uninit/13-struct_param_warn.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none typedef struct { int i,j; } S; diff --git a/tests/regression/07-uninit/14-struct_in_struct.c b/tests/regression/07-uninit/14-struct_in_struct.c index fb359daab4..ca16b03d38 100644 --- a/tests/regression/07-uninit/14-struct_in_struct.c +++ b/tests/regression/07-uninit/14-struct_in_struct.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none typedef struct { int i; } S; @@ -43,7 +43,7 @@ int main(){ mod_S1(&tt1.s); //NOWARN mod_S2(&tt2.s); //NOWARN - + mod_S31(&tt3.s); //NOWARN mod_S32(&tt3.s); //NOWARN diff --git a/tests/regression/07-uninit/15-union_simple_good.c b/tests/regression/07-uninit/15-union_simple_good.c index ab3de7558c..4865881320 100644 --- a/tests/regression/07-uninit/15-union_simple_good.c +++ b/tests/regression/07-uninit/15-union_simple_good.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none typedef union { int i; int j; diff --git a/tests/regression/07-uninit/16-union_simple_bad.c b/tests/regression/07-uninit/16-union_simple_bad.c index 3be5f653fa..36779c0bc8 100644 --- a/tests/regression/07-uninit/16-union_simple_bad.c +++ b/tests/regression/07-uninit/16-union_simple_bad.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none typedef union { double i; int j; diff --git a/tests/regression/07-uninit/17-struct_in_union.c b/tests/regression/07-uninit/17-struct_in_union.c index b75ae650e6..2b88146c36 100644 --- a/tests/regression/07-uninit/17-struct_in_union.c +++ b/tests/regression/07-uninit/17-struct_in_union.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none typedef union { struct { int a; diff --git a/tests/regression/07-uninit/18-union_in_union.c b/tests/regression/07-uninit/18-union_in_union.c index fd93867bf9..193d8b8e63 100644 --- a/tests/regression/07-uninit/18-union_in_union.c +++ b/tests/regression/07-uninit/18-union_in_union.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none typedef union { union { struct { diff --git a/tests/regression/07-uninit/19-struct_in_union_bad.c b/tests/regression/07-uninit/19-struct_in_union_bad.c index 7c32f1a96b..82536c069a 100644 --- a/tests/regression/07-uninit/19-struct_in_union_bad.c +++ b/tests/regression/07-uninit/19-struct_in_union_bad.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','uninit','mallocWrapper','assert']" --set ana.base.privatization none typedef union { struct { short a; diff --git a/tests/regression/08-malloc_null/01-simple-malloc.c b/tests/regression/08-malloc_null/01-simple-malloc.c index 267a485650..ba4da31ad7 100644 --- a/tests/regression/08-malloc_null/01-simple-malloc.c +++ b/tests/regression/08-malloc_null/01-simple-malloc.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','malloc_null','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','malloc_null','mallocWrapper','assert']" --set ana.base.privatization none #include #include @@ -25,9 +25,9 @@ int main(void) { v = (int*)malloc(sizeof(*v)); if (v == 0){ - assert(0); // FAIL + __goblint_check(0); // FAIL } else { - assert(0); // FAIL + __goblint_check(0); // FAIL *v != 0; // NOWARN } @@ -37,7 +37,7 @@ int main(void) { if (v == 0) exit(0); - assert(0); // NOWARN + __goblint_check(0); // NOWARN return 0; } diff --git a/tests/regression/08-malloc_null/02-paths-malloc.c b/tests/regression/08-malloc_null/02-paths-malloc.c index ff48bbe74a..9d5f0060fc 100644 --- a/tests/regression/08-malloc_null/02-paths-malloc.c +++ b/tests/regression/08-malloc_null/02-paths-malloc.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','escape','malloc_null','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','escape','malloc_null','mallocWrapper','assert']" --set ana.base.privatization none #include #include #include @@ -40,7 +40,7 @@ int main(void) { exit(-1); } - assert(0); // FAIL + __goblint_check(0); // FAIL *u = 40; // NOWARN *v = 40; // NOWARN diff --git a/tests/regression/10-synch/20-race-2_1-container_of.c b/tests/regression/10-synch/20-race-2_1-container_of.c index bd558ef1aa..28dfdd1474 100644 --- a/tests/regression/10-synch/20-race-2_1-container_of.c +++ b/tests/regression/10-synch/20-race-2_1-container_of.c @@ -16,9 +16,9 @@ extern void abort(void); #include -void reach_error() { assert(0); } // FAIL +void reach_error() { __goblint_check(0); } // FAIL int __VERIFIER_nondet_int(void); -void ldv_assert(int expression) { if (!expression) { ERROR: {reach_error();abort();}}; return; } // NOWARN +void ldv___goblint_check(int expression) { if (!expression) { ERROR: {reach_error();abort();}}; return; } // NOWARN pthread_t t1,t2; @@ -57,8 +57,8 @@ int my_drv_probe(struct my_data *data) { pthread_mutex_init(&data->lock, NULL); data->shared.a = 0; // NORACE data->shared.b = 0; // NORACE - ldv_assert(data->shared.a==0); // NORACE - ldv_assert(data->shared.b==0); // NORACE + ldv___goblint_check(data->shared.a==0); // NORACE + ldv___goblint_check(data->shared.b==0); // NORACE int res = __VERIFIER_nondet_int(); if(res) @@ -96,14 +96,14 @@ int main(void) { probe_ret = my_drv_probe(&data); if(probe_ret==0) { my_drv_disconnect(&data); - ldv_assert(data.shared.a==1); // NORACE - ldv_assert(data.shared.b==2); // NORACE + ldv___goblint_check(data.shared.a==1); // NORACE + ldv___goblint_check(data.shared.b==2); // NORACE } my_drv_cleanup(); data.shared.a = -1; // NORACE data.shared.b = -1; // NORACE - ldv_assert(data.shared.a==-1); // NORACE - ldv_assert(data.shared.b==-1); // NORACE + ldv___goblint_check(data.shared.a==-1); // NORACE + ldv___goblint_check(data.shared.b==-1); // NORACE } return 0; } diff --git a/tests/regression/11-heap/03-linked.c b/tests/regression/11-heap/03-linked.c index 76efdcfc26..fe85b3fee2 100644 --- a/tests/regression/11-heap/03-linked.c +++ b/tests/regression/11-heap/03-linked.c @@ -33,5 +33,5 @@ int main() l = append(l, 1); l = append(l, 2); - assert(l->next->next->n == 0); //UNKNOWN + __goblint_check(l->next->next->n == 0); //UNKNOWN } diff --git a/tests/regression/11-heap/04-malloc_unique_addresses.c b/tests/regression/11-heap/04-malloc_unique_addresses.c index 3e004f1dfc..3081c5d3b5 100644 --- a/tests/regression/11-heap/04-malloc_unique_addresses.c +++ b/tests/regression/11-heap/04-malloc_unique_addresses.c @@ -19,10 +19,10 @@ int main() { *x = 0; *y = 1; - assert(*x == 0); - assert(*y == 1); + __goblint_check(*x == 0); + __goblint_check(*y == 1); p = x; x = y; y = p; - assert(*x == 1); - assert(*y == 0); + __goblint_check(*x == 1); + __goblint_check(*y == 0); } diff --git a/tests/regression/11-heap/05-malloc_not_unique_address.c b/tests/regression/11-heap/05-malloc_not_unique_address.c index 581744f49c..b9dd706c0f 100644 --- a/tests/regression/11-heap/05-malloc_not_unique_address.c +++ b/tests/regression/11-heap/05-malloc_not_unique_address.c @@ -19,6 +19,6 @@ int main() { *y = 1; *z = 0; - assert(*x == 0); - assert(*y == 1); // UNKNOWN! + __goblint_check(*x == 0); + __goblint_check(*y == 1); // UNKNOWN! } diff --git a/tests/regression/11-heap/06-wrapper_plus_unique_addresses.c b/tests/regression/11-heap/06-wrapper_plus_unique_addresses.c index f96dd1b9da..eeb8497324 100644 --- a/tests/regression/11-heap/06-wrapper_plus_unique_addresses.c +++ b/tests/regression/11-heap/06-wrapper_plus_unique_addresses.c @@ -23,12 +23,12 @@ int main() { *x = 0; *y = 1; - assert(*x == 0); - assert(*y == 1); + __goblint_check(*x == 0); + __goblint_check(*y == 1); p = x; x = y; y = p; - assert(*x == 1); - assert(*y == 0); + __goblint_check(*x == 1); + __goblint_check(*y == 0); return 0; } diff --git a/tests/regression/11-heap/07-strong_updates.c b/tests/regression/11-heap/07-strong_updates.c index d18b35d1cf..b252c2d0d0 100644 --- a/tests/regression/11-heap/07-strong_updates.c +++ b/tests/regression/11-heap/07-strong_updates.c @@ -20,6 +20,6 @@ int main() { *x = 2; *y = 3; - assert (*x == 2); - assert (*y == 3); + __goblint_check(*x == 2); + __goblint_check(*y == 3); } diff --git a/tests/regression/11-heap/08-no_strong_update.c b/tests/regression/11-heap/08-no_strong_update.c index ee1b8c5612..3904bc66b0 100644 --- a/tests/regression/11-heap/08-no_strong_update.c +++ b/tests/regression/11-heap/08-no_strong_update.c @@ -21,6 +21,6 @@ int main() { *x = 2; *y = 3; - assert (*x == 2); - assert (*y == 3); // UNKNOWN! + __goblint_check(*x == 2); + __goblint_check(*y == 3); // UNKNOWN! } diff --git a/tests/regression/11-heap/09-no_strong_update_not_unique_thread.c b/tests/regression/11-heap/09-no_strong_update_not_unique_thread.c index 025e219b26..042bc04fca 100644 --- a/tests/regression/11-heap/09-no_strong_update_not_unique_thread.c +++ b/tests/regression/11-heap/09-no_strong_update_not_unique_thread.c @@ -17,8 +17,8 @@ void *thread(void *v) *x = 2; *y = 3; - assert (*x == 2); // UNKNOWN! - assert (*y == 3); // UNKNOWN! + __goblint_check(*x == 2); // UNKNOWN! + __goblint_check(*y == 3); // UNKNOWN! } int main(int argc, char **argv) diff --git a/tests/regression/11-heap/10-no_strong_update_different_size.c b/tests/regression/11-heap/10-no_strong_update_different_size.c index 6ddde7d013..2d172697a7 100644 --- a/tests/regression/11-heap/10-no_strong_update_different_size.c +++ b/tests/regression/11-heap/10-no_strong_update_different_size.c @@ -16,5 +16,5 @@ int main() { *y = 1; *x = 2; // Size of written value is shorter than blob - assert (*x == 2); // UNKNOWN! + __goblint_check(*x == 2); // UNKNOWN! } diff --git a/tests/regression/11-heap/12-calloc.c b/tests/regression/11-heap/12-calloc.c index db1b21d5a5..747e9928fa 100644 --- a/tests/regression/11-heap/12-calloc.c +++ b/tests/regression/11-heap/12-calloc.c @@ -4,5 +4,5 @@ int main() { int* arr = calloc(5,sizeof(int)); arr[0] = 3; - assert(arr[2] == 0); //UNKNOWN + __goblint_check(arr[2] == 0); //UNKNOWN } diff --git a/tests/regression/11-heap/13-linear-search.c b/tests/regression/11-heap/13-linear-search.c index 21974935c7..f60f9b1579 100644 --- a/tests/regression/11-heap/13-linear-search.c +++ b/tests/regression/11-heap/13-linear-search.c @@ -4,7 +4,7 @@ extern void *calloc(unsigned int num, unsigned int size); void __VERIFIER_as(int cond) { if (!(cond)) { - assert(1); // reachable + __goblint_check(1); // reachable } return; } diff --git a/tests/regression/13-privatized/01-priv_nr.c b/tests/regression/13-privatized/01-priv_nr.c index 4bc235002d..8ea14a3346 100644 --- a/tests/regression/13-privatized/01-priv_nr.c +++ b/tests/regression/13-privatized/01-priv_nr.c @@ -9,9 +9,9 @@ void *t_fun(void *arg) { int t; pthread_mutex_lock(&mutex1); t = glob1; - assert(t == 5); + __goblint_check(t == 5); glob1 = -10; - assert(glob1 == -10); + __goblint_check(glob1 == -10); glob1 = t; pthread_mutex_unlock(&mutex1); return NULL; @@ -19,11 +19,11 @@ void *t_fun(void *arg) { int main(void) { pthread_t id; - assert(glob1 == 5); + __goblint_check(glob1 == 5); pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&mutex1); - glob1++; - assert(glob1 == 6); + glob1++; + __goblint_check(glob1 == 6); glob1--; pthread_mutex_unlock(&mutex1); pthread_join (id, NULL); diff --git a/tests/regression/13-privatized/02-priv_rc.c b/tests/regression/13-privatized/02-priv_rc.c index e4b7368747..b18f3ad8e3 100644 --- a/tests/regression/13-privatized/02-priv_rc.c +++ b/tests/regression/13-privatized/02-priv_rc.c @@ -9,9 +9,9 @@ void *t_fun(void *arg) { int t; pthread_mutex_lock(&mutex1); t = glob1; - assert(t == 5); // UNKNOWN + __goblint_check(t == 5); // UNKNOWN glob1 = -10; - assert(glob1 == -10); // UNKNOWN + __goblint_check(glob1 == -10); // UNKNOWN glob1 = t; pthread_mutex_unlock(&mutex1); return NULL; @@ -19,11 +19,11 @@ void *t_fun(void *arg) { int main(void) { pthread_t id; - assert(glob1 == 5); + __goblint_check(glob1 == 5); pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&mutex2); - glob1++; - assert(glob1 == 6); // UNKNOWN + glob1++; + __goblint_check(glob1 == 6); // UNKNOWN glob1--; pthread_mutex_unlock(&mutex2); pthread_join (id, NULL); diff --git a/tests/regression/13-privatized/03-priv_inv.c b/tests/regression/13-privatized/03-priv_inv.c index 060cd40307..bf97789a1d 100644 --- a/tests/regression/13-privatized/03-priv_inv.c +++ b/tests/regression/13-privatized/03-priv_inv.c @@ -18,11 +18,11 @@ void *t_fun(void *arg) { int main(void) { pthread_t id; - assert(x == 1); + __goblint_check(x == 1); pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&mutex1); x = 0; // NORACE - assert(x == 0); + __goblint_check(x == 0); x = 1; // NORACE pthread_mutex_unlock(&mutex1); pthread_join (id, NULL); diff --git a/tests/regression/13-privatized/04-priv_multi.c b/tests/regression/13-privatized/04-priv_multi.c index 2096cb2c01..198784cecd 100644 --- a/tests/regression/13-privatized/04-priv_multi.c +++ b/tests/regression/13-privatized/04-priv_multi.c @@ -47,7 +47,7 @@ void *dispose(void *arg) { if (B > 0) { p = B; pthread_mutex_unlock(&mutex_B); - assert(p == 5); + __goblint_check(p == 5); } else pthread_mutex_unlock(&mutex_B); @@ -68,7 +68,7 @@ int main () { pthread_mutex_lock(&mutex_A); pthread_mutex_lock(&mutex_B); - assert(A == B); + __goblint_check(A == B); pthread_mutex_unlock(&mutex_B); pthread_mutex_unlock(&mutex_A); diff --git a/tests/regression/13-privatized/17-priv_interval.c b/tests/regression/13-privatized/17-priv_interval.c index 7893020022..f319de7304 100644 --- a/tests/regression/13-privatized/17-priv_interval.c +++ b/tests/regression/13-privatized/17-priv_interval.c @@ -10,9 +10,9 @@ void *t_fun(void *arg) { int t; pthread_mutex_lock(&mutex1); t = glob1; - assert(t == 5); + __goblint_check(t == 5); glob1 = -10; - assert(glob1 == -10); + __goblint_check(glob1 == -10); glob1 = t; pthread_mutex_unlock(&mutex1); return NULL; @@ -20,11 +20,11 @@ void *t_fun(void *arg) { int main(void) { pthread_t id; - assert(glob1 == 5); + __goblint_check(glob1 == 5); pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&mutex1); - glob1++; - assert(glob1 == 6); + glob1++; + __goblint_check(glob1 == 6); glob1--; pthread_mutex_unlock(&mutex1); pthread_join (id, NULL); diff --git a/tests/regression/13-privatized/18-first-reads.c b/tests/regression/13-privatized/18-first-reads.c index b6e8362542..cbfeb68d5d 100644 --- a/tests/regression/13-privatized/18-first-reads.c +++ b/tests/regression/13-privatized/18-first-reads.c @@ -15,9 +15,9 @@ void *t_fun(void *arg) { } t = glob1; - assert(t == 0); //UNKNOWN! + __goblint_check(t == 0); //UNKNOWN! - assert(t == 1); //UNKNOWN! + __goblint_check(t == 1); //UNKNOWN! glob1 = 0; @@ -27,10 +27,10 @@ void *t_fun(void *arg) { int main(void) { pthread_t id; - assert(glob1 == 0); + __goblint_check(glob1 == 0); pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&mutex1); - assert(glob1 == 0); + __goblint_check(glob1 == 0); pthread_mutex_unlock(&mutex1); pthread_join (id, NULL); return 0; diff --git a/tests/regression/13-privatized/19-publish-precision.c b/tests/regression/13-privatized/19-publish-precision.c index de347956c3..07c2f62067 100644 --- a/tests/regression/13-privatized/19-publish-precision.c +++ b/tests/regression/13-privatized/19-publish-precision.c @@ -14,7 +14,7 @@ void *t_fun(void *arg) { pthread_mutex_unlock(&mutex2); pthread_mutex_lock(&mutex2); - assert(glob1 == 5); + __goblint_check(glob1 == 5); glob1 = 0; pthread_mutex_unlock(&mutex2); @@ -24,11 +24,11 @@ void *t_fun(void *arg) { int main(void) { pthread_t id; - assert(glob1 == 0); + __goblint_check(glob1 == 0); pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&mutex2); - assert(glob1 == 0); // UNKNOWN! - assert(glob1 == 5); // UNKNOWN! + __goblint_check(glob1 == 0); // UNKNOWN! + __goblint_check(glob1 == 5); // UNKNOWN! pthread_mutex_unlock(&mutex2); pthread_join (id, NULL); return 0; diff --git a/tests/regression/13-privatized/20-publish-regression.c b/tests/regression/13-privatized/20-publish-regression.c index 1c33a93980..da5c766b62 100644 --- a/tests/regression/13-privatized/20-publish-regression.c +++ b/tests/regression/13-privatized/20-publish-regression.c @@ -17,7 +17,7 @@ void *t_fun(void *arg) { pthread_mutex_unlock(&mutex2); // But if s[g] = {mutex1,mutex2}, we publish here. pthread_mutex_lock(&mutex2); - assert(glob1 == 5); + __goblint_check(glob1 == 5); glob1 = 0; pthread_mutex_unlock(&mutex1); pthread_mutex_unlock(&mutex2); @@ -26,10 +26,10 @@ void *t_fun(void *arg) { int main(void) { pthread_t id; - assert(glob1 == 0); + __goblint_check(glob1 == 0); pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&mutex1); - assert(glob1 == 0); + __goblint_check(glob1 == 0); pthread_mutex_unlock(&mutex1); pthread_join (id, NULL); return 0; diff --git a/tests/regression/13-privatized/21-publish-basic.c b/tests/regression/13-privatized/21-publish-basic.c index 3fd2e6882f..ed9bd05db2 100644 --- a/tests/regression/13-privatized/21-publish-basic.c +++ b/tests/regression/13-privatized/21-publish-basic.c @@ -8,17 +8,17 @@ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&mutex); glob1 = 5; - assert(glob1 == 5); + __goblint_check(glob1 == 5); pthread_mutex_unlock(&mutex); return NULL; } int main(void) { pthread_t id; - assert(glob1 == 0); + __goblint_check(glob1 == 0); pthread_create(&id, NULL, t_fun, NULL); - assert(glob1 == 0); // UNKNOWN! - assert(glob1 == 5); // UNKNOWN! + __goblint_check(glob1 == 0); // UNKNOWN! + __goblint_check(glob1 == 5); // UNKNOWN! pthread_join (id, NULL); return 0; } diff --git a/tests/regression/13-privatized/22-traces-paper.c b/tests/regression/13-privatized/22-traces-paper.c index 274758f1f4..a348e4d8aa 100644 --- a/tests/regression/13-privatized/22-traces-paper.c +++ b/tests/regression/13-privatized/22-traces-paper.c @@ -9,32 +9,32 @@ pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int x = 1; pthread_mutex_lock(&A); - assert(g == 6); - assert(x == 1); + __goblint_check(g == 6); + __goblint_check(x == 1); g = 5; - assert(g == 5); - assert(x == 1); + __goblint_check(g == 5); + __goblint_check(x == 1); pthread_mutex_lock(&B); - assert(g == 5); - assert(x == 1); + __goblint_check(g == 5); + __goblint_check(x == 1); pthread_mutex_unlock(&B); - assert(g == 5); - assert(x == 1); + __goblint_check(g == 5); + __goblint_check(x == 1); x = g; - assert(x == 5); + __goblint_check(x == 5); g = x + 1; - assert(g == 6); + __goblint_check(g == 6); pthread_mutex_unlock(&A); - assert(x == 5); + __goblint_check(x == 5); return NULL; } int main(void) { pthread_t id; - assert(g == 6); + __goblint_check(g == 6); pthread_create(&id, NULL, t_fun, NULL); - assert(5 <= g); - assert(g <= 6); + __goblint_check(5 <= g); + __goblint_check(g <= 6); pthread_join(id, NULL); return 0; } diff --git a/tests/regression/13-privatized/23-traces-paper2.c b/tests/regression/13-privatized/23-traces-paper2.c index 0b4f9a4583..564d233543 100644 --- a/tests/regression/13-privatized/23-traces-paper2.c +++ b/tests/regression/13-privatized/23-traces-paper2.c @@ -9,35 +9,35 @@ pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int x = 1; pthread_mutex_lock(&A); - assert(g == 6); - assert(x == 1); + __goblint_check(g == 6); + __goblint_check(x == 1); g = 5; - assert(g == 5); - assert(x == 1); + __goblint_check(g == 5); + __goblint_check(x == 1); pthread_mutex_lock(&B); - assert(g == 5); - assert(x == 1); + __goblint_check(g == 5); + __goblint_check(x == 1); pthread_mutex_unlock(&B); - assert(g == 5); - assert(x == 1); + __goblint_check(g == 5); + __goblint_check(x == 1); x = g; - assert(x == 5); + __goblint_check(x == 5); g = x + 1; - assert(g == 6); + __goblint_check(g == 6); x = g; // added - assert(g == 6); // added - assert(x == 6); // added + __goblint_check(g == 6); // added + __goblint_check(x == 6); // added pthread_mutex_unlock(&A); - assert(x == 6); // modified + __goblint_check(x == 6); // modified return NULL; } int main(void) { pthread_t id; - assert(g == 6); + __goblint_check(g == 6); pthread_create(&id, NULL, t_fun, NULL); - assert(5 <= g); - assert(g <= 6); + __goblint_check(5 <= g); + __goblint_check(g <= 6); pthread_join(id, NULL); return 0; } diff --git a/tests/regression/13-privatized/24-multiple-protecting.c b/tests/regression/13-privatized/24-multiple-protecting.c index c177b3e6f2..f9cceb0ada 100644 --- a/tests/regression/13-privatized/24-multiple-protecting.c +++ b/tests/regression/13-privatized/24-multiple-protecting.c @@ -34,20 +34,20 @@ int main(void) { pthread_mutex_lock(&mutex1); pthread_mutex_lock(&__global_lock); - assert(g1 == 0); + __goblint_check(g1 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_lock(&mutex2); pthread_mutex_lock(&__global_lock); - assert(g1 == 0); + __goblint_check(g1 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_lock(&__global_lock); - assert(g2 == 0); + __goblint_check(g2 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_unlock(&mutex2); pthread_mutex_lock(&__global_lock); - assert(g1 == 0); + __goblint_check(g1 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_unlock(&mutex1); diff --git a/tests/regression/13-privatized/25-struct_nr.c b/tests/regression/13-privatized/25-struct_nr.c index fbb2756ff9..54ca24d5e1 100644 --- a/tests/regression/13-privatized/25-struct_nr.c +++ b/tests/regression/13-privatized/25-struct_nr.c @@ -13,9 +13,9 @@ void *t_fun(void *arg) { int t; pthread_mutex_lock(&lock1.mutex); t = glob1; - assert(t == 5); + __goblint_check(t == 5); glob1 = -10; - assert(glob1 == -10); + __goblint_check(glob1 == -10); glob1 = t; pthread_mutex_unlock(&lock1.mutex); return NULL; @@ -23,11 +23,11 @@ void *t_fun(void *arg) { int main(void) { pthread_t id; - assert(glob1 == 5); + __goblint_check(glob1 == 5); pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&lock1.mutex); glob1++; - assert(glob1 == 6); + __goblint_check(glob1 == 6); glob1--; pthread_mutex_unlock(&lock1.mutex); pthread_join (id, NULL); diff --git a/tests/regression/13-privatized/26-struct_rc.c b/tests/regression/13-privatized/26-struct_rc.c index 442fe1ee86..f03194a80a 100644 --- a/tests/regression/13-privatized/26-struct_rc.c +++ b/tests/regression/13-privatized/26-struct_rc.c @@ -13,9 +13,9 @@ void *t_fun(void *arg) { int t; pthread_mutex_lock(&lock1.mutex); t = glob1; - assert(t == 5); // UNKNOWN + __goblint_check(t == 5); // UNKNOWN glob1 = -10; - assert(glob1 == -10); // UNKNOWN + __goblint_check(glob1 == -10); // UNKNOWN glob1 = t; pthread_mutex_unlock(&lock1.mutex); return NULL; @@ -23,11 +23,11 @@ void *t_fun(void *arg) { int main(void) { pthread_t id; - assert(glob1 == 5); + __goblint_check(glob1 == 5); pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&lock2.mutex); glob1++; - assert(glob1 == 6); // UNKNOWN + __goblint_check(glob1 == 6); // UNKNOWN glob1--; pthread_mutex_unlock(&lock2.mutex); pthread_join (id, NULL); diff --git a/tests/regression/13-privatized/27-multiple-protecting2.c b/tests/regression/13-privatized/27-multiple-protecting2.c index f9799a6e4f..67fab64055 100644 --- a/tests/regression/13-privatized/27-multiple-protecting2.c +++ b/tests/regression/13-privatized/27-multiple-protecting2.c @@ -39,20 +39,20 @@ int main(void) { pthread_mutex_lock(&mutex1); pthread_mutex_lock(&__global_lock); // Read & join to g2 Mine influence: [[g2, __global_lock], t2_fun, {mutex2}] -> (0 join 1 = Unknown) - assert(g1 == 0); + __goblint_check(g1 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_lock(&mutex2); pthread_mutex_lock(&__global_lock); - assert(g1 == 0); + __goblint_check(g1 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_lock(&__global_lock); - assert(g2 == 0); + __goblint_check(g2 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_unlock(&mutex2); pthread_mutex_lock(&__global_lock); - assert(g1 == 0); + __goblint_check(g1 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_unlock(&mutex1); diff --git a/tests/regression/13-privatized/28-multiple-protecting2-simple.c b/tests/regression/13-privatized/28-multiple-protecting2-simple.c index a22b371d56..0dc05f6cfb 100644 --- a/tests/regression/13-privatized/28-multiple-protecting2-simple.c +++ b/tests/regression/13-privatized/28-multiple-protecting2-simple.c @@ -25,15 +25,15 @@ int main(void) { pthread_mutex_lock(&mutex1); pthread_mutex_lock(&__global_lock); // Read & join to g2 Mine influence: [[g2, __global_lock], t2_fun, {mutex2}] -> (0 join 1 = Unknown) - assert(g1 == 0); + __goblint_check(g1 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_lock(&mutex2); pthread_mutex_lock(&__global_lock); - assert(g2 == 0); + __goblint_check(g2 == 0); pthread_mutex_unlock(&__global_lock); pthread_mutex_unlock(&mutex2); - + pthread_mutex_unlock(&mutex1); pthread_join(id2, NULL); diff --git a/tests/regression/13-privatized/29-multiple-protecting2-vesal.c b/tests/regression/13-privatized/29-multiple-protecting2-vesal.c index a947c94f78..bd160bf4a2 100644 --- a/tests/regression/13-privatized/29-multiple-protecting2-vesal.c +++ b/tests/regression/13-privatized/29-multiple-protecting2-vesal.c @@ -26,13 +26,13 @@ int main(void) { pthread_mutex_lock(&mutex1); pthread_mutex_lock(&__global_lock); // Read & join to g2 Mine influence: [[g2, __global_lock], t2_fun, {mutex2}] -> (0 join 1 = Unknown) - assert(0 <= g2); // TODO (widening) - assert(g2 <= 1); // TODO + __goblint_check(0 <= g2); // TODO (widening) + __goblint_check(g2 <= 1); // TODO pthread_mutex_unlock(&__global_lock); pthread_mutex_lock(&mutex2); pthread_mutex_lock(&__global_lock); - assert(g2 == 0); // TODO + __goblint_check(g2 == 0); // TODO pthread_mutex_unlock(&__global_lock); pthread_mutex_unlock(&mutex2); diff --git a/tests/regression/13-privatized/30-traces-oplus-vs-meet.c b/tests/regression/13-privatized/30-traces-oplus-vs-meet.c index 7b57ba7c99..1d7f1bf11d 100644 --- a/tests/regression/13-privatized/30-traces-oplus-vs-meet.c +++ b/tests/regression/13-privatized/30-traces-oplus-vs-meet.c @@ -27,12 +27,12 @@ void *t_fun(void *arg) { int main(void) { pthread_t id; - assert(g == 0); + __goblint_check(g == 0); pthread_create(&id, NULL, t_fun, NULL); // t2 pthread_mutex_lock(&B); pthread_mutex_lock(&A); - assert(g == 0); + __goblint_check(g == 0); pthread_mutex_unlock(&A); pthread_mutex_unlock(&B); pthread_join(id, NULL); diff --git a/tests/regression/13-privatized/31-traces-mine-vs-mutex.c b/tests/regression/13-privatized/31-traces-mine-vs-mutex.c index 94576830d5..367bd4d39c 100644 --- a/tests/regression/13-privatized/31-traces-mine-vs-mutex.c +++ b/tests/regression/13-privatized/31-traces-mine-vs-mutex.c @@ -27,7 +27,7 @@ int main(void) { pthread_mutex_lock(&A); pthread_mutex_lock(&B); - assert(g == 0); + __goblint_check(g == 0); pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); diff --git a/tests/regression/13-privatized/32-traces-mine-vs-oplus-vs-meet.c b/tests/regression/13-privatized/32-traces-mine-vs-oplus-vs-meet.c index f41065b7b9..814c682166 100644 --- a/tests/regression/13-privatized/32-traces-mine-vs-oplus-vs-meet.c +++ b/tests/regression/13-privatized/32-traces-mine-vs-oplus-vs-meet.c @@ -27,13 +27,13 @@ int main(void) { // This must be before the other to get Mine to fail for the other even with thread ID partitioning. pthread_mutex_lock(&B); pthread_mutex_lock(&C); - assert(g == 0); // TODO (mine and mutex-oplus fail, mutex-meet succeeds) + __goblint_check(g == 0); // TODO (mine and mutex-oplus fail, mutex-meet succeeds) pthread_mutex_unlock(&C); pthread_mutex_unlock(&B); pthread_mutex_lock(&A); pthread_mutex_lock(&B); - assert(g == 0); // TODO (mine fails, mutex-oplus and mutex-meet succeed) + __goblint_check(g == 0); // TODO (mine fails, mutex-oplus and mutex-meet succeed) pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); diff --git a/tests/regression/13-privatized/33-traces-v-matters.c b/tests/regression/13-privatized/33-traces-v-matters.c index 8e5deabbb3..699c4b78e0 100644 --- a/tests/regression/13-privatized/33-traces-v-matters.c +++ b/tests/regression/13-privatized/33-traces-v-matters.c @@ -26,6 +26,6 @@ int main(void) { g = 2; pthread_mutex_unlock(&C); pthread_mutex_lock(&E); - assert(g == 2); // TODO + __goblint_check(g == 2); // TODO return 0; } diff --git a/tests/regression/13-privatized/34-traces-minepp-L-needs-to-be-um.c b/tests/regression/13-privatized/34-traces-minepp-L-needs-to-be-um.c index 0b1ba24d80..27d2442e47 100644 --- a/tests/regression/13-privatized/34-traces-minepp-L-needs-to-be-um.c +++ b/tests/regression/13-privatized/34-traces-minepp-L-needs-to-be-um.c @@ -38,6 +38,6 @@ int main(void) { pthread_mutex_unlock(&B); } // mine-w also reads 15 here by weak influence, so useless example - assert(g == 42); // TODO + __goblint_check(g == 42); // TODO return 0; } diff --git a/tests/regression/13-privatized/35-traces-ex-2.c b/tests/regression/13-privatized/35-traces-ex-2.c index 09e0aea077..806d9bcdea 100644 --- a/tests/regression/13-privatized/35-traces-ex-2.c +++ b/tests/regression/13-privatized/35-traces-ex-2.c @@ -23,7 +23,7 @@ int main(void) { pthread_mutex_lock(&B); pthread_mutex_lock(&A); - assert(g == 0); + __goblint_check(g == 0); pthread_mutex_unlock(&A); pthread_mutex_unlock(&B); return 0; diff --git a/tests/regression/13-privatized/36-traces-ex-3.c b/tests/regression/13-privatized/36-traces-ex-3.c index a76ccc18bd..dca5e67265 100644 --- a/tests/regression/13-privatized/36-traces-ex-3.c +++ b/tests/regression/13-privatized/36-traces-ex-3.c @@ -22,7 +22,7 @@ int main(void) { pthread_mutex_lock(&A); pthread_mutex_unlock(&A); pthread_mutex_lock(&B); - assert(g == 2); + __goblint_check(g == 2); pthread_mutex_unlock(&B); return 0; } diff --git a/tests/regression/13-privatized/37-traces-ex-4.c b/tests/regression/13-privatized/37-traces-ex-4.c index 183c84ab87..11308221b1 100644 --- a/tests/regression/13-privatized/37-traces-ex-4.c +++ b/tests/regression/13-privatized/37-traces-ex-4.c @@ -23,7 +23,7 @@ int main(void) { pthread_mutex_lock(&B); pthread_mutex_lock(&A); - assert(g == 2); + __goblint_check(g == 2); pthread_mutex_unlock(&A); pthread_mutex_unlock(&B); return 0; diff --git a/tests/regression/13-privatized/38-traces-ex-4-switch.c b/tests/regression/13-privatized/38-traces-ex-4-switch.c index e9f8225e27..2de874e407 100644 --- a/tests/regression/13-privatized/38-traces-ex-4-switch.c +++ b/tests/regression/13-privatized/38-traces-ex-4-switch.c @@ -23,7 +23,7 @@ int main(void) { pthread_mutex_lock(&A); pthread_mutex_lock(&B); - assert(g == 2); + __goblint_check(g == 2); pthread_mutex_unlock(&A); pthread_mutex_unlock(&B); return 0; diff --git a/tests/regression/13-privatized/39-traces-ex-5.c b/tests/regression/13-privatized/39-traces-ex-5.c index 1604a98b04..6cbbaac24f 100644 --- a/tests/regression/13-privatized/39-traces-ex-5.c +++ b/tests/regression/13-privatized/39-traces-ex-5.c @@ -27,7 +27,7 @@ int main(void) { pthread_mutex_lock(&D); pthread_mutex_lock(&A); pthread_mutex_unlock(&D); - assert(g == 2); // UNKNOWN! + __goblint_check(g == 2); // UNKNOWN! pthread_mutex_unlock(&A); return 0; } diff --git a/tests/regression/13-privatized/40-traces-ex-6.c b/tests/regression/13-privatized/40-traces-ex-6.c index dd097f0651..24cf634ce3 100644 --- a/tests/regression/13-privatized/40-traces-ex-6.c +++ b/tests/regression/13-privatized/40-traces-ex-6.c @@ -22,6 +22,6 @@ int main(void) { pthread_mutex_lock(&D); pthread_mutex_lock(&A); pthread_mutex_unlock(&D); - assert(g == 2); // TODO + __goblint_check(g == 2); // TODO return 0; } diff --git a/tests/regression/13-privatized/41-traces-ex-7.c b/tests/regression/13-privatized/41-traces-ex-7.c index ffcdd68086..8fc0c184d4 100644 --- a/tests/regression/13-privatized/41-traces-ex-7.c +++ b/tests/regression/13-privatized/41-traces-ex-7.c @@ -21,6 +21,6 @@ int main(void) { pthread_mutex_lock(&D); pthread_mutex_lock(&A); pthread_mutex_unlock(&D); - assert(g == 0); // UNKNOWN! + __goblint_check(g == 0); // UNKNOWN! return 0; } diff --git a/tests/regression/13-privatized/42-traces-ex-mini.c b/tests/regression/13-privatized/42-traces-ex-mini.c index 884b76a047..e1ef653783 100644 --- a/tests/regression/13-privatized/42-traces-ex-mini.c +++ b/tests/regression/13-privatized/42-traces-ex-mini.c @@ -23,7 +23,7 @@ int main(void) { pthread_mutex_lock(&A); pthread_mutex_lock(&B); pthread_mutex_lock(&C); - assert(g == 17); + __goblint_check(g == 17); pthread_mutex_unlock(&A); pthread_mutex_unlock(&B); pthread_mutex_unlock(&C); diff --git a/tests/regression/13-privatized/43-traces-mine1.c b/tests/regression/13-privatized/43-traces-mine1.c index 50386a72b3..7887daa4d4 100644 --- a/tests/regression/13-privatized/43-traces-mine1.c +++ b/tests/regression/13-privatized/43-traces-mine1.c @@ -22,9 +22,9 @@ int main(void) { pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); - assert(g >= 2); // TODO + __goblint_check(g >= 2); // TODO pthread_mutex_lock(&B); - assert(g >= 2); // TODO - assert(g == 3); // TODO + __goblint_check(g >= 2); // TODO + __goblint_check(g == 3); // TODO return 0; } diff --git a/tests/regression/13-privatized/44-traces-mine2.c b/tests/regression/13-privatized/44-traces-mine2.c index 107c21f7af..1f0d1105db 100644 --- a/tests/regression/13-privatized/44-traces-mine2.c +++ b/tests/regression/13-privatized/44-traces-mine2.c @@ -21,8 +21,8 @@ int main(void) { pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); - assert(g == 3); + __goblint_check(g == 3); pthread_mutex_lock(&B); - assert(g == 3); + __goblint_check(g == 3); return 0; } diff --git a/tests/regression/13-privatized/45-traces-per-global-and-current-lock-mine-incomparable.c b/tests/regression/13-privatized/45-traces-per-global-and-current-lock-mine-incomparable.c index 1a697fe0ac..727efe10c6 100644 --- a/tests/regression/13-privatized/45-traces-per-global-and-current-lock-mine-incomparable.c +++ b/tests/regression/13-privatized/45-traces-per-global-and-current-lock-mine-incomparable.c @@ -23,7 +23,7 @@ int main(void) { g = 42; pthread_mutex_unlock(&B); pthread_mutex_lock(&B); - assert(g == 42); + __goblint_check(g == 42); pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/13-privatized/46-refine-protected1.c b/tests/regression/13-privatized/46-refine-protected1.c index 2bd2b4d577..290f8c72d4 100644 --- a/tests/regression/13-privatized/46-refine-protected1.c +++ b/tests/regression/13-privatized/46-refine-protected1.c @@ -16,9 +16,9 @@ int main() { pthread_mutex_lock(&A); if (g) // protected globals should be refined - assert(g); + __goblint_check(g); else - assert(!g); + __goblint_check(!g); pthread_mutex_unlock(&A); pthread_mutex_lock(&A); diff --git a/tests/regression/13-privatized/47-refine-protected2.c b/tests/regression/13-privatized/47-refine-protected2.c index 74b8132261..a959ddb03d 100644 --- a/tests/regression/13-privatized/47-refine-protected2.c +++ b/tests/regression/13-privatized/47-refine-protected2.c @@ -18,9 +18,9 @@ int main() { pthread_mutex_lock(&A); if (g) // protected globals should be refined - assert(g); + __goblint_check(g); else - assert(!g); + __goblint_check(!g); pthread_mutex_unlock(&A); return 0; } diff --git a/tests/regression/13-privatized/48-pfscan_protected_loop_minimal.c b/tests/regression/13-privatized/48-pfscan_protected_loop_minimal.c index 44f25c9c1b..af610af007 100644 --- a/tests/regression/13-privatized/48-pfscan_protected_loop_minimal.c +++ b/tests/regression/13-privatized/48-pfscan_protected_loop_minimal.c @@ -30,11 +30,11 @@ int pqueue_get(PQUEUE *qp) pthread_mutex_lock(& qp->mtx); while (qp->occupied <= 0) { // qp->occupied should not be just 0, unsoundness in old - assert(qp->occupied == 0); // UNKNOWN (no interval, with overflow) + __goblint_check(qp->occupied == 0); // UNKNOWN (no interval, with overflow) // this assert should not refine! } // qp->occupied should not be Error int, unsoundness in global - assert(qp->occupied != 0); + __goblint_check(qp->occupied != 0); if (qp->occupied > 0) { (qp->occupied) --; got = 1; diff --git a/tests/regression/13-privatized/49-refine-protected-loop.c b/tests/regression/13-privatized/49-refine-protected-loop.c index 300b6b52d1..7b5d9ffab3 100644 --- a/tests/regression/13-privatized/49-refine-protected-loop.c +++ b/tests/regression/13-privatized/49-refine-protected-loop.c @@ -26,11 +26,11 @@ int pqueue_get() pthread_mutex_lock(&A); while (g <= 0) { // g should not be just 0, unsoundness in old - assert(g == 0); // UNKNOWN (no interval, with overflow) + __goblint_check(g == 0); // UNKNOWN (no interval, with overflow) // this assert should not refine! } // g should not be Error int, unsoundness in global - assert(g != 0); + __goblint_check(g != 0); if (g > 0) { g--; got = 1; diff --git a/tests/regression/13-privatized/50-pfscan_protected_loop_minimal2.c b/tests/regression/13-privatized/50-pfscan_protected_loop_minimal2.c index 312279a9dc..254541abef 100644 --- a/tests/regression/13-privatized/50-pfscan_protected_loop_minimal2.c +++ b/tests/regression/13-privatized/50-pfscan_protected_loop_minimal2.c @@ -30,11 +30,11 @@ int pqueue_get(PQUEUE *qp) pthread_mutex_lock(& qp->mtx); while (qp->occupied <= 0) { // qp->occupied should not be just 0, unsoundness in old - assert(qp->occupied == 0); // UNKNOWN (no interval, with overflow) + __goblint_check(qp->occupied == 0); // UNKNOWN (no interval, with overflow) // this assert should not refine! } // qp->occupied should not be Error int, unsoundness in global - assert(qp->occupied != 0); + __goblint_check(qp->occupied != 0); if (qp->occupied > 0) { (qp->occupied) --; got = 1; diff --git a/tests/regression/13-privatized/51-refine-protected-loop2.c b/tests/regression/13-privatized/51-refine-protected-loop2.c index 2bf29fb65a..a969ab834c 100644 --- a/tests/regression/13-privatized/51-refine-protected-loop2.c +++ b/tests/regression/13-privatized/51-refine-protected-loop2.c @@ -27,11 +27,11 @@ int pqueue_get() pthread_mutex_lock(&A); while (g <= 0) { // g should not be just 0, unsoundness in old - assert(g == 0); // UNKNOWN (no interval, with overflow) + __goblint_check(g == 0); // UNKNOWN (no interval, with overflow) // this assert should not refine! } // g should not be Error int, unsoundness in global - assert(g != 0); + __goblint_check(g != 0); if (g > 0) { g--; got = 1; diff --git a/tests/regression/13-privatized/52-refine-protected-loop2-small.c b/tests/regression/13-privatized/52-refine-protected-loop2-small.c index 43fd77ebff..9615eb6fff 100644 --- a/tests/regression/13-privatized/52-refine-protected-loop2-small.c +++ b/tests/regression/13-privatized/52-refine-protected-loop2-small.c @@ -11,7 +11,7 @@ void *worker(void *arg ) while (1) { pthread_mutex_lock(&A); g = 1000; - assert(g != 0); + __goblint_check(g != 0); if (g > 0) { g--; } diff --git a/tests/regression/13-privatized/53-pfscan_widen_dependent_minimal.c b/tests/regression/13-privatized/53-pfscan_widen_dependent_minimal.c index 5e6f1b0361..d63d225da9 100644 --- a/tests/regression/13-privatized/53-pfscan_widen_dependent_minimal.c +++ b/tests/regression/13-privatized/53-pfscan_widen_dependent_minimal.c @@ -31,7 +31,7 @@ int pqueue_put(PQUEUE *qp) while (qp->occupied >= qp->qsize) { } - assert(qp->occupied >= 0); // precise privatization fails + __goblint_check(qp->occupied >= 0); // precise privatization fails (qp->occupied) ++; pthread_mutex_unlock(& qp->mtx); return (1); @@ -44,7 +44,7 @@ int pqueue_get(PQUEUE *qp) while (qp->occupied <= 0) { } - assert(qp->occupied > 0); // precise privatization fails + __goblint_check(qp->occupied > 0); // precise privatization fails if (qp->occupied > 0) { (qp->occupied) --; got = 1; diff --git a/tests/regression/13-privatized/54-widen-dependent.c b/tests/regression/13-privatized/54-widen-dependent.c index fe8d08f84a..47c2722343 100644 --- a/tests/regression/13-privatized/54-widen-dependent.c +++ b/tests/regression/13-privatized/54-widen-dependent.c @@ -16,7 +16,7 @@ void *worker(void *arg ) while (g <= 0) { } - assert(g > 0); // precise privatization fails + __goblint_check(g > 0); // precise privatization fails g--; pthread_mutex_unlock(&A); return NULL; @@ -31,7 +31,7 @@ int main(int argc , char **argv ) while (g >= 10) { } - assert(g >= 0); // precise privatization fails + __goblint_check(g >= 0); // precise privatization fails g++; pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/13-privatized/55-widen-dependent-local.c b/tests/regression/13-privatized/55-widen-dependent-local.c index fb1956a9e6..49d25628ee 100644 --- a/tests/regression/13-privatized/55-widen-dependent-local.c +++ b/tests/regression/13-privatized/55-widen-dependent-local.c @@ -24,7 +24,7 @@ int put() { while (g >= limit) { // problematic widen } - assert(g >= 0); // precise privatization fails + __goblint_check(g >= 0); // precise privatization fails g++; pthread_mutex_unlock(&A); } diff --git a/tests/regression/13-privatized/57-singlethreaded-unlock.c b/tests/regression/13-privatized/57-singlethreaded-unlock.c index 2ff72c3fe0..f267673c2a 100644 --- a/tests/regression/13-privatized/57-singlethreaded-unlock.c +++ b/tests/regression/13-privatized/57-singlethreaded-unlock.c @@ -20,6 +20,6 @@ int main() { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); - assert(g == 2); + __goblint_check(g == 2); return 0; } diff --git a/tests/regression/13-privatized/58-singlethreaded-lock.c b/tests/regression/13-privatized/58-singlethreaded-lock.c index ab39f7abc2..8de143dec9 100644 --- a/tests/regression/13-privatized/58-singlethreaded-lock.c +++ b/tests/regression/13-privatized/58-singlethreaded-lock.c @@ -24,6 +24,6 @@ int main() { pthread_create(&id, NULL, t_fun, NULL); // enter multithreaded mode with nonempty lockset g = 3; // write under mutex which was locked during singlethreaded mode - assert(g == 3); + __goblint_check(g == 3); return 0; } diff --git a/tests/regression/13-privatized/60-allfuns-priv.c b/tests/regression/13-privatized/60-allfuns-priv.c index ad80d1a411..98275bf371 100644 --- a/tests/regression/13-privatized/60-allfuns-priv.c +++ b/tests/regression/13-privatized/60-allfuns-priv.c @@ -10,5 +10,5 @@ void f() { while (g) { // should be unreachable } - assert(g == 0); // should be reachable + __goblint_check(g == 0); // should be reachable } \ No newline at end of file diff --git a/tests/regression/13-privatized/61-otherfun-priv.c b/tests/regression/13-privatized/61-otherfun-priv.c index dd26a42566..ec9b47cce8 100644 --- a/tests/regression/13-privatized/61-otherfun-priv.c +++ b/tests/regression/13-privatized/61-otherfun-priv.c @@ -11,5 +11,5 @@ void f() { while (g) { // should be unreachable } - assert(g == 0); // should be reachable + __goblint_check(g == 0); // should be reachable } \ No newline at end of file diff --git a/tests/regression/13-privatized/66-mine-W-init.c b/tests/regression/13-privatized/66-mine-W-init.c index fac558450e..a8f1204509 100644 --- a/tests/regression/13-privatized/66-mine-W-init.c +++ b/tests/regression/13-privatized/66-mine-W-init.c @@ -11,6 +11,6 @@ int main() { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); g = 1; - assert(g); // TODO (Mine's analysis would succeed, our mine-W doesn't) + __goblint_check(g); // TODO (Mine's analysis would succeed, our mine-W doesn't) return 0; } diff --git a/tests/regression/13-privatized/67-pthread_cond_wait.c b/tests/regression/13-privatized/67-pthread_cond_wait.c index 0d4c8f072e..fc9892e081 100644 --- a/tests/regression/13-privatized/67-pthread_cond_wait.c +++ b/tests/regression/13-privatized/67-pthread_cond_wait.c @@ -12,8 +12,8 @@ void* f1(void* ptr) { pthread_mutex_lock(&mut); g = 1; pthread_cond_wait(&cond,&mut); - assert(g == 0); //UNKNOWN! - assert(g != 1); //UNKNOWN! + __goblint_check(g == 0); //UNKNOWN! + __goblint_check(g != 1); //UNKNOWN! printf("g is %i", g); g = 0; pthread_mutex_unlock(&mut); @@ -22,7 +22,7 @@ void* f1(void* ptr) { void* f2(void* ptr) { pthread_mutex_lock(&mut); - assert(g == 0); //UNKNOWN! + __goblint_check(g == 0); //UNKNOWN! g = 0; pthread_cond_signal(&cond); pthread_mutex_unlock(&mut); diff --git a/tests/regression/13-privatized/68-pfscan_protected_loop_minimal_interval.c b/tests/regression/13-privatized/68-pfscan_protected_loop_minimal_interval.c index 6b690e1939..9c81ee279a 100644 --- a/tests/regression/13-privatized/68-pfscan_protected_loop_minimal_interval.c +++ b/tests/regression/13-privatized/68-pfscan_protected_loop_minimal_interval.c @@ -31,9 +31,9 @@ int pqueue_get(PQUEUE *qp) int got = 0; pthread_mutex_lock(& qp->mtx); while (qp->occupied <= 0) { - assert(qp->occupied == 0); + __goblint_check(qp->occupied == 0); } - assert(qp->occupied != 0); + __goblint_check(qp->occupied != 0); if (qp->occupied > 0) { (qp->occupied) --; got = 1; diff --git a/tests/regression/13-privatized/69-refine-protected-loop-interval.c b/tests/regression/13-privatized/69-refine-protected-loop-interval.c index 4b8ea36282..b288767be9 100644 --- a/tests/regression/13-privatized/69-refine-protected-loop-interval.c +++ b/tests/regression/13-privatized/69-refine-protected-loop-interval.c @@ -27,9 +27,9 @@ int pqueue_get() int got = 0; pthread_mutex_lock(&A); while (g <= 0) { - assert(g == 0); + __goblint_check(g == 0); } - assert(g != 0); + __goblint_check(g != 0); if (g > 0) { g--; got = 1; diff --git a/tests/regression/13-privatized/70-mm-reentrant.c b/tests/regression/13-privatized/70-mm-reentrant.c index 138237bf21..8c256e7985 100644 --- a/tests/regression/13-privatized/70-mm-reentrant.c +++ b/tests/regression/13-privatized/70-mm-reentrant.c @@ -18,7 +18,7 @@ void* fn1(void* agr) i = 5; } pthread_mutex_lock(&mt); - assert(i == 0); //UNKNOWN! + __goblint_check(i == 0); //UNKNOWN! i = 0; pthread_mutex_unlock(&mt); pthread_mutex_unlock(&mt); @@ -33,7 +33,7 @@ void* fn2(void* agr) i = 5; } top = pthread_mutex_lock(&mt); - assert(i == 0); //UNKNOWN! + __goblint_check(i == 0); //UNKNOWN! i = 0; pthread_mutex_unlock(&mt); pthread_mutex_unlock(&mt); diff --git a/tests/regression/13-privatized/71-branched-thread-creation-priv.c b/tests/regression/13-privatized/71-branched-thread-creation-priv.c index 685ddffca6..16c4d172ab 100644 --- a/tests/regression/13-privatized/71-branched-thread-creation-priv.c +++ b/tests/regression/13-privatized/71-branched-thread-creation-priv.c @@ -23,7 +23,7 @@ int main() { // sync join needs to publish global also to protected/mutex_inits like enter_multithreaded pthread_mutex_lock(&m); - assert(global == 5); // UNKNOWN! + __goblint_check(global == 5); // UNKNOWN! pthread_mutex_unlock(&m); return 0; diff --git a/tests/regression/13-privatized/72-pthread_cond_wait_mutexoplus.c b/tests/regression/13-privatized/72-pthread_cond_wait_mutexoplus.c index cc44ce27dd..d144f3144e 100644 --- a/tests/regression/13-privatized/72-pthread_cond_wait_mutexoplus.c +++ b/tests/regression/13-privatized/72-pthread_cond_wait_mutexoplus.c @@ -13,8 +13,8 @@ void* f1(void* ptr) { pthread_mutex_lock(&mut); g = 1; pthread_cond_wait(&cond,&mut); - assert(g == 0); //UNKNOWN! - assert(g != 1); //UNKNOWN! + __goblint_check(g == 0); //UNKNOWN! + __goblint_check(g != 1); //UNKNOWN! printf("g is %i", g); g = 0; pthread_mutex_unlock(&mut); @@ -23,7 +23,7 @@ void* f1(void* ptr) { void* f2(void* ptr) { pthread_mutex_lock(&mut); - assert(g == 0); //UNKNOWN! + __goblint_check(g == 0); //UNKNOWN! g = 0; pthread_cond_signal(&cond); pthread_mutex_unlock(&mut); diff --git a/tests/regression/13-privatized/73-branched-thread-creation-priv2.c b/tests/regression/13-privatized/73-branched-thread-creation-priv2.c index 7728f617d4..68c63651c9 100644 --- a/tests/regression/13-privatized/73-branched-thread-creation-priv2.c +++ b/tests/regression/13-privatized/73-branched-thread-creation-priv2.c @@ -26,7 +26,7 @@ int main(void) { pthread_mutex_lock(&A); x = g; // may read 10! - assert(g <= 5); // UNKNOWN! + __goblint_check(g <= 5); // UNKNOWN! pthread_mutex_unlock(&A); return 0; } \ No newline at end of file diff --git a/tests/regression/17-arinc/03-preemt_lock.c b/tests/regression/17-arinc/03-preemt_lock.c index 89731c52dd..3a931adb3c 100644 --- a/tests/regression/17-arinc/03-preemt_lock.c +++ b/tests/regression/17-arinc/03-preemt_lock.c @@ -70,7 +70,7 @@ void P1(void){ while (1){ LAP_Se_LockPreemption(&ll,&r); g = 1; - assert(g==1); // TODO: privatization by preemption? + __goblint_check(g==1); // TODO: privatization by preemption? LAP_Se_UnlockPreemption(&ll,&r); } return; diff --git a/tests/regression/17-arinc/05-term-simple.c b/tests/regression/17-arinc/05-term-simple.c index be3915f875..75a13554b2 100644 --- a/tests/regression/17-arinc/05-term-simple.c +++ b/tests/regression/17-arinc/05-term-simple.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','term','mallocWrapper']" --enable dbg.debug --enable ana.int.interval --set solver slr3 --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','term','mallocWrapper','assert']" --enable dbg.debug --enable ana.int.interval --set solver slr3 --set ana.base.privatization none /*#include "stdio.h"*/ diff --git a/tests/regression/17-arinc/06-term.c b/tests/regression/17-arinc/06-term.c index b0beb55c08..1140152605 100644 --- a/tests/regression/17-arinc/06-term.c +++ b/tests/regression/17-arinc/06-term.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated "['base','threadid','threadflag','term','mallocWrapper']" --enable dbg.debug --enable ana.int.interval --set solver slr3 --set ana.base.privatization none +// PARAM: --set ana.activated "['base','threadid','threadflag','term','mallocWrapper','assert']" --enable dbg.debug --enable ana.int.interval --set solver slr3 --set ana.base.privatization none int main(){ int i = 0; diff --git a/tests/regression/20-slr_term/04-assert-exit.c b/tests/regression/20-slr_term/04-assert-exit.c index 267aa7cfef..522e466f3e 100644 --- a/tests/regression/20-slr_term/04-assert-exit.c +++ b/tests/regression/20-slr_term/04-assert-exit.c @@ -3,7 +3,7 @@ #include void f(void) { - assert(0); // FAIL! + __goblint_check(0); // FAIL! printf("hello, this is \"f\"\n"); } diff --git a/tests/regression/21-casts/01-via_ptr.c b/tests/regression/21-casts/01-via_ptr.c index ee7d614923..df713b8a1a 100644 --- a/tests/regression/21-casts/01-via_ptr.c +++ b/tests/regression/21-casts/01-via_ptr.c @@ -13,19 +13,19 @@ int main(){ int a = 128; typedef signed char schar; // signed may not be the default! schar b = a; // downcast resulting in overflow (pos to neg) - assert(b == -128); + __goblint_check(b == -128); unsigned char b2 = -1; // neg to pos - assert(b2 == 255); + __goblint_check(b2 == 255); // via pointer (same data reinterpreted with different type) // downcasts are ok for pos. values schar* c = (schar*) &a; b = *c; - assert(b == -128); + __goblint_check(b == -128); // and also for neg. values: - a = -1; b = *c; printf("a: %d, b: %d\n", a, b); assert(b == -1); - a = INT_MIN+1; b = *c; printf("a: %d, b: %d\n", a, b); assert(b == 1); - a = CHAR_MIN; b = *c; printf("a: %d, b: %d\n", a, b); assert(b == -128); - a = CHAR_MIN-1; b = *c; printf("a: %d, b: %d\n", a, b); assert(b == 127); + a = -1; b = *c; printf("a: %d, b: %d\n", a, b); __goblint_check(b == -1); + a = INT_MIN+1; b = *c; printf("a: %d, b: %d\n", a, b); __goblint_check(b == 1); + a = CHAR_MIN; b = *c; printf("a: %d, b: %d\n", a, b); __goblint_check(b == -128); + a = CHAR_MIN-1; b = *c; printf("a: %d, b: %d\n", a, b); __goblint_check(b == 127); // upcast must always lead to top since we might read garbage (except we know there was a corresponding downcast before) { schar a = 1; @@ -33,7 +33,7 @@ int main(){ int* pa = (int*) &a; int* pb = (int*) &b; printf("a: %d, b: %d\n", *pa, *pb); - assert(*pa != *pb); // UNKNOWN! + __goblint_check(*pa != *pb); // UNKNOWN! } // check that limits are handled correctly @@ -57,31 +57,31 @@ int main(){ // cast in (add first field) struct a a; a.x = 3; - assert(a.x == 3); - assert(*((int*) &a) == 3); - assert((&a)[0].x == 3); + __goblint_check(a.x == 3); + __goblint_check(*((int*) &a) == 3); + __goblint_check((&a)[0].x == 3); *((int*) &a) = 5; - assert(a.x == 5); + __goblint_check(a.x == 5); // two levels struct b b; b.x = a; - assert(b.x.x == 5); + __goblint_check(b.x.x == 5); ((struct a*) &b)->x = 6; - assert(b.x.x == 6); + __goblint_check(b.x.x == 6); *((int*) &b) = 7; - assert(b.x.x == 7); + __goblint_check(b.x.x == 7); // cast out (strip first field) a.y = 8; - assert(((struct a*) &a.x)->y == 8); + __goblint_check(((struct a*) &a.x)->y == 8); b.y = 9; - assert(((struct b*) &b.x.x)->y == 9); + __goblint_check(((struct b*) &b.x.x)->y == 9); // there are no assumptions one can make for following fields! - assert(*((&a.x)+1) == 8); // UNKNOWN! + __goblint_check(*((&a.x)+1) == 8); // UNKNOWN! // pointers into the middle that are casted out must be top! // this gives a segfault: - assert(((struct a*) &a.y)->y == 8); // UNKNOWN! + __goblint_check(((struct a*) &a.y)->y == 8); // UNKNOWN! } @@ -90,25 +90,25 @@ int main(){ int c[5]; int *e; e = c; - assert(c == &c[0]); - assert(c == e); - assert(&c[1] == e+1); - // assert(c[1] == *(e+1)); // TO-DO array content is still `Bot + __goblint_check(c == &c[0]); + __goblint_check(c == e); + __goblint_check(&c[1] == e+1); + // __goblint_check(c[1] == *(e+1)); // TO-DO array content is still `Bot // of structs struct a f[5]; - assert((int*)f == &(f[0].x)); // index 0, first field - assert((void*)f == &(f[0].x)); // same, but with other type (address is still the same) + __goblint_check((int*)f == &(f[0].x)); // index 0, first field + __goblint_check((void*)f == &(f[0].x)); // same, but with other type (address is still the same) // same, with typedef: addr x, y; x = (addr)f; y = &f[0].x; - assert(x == y); + __goblint_check(x == y); int* p = (int*)f; - assert((((struct a*)p)+1) == &f[1]); + __goblint_check((((struct a*)p)+1) == &f[1]); // of arrays int g[3][4]; p = (int*)g; - assert(((int(*)[4])p)+1 == &g[1]); + __goblint_check(((int(*)[4])p)+1 == &g[1]); } return 0; diff --git a/tests/regression/21-casts/02-loop.c b/tests/regression/21-casts/02-loop.c index 9fee28bc1f..7c64ddc095 100644 --- a/tests/regression/21-casts/02-loop.c +++ b/tests/regression/21-casts/02-loop.c @@ -12,6 +12,6 @@ int main(){ counter++; tmp = 2; } - assert(counter == 10); + __goblint_check(counter == 10); counter = (unsigned char)216; } diff --git a/tests/regression/21-casts/03-Exc-overflow.c b/tests/regression/21-casts/03-Exc-overflow.c index 98276405b3..d12c8c2edc 100644 --- a/tests/regression/21-casts/03-Exc-overflow.c +++ b/tests/regression/21-casts/03-Exc-overflow.c @@ -7,11 +7,11 @@ int main () { if(a == 127) return 42; char b = a+1; // (char)128 = -128 printf("b: %d\n", b); - assert(b != -128); // UNKNOWN + __goblint_check(b != -128); // UNKNOWN int c; if (c == -128) return 42; // c is not -128 c = (char) c; // actual downcast: c could be 128, cast to char = -128 - assert(c != -128); // UNKNOWN! + __goblint_check(c != -128); // UNKNOWN! int top; unsigned long ul = 77777777; @@ -22,7 +22,7 @@ int main () { if(ul != 511) { unsigned char uc = (unsigned char)ul; - assert(uc != 255); //UNKNOWN! + __goblint_check(uc != 255); //UNKNOWN! ul = 1; } } diff --git a/tests/regression/21-casts/04-neg-to-unsigned-invariant.c b/tests/regression/21-casts/04-neg-to-unsigned-invariant.c index 91ae38fe35..e3f838c14e 100644 --- a/tests/regression/21-casts/04-neg-to-unsigned-invariant.c +++ b/tests/regression/21-casts/04-neg-to-unsigned-invariant.c @@ -6,9 +6,9 @@ int main() { int debug_value = -1; if ((unsigned int)debug_value > 31U) - assert(1); // reachable + __goblint_check(1); // reachable else - assert(1); // NOWARN (unreachable) + __goblint_check(1); // NOWARN (unreachable) return 0; } \ No newline at end of file diff --git a/tests/regression/22-partitioned_arrays/01-simple_array.c b/tests/regression/22-partitioned_arrays/01-simple_array.c index baf6fe1c6f..cd004a173a 100644 --- a/tests/regression/22-partitioned_arrays/01-simple_array.c +++ b/tests/regression/22-partitioned_arrays/01-simple_array.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int global; @@ -27,15 +27,15 @@ void example1(void) while (i < 42) { a[i] = 0; - assert(a[i] == 0); - assert(a[0] == 0); - assert(a[17] == 0); // UNKNOWN + __goblint_check(a[i] == 0); + __goblint_check(a[0] == 0); + __goblint_check(a[17] == 0); // UNKNOWN i++; } - assert(a[0] == 0); - assert(a[7] == 0); - assert(a[41] == 0); + __goblint_check(a[0] == 0); + __goblint_check(a[7] == 0); + __goblint_check(a[41] == 0); } // More complicated expression to index rather than just a variable @@ -45,14 +45,14 @@ void example2(void) { while (i < 43) { a[i - 1] = 0; - assert(a[i - 1] == 0); - assert(a[38] == 0); // UNKNOWN + __goblint_check(a[i - 1] == 0); + __goblint_check(a[38] == 0); // UNKNOWN i++; } - assert(a[0] == 0); - assert(a[7] == 0); - assert(a[41] == 0); + __goblint_check(a[0] == 0); + __goblint_check(a[7] == 0); + __goblint_check(a[41] == 0); } // Two values initialized in one loop @@ -67,10 +67,10 @@ void example3(void) { i++; } - assert(a[0] == 2); // FAIL - assert(a[41] == 0); // UNKNOWN - assert(a[41] == 1); // UNKNOWN - assert(a[41] == -1); // FAIL + __goblint_check(a[0] == 2); // FAIL + __goblint_check(a[41] == 0); // UNKNOWN + __goblint_check(a[41] == 1); // UNKNOWN + __goblint_check(a[41] == -1); // FAIL } // Example where initialization proceeds backwards @@ -83,10 +83,10 @@ void example4(void) { i--; } - assert(a[i+2] == 0); - assert(a[41] == 0); - assert(a[i] == 0); //UNKNOWN - assert(a[0] == 0); //UNKNOWN + __goblint_check(a[i+2] == 0); + __goblint_check(a[41] == 0); + __goblint_check(a[i] == 0); //UNKNOWN + __goblint_check(a[0] == 0); //UNKNOWN } // Example having two arrays partitioned according to one expression @@ -99,15 +99,15 @@ void example5(void) { a[i] = 2; b[41-i] = 0; - assert(b[7] == 0); //UNKNOWN - assert(a[5] == 2); //UNKNOWN + __goblint_check(b[7] == 0); //UNKNOWN + __goblint_check(a[5] == 2); //UNKNOWN i++; } - assert(a[0] == 2); - assert(a[41] == 2); - assert(b[0] == 0); - assert(b[41] == 0); + __goblint_check(a[0] == 2); + __goblint_check(a[41] == 2); + __goblint_check(b[0] == 0); + __goblint_check(b[41] == 0); } // Example showing array becoming partitioned according to different expressions @@ -122,22 +122,22 @@ void example6(void) { i++; } - assert(a[17] == 4); - assert(a[9] == 4); - assert(a[3] == 4); - assert(a[i-1] == 4); + __goblint_check(a[17] == 4); + __goblint_check(a[9] == 4); + __goblint_check(a[3] == 4); + __goblint_check(a[i-1] == 4); while(j<10) { a[j] = -1; j++; } - assert(a[3] == -1); - assert(a[0] == -1); - assert(a[j-1] == -1); - assert(a[j] == 4); - assert(a[17] == 4); - assert(a[j+5] == 4); + __goblint_check(a[3] == -1); + __goblint_check(a[0] == -1); + __goblint_check(a[j-1] == -1); + __goblint_check(a[j] == 4); + __goblint_check(a[17] == 4); + __goblint_check(a[j+5] == 4); } // This was the case where we thought we needed path-splitting @@ -149,15 +149,15 @@ void example7(void) { if(top) { while(i < 41) { a[i] = 0; - assert(a[i] == 0); + __goblint_check(a[i] == 0); i++; } } - assert(a[0] == 0); // UNKNOWN - assert(a[7] == 0); // UNKNOWN - assert(a[41] == 0); // UNKNOWN - assert(a[top] == 0); // UNKNOWN + __goblint_check(a[0] == 0); // UNKNOWN + __goblint_check(a[7] == 0); // UNKNOWN + __goblint_check(a[41] == 0); // UNKNOWN + __goblint_check(a[top] == 0); // UNKNOWN } // Check that the global variable is not used for partitioning @@ -165,37 +165,37 @@ void example8() { int a[10]; a[global] = 4; - assert(a[global] == 4); // UNKNOWN + __goblint_check(a[global] == 4); // UNKNOWN for(int i=0; i <5; i++) { a[i] = 42; } - assert(a[0] == 42); - assert(a[1] == 42); - assert(a[2] == 42); - assert(a[3] == 42); - assert(a[global] == 42); + __goblint_check(a[0] == 42); + __goblint_check(a[1] == 42); + __goblint_check(a[2] == 42); + __goblint_check(a[3] == 42); + __goblint_check(a[global] == 42); } // Check that arrays of types different from int are handeled correctly void example9() { char a[10]; int n; - assert(a[3] == 800); // FAIL + __goblint_check(a[3] == 800); // FAIL for(int i=0;i < 10; i++) { a[i] = 7; } - assert(a[0] == 7); - assert(a[3] == 7); + __goblint_check(a[0] == 7); + __goblint_check(a[3] == 7); a[3] = (char) n; - assert(a[3] == 800); //FAIL - assert(a[3] == 127); //UNKNOWN - assert(a[3] == -128); //UNKNOWN - assert(a[3] == -129); //FAIL + __goblint_check(a[3] == 800); //FAIL + __goblint_check(a[3] == 127); //UNKNOWN + __goblint_check(a[3] == -128); //UNKNOWN + __goblint_check(a[3] == -129); //FAIL } void example10() { @@ -204,5 +204,5 @@ void example10() { int i=5; a[i] = 7; - assert(a[5] == 7); + __goblint_check(a[5] == 7); } diff --git a/tests/regression/22-partitioned_arrays/02-pointers_array.c b/tests/regression/22-partitioned_arrays/02-pointers_array.c index b819a46fe2..539e08e4c5 100644 --- a/tests/regression/22-partitioned_arrays/02-pointers_array.c +++ b/tests/regression/22-partitioned_arrays/02-pointers_array.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main(void) { @@ -26,12 +26,12 @@ void example1(void) { *ptr = 42; ptr++; - assert(a[0] == 42); - assert(a[1] == 42); // UNKNOWN + __goblint_check(a[0] == 42); + __goblint_check(a[1] == 42); // UNKNOWN *ptr = 42; - assert(a[0] == 42); - assert(a[1] == 42); + __goblint_check(a[0] == 42); + __goblint_check(a[1] == 42); ptr++; *ptr = 42; @@ -45,13 +45,13 @@ void example1(void) { int i = 5; - assert(a[i] == 42); + __goblint_check(a[i] == 42); if(top) { i++; } - assert(a[i] == 42); // UNKNOWN + __goblint_check(a[i] == 42); // UNKNOWN } // Tests correct handling when pointers may point to several different things @@ -65,19 +65,19 @@ void example2() { ptr = &array1; *ptr = 5; - assert(*ptr == 5); + __goblint_check(*ptr == 5); } else { ptr = &array2; *ptr = 5; - assert(*ptr == 5); + __goblint_check(*ptr == 5); } // Since ptr could point to different arrays, the update here can not be precise *ptr = 6; - assert(*ptr == 6); // UNKNOWN + __goblint_check(*ptr == 6); // UNKNOWN } void example3(void) { @@ -86,7 +86,7 @@ void example3(void) { for(int i =0; i <5; i++) { *ptr = 42; - assert(*ptr == 42); + __goblint_check(*ptr == 42); ptr++; } } @@ -98,7 +98,7 @@ void example4(void) { while(ptr <= end) { *ptr = 42; - assert(*ptr == 42); + __goblint_check(*ptr == 42); ptr++; } @@ -115,11 +115,11 @@ void example5(void) { ptr--; *ptr = 40; - assert(*ptr == 40); - assert(array1[4] == 42); - assert(array1[3] == 42); - assert(array1[2] == 40); - assert(array1[0] == 42); // UNKNOWN + __goblint_check(*ptr == 40); + __goblint_check(array1[4] == 42); + __goblint_check(array1[3] == 42); + __goblint_check(array1[2] == 40); + __goblint_check(array1[0] == 42); // UNKNOWN } void example6(void) { @@ -128,7 +128,7 @@ void example6(void) { *ptr = 5; int v = *ptr; - assert(v == 5); + __goblint_check(v == 5); ptr++; *ptr = 6; @@ -137,15 +137,15 @@ void example6(void) { // This is necessary for the tests that we are doing later int k = ptr-&array1; - assert(k == 2); + __goblint_check(k == 2); int m = ptr-array1; - assert(m == 2); + __goblint_check(m == 2); int* np = &array1; np++; np++; int x = *np; - assert(x==7); + __goblint_check(x==7); } void example7(void) { @@ -180,10 +180,10 @@ void example7(void) { // arr1 -> (-, [4,9]) // arr2 -> (-, [4,9]) int x = arr1[7]; - assert(x == 3); // FAIL - assert(x == 4); // UNKNOWN - assert(x == 9); // UNKNOWN - assert(x == 10); // FAIL + __goblint_check(x == 3); // FAIL + __goblint_check(x == 4); // UNKNOWN + __goblint_check(x == 9); // UNKNOWN + __goblint_check(x == 10); // FAIL } void example8(void) { @@ -199,12 +199,12 @@ void example8(void) { int* ptr = a[7]; int x = *(ptr+7); - assert(x == 3); //FAIL + __goblint_check(x == 3); //FAIL int (*ptr2)[42]; ptr2 = a+7; x = (*ptr2)[6]; - assert(x == 3); //FAIL + __goblint_check(x == 3); //FAIL printf("x is %d\n", x); } @@ -228,7 +228,7 @@ void example9() { a[14][0] = 3; ptr2 = a+7; y = (ptr2+1)[6]; - assert(*y == 3); + __goblint_check(*y == 3); } int example10() { @@ -244,13 +244,13 @@ int example10() { ptr = x[3].x; y = *(ptr + 3); - assert(y == 0); //FAIL + __goblint_check(y == 0); //FAIL printf("y is %d", y); } void foo(int (*a)[40]){ int x = (*(a + 29))[7]; - assert(x == 23); //UNKNOWN + __goblint_check(x == 23); //UNKNOWN } void example11() diff --git a/tests/regression/22-partitioned_arrays/03-multidimensional_arrays.c b/tests/regression/22-partitioned_arrays/03-multidimensional_arrays.c index e6352b806a..3c67c51d11 100644 --- a/tests/regression/22-partitioned_arrays/03-multidimensional_arrays.c +++ b/tests/regression/22-partitioned_arrays/03-multidimensional_arrays.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main(void) { @@ -22,19 +22,19 @@ void example1(void) { j++; } - assert(a[i][0] == 42); - assert(a[i][9] == 42); - assert(a[3][9] == 42); // UNKNOWN + __goblint_check(a[i][0] == 42); + __goblint_check(a[i][9] == 42); + __goblint_check(a[3][9] == 42); // UNKNOWN i++; } - assert(a[0][0] == 42); - assert(a[2][5] == 42); - assert(a[8][9] == 42); - assert(a[3][7] == 42); - assert(a[9][9] == 42); // UNKNOWN - assert(a[9][2] == 42); // UNKNOWN + __goblint_check(a[0][0] == 42); + __goblint_check(a[2][5] == 42); + __goblint_check(a[8][9] == 42); + __goblint_check(a[3][7] == 42); + __goblint_check(a[9][9] == 42); // UNKNOWN + __goblint_check(a[9][2] == 42); // UNKNOWN } // Combines backwards- and forwards-iteration @@ -47,17 +47,17 @@ void example2(void) { while(j < 10) { array[i][j] = 4711; - assert(array[i-1][j+1] == 4711); //UNKNOWN + __goblint_check(array[i-1][j+1] == 4711); //UNKNOWN j++; } i--; } - assert(array[2][3] == 4711); - assert(array[0][9] == 4711); - assert(array[8][5] == 4711); - assert(array[2][1] == 4711); - assert(array[0][0] == 4711); - assert(array[7][5] == 4711); + __goblint_check(array[2][3] == 4711); + __goblint_check(array[0][9] == 4711); + __goblint_check(array[8][5] == 4711); + __goblint_check(array[2][1] == 4711); + __goblint_check(array[0][0] == 4711); + __goblint_check(array[7][5] == 4711); } diff --git a/tests/regression/22-partitioned_arrays/04-nesting_arrays.c b/tests/regression/22-partitioned_arrays/04-nesting_arrays.c index 179e3cef45..c14d3428df 100644 --- a/tests/regression/22-partitioned_arrays/04-nesting_arrays.c +++ b/tests/regression/22-partitioned_arrays/04-nesting_arrays.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include struct kala { @@ -46,23 +46,23 @@ void example1() { i++; // Check assertion that should only hold later does not already hold here - assert(l.a[4] == 42); //UNKNOWN + __goblint_check(l.a[4] == 42); //UNKNOWN } // Check the array is correctly initialized - assert(l.a[1] == 42); - assert(l.a[2] == 42); - assert(l.a[3] == 42); - assert(l.a[4] == 42); + __goblint_check(l.a[1] == 42); + __goblint_check(l.a[2] == 42); + __goblint_check(l.a[3] == 42); + __goblint_check(l.a[4] == 42); // Destructively assign to i i = top; // Check the array is still known to be completly initialized - assert(l.a[1] == 42); - assert(l.a[2] == 42); - assert(l.a[3] == 42); - assert(l.a[4] == 42); + __goblint_check(l.a[1] == 42); + __goblint_check(l.a[2] == 42); + __goblint_check(l.a[3] == 42); + __goblint_check(l.a[4] == 42); } void example2() { @@ -80,8 +80,8 @@ void example2() { } // Initialization has not proceeded this far - assert(kalas[4].a[0] == 8); //UNKNOWN - assert(kalas[0].a[0] == 8); + __goblint_check(kalas[4].a[0] == 8); //UNKNOWN + __goblint_check(kalas[0].a[0] == 8); } void example3() { @@ -90,7 +90,7 @@ void example3() { xnn.a[l] = 42; } - assert(xnn.a[3] == 42); + __goblint_check(xnn.a[3] == 42); } void example4() { @@ -105,7 +105,7 @@ void example4() { } } - assert(xs[3].a[0] == 7); + __goblint_check(xs[3].a[0] == 7); } void example5() { @@ -123,10 +123,10 @@ void example5() { i3++; } - assert(ua.a[i3 - 1] == 42); + __goblint_check(ua.a[i3 - 1] == 42); ua.b[0] = 3; - assert(ua.b[0] == 3); + __goblint_check(ua.b[0] == 3); // ------------------------------- union uStruct us; @@ -134,17 +134,17 @@ void example5() { us.b = 4; us.k.a[i4] = 0; - assert(us.b == 4); // UNKNOWN - assert(us.k.a[0] == 0); - assert(us.k.a[3] == 0); // UNKNOWN + __goblint_check(us.b == 4); // UNKNOWN + __goblint_check(us.k.a[0] == 0); + __goblint_check(us.k.a[3] == 0); // UNKNOWN while (i4 < 5) { us.k.a[i4] = 42; i4++; } - assert(us.k.a[1] == 42); - assert(us.k.a[0] == 0); // FAIL + __goblint_check(us.k.a[1] == 42); + __goblint_check(us.k.a[0] == 0); // FAIL } void example6() { @@ -164,7 +164,7 @@ void example6() { a[k.v] = 2; k.v = k.v+1; - assert(a[k.v] != 3); + __goblint_check(a[k.v] != 3); } void example7() { @@ -196,5 +196,5 @@ void example8() { a[ua.a[*ip]] = 42; ip++; - assert(a[ua.a[*ip]] == 42); //UNKNOWN + __goblint_check(a[ua.a[*ip]] == 42); //UNKNOWN } diff --git a/tests/regression/22-partitioned_arrays/05-adapted_from_01_09_array.c b/tests/regression/22-partitioned_arrays/05-adapted_from_01_09_array.c index 32d0e1ca51..20dc0922c1 100644 --- a/tests/regression/22-partitioned_arrays/05-adapted_from_01_09_array.c +++ b/tests/regression/22-partitioned_arrays/05-adapted_from_01_09_array.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include #include @@ -29,73 +29,73 @@ int main () { if (i) top = (int) ⊤ else top = 5; - assert(a[0] == 2); - assert(a[1] == 2); - assert(a[2] == 2); + __goblint_check(a[0] == 2); + __goblint_check(a[1] == 2); + __goblint_check(a[2] == 2); // writing to unknown index: // NB! We assume the index is in bounds! if (k1) i=0; else i=1; a[i] = 0; - assert(a[0] == 0); // UNKNOWN - assert(a[1] == 0); // UNKNOWN - assert(a[2] == 0); // FAIL + __goblint_check(a[0] == 0); // UNKNOWN + __goblint_check(a[1] == 0); // UNKNOWN + __goblint_check(a[2] == 0); // FAIL // reading from unknown index: b[0] = 2; b[1] = 2; - assert(b[i] == 2); + __goblint_check(b[i] == 2); b[0] = 3; - assert(b[i] == 2); // UNKNOWN + __goblint_check(b[i] == 2); // UNKNOWN // function arrays t = f[i](); - assert(t == 5); // UNKNOWN + __goblint_check(t == 5); // UNKNOWN t = g[i](); - assert(t == 5); + __goblint_check(t == 5); // array has set of addresses: if (k2) f[i] = fun_5b; t = f[1](); - assert(t == 5); // UNKNOWN + __goblint_check(t == 5); // UNKNOWN // now we collect all the sets: fp = f[i]; t = fp(); - assert(t == 5); // UNKNOWN + __goblint_check(t == 5); // UNKNOWN fp = g[i]; t = fp(); - assert(t == 5); + __goblint_check(t == 5); // NASTY ARRAY OPS: c[0] = 5; c[1] = 5; c[2] = 5; // this is not usual: a pointer to an array (easy!) iap = &c; t = (*iap)[2]; - assert(t == 5); + __goblint_check(t == 5); // Typical C: a pointer to first element of array (difficult!) ip = c; // this means &c[0] // dereferencing... - assert(*ip == 5); + __goblint_check(*ip == 5); // pointing into the array ip = &c[1]; - assert(*ip == 5); + __goblint_check(*ip == 5); // and some pointer arithmetic (tests are meaningless) *ip = 6; ip++; - assert(*ip == 5); + __goblint_check(*ip == 5); // Now testing arrays inside structs. struct kala x; ip = x.a; x.a[0] = 7; - assert(*ip == 7); + __goblint_check(*ip == 7); // (typeless) Top index - assert(x.a[top] == 7); // UNKNOWN + __goblint_check(x.a[top] == 7); // UNKNOWN // And finally array of structs struct kala xs[5]; @@ -104,12 +104,12 @@ int main () { struct kass k[1]; k[0].v = 42; - assert(k[0].v == 42); + __goblint_check(k[0].v == 42); // multi-dim arrays int ma[1][1]; ma[0][0] = 42; - assert(ma[0][0] == 42); + __goblint_check(ma[0][0] == 42); //i = hash("kala"); //printf("Hash value: %d", i); diff --git a/tests/regression/22-partitioned_arrays/06-interprocedural.c b/tests/regression/22-partitioned_arrays/06-interprocedural.c index 78f9869a5e..e6602b22bd 100644 --- a/tests/regression/22-partitioned_arrays/06-interprocedural.c +++ b/tests/regression/22-partitioned_arrays/06-interprocedural.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main(void) { @@ -13,15 +13,15 @@ void example1() { init_array(a, 42); - assert(a[2] == 42); - assert(a[10] == 42); + __goblint_check(a[2] == 42); + __goblint_check(a[10] == 42); do_first(a); - assert(a[0] == 3); + __goblint_check(a[0] == 3); init_array(b,12); - assert(b[2] == 12); - assert(b[10] == 12); + __goblint_check(b[2] == 12); + __goblint_check(b[10] == 12); } void do_first(int* arr) { @@ -35,8 +35,8 @@ void init_array(int* arr, int val) { } arr[0] = val; - assert(arr[2] == val); - assert(arr[10] == val); + __goblint_check(arr[2] == val); + __goblint_check(arr[10] == val); } // ----------------------------------- Example 2 ------------------------------------------------------------------------------ @@ -47,21 +47,21 @@ void example2(void) { for(int i = 0; i < 20; i++) { arr[i] = 42; - assert(arr[i] == 42); + __goblint_check(arr[i] == 42); callee(arr); } - assert(arr[0] == 100); //FAIL - assert(arr[0] == 7); //UNKNOWN - assert(arr[0] == 42); //UNKNOWN + __goblint_check(arr[0] == 100); //FAIL + __goblint_check(arr[0] == 7); //UNKNOWN + __goblint_check(arr[0] == 42); //UNKNOWN - assert(arr[7] == 100); //FAIL - assert(arr[7] == 7); //UNKNOWN - assert(arr[7] == 42); //UNKNOWN + __goblint_check(arr[7] == 100); //FAIL + __goblint_check(arr[7] == 7); //UNKNOWN + __goblint_check(arr[7] == 42); //UNKNOWN - assert(arr[20] == 100); //FAIL - assert(arr[20] == 7); //UNKNOWN - assert(arr[20] == 42); //UNKNOWN + __goblint_check(arr[20] == 100); //FAIL + __goblint_check(arr[20] == 7); //UNKNOWN + __goblint_check(arr[20] == 42); //UNKNOWN } void callee(int* arr) { diff --git a/tests/regression/22-partitioned_arrays/07-global_array.c b/tests/regression/22-partitioned_arrays/07-global_array.c index 45015aee16..4795731ce4 100644 --- a/tests/regression/22-partitioned_arrays/07-global_array.c +++ b/tests/regression/22-partitioned_arrays/07-global_array.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int global_array[50]; @@ -7,8 +7,8 @@ int main(void) { some_func(); int x = global_array[5]; - assert(x == 0); //UNKNOWN - assert(x == 42); //UNKNOWN + __goblint_check(x == 0); //UNKNOWN + __goblint_check(x == 42); //UNKNOWN } @@ -20,5 +20,5 @@ void some_func(void) { } int x = global_array[0]; - assert(x == 42); //FAIL + __goblint_check(x == 42); //FAIL } diff --git a/tests/regression/22-partitioned_arrays/08-unsupported.c b/tests/regression/22-partitioned_arrays/08-unsupported.c index 51a0ee6247..4fe5ecc0d6 100644 --- a/tests/regression/22-partitioned_arrays/08-unsupported.c +++ b/tests/regression/22-partitioned_arrays/08-unsupported.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --disable exp.fast_global_inits --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --disable exp.fast_global_inits --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none // This is just to test that the analysis does not cause problems for features that are not explicitly dealt with int main(void) { diff --git a/tests/regression/22-partitioned_arrays/09-one_by_one.c b/tests/regression/22-partitioned_arrays/09-one_by_one.c index ad288d0b0a..2457d9e87e 100644 --- a/tests/regression/22-partitioned_arrays/09-one_by_one.c +++ b/tests/regression/22-partitioned_arrays/09-one_by_one.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main(void) { @@ -10,10 +10,10 @@ int main(void) { a[2] = 42; a[3] = 42; - assert(a[0] == 42); - assert(a[1] == 42); - assert(a[2] == 42); - assert(a[3] == 42); + __goblint_check(a[0] == 42); + __goblint_check(a[1] == 42); + __goblint_check(a[2] == 42); + __goblint_check(a[3] == 42); int *ptr = &b; *ptr = 1; ptr++; @@ -21,8 +21,8 @@ int main(void) { *ptr = 1; ptr++; *ptr = 1; ptr++; - assert(b[0] == 1); - assert(b[1] == 1); - assert(b[2] == 1); - assert(b[3] == 1); + __goblint_check(b[0] == 1); + __goblint_check(b[1] == 1); + __goblint_check(b[2] == 1); + __goblint_check(b[3] == 1); } diff --git a/tests/regression/22-partitioned_arrays/11-was_problematic.c b/tests/regression/22-partitioned_arrays/11-was_problematic.c index c16443f15c..4854a09c11 100644 --- a/tests/regression/22-partitioned_arrays/11-was_problematic.c +++ b/tests/regression/22-partitioned_arrays/11-was_problematic.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main(int argc, char **argv) @@ -29,6 +29,6 @@ int main(int argc, char **argv) int y = 27; } - assert(1 == 1); // Was reported as unreachable before + __goblint_check(1 == 1); // Was reported as unreachable before return 0; } diff --git a/tests/regression/22-partitioned_arrays/12-was_problematic_2.c b/tests/regression/22-partitioned_arrays/12-was_problematic_2.c index f2e2dcc6a3..fb526e6f11 100644 --- a/tests/regression/22-partitioned_arrays/12-was_problematic_2.c +++ b/tests/regression/22-partitioned_arrays/12-was_problematic_2.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none int main(void) { int arr[260]; diff --git a/tests/regression/22-partitioned_arrays/13-was_problematic_3.c b/tests/regression/22-partitioned_arrays/13-was_problematic_3.c index 047b736778..bdbdfb4fdc 100644 --- a/tests/regression/22-partitioned_arrays/13-was_problematic_3.c +++ b/tests/regression/22-partitioned_arrays/13-was_problematic_3.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none struct some_struct { int dir[7]; diff --git a/tests/regression/22-partitioned_arrays/14-with_def_exc.c b/tests/regression/22-partitioned_arrays/14-with_def_exc.c index 1be0467c02..f2e2355fe6 100644 --- a/tests/regression/22-partitioned_arrays/14-with_def_exc.c +++ b/tests/regression/22-partitioned_arrays/14-with_def_exc.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.def_exc --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.def_exc --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main(void) { @@ -18,7 +18,7 @@ void t1() { for(i=0; i < 9;i++) { } int j = arr[i]; - assert(j == 5); //UNKNOWN + __goblint_check(j == 5); //UNKNOWN } @@ -287,5 +287,5 @@ void t2() { for(i=0; i < 511; i++) { } int j = arr[i]; - assert(j==5); //UNKNOWN + __goblint_check(j==5); //UNKNOWN } diff --git a/tests/regression/22-partitioned_arrays/15-var_eq.c b/tests/regression/22-partitioned_arrays/15-var_eq.c index 84afcd2c8b..174279e2d5 100644 --- a/tests/regression/22-partitioned_arrays/15-var_eq.c +++ b/tests/regression/22-partitioned_arrays/15-var_eq.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','var_eq']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','var_eq','assert']" --set ana.base.privatization none #include int global; @@ -27,5 +27,5 @@ void example1(void) arr[top] = 42; top2 = top; - assert(arr[top2] == 42); + __goblint_check(arr[top2] == 42); } diff --git a/tests/regression/22-partitioned_arrays/17-large_arrays.c b/tests/regression/22-partitioned_arrays/17-large_arrays.c index c449a8ec91..ee3d26c76f 100644 --- a/tests/regression/22-partitioned_arrays/17-large_arrays.c +++ b/tests/regression/22-partitioned_arrays/17-large_arrays.c @@ -12,7 +12,7 @@ int main(){ // Check that ptrdiff_t is at least as big as long, so we can index arrays with non-negative longs - assert(sizeof(ptrdiff_t) >= sizeof(long)); + __goblint_check(sizeof(ptrdiff_t) >= sizeof(long)); char *arr = calloc(LENGTH, sizeof(char)); if(arr == NULL){ @@ -25,23 +25,23 @@ int main(){ } // arr[0] ... arr[STOP - 1] should be 1, the others equal to 0 - assert(arr[0] == 1); // UNKNOWN - assert(arr[INT_MAX + 1l] == 1); //UNKNOWN + __goblint_check(arr[0] == 1); // UNKNOWN + __goblint_check(arr[INT_MAX + 1l] == 1); //UNKNOWN // j is the smallest index where checking it used to yield an unsound value // long j = ((long) INT_MAX) * INT_MAX * 2 + INT_MAX - 1; long j = LONG_MAX - 6442450943; - assert(0 < j); - assert(j < STOP); + __goblint_check(0 < j); + __goblint_check(j < STOP); // This check is imprecise, but not unsound - assert(arr[j - 1] == 1); //UNKNOWN + __goblint_check(arr[j - 1] == 1); //UNKNOWN // These two asserts used to fail somehow - assert(arr[j] == 1); //UNKNOWN - assert(arr[STOP - 1] == 1); //UNKNOWN + __goblint_check(arr[j] == 1); //UNKNOWN + __goblint_check(arr[STOP - 1] == 1); //UNKNOWN - assert(arr[STOP] == 0); //UNKNOWN - assert(arr[LENGTH - 1] == 0); //UNKNOWN + __goblint_check(arr[STOP] == 0); //UNKNOWN + __goblint_check(arr[LENGTH - 1] == 0); //UNKNOWN return 0; } diff --git a/tests/regression/22-partitioned_arrays/18-large_arrays-nocalloc.c b/tests/regression/22-partitioned_arrays/18-large_arrays-nocalloc.c index 09b6f94bd4..89c01a0fda 100644 --- a/tests/regression/22-partitioned_arrays/18-large_arrays-nocalloc.c +++ b/tests/regression/22-partitioned_arrays/18-large_arrays-nocalloc.c @@ -12,7 +12,7 @@ int main(){ // Check that ptrdiff_t is at least as big as long, so we can index arrays with non-negative longs - assert(sizeof(ptrdiff_t) >= sizeof(long)); + __goblint_check(sizeof(ptrdiff_t) >= sizeof(long)); char arr[LENGTH]; @@ -21,21 +21,21 @@ int main(){ } // arr[0] ... arr[STOP - 1] should be 1, the others equal to 0 - assert(arr[0] == 1); - assert(arr[INT_MAX + 1l] == 1); + __goblint_check(arr[0] == 1); + __goblint_check(arr[INT_MAX + 1l] == 1); // j is the smallest index where checking it used to yield an unsound value // long j = ((long) INT_MAX) * INT_MAX * 2 + INT_MAX - 1; long j = LONG_MAX - 6442450943; - assert(0 < j); - assert(j < STOP); + __goblint_check(0 < j); + __goblint_check(j < STOP); - assert(arr[j - 1] == 1); + __goblint_check(arr[j - 1] == 1); - assert(arr[j] == 1); - assert(arr[STOP - 1] == 1); + __goblint_check(arr[j] == 1); + __goblint_check(arr[STOP - 1] == 1); - assert(arr[STOP] == 0); //UNKNOWN! - assert(arr[LENGTH - 1] == 0); //UNKNOWN! + __goblint_check(arr[STOP] == 0); //UNKNOWN! + __goblint_check(arr[LENGTH - 1] == 0); //UNKNOWN! return 0; } diff --git a/tests/regression/23-partitioned_arrays_last/01-simple_array.c b/tests/regression/23-partitioned_arrays_last/01-simple_array.c index 715547ab82..3083e51c54 100644 --- a/tests/regression/23-partitioned_arrays_last/01-simple_array.c +++ b/tests/regression/23-partitioned_arrays_last/01-simple_array.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int global; @@ -25,15 +25,15 @@ void example1(void) while (i < 42) { a[i] = 0; - assert(a[i] == 0); - assert(a[0] == 0); - assert(a[17] == 0); // UNKNOWN + __goblint_check(a[i] == 0); + __goblint_check(a[0] == 0); + __goblint_check(a[17] == 0); // UNKNOWN i++; } - assert(a[0] == 0); - assert(a[7] == 0); - assert(a[41] == 0); + __goblint_check(a[0] == 0); + __goblint_check(a[7] == 0); + __goblint_check(a[41] == 0); } // More complicated expression to index rather than just a variable @@ -43,14 +43,14 @@ void example2(void) { while (i < 43) { a[i - 1] = 0; - assert(a[i - 1] == 0); - assert(a[38] == 0); // UNKNOWN + __goblint_check(a[i - 1] == 0); + __goblint_check(a[38] == 0); // UNKNOWN i++; } - assert(a[0] == 0); - assert(a[7] == 0); - assert(a[41] == 0); + __goblint_check(a[0] == 0); + __goblint_check(a[7] == 0); + __goblint_check(a[41] == 0); } // Two values initialized in one loop @@ -65,10 +65,10 @@ void example3(void) { i++; } - assert(a[0] == 2); // FAIL - assert(a[41] == 0); // UNKNOWN - assert(a[41] == 1); // UNKNOWN - assert(a[41] == -1); // FAIL + __goblint_check(a[0] == 2); // FAIL + __goblint_check(a[41] == 0); // UNKNOWN + __goblint_check(a[41] == 1); // UNKNOWN + __goblint_check(a[41] == -1); // FAIL } // Example where initialization proceeds backwards @@ -81,10 +81,10 @@ void example4(void) { i--; } - assert(a[i+2] == 0); - assert(a[41] == 0); - assert(a[i] == 0); //UNKNOWN - assert(a[0] == 0); //UNKNOWN + __goblint_check(a[i+2] == 0); + __goblint_check(a[41] == 0); + __goblint_check(a[i] == 0); //UNKNOWN + __goblint_check(a[0] == 0); //UNKNOWN } // Example having two arrays partitioned according to one expression @@ -97,15 +97,15 @@ void example5(void) { a[i] = 2; b[41-i] = 0; - assert(b[7] == 0); //UNKNOWN - assert(a[5] == 2); //UNKNOWN + __goblint_check(b[7] == 0); //UNKNOWN + __goblint_check(a[5] == 2); //UNKNOWN i++; } - assert(a[0] == 2); - assert(a[41] == 2); - assert(b[0] == 0); - assert(b[41] == 0); + __goblint_check(a[0] == 2); + __goblint_check(a[41] == 2); + __goblint_check(b[0] == 0); + __goblint_check(b[41] == 0); } // Example showing array becoming partitioned according to different expressions @@ -120,22 +120,22 @@ void example6(void) { i++; } - assert(a[17] == 4); - assert(a[9] == 4); - assert(a[3] == 4); - assert(a[i-1] == 4); + __goblint_check(a[17] == 4); + __goblint_check(a[9] == 4); + __goblint_check(a[3] == 4); + __goblint_check(a[i-1] == 4); while(j<10) { a[j] = -1; j++; } - assert(a[3] == -1); - assert(a[0] == -1); - assert(a[j-1] == -1); - assert(a[j] == 4); - assert(a[17] == 4); - assert(a[j+5] == 4); + __goblint_check(a[3] == -1); + __goblint_check(a[0] == -1); + __goblint_check(a[j-1] == -1); + __goblint_check(a[j] == 4); + __goblint_check(a[17] == 4); + __goblint_check(a[j+5] == 4); } // This was the case where we thought we needed path-splitting @@ -147,15 +147,15 @@ void example7(void) { if(top) { while(i < 41) { a[i] = 0; - assert(a[i] == 0); + __goblint_check(a[i] == 0); i++; } } - assert(a[0] == 0); // UNKNOWN - assert(a[7] == 0); // UNKNOWN - assert(a[41] == 0); // UNKNOWN - assert(a[top] == 0); // UNKNOWN + __goblint_check(a[0] == 0); // UNKNOWN + __goblint_check(a[7] == 0); // UNKNOWN + __goblint_check(a[41] == 0); // UNKNOWN + __goblint_check(a[top] == 0); // UNKNOWN } // Check that the global variable is not used for partitioning @@ -163,15 +163,15 @@ void example8() { int a[10]; a[global] = 4; - assert(a[global] == 4); // UNKNOWN + __goblint_check(a[global] == 4); // UNKNOWN for(int i=0; i <5; i++) { a[i] = 42; } - assert(a[0] == 42); - assert(a[1] == 42); - assert(a[2] == 42); - assert(a[3] == 42); - assert(a[global] == 42); + __goblint_check(a[0] == 42); + __goblint_check(a[1] == 42); + __goblint_check(a[2] == 42); + __goblint_check(a[3] == 42); + __goblint_check(a[global] == 42); } diff --git a/tests/regression/23-partitioned_arrays_last/02-pointers_array.c b/tests/regression/23-partitioned_arrays_last/02-pointers_array.c index e6996cf34d..a858f94c1f 100644 --- a/tests/regression/23-partitioned_arrays_last/02-pointers_array.c +++ b/tests/regression/23-partitioned_arrays_last/02-pointers_array.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main(void) { @@ -22,12 +22,12 @@ void example1(void) { *ptr = 42; ptr++; - assert(a[0] == 42); - assert(a[1] == 42); // UNKNOWN + __goblint_check(a[0] == 42); + __goblint_check(a[1] == 42); // UNKNOWN *ptr = 42; - assert(a[0] == 42); - assert(a[1] == 42); + __goblint_check(a[0] == 42); + __goblint_check(a[1] == 42); ptr++; *ptr = 42; @@ -41,13 +41,13 @@ void example1(void) { int i = 5; - assert(a[i] == 42); + __goblint_check(a[i] == 42); if(top) { i++; } - assert(a[i] == 42); // UNKNOWN + __goblint_check(a[i] == 42); // UNKNOWN } // Tests correct handling when pointers may point to several different things @@ -61,19 +61,19 @@ void example2() { ptr = &array1; *ptr = 5; - assert(*ptr == 5); + __goblint_check(*ptr == 5); } else { ptr = &array2; *ptr = 5; - assert(*ptr == 5); + __goblint_check(*ptr == 5); } // Since ptr could point to different arrays, the update here can not be precise *ptr = 6; - assert(*ptr == 6); // UNKNOWN + __goblint_check(*ptr == 6); // UNKNOWN } void example3(void) { @@ -82,7 +82,7 @@ void example3(void) { for(int i =0; i <5; i++) { *ptr = 42; - assert(*ptr == 42); + __goblint_check(*ptr == 42); ptr++; } } @@ -94,7 +94,7 @@ void example4(void) { while(ptr <= end) { *ptr = 42; - assert(*ptr == 42); + __goblint_check(*ptr == 42); ptr++; } @@ -111,11 +111,11 @@ void example5(void) { ptr--; *ptr = 40; - assert(*ptr == 40); - assert(array1[4] == 42); - assert(array1[3] == 42); - assert(array1[2] == 40); - assert(array1[0] == 42); // UNKNOWN + __goblint_check(*ptr == 40); + __goblint_check(array1[4] == 42); + __goblint_check(array1[3] == 42); + __goblint_check(array1[2] == 40); + __goblint_check(array1[0] == 42); // UNKNOWN } void example6(void) { @@ -124,7 +124,7 @@ void example6(void) { *ptr = 5; int v = *ptr; - assert(v == 5); + __goblint_check(v == 5); ptr++; *ptr = 6; @@ -133,15 +133,15 @@ void example6(void) { // This is necessary for the tests that we are doing later int k = ptr-&array1; - assert(k == 2); + __goblint_check(k == 2); int m = ptr-array1; - assert(m == 2); + __goblint_check(m == 2); int* np = &array1; np++; np++; int x = *np; - assert(x==7); + __goblint_check(x==7); } void example7(void) { @@ -176,8 +176,8 @@ void example7(void) { // arr1 -> (-, [4,9]) // arr2 -> (-, [4,9]) int x = arr1[7]; - assert(x == 3); // FAIL - assert(x == 4); // UNKNOWN - assert(x == 9); // UNKNOWN - assert(x == 10); // FAIL + __goblint_check(x == 3); // FAIL + __goblint_check(x == 4); // UNKNOWN + __goblint_check(x == 9); // UNKNOWN + __goblint_check(x == 10); // FAIL } diff --git a/tests/regression/23-partitioned_arrays_last/03-multidimensional_arrays.c b/tests/regression/23-partitioned_arrays_last/03-multidimensional_arrays.c index 1e2e3d7b47..a4827efa08 100644 --- a/tests/regression/23-partitioned_arrays_last/03-multidimensional_arrays.c +++ b/tests/regression/23-partitioned_arrays_last/03-multidimensional_arrays.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main(void) { @@ -22,19 +22,19 @@ void example1(void) { j++; } - assert(a[i][0] == 42); - assert(a[i][9] == 42); - assert(a[3][9] == 42); // UNKNOWN + __goblint_check(a[i][0] == 42); + __goblint_check(a[i][9] == 42); + __goblint_check(a[3][9] == 42); // UNKNOWN i++; } - assert(a[0][0] == 42); - assert(a[2][5] == 42); - assert(a[8][9] == 42); - assert(a[3][7] == 42); - assert(a[9][9] == 42); // UNKNOWN - assert(a[9][2] == 42); // UNKNOWN + __goblint_check(a[0][0] == 42); + __goblint_check(a[2][5] == 42); + __goblint_check(a[8][9] == 42); + __goblint_check(a[3][7] == 42); + __goblint_check(a[9][9] == 42); // UNKNOWN + __goblint_check(a[9][2] == 42); // UNKNOWN } // Combines backwards- and forwards-iteration @@ -47,17 +47,17 @@ void example2(void) { while(j < 10) { array[i][j] = 4711; - assert(array[i-1][j+1] == 4711); //UNKNOWN + __goblint_check(array[i-1][j+1] == 4711); //UNKNOWN j++; } i--; } - assert(array[2][3] == 4711); - assert(array[0][9] == 4711); - assert(array[8][5] == 4711); - assert(array[2][1] == 4711); - assert(array[0][0] == 4711); - assert(array[7][5] == 4711); + __goblint_check(array[2][3] == 4711); + __goblint_check(array[0][9] == 4711); + __goblint_check(array[8][5] == 4711); + __goblint_check(array[2][1] == 4711); + __goblint_check(array[0][0] == 4711); + __goblint_check(array[7][5] == 4711); } diff --git a/tests/regression/23-partitioned_arrays_last/04-nesting_arrays.c b/tests/regression/23-partitioned_arrays_last/04-nesting_arrays.c index 1143bba224..2742a26447 100644 --- a/tests/regression/23-partitioned_arrays_last/04-nesting_arrays.c +++ b/tests/regression/23-partitioned_arrays_last/04-nesting_arrays.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include struct kala { @@ -46,23 +46,23 @@ void example1() { i++; // Check assertion that should only hold later does not already hold here - assert(l.a[4] == 42); //UNKNOWN + __goblint_check(l.a[4] == 42); //UNKNOWN } // Check the array is correctly initialized - assert(l.a[1] == 42); - assert(l.a[2] == 42); - assert(l.a[3] == 42); - assert(l.a[4] == 42); + __goblint_check(l.a[1] == 42); + __goblint_check(l.a[2] == 42); + __goblint_check(l.a[3] == 42); + __goblint_check(l.a[4] == 42); // Destructively assign to i i = top; // Check the array is still known to be completly initialized - assert(l.a[1] == 42); - assert(l.a[2] == 42); - assert(l.a[3] == 42); - assert(l.a[4] == 42); + __goblint_check(l.a[1] == 42); + __goblint_check(l.a[2] == 42); + __goblint_check(l.a[3] == 42); + __goblint_check(l.a[4] == 42); } void example2() { @@ -80,8 +80,8 @@ void example2() { } // Initialization has not proceeded this far - assert(kalas[4].a[0] == 8); //UNKNOWN - assert(kalas[0].a[0] == 8); + __goblint_check(kalas[4].a[0] == 8); //UNKNOWN + __goblint_check(kalas[0].a[0] == 8); } void example3() { @@ -90,7 +90,7 @@ void example3() { xnn.a[l] = 42; } - assert(xnn.a[3] == 42); + __goblint_check(xnn.a[3] == 42); } void example4() { @@ -105,7 +105,7 @@ void example4() { } } - assert(xs[3].a[0] == 7); + __goblint_check(xs[3].a[0] == 7); } void example5() { @@ -123,10 +123,10 @@ void example5() { i3++; } - assert(ua.a[i3 - 1] == 42); + __goblint_check(ua.a[i3 - 1] == 42); ua.b[0] = 3; - assert(ua.b[0] == 3); + __goblint_check(ua.b[0] == 3); // ------------------------------- union uStruct us; @@ -134,17 +134,17 @@ void example5() { us.b = 4; us.k.a[i4] = 0; - assert(us.b == 4); // UNKNOWN - assert(us.k.a[0] == 0); - assert(us.k.a[3] == 0); // UNKNOWN + __goblint_check(us.b == 4); // UNKNOWN + __goblint_check(us.k.a[0] == 0); + __goblint_check(us.k.a[3] == 0); // UNKNOWN while (i4 < 5) { us.k.a[i4] = 42; i4++; } - assert(us.k.a[1] == 42); - assert(us.k.a[0] == 0); // FAIL + __goblint_check(us.k.a[1] == 42); + __goblint_check(us.k.a[0] == 0); // FAIL } void example6() { @@ -164,7 +164,7 @@ void example6() { a[k.v] = 2; k.v = k.v+1; - assert(a[k.v] != 3); + __goblint_check(a[k.v] != 3); } void example7() { @@ -196,5 +196,5 @@ void example8() { a[ua.a[*ip]] = 42; ip++; - assert(a[ua.a[*ip]] == 42); //UNKNOWN + __goblint_check(a[ua.a[*ip]] == 42); //UNKNOWN } diff --git a/tests/regression/23-partitioned_arrays_last/05-adapted_from_01_09_array.c b/tests/regression/23-partitioned_arrays_last/05-adapted_from_01_09_array.c index 7765a179cc..4e98a30996 100644 --- a/tests/regression/23-partitioned_arrays_last/05-adapted_from_01_09_array.c +++ b/tests/regression/23-partitioned_arrays_last/05-adapted_from_01_09_array.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include #include @@ -29,73 +29,73 @@ int main () { if (i) top = (int) ⊤ else top = 5; - assert(a[0] == 2); - assert(a[1] == 2); - assert(a[2] == 2); + __goblint_check(a[0] == 2); + __goblint_check(a[1] == 2); + __goblint_check(a[2] == 2); // writing to unknown index: // NB! We assume the index is in bounds! if (k1) i=0; else i=1; a[i] = 0; - assert(a[0] == 0); // UNKNOWN - assert(a[1] == 0); // UNKNOWN - assert(a[2] == 0); // FAIL + __goblint_check(a[0] == 0); // UNKNOWN + __goblint_check(a[1] == 0); // UNKNOWN + __goblint_check(a[2] == 0); // FAIL // reading from unknown index: b[0] = 2; b[1] = 2; - assert(b[i] == 2); + __goblint_check(b[i] == 2); b[0] = 3; - assert(b[i] == 2); // UNKNOWN + __goblint_check(b[i] == 2); // UNKNOWN // function arrays t = f[i](); - assert(t == 5); // UNKNOWN + __goblint_check(t == 5); // UNKNOWN t = g[i](); - assert(t == 5); + __goblint_check(t == 5); // array has set of addresses: if (k2) f[i] = fun_5b; t = f[1](); - assert(t == 5); // UNKNOWN + __goblint_check(t == 5); // UNKNOWN // now we collect all the sets: fp = f[i]; t = fp(); - assert(t == 5); // UNKNOWN + __goblint_check(t == 5); // UNKNOWN fp = g[i]; t = fp(); - assert(t == 5); + __goblint_check(t == 5); // NASTY ARRAY OPS: c[0] = 5; c[1] = 5; c[2] = 5; // this is not usual: a pointer to an array (easy!) iap = &c; t = (*iap)[2]; - assert(t == 5); + __goblint_check(t == 5); // Typical C: a pointer to first element of array (difficult!) ip = c; // this means &c[0] // dereferencing... - assert(*ip == 5); + __goblint_check(*ip == 5); // pointing into the array ip = &c[1]; - assert(*ip == 5); + __goblint_check(*ip == 5); // and some pointer arithmetic (tests are meaningless) *ip = 6; ip++; - assert(*ip == 5); + __goblint_check(*ip == 5); // Now testing arrays inside structs. struct kala x; ip = x.a; x.a[0] = 7; - assert(*ip == 7); + __goblint_check(*ip == 7); // (typeless) Top index - assert(x.a[top] == 7); // UNKNOWN + __goblint_check(x.a[top] == 7); // UNKNOWN // And finally array of structs struct kala xs[5]; @@ -104,12 +104,12 @@ int main () { struct kass k[1]; k[0].v = 42; - assert(k[0].v == 42); + __goblint_check(k[0].v == 42); // multi-dim arrays int ma[1][1]; ma[0][0] = 42; - assert(ma[0][0] == 42); + __goblint_check(ma[0][0] == 42); //i = hash("kala"); //printf("Hash value: %d", i); diff --git a/tests/regression/23-partitioned_arrays_last/06-interprocedural.c b/tests/regression/23-partitioned_arrays_last/06-interprocedural.c index 5edab569df..bc8796d37b 100644 --- a/tests/regression/23-partitioned_arrays_last/06-interprocedural.c +++ b/tests/regression/23-partitioned_arrays_last/06-interprocedural.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main(void) { @@ -13,15 +13,15 @@ void example1() { init_array(a, 42); - assert(a[2] == 42); - assert(a[10] == 42); + __goblint_check(a[2] == 42); + __goblint_check(a[10] == 42); do_first(a); - assert(a[0] == 3); + __goblint_check(a[0] == 3); init_array(b,12); - assert(b[2] == 12); - assert(b[10] == 12); + __goblint_check(b[2] == 12); + __goblint_check(b[10] == 12); } void do_first(int* arr) { @@ -35,8 +35,8 @@ void init_array(int* arr, int val) { } arr[0] = val; - assert(arr[2] == val); - assert(arr[10] == val); + __goblint_check(arr[2] == val); + __goblint_check(arr[10] == val); } // ----------------------------------- Example 2 ------------------------------------------------------------------------------ @@ -47,24 +47,24 @@ void example2(void) { for(int i = 0; i < 20; i++) { arr[i] = 42; - assert(arr[i] == 42); + __goblint_check(arr[i] == 42); callee(arr); } - assert(arr[0] == 100); //UNKNOWN - assert(arr[0] == 7); //UNKNOWN - assert(arr[0] == 42); //UNKNOWN + __goblint_check(arr[0] == 100); //UNKNOWN + __goblint_check(arr[0] == 7); //UNKNOWN + __goblint_check(arr[0] == 42); //UNKNOWN - assert(arr[7] == 100); //UNKNOWN - assert(arr[7] == 7); //UNKNOWN - assert(arr[7] == 42); //UNKNOWN + __goblint_check(arr[7] == 100); //UNKNOWN + __goblint_check(arr[7] == 7); //UNKNOWN + __goblint_check(arr[7] == 42); //UNKNOWN - assert(arr[20] == 100); //UNKNOWN - assert(arr[20] == 7); //UNKNOWN - assert(arr[20] == 42); //UNKNOWN + __goblint_check(arr[20] == 100); //UNKNOWN + __goblint_check(arr[20] == 7); //UNKNOWN + __goblint_check(arr[20] == 42); //UNKNOWN } void callee(int* arr) { arr[0] = 7; - assert(arr[0] == 7); + __goblint_check(arr[0] == 7); } diff --git a/tests/regression/23-partitioned_arrays_last/07-global_array.c b/tests/regression/23-partitioned_arrays_last/07-global_array.c index eb1b7db640..e277a777a2 100644 --- a/tests/regression/23-partitioned_arrays_last/07-global_array.c +++ b/tests/regression/23-partitioned_arrays_last/07-global_array.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int global_array[50]; @@ -7,8 +7,8 @@ int main(void) { some_func(); int x = global_array[5]; - assert(x == 0); //UNKNOWN - assert(x == 42); //UNKNOWN + __goblint_check(x == 0); //UNKNOWN + __goblint_check(x == 42); //UNKNOWN } @@ -20,5 +20,5 @@ void some_func(void) { } int x = global_array[0]; - assert(x == 42); //UNKNOWN + __goblint_check(x == 42); //UNKNOWN } diff --git a/tests/regression/23-partitioned_arrays_last/08-unsupported.c b/tests/regression/23-partitioned_arrays_last/08-unsupported.c index f20a142ea0..55ca3188a4 100644 --- a/tests/regression/23-partitioned_arrays_last/08-unsupported.c +++ b/tests/regression/23-partitioned_arrays_last/08-unsupported.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --disable exp.fast_global_inits --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --disable exp.fast_global_inits --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none // This is just to test that the analysis does not cause problems for features that are not explicitly dealt with int main(void) { diff --git a/tests/regression/23-partitioned_arrays_last/09-one_by_one.c b/tests/regression/23-partitioned_arrays_last/09-one_by_one.c index 6c05403de3..1ecbe94da2 100644 --- a/tests/regression/23-partitioned_arrays_last/09-one_by_one.c +++ b/tests/regression/23-partitioned_arrays_last/09-one_by_one.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main(void) { @@ -10,10 +10,10 @@ int main(void) { a[2] = 42; a[3] = 42; - assert(a[0] == 42); - assert(a[1] == 42); - assert(a[2] == 42); - assert(a[3] == 42); + __goblint_check(a[0] == 42); + __goblint_check(a[1] == 42); + __goblint_check(a[2] == 42); + __goblint_check(a[3] == 42); int *ptr = &b; *ptr = 1; ptr++; @@ -21,8 +21,8 @@ int main(void) { *ptr = 1; ptr++; *ptr = 1; ptr++; - assert(b[0] == 1); - assert(b[1] == 1); - assert(b[2] == 1); - assert(b[3] == 1); + __goblint_check(b[0] == 1); + __goblint_check(b[1] == 1); + __goblint_check(b[2] == 1); + __goblint_check(b[3] == 1); } diff --git a/tests/regression/23-partitioned_arrays_last/11-was_problematic.c b/tests/regression/23-partitioned_arrays_last/11-was_problematic.c index 3a564147ab..b8fcb834c7 100644 --- a/tests/regression/23-partitioned_arrays_last/11-was_problematic.c +++ b/tests/regression/23-partitioned_arrays_last/11-was_problematic.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main(int argc, char **argv) @@ -29,6 +29,6 @@ int main(int argc, char **argv) int y = 27; } - assert(1 == 1); // Was reported as unreachable before + __goblint_check(1 == 1); // Was reported as unreachable before return 0; } diff --git a/tests/regression/23-partitioned_arrays_last/12-was_problematic_2.c b/tests/regression/23-partitioned_arrays_last/12-was_problematic_2.c index 2ee069b2e5..d8397290fa 100644 --- a/tests/regression/23-partitioned_arrays_last/12-was_problematic_2.c +++ b/tests/regression/23-partitioned_arrays_last/12-was_problematic_2.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none int main(void) { int arr[260]; diff --git a/tests/regression/23-partitioned_arrays_last/13-advantage_for_last.c b/tests/regression/23-partitioned_arrays_last/13-advantage_for_last.c index a376b671f2..c4908446e4 100644 --- a/tests/regression/23-partitioned_arrays_last/13-advantage_for_last.c +++ b/tests/regression/23-partitioned_arrays_last/13-advantage_for_last.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.partition-arrays.keep-expr last --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.partition-arrays.keep-expr last --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include void main(void) { @@ -15,6 +15,6 @@ void example1(void) { i++; } - assert(a[2] == 0); - assert(a[3] == 0); + __goblint_check(a[2] == 0); + __goblint_check(a[3] == 0); } diff --git a/tests/regression/23-partitioned_arrays_last/14-replace_with_const.c b/tests/regression/23-partitioned_arrays_last/14-replace_with_const.c index 066e0d3a98..99d807f445 100644 --- a/tests/regression/23-partitioned_arrays_last/14-replace_with_const.c +++ b/tests/regression/23-partitioned_arrays_last/14-replace_with_const.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --enable ana.base.partition-arrays.partition-by-const-on-return --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --enable ana.base.partition-arrays.partition-by-const-on-return --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main(void) { @@ -12,15 +12,15 @@ void example1() { init_array(a, 42); - assert(a[2] == 42); - assert(a[10] == 42); + __goblint_check(a[2] == 42); + __goblint_check(a[10] == 42); do_first(a); - assert(a[0] == 3); + __goblint_check(a[0] == 3); init_array(b,12); - assert(b[2] == 12); - assert(b[10] == 12); + __goblint_check(b[2] == 12); + __goblint_check(b[10] == 12); } void do_first(int* arr) { @@ -33,6 +33,6 @@ void init_array(int* arr, int val) { arr[i] = val; } - assert(arr[2] == val); - assert(arr[10] == val); + __goblint_check(arr[2] == val); + __goblint_check(arr[10] == val); } diff --git a/tests/regression/24-octagon/01-octagon_simple.c b/tests/regression/24-octagon/01-octagon_simple.c index 8c2eb52f44..d2b68a3909 100644 --- a/tests/regression/24-octagon/01-octagon_simple.c +++ b/tests/regression/24-octagon/01-octagon_simple.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper']" --set ana.base.privatization none +// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper','assert']" --set ana.base.privatization none // Example from https://www-apr.lip6.fr/~mine/publi/article-mine-HOSC06.pdf #include @@ -11,8 +11,8 @@ void main(void) { X++; } - assert(X-N == 0); - assert(X == N); + __goblint_check(X-N == 0); + __goblint_check(X == N); if(X == N) { N = 8; diff --git a/tests/regression/24-octagon/02-octagon_interprocedural.c b/tests/regression/24-octagon/02-octagon_interprocedural.c index 10fff924a9..c314c8c25a 100644 --- a/tests/regression/24-octagon/02-octagon_interprocedural.c +++ b/tests/regression/24-octagon/02-octagon_interprocedural.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper']" --set ana.base.privatization none +// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper','assert']" --set ana.base.privatization none #include int main(void) { @@ -13,14 +13,14 @@ int f1() { one = two; - assert(one - two == 0); + __goblint_check(one - two == 0); x = f2(one,two); - assert(one - two == 0); - assert(x == 48); + __goblint_check(one - two == 0); + __goblint_check(x == 48); } int f2(int a, int b) { - assert(a-b == 0); + __goblint_check(a-b == 0); return 48; } diff --git a/tests/regression/24-octagon/03-previously_problematic_a.c b/tests/regression/24-octagon/03-previously_problematic_a.c index 23a8468840..59a43507c3 100644 --- a/tests/regression/24-octagon/03-previously_problematic_a.c +++ b/tests/regression/24-octagon/03-previously_problematic_a.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper']" --set ana.base.privatization none +// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper','assert']" --set ana.base.privatization none // These examples were cases were we saw issues of not reaching a fixpoint during development of the octagon domain. Since those issues might // resurface, these tests without asserts are included int main(int argc, char const *argv[]) diff --git a/tests/regression/24-octagon/04-previously_problematic_b.c b/tests/regression/24-octagon/04-previously_problematic_b.c index cc67569af2..155cd4755d 100644 --- a/tests/regression/24-octagon/04-previously_problematic_b.c +++ b/tests/regression/24-octagon/04-previously_problematic_b.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper']" --set ana.base.privatization none +// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper','assert']" --set ana.base.privatization none // These examples were cases were we saw issues of not reaching a fixpoint during development of the octagon domain. Since those issues might // resurface, these tests without asserts are included typedef int wchar_t; diff --git a/tests/regression/24-octagon/05-previously_problematic_c.c b/tests/regression/24-octagon/05-previously_problematic_c.c index e7cff27305..b6e6c1a94e 100644 --- a/tests/regression/24-octagon/05-previously_problematic_c.c +++ b/tests/regression/24-octagon/05-previously_problematic_c.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper']" --set ana.base.privatization none +// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper','assert']" --set ana.base.privatization none // These examples were cases were we saw issues of not reaching a fixpoint during development of the octagon domain. Since those issues might // resurface, these tests without asserts are included int main(int argc, char const *argv[]) diff --git a/tests/regression/24-octagon/06-previously_problematic_d.c b/tests/regression/24-octagon/06-previously_problematic_d.c index 1e2df54a3c..3ddb637bd9 100644 --- a/tests/regression/24-octagon/06-previously_problematic_d.c +++ b/tests/regression/24-octagon/06-previously_problematic_d.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper']" --set ana.base.privatization none +// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper','assert']" --set ana.base.privatization none // These examples were cases were we saw issues of not reaching a fixpoint during development of the octagon domain. Since those issues might // resurface, these tests without asserts are included int main(int argc, char const *argv[]) diff --git a/tests/regression/24-octagon/07-previously_problematic_e.c b/tests/regression/24-octagon/07-previously_problematic_e.c index 3d411069e9..68b75bafb8 100644 --- a/tests/regression/24-octagon/07-previously_problematic_e.c +++ b/tests/regression/24-octagon/07-previously_problematic_e.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper']" --set ana.base.privatization none +// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper','assert']" --set ana.base.privatization none // These examples were cases were we saw issues of not reaching a fixpoint during development of the octagon domain. Since those issues might // resurface, these tests without asserts are included int main(int argc, char const *argv[]) diff --git a/tests/regression/24-octagon/08-previously_problematic_f.c b/tests/regression/24-octagon/08-previously_problematic_f.c index ec6e6a1d70..931527421a 100644 --- a/tests/regression/24-octagon/08-previously_problematic_f.c +++ b/tests/regression/24-octagon/08-previously_problematic_f.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper']" --set ana.base.privatization none +// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper','assert']" --set ana.base.privatization none // These examples were cases were we saw issues of not reaching a fixpoint during development of the octagon domain. Since those issues might // resurface, these tests without asserts are included int main(int argc, char const *argv[]) diff --git a/tests/regression/24-octagon/09-previously_problematic_g.c b/tests/regression/24-octagon/09-previously_problematic_g.c index b257e29d71..686709fb46 100644 --- a/tests/regression/24-octagon/09-previously_problematic_g.c +++ b/tests/regression/24-octagon/09-previously_problematic_g.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper']" --set ana.base.privatization none +// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper','assert']" --set ana.base.privatization none // These examples were cases were we saw issues of not reaching a fixpoint during development of the octagon domain. Since those issues might // resurface, these tests without asserts are included int main(int argc, char const *argv[]) diff --git a/tests/regression/24-octagon/10-previously_problematic_h.c b/tests/regression/24-octagon/10-previously_problematic_h.c index 630711d9a0..7f44ce38f3 100644 --- a/tests/regression/24-octagon/10-previously_problematic_h.c +++ b/tests/regression/24-octagon/10-previously_problematic_h.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper']" --set ana.base.privatization none +// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper','assert']" --set ana.base.privatization none // These examples were cases were we saw issues of not reaching a fixpoint during development of the octagon domain. Since those issues might // resurface, these tests without asserts are included int main(int argc, char const *argv[]) diff --git a/tests/regression/24-octagon/11-previously_problematic_i.c b/tests/regression/24-octagon/11-previously_problematic_i.c index 341a042e20..3b6b7f61f4 100644 --- a/tests/regression/24-octagon/11-previously_problematic_i.c +++ b/tests/regression/24-octagon/11-previously_problematic_i.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper']" --set ana.base.privatization none +// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','apron','mallocWrapper','assert']" --set ana.base.privatization none // These examples were cases were we saw issues of not reaching a fixpoint during development of the octagon domain. Since those issues might // resurface, these tests without asserts are included char buf2[67]; diff --git a/tests/regression/24-octagon/12-previously_problematic_j.c b/tests/regression/24-octagon/12-previously_problematic_j.c index 419c913622..15c87d005b 100644 --- a/tests/regression/24-octagon/12-previously_problematic_j.c +++ b/tests/regression/24-octagon/12-previously_problematic_j.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','apron','mallocWrapper']" --set ana.base.privatization none +// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','apron','mallocWrapper','assert']" --set ana.base.privatization none void main(void) { int i = 0; int j = i; diff --git a/tests/regression/24-octagon/13-array_octagon.c b/tests/regression/24-octagon/13-array_octagon.c index ae62b84731..5362b63954 100644 --- a/tests/regression/24-octagon/13-array_octagon.c +++ b/tests/regression/24-octagon/13-array_octagon.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','apron','mallocWrapper']" --set ana.base.privatization none --set sem.int.signed_overflow assume_none +// SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','apron','mallocWrapper','assert']" --set ana.base.privatization none --set sem.int.signed_overflow assume_none #include void main(void) { @@ -51,11 +51,11 @@ void example0(void) { z = j; // Values that may be read are 1 or 2 - assert(a[z] == 1); // FAIL - assert(a[z] == 2); - assert(z >= 0); - assert(z <= j); - assert(a[z] == 0); //FAIL + __goblint_check(a[z] == 1); // FAIL + __goblint_check(a[z] == 2); + __goblint_check(z >= 0); + __goblint_check(z <= j); + __goblint_check(a[z] == 0); //FAIL } void example1(void) { @@ -95,13 +95,13 @@ void example1(void) { } // Values that may be read are 1 or 2 - assert(a[z] == 1); //UNKNOWN - assert(a[z] == 2); //UNKNOWN - assert(z >= 0); + __goblint_check(a[z] == 1); //UNKNOWN + __goblint_check(a[z] == 2); //UNKNOWN + __goblint_check(z >= 0); // Relies on option sem.int.signed_overflow assume_none - assert(z <= j); - assert(a[z] != 0); + __goblint_check(z <= j); + __goblint_check(a[z] != 0); } void example2(void) { @@ -141,11 +141,11 @@ void example2(void) { } // Values that may be read are 1 or 0 - assert(a[z] == 1); //UNKNOWN - assert(a[z] == 0); //UNKNOWN + __goblint_check(a[z] == 1); //UNKNOWN + __goblint_check(a[z] == 0); //UNKNOWN // Relies on option sem.int.signed_overflow assume_none - assert(a[z] != 2); + __goblint_check(a[z] != 2); } // Simple example (employing MustBeEqual) @@ -158,7 +158,7 @@ void example3(void) { a[i] = 0; int v = i; x = a[v]; - assert(x == 0); + __goblint_check(x == 0); i++; } } @@ -174,15 +174,15 @@ void example4(void) { a[j] = 42; // Here we know a[i] is 9 when we have MayBeEqual - assert(a[i] == 9); + __goblint_check(a[i] == 9); // but only about the part to the left of i if we also have MayBeSmaller if(i>0) { int k = a[i-1]; - assert(k == 9); + __goblint_check(k == 9); int l = a[0]; - assert(l == 9); + __goblint_check(l == 9); } i++; @@ -200,11 +200,11 @@ void example4a(void) { a[j] = 42; // Here we know a[i] is 9 when we have MayBeEqual - assert(a[i] == 9); + __goblint_check(a[i] == 9); // but only about the part to the left of i if we also have MayBeSmaller if(i>0) { - assert(a[i-1] == 9); + __goblint_check(a[i-1] == 9); } i++; @@ -223,11 +223,11 @@ void example4b(void) { a[j] = 42; // Here we know a[i] is 9 when we have MayBeEqual - assert(a[i] == 9); + __goblint_check(a[i] == 9); // but only about the part to the left of i if we also have MayBeSmaller if(i>0) { - assert(a[i-1] == 9); + __goblint_check(a[i-1] == 9); } i++; @@ -245,7 +245,7 @@ void example4c(void) { a[i-2] = 31; if(i < 41) { - assert(a[i+1] == 7); + __goblint_check(a[i+1] == 7); } i--; @@ -266,14 +266,14 @@ void example5(void) { a[j] = 0; i++; - assert(a[i] == 0); //UNKNOWN + __goblint_check(a[i] == 0); //UNKNOWN - assert(a[i-1] == 0); - assert(a[j] == 0); + __goblint_check(a[i-1] == 0); + __goblint_check(a[j] == 0); if (i>1) { - assert(a[i-2] == 0); - assert(a[j-1] == 0); + __goblint_check(a[i-2] == 0); + __goblint_check(a[j-1] == 0); } } } @@ -287,11 +287,11 @@ void example6(void) { a[i] = 0; i++; - assert(a[top] == 0); //UNKNOWN + __goblint_check(a[top] == 0); //UNKNOWN int j=0; while(j void main(void) { @@ -53,11 +53,11 @@ void example1(void) { } // Values that may be read are 1 or 2 - assert(a[z] == 1); //UNKNOWN - assert(a[z] == 2); //UNKNOWN + __goblint_check(a[z] == 1); //UNKNOWN + __goblint_check(a[z] == 2); //UNKNOWN // Relies on option sem.int.signed_overflow assume_none - assert(a[z] != 0); + __goblint_check(a[z] != 0); } void example2(void) { @@ -97,11 +97,11 @@ void example2(void) { } // Values that may be read are 1 or 0 - assert(a[z] == 1); //UNKNOWN - assert(a[z] == 0); //UNKNOWN + __goblint_check(a[z] == 1); //UNKNOWN + __goblint_check(a[z] == 0); //UNKNOWN // Relies on option sem.int.signed_overflow assume_none - assert(a[z] != 2); + __goblint_check(a[z] != 2); } // Simple example (employing MustBeEqual) @@ -114,7 +114,7 @@ void example3(void) { a[i] = 0; int v = i; x = a[v]; - assert(x == 0); + __goblint_check(x == 0); i++; } } @@ -130,15 +130,15 @@ void example4(void) { a[j] = 42; // Here we know a[i] is 9 when we have MayBeEqual - assert(a[i] == 9); // UNKNOWN + __goblint_check(a[i] == 9); // UNKNOWN // but only about the part to the left of i if we also have MayBeSmaller if(i>0) { int k = a[i-1]; - assert(k == 9); // UNKNOWN + __goblint_check(k == 9); // UNKNOWN int l = a[0]; - assert(l == 9); // UNKNOWN + __goblint_check(l == 9); // UNKNOWN } i++; @@ -156,11 +156,11 @@ void example4a(void) { a[j] = 42; // Here we know a[i] is 9 when we have MayBeEqual - assert(a[i] == 9); //UNKNOWN + __goblint_check(a[i] == 9); //UNKNOWN // but only about the part to the left of i if we also have MayBeSmaller if(i>0) { - assert(a[i-1] == 9); //UNKNOWN + __goblint_check(a[i-1] == 9); //UNKNOWN } i++; @@ -179,11 +179,11 @@ void example4b(void) { a[j] = 42; // Here we know a[i] is 9 when we have MayBeEqual - assert(a[i] == 9); //UNKNOWN + __goblint_check(a[i] == 9); //UNKNOWN // but only about the part to the left of i if we also have MayBeSmaller if(i>0) { - assert(a[i-1] == 9); //UNKNOWN + __goblint_check(a[i-1] == 9); //UNKNOWN } i++; @@ -201,7 +201,7 @@ void example4c(void) { a[i-2] = 31; if(i < 41) { - assert(a[i+1] == 7); //UNKNOWN + __goblint_check(a[i+1] == 7); //UNKNOWN } i--; @@ -222,14 +222,14 @@ void example5(void) { a[j] = 0; i++; - assert(a[i] == 0); //UNKNOWN + __goblint_check(a[i] == 0); //UNKNOWN - assert(a[i-1] == 0); - assert(a[j] == 0); + __goblint_check(a[i-1] == 0); + __goblint_check(a[j] == 0); if (i>1) { - assert(a[i-2] == 0); - assert(a[j-1] == 0); + __goblint_check(a[i-2] == 0); + __goblint_check(a[j-1] == 0); } } } @@ -243,11 +243,11 @@ void example6(void) { a[i] = 0; i++; - assert(a[top] == 0); //UNKNOWN + __goblint_check(a[top] == 0); //UNKNOWN int j=0; while(j void main(void) __attribute__((goblint_precision("no-interval"))); @@ -68,11 +68,11 @@ void example1(void) { } // Values that may be read are 1 or 2 - assert(a[z] == 1); //UNKNOWN - assert(a[z] == 2); //UNKNOWN + __goblint_check(a[z] == 1); //UNKNOWN + __goblint_check(a[z] == 2); //UNKNOWN // Relies on option sem.int.signed_overflow assume_none - assert(a[z] != 0); + __goblint_check(a[z] != 0); } void example2(void) { @@ -112,11 +112,11 @@ void example2(void) { } // Values that may be read are 1 or 0 - assert(a[z] == 1); //UNKNOWN - assert(a[z] == 0); //UNKNOWN + __goblint_check(a[z] == 1); //UNKNOWN + __goblint_check(a[z] == 0); //UNKNOWN // Relies on option sem.int.signed_overflow assume_none - assert(a[z] != 2); + __goblint_check(a[z] != 2); } // Simple example (employing MustBeEqual) @@ -129,7 +129,7 @@ void example3(void) { a[i] = 0; int v = i; x = a[v]; - assert(x == 0); + __goblint_check(x == 0); i++; } } @@ -145,15 +145,15 @@ void example4(void) { a[j] = 42; // Here we know a[i] is 9 when we have MayBeEqual - assert(a[i] == 9); + __goblint_check(a[i] == 9); // but only about the part to the left of i if we also have MayBeSmaller if(i>0) { int k = a[i-1]; - assert(k == 9); + __goblint_check(k == 9); int l = a[0]; - assert(l == 9); + __goblint_check(l == 9); } i++; @@ -171,11 +171,11 @@ void example4a(void) { a[j] = 42; // Here we know a[i] is 9 when we have MayBeEqual - assert(a[i] == 9); + __goblint_check(a[i] == 9); // but only about the part to the left of i if we also have MayBeSmaller if(i>0) { - assert(a[i-1] == 9); + __goblint_check(a[i-1] == 9); } i++; @@ -194,11 +194,11 @@ void example4b(void) { a[j] = 42; // Here we know a[i] is 9 when we have MayBeEqual - assert(a[i] == 9); + __goblint_check(a[i] == 9); // but only about the part to the left of i if we also have MayBeSmaller if(i>0) { - assert(a[i-1] == 9); + __goblint_check(a[i-1] == 9); } i++; @@ -216,7 +216,7 @@ void example4c(void) { a[i-2] = 31; if(i < 41) { - assert(a[i+1] == 7); + __goblint_check(a[i+1] == 7); } i--; @@ -237,14 +237,14 @@ void example5(void) { a[j] = 0; i++; - assert(a[i] == 0); //UNKNOWN + __goblint_check(a[i] == 0); //UNKNOWN - assert(a[i-1] == 0); - assert(a[j] == 0); + __goblint_check(a[i-1] == 0); + __goblint_check(a[j] == 0); if (i>1) { - assert(a[i-2] == 0); - assert(a[j-1] == 0); + __goblint_check(a[i-2] == 0); + __goblint_check(a[j-1] == 0); } } } @@ -258,11 +258,11 @@ void example6(void) { a[i] = 0; i++; - assert(a[top] == 0); //UNKNOWN + __goblint_check(a[top] == 0); //UNKNOWN int j=0; while(j void main(void) __attribute__((goblint_precision("no-interval"))); @@ -67,11 +67,11 @@ void example1(void) { } // Values that may be read are 1 or 2 - assert(a[z] == 1); //UNKNOWN - assert(a[z] == 2); //UNKNOWN + __goblint_check(a[z] == 1); //UNKNOWN + __goblint_check(a[z] == 2); //UNKNOWN // Relies on option sem.int.signed_overflow assume_none - assert(a[z] != 0); + __goblint_check(a[z] != 0); } void example2(void) { @@ -111,11 +111,11 @@ void example2(void) { } // Values that may be read are 1 or 0 - assert(a[z] == 1); //UNKNOWN - assert(a[z] == 0); //UNKNOWN + __goblint_check(a[z] == 1); //UNKNOWN + __goblint_check(a[z] == 0); //UNKNOWN // Relies on option sem.int.signed_overflow assume_none - assert(a[z] != 2); + __goblint_check(a[z] != 2); } // Simple example (employing MustBeEqual) @@ -128,7 +128,7 @@ void example3(void) { a[i] = 0; int v = i; x = a[v]; - assert(x == 0); + __goblint_check(x == 0); i++; } } @@ -144,15 +144,15 @@ void example4(void) { a[j] = 42; // Here we know a[i] is 9 when we have MayBeEqual - assert(a[i] == 9); // UNKNOWN + __goblint_check(a[i] == 9); // UNKNOWN // but only about the part to the left of i if we also have MayBeSmaller if(i>0) { int k = a[i-1]; - assert(k == 9); // UNKNOWN + __goblint_check(k == 9); // UNKNOWN int l = a[0]; - assert(l == 9); // UNKNOWN + __goblint_check(l == 9); // UNKNOWN } i++; @@ -170,11 +170,11 @@ void example4a(void) { a[j] = 42; // Here we know a[i] is 9 when we have MayBeEqual - assert(a[i] == 9); //UNKNOWN + __goblint_check(a[i] == 9); //UNKNOWN // but only about the part to the left of i if we also have MayBeSmaller if(i>0) { - assert(a[i-1] == 9); //UNKNOWN + __goblint_check(a[i-1] == 9); //UNKNOWN } i++; @@ -193,11 +193,11 @@ void example4b(void) { a[j] = 42; // Here we know a[i] is 9 when we have MayBeEqual - assert(a[i] == 9); //UNKNOWN + __goblint_check(a[i] == 9); //UNKNOWN // but only about the part to the left of i if we also have MayBeSmaller if(i>0) { - assert(a[i-1] == 9); //UNKNOWN + __goblint_check(a[i-1] == 9); //UNKNOWN } i++; @@ -215,7 +215,7 @@ void example4c(void) { a[i-2] = 31; if(i < 41) { - assert(a[i+1] == 7); //UNKNOWN + __goblint_check(a[i+1] == 7); //UNKNOWN } i--; @@ -236,14 +236,14 @@ void example5(void) { a[j] = 0; i++; - assert(a[i] == 0); //UNKNOWN + __goblint_check(a[i] == 0); //UNKNOWN - assert(a[i-1] == 0); - assert(a[j] == 0); + __goblint_check(a[i-1] == 0); + __goblint_check(a[j] == 0); if (i>1) { - assert(a[i-2] == 0); - assert(a[j-1] == 0); + __goblint_check(a[i-2] == 0); + __goblint_check(a[j-1] == 0); } } } @@ -257,11 +257,11 @@ void example6(void) { a[i] = 0; i++; - assert(a[top] == 0); //UNKNOWN + __goblint_check(a[top] == 0); //UNKNOWN int j=0; while(j @@ -15,8 +15,8 @@ void main(void) { *ptr = N; - assert(X-N == 0); - assert(X == N); + __goblint_check(X-N == 0); + __goblint_check(X == N); if(X == N) { N = 8; diff --git a/tests/regression/25-vla/01-simple.c b/tests/regression/25-vla/01-simple.c index 3504992a0a..0cb3f4229c 100644 --- a/tests/regression/25-vla/01-simple.c +++ b/tests/regression/25-vla/01-simple.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main(void) @@ -10,24 +10,24 @@ int main(void) // Check one-dimensional first int b[n]; b[29] = 5; - assert(b[29] = 5); + __goblint_check(b[29] = 5); int c[n+4]; c[31] = 2; - assert(c[31] = 2); + __goblint_check(c[31] = 2); // Two dimensional, one variable, first int d[n][30]; d[2][2] = 42; - assert(d[2][2] == 42); + __goblint_check(d[2][2] == 42); // Two dimensional, one variable, last int e[20][n]; e[2][2] = 42; - assert(e[2][2] == 42); + __goblint_check(e[2][2] == 42); // Two dimensional, two variable int f[m][n]; f[2][2] = 42; - assert(f[2][2] == 42); + __goblint_check(f[2][2] == 42); } diff --git a/tests/regression/25-vla/02-loop.c b/tests/regression/25-vla/02-loop.c index 9b4ce2f0b0..9f35a29ef1 100644 --- a/tests/regression/25-vla/02-loop.c +++ b/tests/regression/25-vla/02-loop.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main(void) @@ -13,7 +13,7 @@ void example1(void) { for(int i=1;i<10;i++) { int a[i]; a[i-1] = 0; - assert(a[i-1] == 0); + __goblint_check(a[i-1] == 0); } } @@ -25,7 +25,7 @@ void example2(void) { a[j] = 0; } - assert(a[0] == 0); + __goblint_check(a[0] == 0); } } @@ -38,7 +38,7 @@ void example3(void) { a[0] = 42; } - assert(a[0] == 42); //UNKNOWN + __goblint_check(a[0] == 42); //UNKNOWN } } @@ -57,6 +57,6 @@ void example4(void) { } for(int i=0; i < 4; i++) { - assert(a[i] == 42); + __goblint_check(a[i] == 42); } } diff --git a/tests/regression/25-vla/03-calls.c b/tests/regression/25-vla/03-calls.c index 9a39f6f6a8..32c0edabfe 100644 --- a/tests/regression/25-vla/03-calls.c +++ b/tests/regression/25-vla/03-calls.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none // Variable-sized arrays void foo(int n, int a[n]); void foo2(int n, int a[30][n]); diff --git a/tests/regression/25-vla/04-passing_ptr_to_array.c b/tests/regression/25-vla/04-passing_ptr_to_array.c index bd521756f9..80785e854b 100644 --- a/tests/regression/25-vla/04-passing_ptr_to_array.c +++ b/tests/regression/25-vla/04-passing_ptr_to_array.c @@ -1,54 +1,54 @@ -//PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +//PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include void foo(int (*a)[40]){ int x = (*(a + 29))[7]; - assert(x == 23); //FAIL + __goblint_check(x == 23); //FAIL int y = (*(a + 7))[13]; - assert(y == 23); + __goblint_check(y == 23); - assert(a[7][13] == 23); + __goblint_check(a[7][13] == 23); } void foo2(int n,int (*a)[n]){ int x = (*(a + 29))[7]; - assert(x == 23); //FAIL + __goblint_check(x == 23); //FAIL int y = (*(a + 7))[13]; - assert(y == 23); + __goblint_check(y == 23); - assert(a[7][13] == 23); + __goblint_check(a[7][13] == 23); } void foo3(int n,int a[][n]){ int x = (*(a + 29))[7]; - assert(x == 23); //FAIL + __goblint_check(x == 23); //FAIL int y = (*(a + 7))[13]; - assert(y == 23); + __goblint_check(y == 23); - assert(a[7][13] == 23); + __goblint_check(a[7][13] == 23); } void foo4(int n,int a[n][n]){ int x = (*(a + 29))[7]; - assert(x == 23); //FAIL + __goblint_check(x == 23); //FAIL int y = (*(a + 7))[13]; - assert(y == 23); + __goblint_check(y == 23); - assert(a[7][13] == 23); + __goblint_check(a[7][13] == 23); } void foo5(int n, int m, int a[n][m]){ int x = (*(a + 29))[7]; - assert(x == 23); //FAIL + __goblint_check(x == 23); //FAIL int y = (*(a + 7))[13]; - assert(y == 23); + __goblint_check(y == 23); - assert(a[7][13] == 23); + __goblint_check(a[7][13] == 23); } int main(void) diff --git a/tests/regression/25-vla/05-more_passing.c b/tests/regression/25-vla/05-more_passing.c index 7357de23e7..8b5c609e1f 100644 --- a/tests/regression/25-vla/05-more_passing.c +++ b/tests/regression/25-vla/05-more_passing.c @@ -1,32 +1,32 @@ -//PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +//PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include #include void foo(int n, int a[n]) { int x = a[7]; - assert(x == 42); + __goblint_check(x == 42); } void fooo(int n, int a[n][n]) { - assert(a[29][7] == 42); + __goblint_check(a[29][7] == 42); int *ptr = a[29]; int x = *(ptr+7); printf("x is %d", x); - assert(x == 42); + __goblint_check(x == 42); } void foo2(int n, int a[50][n]) { - assert(a[29][7] == 42); - assert(a[29][7] == 0); //FAIL + __goblint_check(a[29][7] == 42); + __goblint_check(a[29][7] == 0); //FAIL } // This is quite ugly, but valid C99 void foo3(int n, int b[n], int a[n][b[0]]) { - assert(a[29][7] == 42); + __goblint_check(a[29][7] == 42); } void foo4(int n, int m, int r, int a[n][m][r]) { - assert(a[3][3][2] == 42); + __goblint_check(a[3][3][2] == 42); } int main(void) diff --git a/tests/regression/25-vla/06-even_more_passing.c b/tests/regression/25-vla/06-even_more_passing.c index 60ed12046b..62bebe29ca 100644 --- a/tests/regression/25-vla/06-even_more_passing.c +++ b/tests/regression/25-vla/06-even_more_passing.c @@ -1,4 +1,4 @@ -//PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +//PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include void foo2(int n , int (*a)[n] ) @@ -7,13 +7,13 @@ void foo2(int n , int (*a)[n] ) int y ; int *ptr = *(a+7); - assert(ptr[13] == 23); + __goblint_check(ptr[13] == 23); x = (*(a + 29))[7]; - assert(x == 23); //FAIL + __goblint_check(x == 23); //FAIL y = (*(a + 7))[13]; - assert(y == 23); + __goblint_check(y == 23); return; } diff --git a/tests/regression/26-undefined_behavior/01-only-intervals.c b/tests/regression/26-undefined_behavior/01-only-intervals.c index 7a6ba31be8..2587e24c6e 100644 --- a/tests/regression/26-undefined_behavior/01-only-intervals.c +++ b/tests/regression/26-undefined_behavior/01-only-intervals.c @@ -1,9 +1,9 @@ -// PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none #include int main() { for(int i=2; i < 42; i++) { int x = i==2; // NOWARN - assert(1); + __goblint_check(1); } } diff --git a/tests/regression/27-inv_invariants/01-ints.c b/tests/regression/27-inv_invariants/01-ints.c index f3eec60e62..ae55f89339 100644 --- a/tests/regression/27-inv_invariants/01-ints.c +++ b/tests/regression/27-inv_invariants/01-ints.c @@ -10,84 +10,84 @@ int main() { int x, y; if (x+1 == 2) { - assert(x == 1); + __goblint_check(x == 1); } else { - assert(x != 1); + __goblint_check(x != 1); } if (5-x == 3) - assert(x == 2); + __goblint_check(x == 2); else - assert(x != 2); + __goblint_check(x != 2); if (5-x == 3 && x+y == x*3) - assert(x == 2 && y == 4); + __goblint_check(x == 2 && y == 4); if (x == 3 && y/x == 2) { - assert(y == 6); // UNKNOWN! - assert(RANGE(y, 6, 8)); + __goblint_check(y == 6); // UNKNOWN! + __goblint_check(RANGE(y, 6, 8)); } if (y/3 == -2) - assert(RANGE(y, -8, -6)); + __goblint_check(RANGE(y, -8, -6)); if (y/-3 == -2) - assert(RANGE(y, 6, 8)); + __goblint_check(RANGE(y, 6, 8)); if (y/x == 2 && x == 3) - assert(x == 3); // TO-DO y == [6,8]; this does not work because CIL transforms this into two if-statements + __goblint_check(x == 3); // TO-DO y == [6,8]; this does not work because CIL transforms this into two if-statements if (2+(3-x)*4/5 == 6 && 2*y >= x+5) - assert(RANGE(x, -3, -2) && y >= 1); // UNKNOWN + __goblint_check(RANGE(x, -3, -2) && y >= 1); // UNKNOWN if (x > 1 && x < 5 && x % 2 == 1) // x = [2,4] && x % 2 = 1 => x = 3 - assert(x == 3); + __goblint_check(x == 3); long xl, yl, zl; if (xl+1 == 2) { - assert(xl == 1); + __goblint_check(xl == 1); } else { - assert(xl != 1); + __goblint_check(xl != 1); } if (5-xl == 3) - assert(xl == 2); + __goblint_check(xl == 2); if (5-xl == 3 && xl+yl == xl*3) - assert(xl == 2 && yl == 4); + __goblint_check(xl == 2 && yl == 4); if (xl == 3 && yl/xl == 2) // yl could for example also be 7 - assert(yl == 6); // UNKNOWN! + __goblint_check(yl == 6); // UNKNOWN! if (yl/xl == 2 && xl == 3) - assert(xl == 3); // TO-DO yl == 6 + __goblint_check(xl == 3); // TO-DO yl == 6 if (2+(3-xl)*4/5 == 6 && 2*yl >= xl+4) // xl could also be -3 - assert(xl == -2 && yl >= 1); //UNKNOWN! + __goblint_check(xl == -2 && yl >= 1); //UNKNOWN! if (xl > 1 && xl < 5 && xl % 2 == 1) { - assert(xl != 2); // [2,4] -> [3,4] TO-DO x % 2 == 1 + __goblint_check(xl != 2); // [2,4] -> [3,4] TO-DO x % 2 == 1 } short xs, ys, zs; if (xs+1 == 2) { - assert(xs == 1); + __goblint_check(xs == 1); } else { // Does not survive the casts inserted by CIL - // assert(xs != 1); + // __goblint_check(xs != 1); } if (5-xs == 3) - assert(xs == 2); + __goblint_check(xs == 2); if (5-xs == 3 && xs+ys == xs*3) - assert(xs == 2 && ys == 4); + __goblint_check(xs == 2 && ys == 4); if (xs == 3 && ys/xs == 2) { // ys could for example also be 7 - assert(ys == 6); // UNKNOWN! - assert(RANGE(ys, 6, 8)); + __goblint_check(ys == 6); // UNKNOWN! + __goblint_check(RANGE(ys, 6, 8)); } if (ys/3 == -2) - assert(RANGE(ys, -8, -6)); + __goblint_check(RANGE(ys, -8, -6)); if (ys/-3 == -2) - assert(RANGE(ys, 6, 8)); + __goblint_check(RANGE(ys, 6, 8)); if (ys/xs == 2 && xs == 3) - assert(xs == 3); // TO-DO yl == 6 + __goblint_check(xs == 3); // TO-DO yl == 6 if (2+(3-xs)*4/5 == 6 && 2*ys >= xs+5) { // xs could also be -3 - assert(xs == -2 && ys >= 1); //UNKNOWN! - assert(RANGE(xs, -3, -2) && ys >= 1); // UNKNOWN + __goblint_check(xs == -2 && ys >= 1); //UNKNOWN! + __goblint_check(RANGE(xs, -3, -2) && ys >= 1); // UNKNOWN } if (xs > 1 && xs < 5 && xs % 2 == 1) { - assert(xs != 2); + __goblint_check(xs != 2); } } @@ -102,93 +102,93 @@ int main2() { int x, y, z; if (x+one == two) { - assert(x == one); + __goblint_check(x == one); } else { - assert(x != one); + __goblint_check(x != one); } if (five-x == three) - assert(x == two); + __goblint_check(x == two); if (five-x == three && x+y == x*three) - assert(x == two && y == four); + __goblint_check(x == two && y == four); if (x == three && y/x == two) { // y could for example also be 7 - assert(y == six); // UNKNOWN! - assert(RANGE(y, 6, 8)); + __goblint_check(y == six); // UNKNOWN! + __goblint_check(RANGE(y, 6, 8)); } if (y/x == two && x == three) - assert(x == three); // TO-DO y == six + __goblint_check(x == three); // TO-DO y == six if (two+(three-x)*four/five == six && two*y >= x+four) // x could also be -three - assert(x == -two && y >= one); //UNKNOWN! + __goblint_check(x == -two && y >= one); //UNKNOWN! if (x > one && x < five && x % two == one) - assert(x != two); // [two,four] -> [three,four] TO-DO x % two == one + __goblint_check(x != two); // [two,four] -> [three,four] TO-DO x % two == one if (y/three == -two) - assert(RANGE(y, -8, -6)); + __goblint_check(RANGE(y, -8, -6)); if (y/-three == -two) - assert(RANGE(y, 6, 8)); + __goblint_check(RANGE(y, 6, 8)); if (y/x == two && x == three) - assert(x == 3); // TO-DO y == [6,8]; this does not work because CIL transforms this into two if-statements + __goblint_check(x == 3); // TO-DO y == [6,8]; this does not work because CIL transforms this into two if-statements if (two+(three-x)*four/five == six && two*y >= x+five) - assert(RANGE(x, -3, -2) && y >= 1); // UNKNOWN + __goblint_check(RANGE(x, -3, -2) && y >= 1); // UNKNOWN if (x > one && x < five && x % two == one) // x = [2,4] && x % 2 = 1 => x = 3 - assert(x != 2); // [3,4] TO-DO [3,3] + __goblint_check(x != 2); // [3,4] TO-DO [3,3] long xl, yl, zl; if (xl+one == two) { - assert(xl == one); + __goblint_check(xl == one); } else { - assert(xl != one); + __goblint_check(xl != one); } if (five-xl == three) - assert(xl == two); + __goblint_check(xl == two); if (five-xl == three && xl+yl == xl*three) - assert(xl == two && yl == four); + __goblint_check(xl == two && yl == four); if (xl == three && yl/xl == two) // yl could for example also be 7 - assert(yl == six); // UNKNOWN! + __goblint_check(yl == six); // UNKNOWN! if (yl/xl == two && xl == three) - assert(xl == three); // TO-DO yl == six + __goblint_check(xl == three); // TO-DO yl == six if (two+(three-xl)*four/five == six && two*yl >= xl+four) // xl could also be -three - assert(xl == -two && yl >= one); //UNKNOWN! + __goblint_check(xl == -two && yl >= one); //UNKNOWN! if (xl > one && xl < five && xl % two == one) { - assert(xl != two); // [two,four] -> [three,four] TO-DO x % two == one + __goblint_check(xl != two); // [two,four] -> [three,four] TO-DO x % two == one } short xs, ys, zs; if (xs+one == two) { - assert(xs == one); + __goblint_check(xs == one); } else { // Does not survive the casts inserted by CIL - // assert(xs != one); + // __goblint_check(xs != one); } if (five-xs == three) - assert(xs == two); + __goblint_check(xs == two); if (five-xs == three && xs+ys == xs*three) - assert(xs == two && ys == four); + __goblint_check(xs == two && ys == four); if (xs == three && ys/xs == two) { // ys could for example also be 7 - assert(ys == six); // UNKNOWN! - assert(RANGE(ys, six, 8)); + __goblint_check(ys == six); // UNKNOWN! + __goblint_check(RANGE(ys, six, 8)); } if (ys/xs == two && xs == three) - assert(xs == three); // TO-DO yl == six + __goblint_check(xs == three); // TO-DO yl == six if (two+(three-xs)*four/five == six && two*ys >= xs+five) { // xs could also be -three - assert(xs == -two && ys >= one); //UNKNOWN! - assert(RANGE(xs, -three, -two) && ys >= one); // UNKNOWN + __goblint_check(xs == -two && ys >= one); //UNKNOWN! + __goblint_check(RANGE(xs, -three, -two) && ys >= one); // UNKNOWN } if (xs > one && xs < five && xs % two == one) { - assert(xs != two); + __goblint_check(xs != two); } if (ys/three == -two) - assert(RANGE(ys, -8, -6)); + __goblint_check(RANGE(ys, -8, -6)); if (ys/-three == -two) - assert(RANGE(ys, 6, 8)); + __goblint_check(RANGE(ys, 6, 8)); if (ys/xs == two && xs == three) - assert(xs == 3); // TO-DO y == [6,8]; this does not work because CIL transforms this into two if-statements + __goblint_check(xs == 3); // TO-DO y == [6,8]; this does not work because CIL transforms this into two if-statements } diff --git a/tests/regression/27-inv_invariants/03-ints-not.c b/tests/regression/27-inv_invariants/03-ints-not.c index 253f9bece0..77aee2ee8b 100644 --- a/tests/regression/27-inv_invariants/03-ints-not.c +++ b/tests/regression/27-inv_invariants/03-ints-not.c @@ -4,8 +4,8 @@ int main() { int x; if(!x) { - assert(x==0); + __goblint_check(x==0); } else { - assert(x==1); //UNKNOWN! + __goblint_check(x==1); //UNKNOWN! } } diff --git a/tests/regression/27-inv_invariants/04-ints-not-interval.c b/tests/regression/27-inv_invariants/04-ints-not-interval.c index 6a76c95c98..f9f12953cb 100644 --- a/tests/regression/27-inv_invariants/04-ints-not-interval.c +++ b/tests/regression/27-inv_invariants/04-ints-not-interval.c @@ -6,6 +6,6 @@ int main() { if(!x) { } else { - assert(x==1); //UNKNOWN! + __goblint_check(x==1); //UNKNOWN! } } diff --git a/tests/regression/27-inv_invariants/05-overflow-def-exc.c b/tests/regression/27-inv_invariants/05-overflow-def-exc.c index 34c7c036a5..733ccfc8f0 100644 --- a/tests/regression/27-inv_invariants/05-overflow-def-exc.c +++ b/tests/regression/27-inv_invariants/05-overflow-def-exc.c @@ -7,7 +7,7 @@ int main() { int z = 5; if(xl == -20) { - assert(1); + __goblint_check(1); } } } diff --git a/tests/regression/27-inv_invariants/06-mul-arith.c b/tests/regression/27-inv_invariants/06-mul-arith.c index 11837052ef..975e2337b1 100644 --- a/tests/regression/27-inv_invariants/06-mul-arith.c +++ b/tests/regression/27-inv_invariants/06-mul-arith.c @@ -10,7 +10,7 @@ int main(){ unsigned int r = i * 1073741824u; if(i * 1073741824u == 3221225472u){ printf("%u\n", i); - assert(i == 3); // UNKNOWN! + __goblint_check(i == 3); // UNKNOWN! } return 0; } diff --git a/tests/regression/27-inv_invariants/08-bor-inv.c b/tests/regression/27-inv_invariants/08-bor-inv.c index defce7b107..b074eaf4b8 100644 --- a/tests/regression/27-inv_invariants/08-bor-inv.c +++ b/tests/regression/27-inv_invariants/08-bor-inv.c @@ -13,7 +13,7 @@ int main(){ if( x + y == 4){ z = 3; } - assert(z == 0); + __goblint_check(z == 0); // if( ((n - nn) == 3) == (x+top == 3) * (y+ top == 3)){ // z = 1; @@ -21,6 +21,6 @@ int main(){ // z = 3; // } - // assert(z == 1); + // __goblint_check(z == 1); return 0; } diff --git a/tests/regression/27-inv_invariants/09-invariant-worsen.c b/tests/regression/27-inv_invariants/09-invariant-worsen.c index e0dc80cc1f..fdee2fdd84 100644 --- a/tests/regression/27-inv_invariants/09-invariant-worsen.c +++ b/tests/regression/27-inv_invariants/09-invariant-worsen.c @@ -12,12 +12,12 @@ int main() { else x = &b; - assert(*x == 1); + __goblint_check(*x == 1); b = 2; - assert(a == 1); + __goblint_check(a == 1); if (*x != 0) { // invariant shouldn't make less precise! - assert(a == 1); + __goblint_check(a == 1); } return 0; } \ No newline at end of file diff --git a/tests/regression/27-inv_invariants/10-invariant-worsen-global.c b/tests/regression/27-inv_invariants/10-invariant-worsen-global.c index 9a03a51db4..dfa0491ca8 100644 --- a/tests/regression/27-inv_invariants/10-invariant-worsen-global.c +++ b/tests/regression/27-inv_invariants/10-invariant-worsen-global.c @@ -25,12 +25,12 @@ int main() { pthread_mutex_lock(&A); // continue with protected (privatized) values - assert(*x == 1); + __goblint_check(*x == 1); b = 2; - assert(a == 1); + __goblint_check(a == 1); if (*x != 0) { // invariant shouldn't make less precise! - assert(a == 1); + __goblint_check(a == 1); } return 0; } \ No newline at end of file diff --git a/tests/regression/27-inv_invariants/11-indirect-addresses.c b/tests/regression/27-inv_invariants/11-indirect-addresses.c index 70336c94a9..33265e07cc 100644 --- a/tests/regression/27-inv_invariants/11-indirect-addresses.c +++ b/tests/regression/27-inv_invariants/11-indirect-addresses.c @@ -12,13 +12,13 @@ int main() { else x = &b; - assert(*x == 1); + __goblint_check(*x == 1); b = 2; - assert(a == 1); + __goblint_check(a == 1); if (*x > 1) { // invariant rules out x == &a - assert(x == &b); // TODO - assert(*x == 2); // TODO + __goblint_check(x == &b); // TODO + __goblint_check(*x == 2); // TODO } return 0; } \ No newline at end of file diff --git a/tests/regression/27-inv_invariants/12-bot-mul-div.c b/tests/regression/27-inv_invariants/12-bot-mul-div.c index a316807586..170e9184d2 100644 --- a/tests/regression/27-inv_invariants/12-bot-mul-div.c +++ b/tests/regression/27-inv_invariants/12-bot-mul-div.c @@ -5,7 +5,7 @@ int main(){ unsigned long top; printf("value to reach true branch: %ld\n", (-1 / (8 * sizeof(int)))); if (top == (-1 / (8 * sizeof(int)))){ // parts of the expression evaluate to bottom and make Goblint crash - assert(1); + __goblint_check(1); } return 0; } diff --git a/tests/regression/27-inv_invariants/13-mul-arith.c b/tests/regression/27-inv_invariants/13-mul-arith.c index 11837052ef..975e2337b1 100644 --- a/tests/regression/27-inv_invariants/13-mul-arith.c +++ b/tests/regression/27-inv_invariants/13-mul-arith.c @@ -10,7 +10,7 @@ int main(){ unsigned int r = i * 1073741824u; if(i * 1073741824u == 3221225472u){ printf("%u\n", i); - assert(i == 3); // UNKNOWN! + __goblint_check(i == 3); // UNKNOWN! } return 0; } diff --git a/tests/regression/27-inv_invariants/14-interval-arith.c b/tests/regression/27-inv_invariants/14-interval-arith.c index 38049c66c6..38350b58cc 100644 --- a/tests/regression/27-inv_invariants/14-interval-arith.c +++ b/tests/regression/27-inv_invariants/14-interval-arith.c @@ -10,8 +10,8 @@ int main(){ // We thus get i -> Bottom, and the code after the condition is considered unreachable if(i * 1073741824u == 3221225472u){ printf("%u\n", i); - assert(i == 3); // SUCCESS + __goblint_check(i == 3); // SUCCESS } - assert(i == 3); // SUCCESS + __goblint_check(i == 3); // SUCCESS return 0; } diff --git a/tests/regression/27-inv_invariants/15-unknown-null-ptr.c b/tests/regression/27-inv_invariants/15-unknown-null-ptr.c index f2742df428..c4be09ee50 100644 --- a/tests/regression/27-inv_invariants/15-unknown-null-ptr.c +++ b/tests/regression/27-inv_invariants/15-unknown-null-ptr.c @@ -5,14 +5,14 @@ int main() { int *r; // rand if (r == NULL) - assert(r == NULL); + __goblint_check(r == NULL); else - assert(r != NULL); + __goblint_check(r != NULL); if (r != NULL) - assert(r != NULL); + __goblint_check(r != NULL); else - assert(r == NULL); + __goblint_check(r == NULL); return 0; } diff --git a/tests/regression/27-inv_invariants/16-sedgewick.c b/tests/regression/27-inv_invariants/16-sedgewick.c index 31cfcccd3b..47243c0405 100644 --- a/tests/regression/27-inv_invariants/16-sedgewick.c +++ b/tests/regression/27-inv_invariants/16-sedgewick.c @@ -21,6 +21,6 @@ struct node* min(struct node *root) { int main() { struct node *root; struct node *m = min(root); - assert(m == NULL); + __goblint_check(m == NULL); return 0; } diff --git a/tests/regression/28-race_reach/racemacros.h b/tests/regression/28-race_reach/racemacros.h index 316fd73dfc..cb6cab9505 100644 --- a/tests/regression/28-race_reach/racemacros.h +++ b/tests/regression/28-race_reach/racemacros.h @@ -9,7 +9,7 @@ extern void abort(void); void reach_error() { assert(0); } void __VERIFIER_assert(int cond) { if(!(cond)) { ERROR: {reach_error();abort();} } } #else -#define __VERIFIER_assert assert +#define __VERIFIER_assert __goblint_check #endif extern int __VERIFIER_nondet_int(); diff --git a/tests/regression/29-svcomp/01-race-2_3b-container_of.c b/tests/regression/29-svcomp/01-race-2_3b-container_of.c index edc0c8fcdf..b5eba7eab1 100644 --- a/tests/regression/29-svcomp/01-race-2_3b-container_of.c +++ b/tests/regression/29-svcomp/01-race-2_3b-container_of.c @@ -12,9 +12,9 @@ extern void abort(void); #include -void reach_error() { assert(0); } // FAIL +void reach_error() { __goblint_check(0); } // FAIL int __VERIFIER_nondet_int(void); -void ldv_assert(int expression) { if (!expression) { ERROR: {reach_error();abort();}}; return; } // NOWARN +void ldv___goblint_check(int expression) { if (!expression) { ERROR: {reach_error();abort();}}; return; } // NOWARN pthread_t t1,t2; @@ -63,8 +63,8 @@ int my_drv_probe(struct my_data *data) { //race on data->shared.a and data->shared.b data->shared.a = 3; // RACE! data->shared.b = 3; // RACE! - ldv_assert(data->shared.a==3); // RACE! - ldv_assert(data->shared.b==3); // RACE! + ldv___goblint_check(data->shared.a==3); // RACE! + ldv___goblint_check(data->shared.b==3); // RACE! return 0; exit: @@ -95,14 +95,14 @@ int main(void) { probe_ret = my_drv_probe(&data); if(probe_ret==0) { my_drv_disconnect(&data); - ldv_assert(data.shared.a==1); // RACE - ldv_assert(data.shared.b==2); // RACE + ldv___goblint_check(data.shared.a==1); // RACE + ldv___goblint_check(data.shared.b==2); // RACE } my_drv_cleanup(); data.shared.a = -1; // RACE data.shared.b = -1; // RACE - ldv_assert(data.shared.a==-1); // RACE - ldv_assert(data.shared.b==-1); // RACE + ldv___goblint_check(data.shared.a==-1); // RACE + ldv___goblint_check(data.shared.b==-1); // RACE } return 0; } diff --git a/tests/regression/29-svcomp/02-race-2_4b-container_of.c b/tests/regression/29-svcomp/02-race-2_4b-container_of.c index 53698e4f28..b547f71117 100644 --- a/tests/regression/29-svcomp/02-race-2_4b-container_of.c +++ b/tests/regression/29-svcomp/02-race-2_4b-container_of.c @@ -12,9 +12,9 @@ extern void abort(void); #include -void reach_error() { assert(0); } // FAIL +void reach_error() { __goblint_check(0); } // FAIL int __VERIFIER_nondet_int(void); -void ldv_assert(int expression) { if (!expression) { ERROR: {reach_error();abort();}}; return; } // NOWARN +void ldv___goblint_check(int expression) { if (!expression) { ERROR: {reach_error();abort();}}; return; } // NOWARN pthread_t t1,t2; @@ -72,8 +72,8 @@ void my_drv_disconnect(struct my_data *data) { //race on data->shared.a and data->shared.b data->shared.a = 3; // RACE! data->shared.b = 3; // RACE! - ldv_assert(data->shared.a==3); // RACE! - ldv_assert(data->shared.b==3); // RACE! + ldv___goblint_check(data->shared.a==3); // RACE! + ldv___goblint_check(data->shared.b==3); // RACE! pthread_join(t1, &status); pthread_join(t2, &status); @@ -96,14 +96,14 @@ int main(void) { probe_ret = my_drv_probe(&data); if(probe_ret==0) { my_drv_disconnect(&data); - ldv_assert(data.shared.a==1); // RACE - ldv_assert(data.shared.b==2); // RACE + ldv___goblint_check(data.shared.a==1); // RACE + ldv___goblint_check(data.shared.b==2); // RACE } my_drv_cleanup(); data.shared.a = -1; // RACE data.shared.b = -1; // RACE - ldv_assert(data.shared.a==-1); // RACE - ldv_assert(data.shared.b==-1); // RACE + ldv___goblint_check(data.shared.a==-1); // RACE + ldv___goblint_check(data.shared.b==-1); // RACE } return 0; } diff --git a/tests/regression/29-svcomp/03-race-2_5b-container_of.c b/tests/regression/29-svcomp/03-race-2_5b-container_of.c index 27849e6ab0..73ba5055b9 100644 --- a/tests/regression/29-svcomp/03-race-2_5b-container_of.c +++ b/tests/regression/29-svcomp/03-race-2_5b-container_of.c @@ -12,9 +12,9 @@ extern void abort(void); #include -void reach_error() { assert(0); } // FAIL +void reach_error() { __goblint_check(0); } // FAIL int __VERIFIER_nondet_int(void); -void ldv_assert(int expression) { if (!expression) { ERROR: {reach_error();abort();}}; return; } // NOWARN +void ldv___goblint_check(int expression) { if (!expression) { ERROR: {reach_error();abort();}}; return; } // NOWARN pthread_t t1,t2; @@ -73,8 +73,8 @@ void my_drv_disconnect(struct my_data *data) { //race on data->shared.a and data->shared.b data->shared.a = 3; // RACE! data->shared.b = 3; // RACE! - ldv_assert(data->shared.a==3); // RACE! - ldv_assert(data->shared.b==3); // RACE! + ldv___goblint_check(data->shared.a==3); // RACE! + ldv___goblint_check(data->shared.b==3); // RACE! pthread_join(t2, &status); pthread_mutex_destroy(&data->lock); @@ -96,14 +96,14 @@ int main(void) { probe_ret = my_drv_probe(&data); if(probe_ret==0) { my_drv_disconnect(&data); - ldv_assert(data.shared.a==1); // RACE - ldv_assert(data.shared.b==2); // RACE + ldv___goblint_check(data.shared.a==1); // RACE + ldv___goblint_check(data.shared.b==2); // RACE } my_drv_cleanup(); data.shared.a = -1; // RACE data.shared.b = -1; // RACE - ldv_assert(data.shared.a==-1); // RACE - ldv_assert(data.shared.b==-1); // RACE + ldv___goblint_check(data.shared.a==-1); // RACE + ldv___goblint_check(data.shared.b==-1); // RACE } return 0; } diff --git a/tests/regression/29-svcomp/04-lustre-minimal.c b/tests/regression/29-svcomp/04-lustre-minimal.c index bb10e8fb83..9115ff3e06 100644 --- a/tests/regression/29-svcomp/04-lustre-minimal.c +++ b/tests/regression/29-svcomp/04-lustre-minimal.c @@ -7,5 +7,5 @@ int main() { unsigned long n = 16; unsigned long size = 4912; - assert(!(0xffffffffffffffffUL / size < n)); + __goblint_check(!(0xffffffffffffffffUL / size < n)); } diff --git a/tests/regression/29-svcomp/07-malloc_fun.c b/tests/regression/29-svcomp/07-malloc_fun.c index 2092e82c57..fa1f7a18cd 100644 --- a/tests/regression/29-svcomp/07-malloc_fun.c +++ b/tests/regression/29-svcomp/07-malloc_fun.c @@ -16,12 +16,12 @@ int main() { *x = 0; *y = 1; - assert(*x == 0); - assert(*y == 1); + __goblint_check(*x == 0); + __goblint_check(*y == 1); p = x; x = y; y = p; - assert(*x == 1); - assert(*y == 0); + __goblint_check(*x == 1); + __goblint_check(*y == 0); return 0; } diff --git a/tests/regression/29-svcomp/08-malloc_fun2.c b/tests/regression/29-svcomp/08-malloc_fun2.c index 738ee28e8c..7cae809ffd 100644 --- a/tests/regression/29-svcomp/08-malloc_fun2.c +++ b/tests/regression/29-svcomp/08-malloc_fun2.c @@ -20,12 +20,12 @@ int main() { *x = 0; *y = 1; - assert(*x == 0); - assert(*y == 1); + __goblint_check(*x == 0); + __goblint_check(*y == 1); p = x; x = y; y = p; - assert(*x == 1); - assert(*y == 0); + __goblint_check(*x == 1); + __goblint_check(*y == 0); return 0; } diff --git a/tests/regression/29-svcomp/09-ptr-cast-write.c b/tests/regression/29-svcomp/09-ptr-cast-write.c index 3823bf3072..a6c18b3a53 100644 --- a/tests/regression/29-svcomp/09-ptr-cast-write.c +++ b/tests/regression/29-svcomp/09-ptr-cast-write.c @@ -7,5 +7,5 @@ int main() { unsigned char* y = &x; *y = a; - assert(x == -56); + __goblint_check(x == -56); } \ No newline at end of file diff --git a/tests/regression/29-svcomp/10-ptr-cast-write-malloc.c b/tests/regression/29-svcomp/10-ptr-cast-write-malloc.c index 8ef5437919..6941319b9c 100644 --- a/tests/regression/29-svcomp/10-ptr-cast-write-malloc.c +++ b/tests/regression/29-svcomp/10-ptr-cast-write-malloc.c @@ -8,7 +8,7 @@ int main() { *y = a; signed char *z = y; - assert(*z == -56); + __goblint_check(*z == -56); // Two signed char* s = malloc(10*sizeof(signed char)); diff --git a/tests/regression/29-svcomp/16-atomic_priv.c b/tests/regression/29-svcomp/16-atomic_priv.c index f7bfa993dc..21301693da 100644 --- a/tests/regression/29-svcomp/16-atomic_priv.c +++ b/tests/regression/29-svcomp/16-atomic_priv.c @@ -9,11 +9,11 @@ int myglobal = 5; void *t_fun(void *arg) { __VERIFIER_atomic_begin(); - assert(myglobal == 5); + __goblint_check(myglobal == 5); myglobal++; - assert(myglobal == 6); + __goblint_check(myglobal == 6); myglobal--; - assert(myglobal == 5); + __goblint_check(myglobal == 5); __VERIFIER_atomic_end(); return NULL; } @@ -21,9 +21,9 @@ void *t_fun(void *arg) { int main(void) { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); - assert(myglobal == 5); // TODO + __goblint_check(myglobal == 5); // TODO __VERIFIER_atomic_begin(); - assert(myglobal == 5); + __goblint_check(myglobal == 5); __VERIFIER_atomic_end(); pthread_join (id, NULL); return 0; diff --git a/tests/regression/29-svcomp/18-atomic_fun_priv.c b/tests/regression/29-svcomp/18-atomic_fun_priv.c index de7e403610..3d709640fa 100644 --- a/tests/regression/29-svcomp/18-atomic_fun_priv.c +++ b/tests/regression/29-svcomp/18-atomic_fun_priv.c @@ -6,11 +6,11 @@ int myglobal = 5; // atomic by function name prefix void __VERIFIER_atomic_fun() { - assert(myglobal == 5); + __goblint_check(myglobal == 5); myglobal++; - assert(myglobal == 6); + __goblint_check(myglobal == 6); myglobal--; - assert(myglobal == 5); + __goblint_check(myglobal == 5); } void *t_fun(void *arg) { @@ -21,9 +21,9 @@ void *t_fun(void *arg) { int main(void) { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); - assert(myglobal == 5); // TODO + __goblint_check(myglobal == 5); // TODO __VERIFIER_atomic_begin(); - assert(myglobal == 5); + __goblint_check(myglobal == 5); __VERIFIER_atomic_end(); pthread_join (id, NULL); return 0; diff --git a/tests/regression/29-svcomp/20-char_generic_nvram.c b/tests/regression/29-svcomp/20-char_generic_nvram.c index e83456578a..f8613f00a7 100644 --- a/tests/regression/29-svcomp/20-char_generic_nvram.c +++ b/tests/regression/29-svcomp/20-char_generic_nvram.c @@ -10,13 +10,13 @@ void read_nvram(loff_t *ppos) { unsigned int i; *ppos = i; - assert(*ppos == i); // UNKNOWN! + __goblint_check(*ppos == i); // UNKNOWN! } void write_nvram(loff_t *ppos) { unsigned int i; *ppos = i; - assert(*ppos == i); // UNKNOWN! + __goblint_check(*ppos == i); // UNKNOWN! } loff_t *whoop_loff_t; void *whoop_wrapper_write_nvram(void* args) diff --git a/tests/regression/29-svcomp/21-issue-casting.c b/tests/regression/29-svcomp/21-issue-casting.c index 96983882d7..7446426f80 100644 --- a/tests/regression/29-svcomp/21-issue-casting.c +++ b/tests/regression/29-svcomp/21-issue-casting.c @@ -1,4 +1,4 @@ -// PARAM: --set ana.activated ["'base'","'mallocWrapper'"] --set ana.base.privatization none +// PARAM: --set ana.activated ["'base'","'mallocWrapper'","'assert'"] --set ana.base.privatization none static long main(void) { unsigned int cmd; diff --git a/tests/regression/29-svcomp/22-atomic_priv_sound.c b/tests/regression/29-svcomp/22-atomic_priv_sound.c index 5a37128936..147c089239 100644 --- a/tests/regression/29-svcomp/22-atomic_priv_sound.c +++ b/tests/regression/29-svcomp/22-atomic_priv_sound.c @@ -9,9 +9,9 @@ int myglobal = 5; void *t_fun(void *arg) { __VERIFIER_atomic_begin(); - assert(myglobal == 5); // TODO + __goblint_check(myglobal == 5); // TODO myglobal++; - assert(myglobal == 6); // TODO + __goblint_check(myglobal == 6); // TODO __VERIFIER_atomic_end(); return NULL; } @@ -19,9 +19,9 @@ void *t_fun(void *arg) { int main(void) { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); - assert(myglobal == 5); // UNKNOWN! + __goblint_check(myglobal == 5); // UNKNOWN! __VERIFIER_atomic_begin(); - assert(myglobal == 5); // UNKNOWN! + __goblint_check(myglobal == 5); // UNKNOWN! __VERIFIER_atomic_end(); pthread_join (id, NULL); return 0; diff --git a/tests/regression/29-svcomp/23-atomic_priv_sound2.c b/tests/regression/29-svcomp/23-atomic_priv_sound2.c index 8220989342..65517e8a2f 100644 --- a/tests/regression/29-svcomp/23-atomic_priv_sound2.c +++ b/tests/regression/29-svcomp/23-atomic_priv_sound2.c @@ -33,9 +33,9 @@ int main(void) { pthread_t id, id2; pthread_create(&id, NULL, t_fun, NULL); pthread_create(&id2, NULL, t2_fun, NULL); - assert(myglobal == 2); // UNKNOWN! + __goblint_check(myglobal == 2); // UNKNOWN! __VERIFIER_atomic_begin(); - assert(myglobal == 2); // UNKNOWN! + __goblint_check(myglobal == 2); // UNKNOWN! __VERIFIER_atomic_end(); pthread_join (id, NULL); pthread_join (id2, NULL); diff --git a/tests/regression/29-svcomp/24-atomic_priv_sound3.c b/tests/regression/29-svcomp/24-atomic_priv_sound3.c index 3ea103409e..7bafefbfd9 100644 --- a/tests/regression/29-svcomp/24-atomic_priv_sound3.c +++ b/tests/regression/29-svcomp/24-atomic_priv_sound3.c @@ -16,7 +16,7 @@ int main(void) { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); __VERIFIER_atomic_begin(); - assert(myglobal == 5); // UNKNOWN! + __goblint_check(myglobal == 5); // UNKNOWN! __VERIFIER_atomic_end(); pthread_join (id, NULL); return 0; diff --git a/tests/regression/30-fast_global_inits/01-on.c b/tests/regression/30-fast_global_inits/01-on.c index 7aa125d8fd..2cdf61c534 100644 --- a/tests/regression/30-fast_global_inits/01-on.c +++ b/tests/regression/30-fast_global_inits/01-on.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none // This checks that partitioned arrays and fast_global_inits are no longer incompatible #include @@ -7,7 +7,7 @@ int global_array_multi[50][2][2]; int main(void) { for(int i =0; i < 50; i++) { - assert(global_array[i] == 0); - assert(global_array_multi[i][1][1] == 0); + __goblint_check(global_array[i] == 0); + __goblint_check(global_array_multi[i][1][1] == 0); } } diff --git a/tests/regression/30-fast_global_inits/02-off.c b/tests/regression/30-fast_global_inits/02-off.c index 07654e6fd5..8e7d262acb 100644 --- a/tests/regression/30-fast_global_inits/02-off.c +++ b/tests/regression/30-fast_global_inits/02-off.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none --disable exp.fast_global_inits +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none --disable exp.fast_global_inits // This checks that partitioned arrays and fast_global_inits are no longer incompatible #include @@ -7,7 +7,7 @@ int global_array_multi[50][2][2]; int main(void) { for(int i =0; i < 50; i++) { - assert(global_array[i] == 0); - assert(global_array_multi[i][1][1] == 0); + __goblint_check(global_array[i] == 0); + __goblint_check(global_array_multi[i][1][1] == 0); } } diff --git a/tests/regression/30-fast_global_inits/03-performance.c b/tests/regression/30-fast_global_inits/03-performance.c index 3922436937..8a259277fa 100644 --- a/tests/regression/30-fast_global_inits/03-performance.c +++ b/tests/regression/30-fast_global_inits/03-performance.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --enable exp.fast_global_inits --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --enable exp.fast_global_inits --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none // Without fast_global_inits this takes >150s, when it is enabled < 0.1s #include @@ -6,6 +6,6 @@ int global_array[50][500][20]; int main(void) { for(int i =0; i < 50; i++) { - assert(global_array[i][42][7] == 0); + __goblint_check(global_array[i][42][7] == 0); } } diff --git a/tests/regression/30-fast_global_inits/04-non-zero.c b/tests/regression/30-fast_global_inits/04-non-zero.c index 35ada1be51..6b3c37ee35 100644 --- a/tests/regression/30-fast_global_inits/04-non-zero.c +++ b/tests/regression/30-fast_global_inits/04-non-zero.c @@ -6,24 +6,24 @@ int global_array[5] = {9, 0, 3, 42, 11}; int global_array_multi[2][5] = {{9, 0, 3, 42, 11}, {9, 0, 3, 42, 11}}; int main(void) { - assert(global_array[0] == 9); //UNKNOWN - assert(global_array[1] == 0); //UNKNOWN - assert(global_array[2] == 3); //UNKNOWN - assert(global_array[3] == 42); //UNKNOWN - assert(global_array[3] == 11); //UNKNOWN - assert(global_array[1] == -1); //FAIL + __goblint_check(global_array[0] == 9); //UNKNOWN + __goblint_check(global_array[1] == 0); //UNKNOWN + __goblint_check(global_array[2] == 3); //UNKNOWN + __goblint_check(global_array[3] == 42); //UNKNOWN + __goblint_check(global_array[3] == 11); //UNKNOWN + __goblint_check(global_array[1] == -1); //FAIL - assert(global_array_multi[0][0] == 9); //UNKNOWN - assert(global_array_multi[0][1] == 0); //UNKNOWN - assert(global_array_multi[0][2] == 3); //UNKNOWN - assert(global_array_multi[0][3] == 42); //UNKNOWN - assert(global_array_multi[0][3] == 11); //UNKNOWN - assert(global_array_multi[0][1] == -1); //FAIL + __goblint_check(global_array_multi[0][0] == 9); //UNKNOWN + __goblint_check(global_array_multi[0][1] == 0); //UNKNOWN + __goblint_check(global_array_multi[0][2] == 3); //UNKNOWN + __goblint_check(global_array_multi[0][3] == 42); //UNKNOWN + __goblint_check(global_array_multi[0][3] == 11); //UNKNOWN + __goblint_check(global_array_multi[0][1] == -1); //FAIL - assert(global_array_multi[1][0] == 9); //UNKNOWN - assert(global_array_multi[1][1] == 0); //UNKNOWN - assert(global_array_multi[1][2] == 3); //UNKNOWN - assert(global_array_multi[1][3] == 42); //UNKNOWN - assert(global_array_multi[1][3] == 11); //UNKNOWN - assert(global_array_multi[1][1] == -1); //FAIL + __goblint_check(global_array_multi[1][0] == 9); //UNKNOWN + __goblint_check(global_array_multi[1][1] == 0); //UNKNOWN + __goblint_check(global_array_multi[1][2] == 3); //UNKNOWN + __goblint_check(global_array_multi[1][3] == 42); //UNKNOWN + __goblint_check(global_array_multi[1][3] == 11); //UNKNOWN + __goblint_check(global_array_multi[1][1] == -1); //FAIL } diff --git a/tests/regression/30-fast_global_inits/05-non-zero-performance.c b/tests/regression/30-fast_global_inits/05-non-zero-performance.c index 2caad5540a..7de8993643 100644 --- a/tests/regression/30-fast_global_inits/05-non-zero-performance.c +++ b/tests/regression/30-fast_global_inits/05-non-zero-performance.c @@ -5,22 +5,22 @@ int global_array[10000] = {9, 0, 3, 42, 11 }; // All non-specified ones will be int global_array_multi[2][10000] = {{9, 0, 3, 42, 11}, {9, 0, 3, 42, 11}}; // All non-specified ones will be zero int main(void) { - assert(global_array[0] == 9); //UNKNOWN - assert(global_array[1] == 0); //UNKNOWN - assert(global_array[2] == 3); //UNKNOWN - assert(global_array[3] == 42); //UNKNOWN - assert(global_array[3] == 11); //UNKNOWN + __goblint_check(global_array[0] == 9); //UNKNOWN + __goblint_check(global_array[1] == 0); //UNKNOWN + __goblint_check(global_array[2] == 3); //UNKNOWN + __goblint_check(global_array[3] == 42); //UNKNOWN + __goblint_check(global_array[3] == 11); //UNKNOWN - assert(global_array_multi[0][0] == 9); //UNKNOWN - assert(global_array_multi[0][1] == 0); //UNKNOWN - assert(global_array_multi[0][2] == 3); //UNKNOWN - assert(global_array_multi[0][3] == 42); //UNKNOWN - assert(global_array_multi[0][3] == 11); //UNKNOWN + __goblint_check(global_array_multi[0][0] == 9); //UNKNOWN + __goblint_check(global_array_multi[0][1] == 0); //UNKNOWN + __goblint_check(global_array_multi[0][2] == 3); //UNKNOWN + __goblint_check(global_array_multi[0][3] == 42); //UNKNOWN + __goblint_check(global_array_multi[0][3] == 11); //UNKNOWN - assert(global_array_multi[1][0] == 9); //UNKNOWN - assert(global_array_multi[1][1] == 0); //UNKNOWN - assert(global_array_multi[1][2] == 3); //UNKNOWN - assert(global_array_multi[1][3] == 42); //UNKNOWN - assert(global_array_multi[1][3] == 11); //UNKNOWN + __goblint_check(global_array_multi[1][0] == 9); //UNKNOWN + __goblint_check(global_array_multi[1][1] == 0); //UNKNOWN + __goblint_check(global_array_multi[1][2] == 3); //UNKNOWN + __goblint_check(global_array_multi[1][3] == 42); //UNKNOWN + __goblint_check(global_array_multi[1][3] == 11); //UNKNOWN } diff --git a/tests/regression/31-ikind-aware-ints/01-cast-in-if.c b/tests/regression/31-ikind-aware-ints/01-cast-in-if.c index 64aeed917e..012eb7ae89 100644 --- a/tests/regression/31-ikind-aware-ints/01-cast-in-if.c +++ b/tests/regression/31-ikind-aware-ints/01-cast-in-if.c @@ -5,6 +5,6 @@ int main(){ if ((unsigned long )b == (unsigned long )((void *)0)) { b = b + 1; } - assert(b == 1); // + __goblint_check(b == 1); // return 0; } diff --git a/tests/regression/31-ikind-aware-ints/02-NULL-0-test.c b/tests/regression/31-ikind-aware-ints/02-NULL-0-test.c index bcbfd5d0a3..0e1839a926 100644 --- a/tests/regression/31-ikind-aware-ints/02-NULL-0-test.c +++ b/tests/regression/31-ikind-aware-ints/02-NULL-0-test.c @@ -7,6 +7,6 @@ int main(){ if((unsigned long )null == (unsigned long ) ptr){ a++; } - assert(a == 1); + __goblint_check(a == 1); return 0; } diff --git a/tests/regression/31-ikind-aware-ints/04-ptrdiff.c b/tests/regression/31-ikind-aware-ints/04-ptrdiff.c index 4fdd85d469..0d70055379 100644 --- a/tests/regression/31-ikind-aware-ints/04-ptrdiff.c +++ b/tests/regression/31-ikind-aware-ints/04-ptrdiff.c @@ -1,4 +1,4 @@ -// PARAM: --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base', 'mallocWrapper', 'escape', 'expRelation', 'var_eq']" --set ana.base.privatization none +// PARAM: --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base', 'mallocWrapper','assert', 'escape', 'expRelation', 'var_eq']" --set ana.base.privatization none int *tmp; int main () diff --git a/tests/regression/31-ikind-aware-ints/05-shift.c b/tests/regression/31-ikind-aware-ints/05-shift.c index f89e546729..2ad97484d0 100644 --- a/tests/regression/31-ikind-aware-ints/05-shift.c +++ b/tests/regression/31-ikind-aware-ints/05-shift.c @@ -1,4 +1,4 @@ -// PARAM: --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base', 'mallocWrapper']" --set ana.base.privatization none +// PARAM: --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base', 'mallocWrapper','assert']" --set ana.base.privatization none int main(void) { // Shifting by a negative number is UB, but we should still not crash on it, but go to top instead int v = -1; diff --git a/tests/regression/31-ikind-aware-ints/06-structs.c b/tests/regression/31-ikind-aware-ints/06-structs.c index c0b198880b..50c69f1c24 100644 --- a/tests/regression/31-ikind-aware-ints/06-structs.c +++ b/tests/regression/31-ikind-aware-ints/06-structs.c @@ -1,4 +1,4 @@ -// PARAM: --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base', 'threadflag', 'mallocWrapper']" --set ana.base.privatization none +// PARAM: --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base', 'threadflag', 'mallocWrapper','assert']" --set ana.base.privatization none struct rtl8169_private { unsigned int features ; }; diff --git a/tests/regression/31-ikind-aware-ints/07-defexc-large.c b/tests/regression/31-ikind-aware-ints/07-defexc-large.c index b1836e57c6..aeedd07108 100644 --- a/tests/regression/31-ikind-aware-ints/07-defexc-large.c +++ b/tests/regression/31-ikind-aware-ints/07-defexc-large.c @@ -9,19 +9,19 @@ int main(){ if(x > 18446744073709551612ull){ a = 1; } - assert(a); + __goblint_check(a); unsigned long long y = x + 4; // Unsigned overflow -- The following assertion should succeed - assert(y == 3); + __goblint_check(y == 3); // maximum value for long long signed long long s = 9223372036854775807; - assert(s > 9223372036854775806); + __goblint_check(s > 9223372036854775806); signed long long t = s + 2; // Signed overflow -- The following assertion must be UNKNOWN! - assert(t == -9223372036854775807); // UNKNOWN! + __goblint_check(t == -9223372036854775807); // UNKNOWN! return 0; } diff --git a/tests/regression/31-ikind-aware-ints/08-unsigned-negate.c b/tests/regression/31-ikind-aware-ints/08-unsigned-negate.c index 6783181529..f2dc82838a 100644 --- a/tests/regression/31-ikind-aware-ints/08-unsigned-negate.c +++ b/tests/regression/31-ikind-aware-ints/08-unsigned-negate.c @@ -6,7 +6,7 @@ int main(){ unsigned int y = -x; - assert(y == 4294967295); + __goblint_check(y == 4294967295); printf("y: %u\n", y); return 0; } diff --git a/tests/regression/31-ikind-aware-ints/09-signed-negate.c b/tests/regression/31-ikind-aware-ints/09-signed-negate.c index 74d76cb39e..aa42b9dc82 100644 --- a/tests/regression/31-ikind-aware-ints/09-signed-negate.c +++ b/tests/regression/31-ikind-aware-ints/09-signed-negate.c @@ -6,11 +6,11 @@ int main(){ // maximum value for long long signed long long s = 9223372036854775807; - assert(s > 9223372036854775806); + __goblint_check(s > 9223372036854775806); signed long long t = s + 2; // Signed overflow - The following assertion only works with sem.int.signed_overflow set to assume_wraparound - assert(t == -9223372036854775807); + __goblint_check(t == -9223372036854775807); return 0; } diff --git a/tests/regression/31-ikind-aware-ints/10-log-bitwise-def_exc.c b/tests/regression/31-ikind-aware-ints/10-log-bitwise-def_exc.c index 8f53fb82e6..355ae137ee 100644 --- a/tests/regression/31-ikind-aware-ints/10-log-bitwise-def_exc.c +++ b/tests/regression/31-ikind-aware-ints/10-log-bitwise-def_exc.c @@ -11,36 +11,36 @@ int main(){ int z; // logical and - assert((x && y) == 1); + __goblint_check((x && y) == 1); z = x & y; // bitwise and - assert(z == 2); + __goblint_check(z == 2); // logical or - assert((x || y) == 1); + __goblint_check((x || y) == 1); - assert((x || 1) == 1); + __goblint_check((x || 1) == 1); z = x | y; // bitwise or - assert(z == 3); + __goblint_check(z == 3); z = x ^ y; // bitwise xor - assert(z == 1); + __goblint_check(z == 1); // logical negation - assert(!x == 0); + __goblint_check(!x == 0); z = !n; - assert(z == 1); + __goblint_check(z == 1); z = ~x; // bitwise negation - assert(z == -3); + __goblint_check(z == -3); z = x << y; // shift left - assert(z == 16); + __goblint_check(z == 16); z = m >> x; // shift right - assert(z == 6); + __goblint_check(z == 6); return 0; } diff --git a/tests/regression/31-ikind-aware-ints/11-log-bitwise-intervals.c b/tests/regression/31-ikind-aware-ints/11-log-bitwise-intervals.c index 268f1a08ba..1b484ad678 100644 --- a/tests/regression/31-ikind-aware-ints/11-log-bitwise-intervals.c +++ b/tests/regression/31-ikind-aware-ints/11-log-bitwise-intervals.c @@ -11,36 +11,36 @@ int main(){ int z; // logical and - assert((x && y) == 1); + __goblint_check((x && y) == 1); z = x & y; // bitwise and - assert(z == 2); + __goblint_check(z == 2); // logical or - assert((x || y) == 1); + __goblint_check((x || y) == 1); - assert((x || 1) == 1); + __goblint_check((x || 1) == 1); z = x | y; // bitwise or - assert(z == 3); + __goblint_check(z == 3); z = x ^ y; // bitwise xor - assert(z == 1); + __goblint_check(z == 1); // logical negation - assert(!x == 0); + __goblint_check(!x == 0); z = !n; - assert(z == 1); + __goblint_check(z == 1); z = ~x; // bitwise negation - assert(z == -3); + __goblint_check(z == -3); z = x << y; // shift left - assert(z == 16); + __goblint_check(z == 16); z = m >> x; // shift right - assert(z == 6); + __goblint_check(z == 6); return 0; } diff --git a/tests/regression/31-ikind-aware-ints/12-log-bitwise-enums.c b/tests/regression/31-ikind-aware-ints/12-log-bitwise-enums.c index f01bca7553..3bd3809895 100644 --- a/tests/regression/31-ikind-aware-ints/12-log-bitwise-enums.c +++ b/tests/regression/31-ikind-aware-ints/12-log-bitwise-enums.c @@ -11,40 +11,40 @@ int main(){ int z; // logical and - assert((x && y) == 1); + __goblint_check((x && y) == 1); z = x & y; // bitwise and - assert(z == 2); + __goblint_check(z == 2); // logical or - assert((x || y) == 1); + __goblint_check((x || y) == 1); - assert((x || 1) == 1); + __goblint_check((x || 1) == 1); z = x | y; // bitwise or - assert(z == 3); + __goblint_check(z == 3); z = x ^ y; // bitwise xor - assert(z == 1); + __goblint_check(z == 1); // logical negation - assert(!x == 0); + __goblint_check(!x == 0); z = !n; - assert(z == 1); + __goblint_check(z == 1); z = ~x; // bitwise negation - assert(z == -3); + __goblint_check(z == -3); z = x << y; // shift left - assert(z == 16); //UNKNOWN + __goblint_check(z == 16); //UNKNOWN z = m >> x; // shift right - assert(z == 6); //UNKNOWN + __goblint_check(z == 6); //UNKNOWN int one = 1; z = one / 10; - assert(z == 0); + __goblint_check(z == 0); return 0; } diff --git a/tests/regression/31-ikind-aware-ints/13-intervals-large.c b/tests/regression/31-ikind-aware-ints/13-intervals-large.c index 0c10ca72b4..60c75f5cce 100644 --- a/tests/regression/31-ikind-aware-ints/13-intervals-large.c +++ b/tests/regression/31-ikind-aware-ints/13-intervals-large.c @@ -9,18 +9,18 @@ int main(){ if(x > 18446744073709551612ull){ a = 1; } - assert(a); + __goblint_check(a); unsigned long long y = x + 4; - assert(y == 3); + __goblint_check(y == 3); // maximum value for long long signed long long s = 9223372036854775807; - assert(s > 9223372036854775806); + __goblint_check(s > 9223372036854775806); signed long long t = s + 2; // Signed overflow -- The following assertion must be UNKNOWN! - assert(t == -9223372036854775807); // UNKNOWN! + __goblint_check(t == -9223372036854775807); // UNKNOWN! return 0; } diff --git a/tests/regression/31-ikind-aware-ints/14-enums-large.c b/tests/regression/31-ikind-aware-ints/14-enums-large.c index affbecc27e..89a139d3d8 100644 --- a/tests/regression/31-ikind-aware-ints/14-enums-large.c +++ b/tests/regression/31-ikind-aware-ints/14-enums-large.c @@ -9,18 +9,18 @@ int main(){ if(x > 18446744073709551612ull){ a = 1; } - assert(a); + __goblint_check(a); unsigned long long y = x + 4; - assert(y == 3); + __goblint_check(y == 3); // maximum value for long long signed long long s = 9223372036854775807; - assert(s > 9223372036854775806); + __goblint_check(s > 9223372036854775806); signed long long t = s + 2; // Signed overflow -- The following assertion must be UNKNOWN! - assert(t == -9223372036854775807); // UNKNOWN! + __goblint_check(t == -9223372036854775807); // UNKNOWN! return 0; } diff --git a/tests/regression/31-ikind-aware-ints/16-enums-compare.c b/tests/regression/31-ikind-aware-ints/16-enums-compare.c index e23b9a1449..d89325f222 100644 --- a/tests/regression/31-ikind-aware-ints/16-enums-compare.c +++ b/tests/regression/31-ikind-aware-ints/16-enums-compare.c @@ -18,40 +18,40 @@ int main(){ y = 0; } - assert(x < 2); - assert(x < 1); // UNKNOWN! - assert(x < 0); // FAIL + __goblint_check(x < 2); + __goblint_check(x < 1); // UNKNOWN! + __goblint_check(x < 0); // FAIL - assert(x <= 2); - assert(x <= 1); - assert(x <= 0); // UNKNOWN! - assert(x <= -1); //FAIL + __goblint_check(x <= 2); + __goblint_check(x <= 1); + __goblint_check(x <= 0); // UNKNOWN! + __goblint_check(x <= -1); //FAIL - assert(x > -1); - assert(x > 0); //UNKNOWN! - assert(x > 1); //FAIL + __goblint_check(x > -1); + __goblint_check(x > 0); //UNKNOWN! + __goblint_check(x > 1); //FAIL - assert(x >= -1); - assert(x >= 0); - assert(x >= 1); //UNKNOWN! - assert(x >= 2); //FAIL + __goblint_check(x >= -1); + __goblint_check(x >= 0); + __goblint_check(x >= 1); //UNKNOWN! + __goblint_check(x >= 2); //FAIL - assert(x == y); // UNKNOWN - assert(x == 1); // UNKNOWN - assert(x == 2); // FAIL + __goblint_check(x == y); // UNKNOWN + __goblint_check(x == 1); // UNKNOWN + __goblint_check(x == 2); // FAIL - assert(x != y); // UNKNOWN - assert(x != 1); // UNKNOWN - assert(x != 2); + __goblint_check(x != y); // UNKNOWN + __goblint_check(x != 1); // UNKNOWN + __goblint_check(x != 2); int z = rand(); y = 3; if(z==3){ - assert(y==z); - assert(y!=z); //FAIL + __goblint_check(y==z); + __goblint_check(y!=z); //FAIL } else { - assert(y==z); //FAIL - assert(y!=z); + __goblint_check(y==z); //FAIL + __goblint_check(y!=z); } return 0; diff --git a/tests/regression/32-widen-context/01-on.c b/tests/regression/32-widen-context/01-on.c index 9507b91a82..1c306970ec 100644 --- a/tests/regression/32-widen-context/01-on.c +++ b/tests/regression/32-widen-context/01-on.c @@ -10,6 +10,6 @@ int f(int x) { int main () { int a = f(1); - assert(!a); + __goblint_check(!a); return 0; } diff --git a/tests/regression/32-widen-context/02-on-attribute.c b/tests/regression/32-widen-context/02-on-attribute.c index ad737029af..5d19db9607 100644 --- a/tests/regression/32-widen-context/02-on-attribute.c +++ b/tests/regression/32-widen-context/02-on-attribute.c @@ -11,6 +11,6 @@ int f(int x) { int main () { int a = f(1); - assert(!a); + __goblint_check(!a); return 0; } diff --git a/tests/regression/32-widen-context/03-off-attribute.c b/tests/regression/32-widen-context/03-off-attribute.c index dc81f9874b..377226b3f1 100644 --- a/tests/regression/32-widen-context/03-off-attribute.c +++ b/tests/regression/32-widen-context/03-off-attribute.c @@ -11,6 +11,6 @@ int f(int x) { int main () { int a = f(10); - assert(a == 3628800); + __goblint_check(a == 3628800); return 0; } diff --git a/tests/regression/34-localization/01-nested.c b/tests/regression/34-localization/01-nested.c index 993866ae99..edf82c1b25 100644 --- a/tests/regression/34-localization/01-nested.c +++ b/tests/regression/34-localization/01-nested.c @@ -12,5 +12,5 @@ void main() for (int j = 0; j < 10 ; j++) ; } - assert(i == 10); + __goblint_check(i == 10); } diff --git a/tests/regression/34-localization/02-hybrid.c b/tests/regression/34-localization/02-hybrid.c index f3084e212f..5a015b1091 100644 --- a/tests/regression/34-localization/02-hybrid.c +++ b/tests/regression/34-localization/02-hybrid.c @@ -10,8 +10,8 @@ void main() while (1) { i++; for (int j=0; j < 10; j++) { - assert(0 <= i); // UNKNOWN - assert(i <= 10); + __goblint_check(0 <= i); // UNKNOWN + __goblint_check(i <= 10); } if (i>9) i=0; } diff --git a/tests/regression/34-localization/03-nested2.c b/tests/regression/34-localization/03-nested2.c index 68a07d7cde..cc1d26e550 100644 --- a/tests/regression/34-localization/03-nested2.c +++ b/tests/regression/34-localization/03-nested2.c @@ -11,7 +11,7 @@ void main() int j = 0; for (; j<10; j++) ; i=i+11-j; - assert(i >= 0); // UNKNOWN + __goblint_check(i >= 0); // UNKNOWN } return; } diff --git a/tests/regression/34-localization/04-hh.c b/tests/regression/34-localization/04-hh.c index 0a8517be6a..d20b290bb4 100644 --- a/tests/regression/34-localization/04-hh.c +++ b/tests/regression/34-localization/04-hh.c @@ -14,7 +14,7 @@ void main() j=j+1; } i = i-j+1; - assert(i <= j+3); // UNKNOWN + __goblint_check(i <= j+3); // UNKNOWN } return ; } diff --git a/tests/regression/36-apron/01-octagon_simple.c b/tests/regression/36-apron/01-octagon_simple.c index fd68e45916..fb99a4eaff 100644 --- a/tests/regression/36-apron/01-octagon_simple.c +++ b/tests/regression/36-apron/01-octagon_simple.c @@ -11,8 +11,8 @@ void main(void) { X++; } - assert(X-N == 0); - assert(X == N); + __goblint_check(X-N == 0); + __goblint_check(X == N); if(X == N) { N = 8; @@ -21,7 +21,7 @@ void main(void) { N = 42; } - assert(N == 8); + __goblint_check(N == 8); two(); } @@ -39,7 +39,7 @@ void two() { N = 0; } - assert(X <= N); + __goblint_check(X <= N); while (1) { while_continue: /* CIL Label */ ; @@ -50,6 +50,6 @@ void two() { } while_break: /* CIL Label */ ; - assert(X - N == 0); - assert(X == N); + __goblint_check(X - N == 0); + __goblint_check(X == N); } diff --git a/tests/regression/36-apron/02-octagon_interprocudral.c b/tests/regression/36-apron/02-octagon_interprocudral.c index 0218be6e15..be4a54dea9 100644 --- a/tests/regression/36-apron/02-octagon_interprocudral.c +++ b/tests/regression/36-apron/02-octagon_interprocudral.c @@ -15,17 +15,17 @@ int f1() { one = two; - assert(one - two == 0); - assert(one == two); + __goblint_check(one - two == 0); + __goblint_check(one == two); x = f2(one,two); - assert(one - two == 0); - assert(one == two); - assert(x == 48); + __goblint_check(one - two == 0); + __goblint_check(one == two); + __goblint_check(x == 48); } int f2(int a, int b) { - assert(a-b == 0); - assert(a == b); + __goblint_check(a-b == 0); + __goblint_check(a == b); return 48; } diff --git a/tests/regression/36-apron/03-problem-signextension.c b/tests/regression/36-apron/03-problem-signextension.c index f4ed47b622..c2fce19ec0 100644 --- a/tests/regression/36-apron/03-problem-signextension.c +++ b/tests/regression/36-apron/03-problem-signextension.c @@ -14,7 +14,7 @@ int main() { if (unsignedtosigned == 65535 && unsignedtounsigned == 65535 && signedtosigned == -1 && signedtounsigned == 4294967295) { - assert(1); // reachable + __goblint_check(1); // reachable } return (0); diff --git a/tests/regression/36-apron/04-problem-rec.c b/tests/regression/36-apron/04-problem-rec.c index 4be0d5e065..c0f4b9131d 100644 --- a/tests/regression/36-apron/04-problem-rec.c +++ b/tests/regression/36-apron/04-problem-rec.c @@ -6,7 +6,7 @@ void f(int n) { if (n<3) return; n--; f(n); - assert(1); + __goblint_check(1); } int main(void) { diff --git a/tests/regression/36-apron/05-problem-rec2.c b/tests/regression/36-apron/05-problem-rec2.c index bb04418f9d..9accf6ed62 100644 --- a/tests/regression/36-apron/05-problem-rec2.c +++ b/tests/regression/36-apron/05-problem-rec2.c @@ -9,14 +9,14 @@ void f(int n) { if (n<3) return; n--; f2(n); - assert(1); + __goblint_check(1); } void f2(int n) { if (n<3) return; n--; f(n); - assert(1); + __goblint_check(1); } int main(void) { diff --git a/tests/regression/36-apron/06-problem-overflow.c b/tests/regression/36-apron/06-problem-overflow.c index 41410e0058..4749716394 100644 --- a/tests/regression/36-apron/06-problem-overflow.c +++ b/tests/regression/36-apron/06-problem-overflow.c @@ -9,5 +9,5 @@ int main(void) { x += 2; } - assert(1); + __goblint_check(1); } diff --git a/tests/regression/36-apron/07-problem-pointer.c b/tests/regression/36-apron/07-problem-pointer.c index fe4bfe35a2..c173617635 100644 --- a/tests/regression/36-apron/07-problem-pointer.c +++ b/tests/regression/36-apron/07-problem-pointer.c @@ -11,12 +11,12 @@ int g; int main() { int c = __VERIFIER_nondet_int(); g = 3; - assert(g != 3); // FAIL - assert(g == 3); + __goblint_check(g != 3); // FAIL + __goblint_check(g == 3); int a = 5; int *p = &a; // after this apron should put a to top because pointers are not tracked change(p); - assert(a == 5); //FAIL - assert(a - 6 == 0); + __goblint_check(a == 5); //FAIL + __goblint_check(a - 6 == 0); return 0; } diff --git a/tests/regression/36-apron/08-problem-implicitunsignedconversion.c b/tests/regression/36-apron/08-problem-implicitunsignedconversion.c index fd5c702754..4a990e7799 100644 --- a/tests/regression/36-apron/08-problem-implicitunsignedconversion.c +++ b/tests/regression/36-apron/08-problem-implicitunsignedconversion.c @@ -8,7 +8,7 @@ int main() { int minus_one = -1; if(plus_one < minus_one) { - assert(1); // reachable + __goblint_check(1); // reachable } return (0); diff --git a/tests/regression/36-apron/09-branch.c b/tests/regression/36-apron/09-branch.c index 882698786c..80137f8a49 100644 --- a/tests/regression/36-apron/09-branch.c +++ b/tests/regression/36-apron/09-branch.c @@ -10,9 +10,9 @@ void main() { // only implies i - 1 != 0 (i != 1) // doesn't imply i - 1 == 1 (i == 2) // doesn't imply i - 1 != 1 (i != 2) - assert(i == 2); // UNKNOWN! + __goblint_check(i == 2); // UNKNOWN! } - + two(); } @@ -21,12 +21,12 @@ void two() { int j = __VERIFIER_nondet_int(); if(i 0 // doesn't imply i >= 1 - assert(i >= 1); // UNKNOWN! + __goblint_check(i >= 1); // UNKNOWN! } else { // implies i == 0 // doesn't imply i < 0 - assert(i == 0); - assert(i < 0); // FAIL + __goblint_check(i == 0); + __goblint_check(i < 0); // FAIL } } diff --git a/tests/regression/36-apron/19-traces-other-rpb.c b/tests/regression/36-apron/19-traces-other-rpb.c index 34b173cbed..0f9c3b6351 100644 --- a/tests/regression/36-apron/19-traces-other-rpb.c +++ b/tests/regression/36-apron/19-traces-other-rpb.c @@ -39,13 +39,13 @@ int main(void) { pthread_mutex_lock(&A); pthread_mutex_lock(&B); - assert(g >= h); + __goblint_check(g >= h); pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); t = g; pthread_mutex_lock(&A); - assert(t >= g); + __goblint_check(t >= g); pthread_mutex_unlock(&A); return 0; } diff --git a/tests/regression/36-apron/20-traces-even-more-rpb.c b/tests/regression/36-apron/20-traces-even-more-rpb.c index 69bd68f377..6ef3519e9f 100644 --- a/tests/regression/36-apron/20-traces-even-more-rpb.c +++ b/tests/regression/36-apron/20-traces-even-more-rpb.c @@ -54,7 +54,7 @@ int main(void) { pthread_mutex_lock(&A); pthread_mutex_lock(&B); - assert(g >= h); // UNKNOWN (for protection at least) + __goblint_check(g >= h); // UNKNOWN (for protection at least) pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/21-traces-cluster-based.c b/tests/regression/36-apron/21-traces-cluster-based.c index 3aa7bf5e1d..12684d390c 100644 --- a/tests/regression/36-apron/21-traces-cluster-based.c +++ b/tests/regression/36-apron/21-traces-cluster-based.c @@ -32,7 +32,7 @@ void *t2_fun(void *arg) { x = g; y = h; pthread_mutex_unlock(&A); - assert(y <= x); + __goblint_check(y <= x); return NULL; } @@ -45,7 +45,7 @@ void *t3_fun(void *arg) { y = h; pthread_mutex_unlock(&A); pthread_mutex_unlock(&B); - assert(y == x); // TODO (mutex-meet succeeds, protection unknown) + __goblint_check(y == x); // TODO (mutex-meet succeeds, protection unknown) return NULL; } @@ -63,9 +63,9 @@ int main(void) { x = g; y = h; pthread_mutex_lock(&B); - assert(y == x); // TODO (mutex-meet succeeds, protection unknown) + __goblint_check(y == x); // TODO (mutex-meet succeeds, protection unknown) pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); - assert(y == x); // TODO (mutex-meet succeeds, protection unknown) + __goblint_check(y == x); // TODO (mutex-meet succeeds, protection unknown) return 0; } diff --git a/tests/regression/36-apron/22-traces-write-centered-vs-meet-mutex.c b/tests/regression/36-apron/22-traces-write-centered-vs-meet-mutex.c index 7ae91ced30..1912fa4ef6 100644 --- a/tests/regression/36-apron/22-traces-write-centered-vs-meet-mutex.c +++ b/tests/regression/36-apron/22-traces-write-centered-vs-meet-mutex.c @@ -20,13 +20,13 @@ void *t_fun(void *arg) { pthread_mutex_lock(&A); x = g; y = h; - assert(y <= x); + __goblint_check(y <= x); pthread_mutex_lock(&B); - assert(x == y); // TODO (mutex-meet succeeds, write unknown) + __goblint_check(x == y); // TODO (mutex-meet succeeds, write unknown) pthread_mutex_unlock(&B); i = x + 31; z = i; - assert(z >= x); // TODO (write succeeds, mutex-meet unknown) + __goblint_check(z >= x); // TODO (write succeeds, mutex-meet unknown) pthread_mutex_unlock(&A); pthread_mutex_unlock(&C); } diff --git a/tests/regression/36-apron/23-traces-write-centered-problem.c b/tests/regression/36-apron/23-traces-write-centered-problem.c index d9faef4630..5ef3ec70ee 100644 --- a/tests/regression/36-apron/23-traces-write-centered-problem.c +++ b/tests/regression/36-apron/23-traces-write-centered-problem.c @@ -34,7 +34,7 @@ int main(void) { pthread_mutex_lock(&A); x = g; y = h; - assert(x >= y); // write would fail this due to disjunctive reading from local and global + __goblint_check(x >= y); // write would fail this due to disjunctive reading from local and global pthread_mutex_unlock(&A); return 0; } diff --git a/tests/regression/36-apron/24-combine-no-lval.c b/tests/regression/36-apron/24-combine-no-lval.c index 890da92adb..7e1dfd63e9 100644 --- a/tests/regression/36-apron/24-combine-no-lval.c +++ b/tests/regression/36-apron/24-combine-no-lval.c @@ -21,12 +21,12 @@ int main(void) { y = 6; } - assert(x < y); - assert(y - x == 2); + __goblint_check(x < y); + __goblint_check(y - x == 2); foo(); // combine without lval shouldn't ruin local state - assert(x < y); - assert(y - x == 2); + __goblint_check(x < y); + __goblint_check(y - x == 2); return 0; } diff --git a/tests/regression/36-apron/25-combine-global.c b/tests/regression/36-apron/25-combine-global.c index 886e6ef38c..b68558484e 100644 --- a/tests/regression/36-apron/25-combine-global.c +++ b/tests/regression/36-apron/25-combine-global.c @@ -18,8 +18,8 @@ void foo() { h = 4; } - assert(h < g); - assert(g - h == 2); + __goblint_check(h < g); + __goblint_check(g - h == 2); // return state should contain globals } @@ -35,12 +35,12 @@ int main(void) { h = 6; } - assert(g < h); - assert(h - g == 2); + __goblint_check(g < h); + __goblint_check(h - g == 2); foo(); // combine should use globals from function, not go to bottom due to contradiction with local - assert(h < g); - assert(g - h == 2); + __goblint_check(h < g); + __goblint_check(g - h == 2); return 0; } diff --git a/tests/regression/36-apron/26-combine-forget-local-lval.c b/tests/regression/36-apron/26-combine-forget-local-lval.c index b286947e31..6931838427 100644 --- a/tests/regression/36-apron/26-combine-forget-local-lval.c +++ b/tests/regression/36-apron/26-combine-forget-local-lval.c @@ -11,6 +11,6 @@ int main(void) { y = f(42); // combine should forget caller's y before unifying with y == 43 to avoid bottom - assert(y); + __goblint_check(y); return 0; } diff --git a/tests/regression/36-apron/27-combine-forget-fun-lval.c b/tests/regression/36-apron/27-combine-forget-fun-lval.c index cf0e55fa4f..bf176a64f7 100644 --- a/tests/regression/36-apron/27-combine-forget-fun-lval.c +++ b/tests/regression/36-apron/27-combine-forget-fun-lval.c @@ -11,6 +11,6 @@ int main(void) { y = f(y); // combine should forget callee's y after substituting arg vars with args to avoid bottom in #ret substitute - assert(y); + __goblint_check(y); return 0; } diff --git a/tests/regression/36-apron/28-combine-forget-fun-lval-imprecise.c b/tests/regression/36-apron/28-combine-forget-fun-lval-imprecise.c index 3620185dfa..b495020581 100644 --- a/tests/regression/36-apron/28-combine-forget-fun-lval-imprecise.c +++ b/tests/regression/36-apron/28-combine-forget-fun-lval-imprecise.c @@ -34,7 +34,7 @@ int main(void) { // 3. y == #ret && #ret == z + 1 (&& y == z + 1) // forget #ret is: y == z + 1 - assert(y == z + 1); + __goblint_check(y == z + 1); } return 0; } diff --git a/tests/regression/36-apron/29-combine-arg-var-conflict.c b/tests/regression/36-apron/29-combine-arg-var-conflict.c index 20bb42e6e6..9336a67bfe 100644 --- a/tests/regression/36-apron/29-combine-arg-var-conflict.c +++ b/tests/regression/36-apron/29-combine-arg-var-conflict.c @@ -11,7 +11,7 @@ int g(int x) { int y = __VERIFIER_nondet_int(); //rand if (x < 1000) { // avoid overflow y = f(x); - assert(y == x + 1); + __goblint_check(y == x + 1); } return x; } @@ -20,6 +20,6 @@ int main(void) { int z = __VERIFIER_nondet_int(); //rand int w = __VERIFIER_nondet_int(); //rand w = g(z); - assert(z == w); + __goblint_check(z == w); return 0; } diff --git a/tests/regression/36-apron/30-return-global.c b/tests/regression/36-apron/30-return-global.c index a43785c546..ddf6848b64 100644 --- a/tests/regression/36-apron/30-return-global.c +++ b/tests/regression/36-apron/30-return-global.c @@ -14,8 +14,8 @@ int main(void) { int y = __VERIFIER_nondet_int(); //rand g = x; y = f(); - assert(y == g); - assert(x == g); // TODO (only when singlethreaded) - assert(x == y); // TODO (only when singlethreaded) + __goblint_check(y == g); + __goblint_check(x == g); // TODO (only when singlethreaded) + __goblint_check(x == y); // TODO (only when singlethreaded) return 0; } diff --git a/tests/regression/36-apron/31-combine-global-lval.c b/tests/regression/36-apron/31-combine-global-lval.c index c2fd156628..839d4faaa3 100644 --- a/tests/regression/36-apron/31-combine-global-lval.c +++ b/tests/regression/36-apron/31-combine-global-lval.c @@ -16,8 +16,8 @@ int main(void) { g = f(r); h = r; - assert(g < h); - assert(h - g == 2); + __goblint_check(g < h); + __goblint_check(h - g == 2); } return 0; } diff --git a/tests/regression/36-apron/32-typedef.c b/tests/regression/36-apron/32-typedef.c index 9cce8e1b5a..328b9e7483 100644 --- a/tests/regression/36-apron/32-typedef.c +++ b/tests/regression/36-apron/32-typedef.c @@ -10,7 +10,7 @@ int main() { if (i < 0) { i = jz; // must invalidate apron invariant about i through typedef if (i >= 0) { - assert(1); // reachable + __goblint_check(1); // reachable } } diff --git a/tests/regression/36-apron/33-large-int64.c b/tests/regression/36-apron/33-large-int64.c index 1fbc5b548f..75aa2da663 100644 --- a/tests/regression/36-apron/33-large-int64.c +++ b/tests/regression/36-apron/33-large-int64.c @@ -5,18 +5,18 @@ void main() { // requires int64, not int signed long long x, y, z; if (x < y && y < z) { - assert(x < y); - assert(y < z); - assert(x < z); + __goblint_check(x < y); + __goblint_check(y < z); + __goblint_check(x < z); if (9223372036854775805 <= x && z <= 9223372036854775807) { - assert(x == 9223372036854775805); // TODO (unknown with D, success with MPQ) - assert(y == 9223372036854775806); // TODO (unknown with D, success with MPQ) - assert(z == 9223372036854775807); // TODO (unknown with D, success with MPQ) + __goblint_check(x == 9223372036854775805); // TODO (unknown with D, success with MPQ) + __goblint_check(y == 9223372036854775806); // TODO (unknown with D, success with MPQ) + __goblint_check(z == 9223372036854775807); // TODO (unknown with D, success with MPQ) - assert(x != -3); - assert(y != -2); - assert(z != -1); + __goblint_check(x != -3); + __goblint_check(y != -2); + __goblint_check(z != -1); } } } diff --git a/tests/regression/36-apron/34-large-bigint.c b/tests/regression/36-apron/34-large-bigint.c index a27b05ba2d..d533dac257 100644 --- a/tests/regression/36-apron/34-large-bigint.c +++ b/tests/regression/36-apron/34-large-bigint.c @@ -5,21 +5,21 @@ void main() { // requires bigint, not int64 unsigned long long x, y, z; if (x < y && y < z) { - assert(x < y); - assert(y < z); - assert(x < z); + __goblint_check(x < y); + __goblint_check(y < z); + __goblint_check(x < z); if (18446744073709551612ull <= x && z <= 18446744073709551615ull) { - assert(18446744073709551612ull <= x); // TODO (unknown with D, success with MPQ) - assert(x <= 18446744073709551613ull); // TODO (unknown with D, success with MPQ) - assert(18446744073709551613ull <= y); // TODO (unknown with D, success with MPQ) - assert(y <= 18446744073709551614ull); // TODO (unknown with D, success with MPQ) - assert(18446744073709551614ull <= z); // TODO (unknown with D, success with MPQ) - assert(z <= 18446744073709551615ull); // TODO (unknown with D, success with MPQ) + __goblint_check(18446744073709551612ull <= x); // TODO (unknown with D, success with MPQ) + __goblint_check(x <= 18446744073709551613ull); // TODO (unknown with D, success with MPQ) + __goblint_check(18446744073709551613ull <= y); // TODO (unknown with D, success with MPQ) + __goblint_check(y <= 18446744073709551614ull); // TODO (unknown with D, success with MPQ) + __goblint_check(18446744073709551614ull <= z); // TODO (unknown with D, success with MPQ) + __goblint_check(z <= 18446744073709551615ull); // TODO (unknown with D, success with MPQ) - assert(x >= x - x); // avoid base from answering to check if apron doesn't say x == -3 - assert(y >= y - y); // avoid base from answering to check if apron doesn't say y == -3 - assert(z >= z - z); // avoid base from answering to check if apron doesn't say z == -3 + __goblint_check(x >= x - x); // avoid base from answering to check if apron doesn't say x == -3 + __goblint_check(y >= y - y); // avoid base from answering to check if apron doesn't say y == -3 + __goblint_check(z >= z - z); // avoid base from answering to check if apron doesn't say z == -3 } } } diff --git a/tests/regression/36-apron/35-rational-value.c b/tests/regression/36-apron/35-rational-value.c index 4340af3618..be5cddbc69 100644 --- a/tests/regression/36-apron/35-rational-value.c +++ b/tests/regression/36-apron/35-rational-value.c @@ -10,6 +10,6 @@ void main() { if (2 * x == 3) { // apron excludes true branch a = 1; } - assert(a == 0); + __goblint_check(a == 0); } } diff --git a/tests/regression/36-apron/36-special-unknown-globals.c b/tests/regression/36-apron/36-special-unknown-globals.c index db1af9c710..7620b6d5a2 100644 --- a/tests/regression/36-apron/36-special-unknown-globals.c +++ b/tests/regression/36-apron/36-special-unknown-globals.c @@ -16,9 +16,9 @@ void main() { g = r; h = r + 1; - assert(g < h); + __goblint_check(g < h); magic(); // invalidates (forgets) globals - assert(g < h); // UNKNOWN! - assert(x == r); // shouldn't forget locals + __goblint_check(g < h); // UNKNOWN! + __goblint_check(x == r); // shouldn't forget locals } } diff --git a/tests/regression/36-apron/37-special-unknown-lval.c b/tests/regression/36-apron/37-special-unknown-lval.c index 1e2d239f80..90dec25a77 100644 --- a/tests/regression/36-apron/37-special-unknown-lval.c +++ b/tests/regression/36-apron/37-special-unknown-lval.c @@ -17,16 +17,16 @@ void main() { y = r; g = r; - assert(x == y); + __goblint_check(x == y); x = rand(); // invalidates x, LibraryFunction doesn't invalidate globals - assert(x == y); // UNKNOWN! - assert(y == g); + __goblint_check(x == y); // UNKNOWN! + __goblint_check(y == g); g = rand(); // invalidates g - assert(y == g); // UNKNOWN! - assert(y == r); + __goblint_check(y == g); // UNKNOWN! + __goblint_check(y == r); y = magic(); // invalidates y - assert(y == r); // UNKNOWN! + __goblint_check(y == r); // UNKNOWN! } diff --git a/tests/regression/36-apron/39-enter-global-arg.c b/tests/regression/36-apron/39-enter-global-arg.c index 1cae0a40f6..f835059913 100644 --- a/tests/regression/36-apron/39-enter-global-arg.c +++ b/tests/regression/36-apron/39-enter-global-arg.c @@ -7,7 +7,7 @@ int g; int h; void f(int x, int y) { - assert(x < y); + __goblint_check(x < y); } int main(void) { diff --git a/tests/regression/36-apron/40-rational-bounds.c b/tests/regression/36-apron/40-rational-bounds.c index aee625c62d..1d6c077a25 100644 --- a/tests/regression/36-apron/40-rational-bounds.c +++ b/tests/regression/36-apron/40-rational-bounds.c @@ -9,8 +9,8 @@ void main() { // if (1 <= x) { // if (-10 <= x) { if (x <= 10) { - assert((x / 3) <= 4); - assert((x / 3) <= 3); // TODO: why does apron think the upper bound is 13/3 if no (positive) lower bound is known? + __goblint_check((x / 3) <= 4); + __goblint_check((x / 3) <= 3); // TODO: why does apron think the upper bound is 13/3 if no (positive) lower bound is known? } } } diff --git a/tests/regression/36-apron/41-threadenter-no-locals.c b/tests/regression/36-apron/41-threadenter-no-locals.c index 37e42659cf..60d3b790c3 100644 --- a/tests/regression/36-apron/41-threadenter-no-locals.c +++ b/tests/regression/36-apron/41-threadenter-no-locals.c @@ -6,7 +6,7 @@ extern int __VERIFIER_nondet_int(); void *t_fun(void *arg) { int x = __VERIFIER_nondet_int(); // threadenter shouldn't pass value for x here - assert(x == 3); // UNKNOWN! + __goblint_check(x == 3); // UNKNOWN! return NULL; } diff --git a/tests/regression/36-apron/42-threadenter-arg.c b/tests/regression/36-apron/42-threadenter-arg.c index a47f348d0a..1d45037120 100644 --- a/tests/regression/36-apron/42-threadenter-arg.c +++ b/tests/regression/36-apron/42-threadenter-arg.c @@ -3,7 +3,7 @@ #include void *t_fun(int arg) { - assert(arg == 3); // TODO (cast through void*) + __goblint_check(arg == 3); // TODO (cast through void*) return NULL; } diff --git a/tests/regression/36-apron/45-context.c b/tests/regression/36-apron/45-context.c index 04d2a35414..9ec7d3513c 100644 --- a/tests/regression/36-apron/45-context.c +++ b/tests/regression/36-apron/45-context.c @@ -18,7 +18,7 @@ void main() { int res; if (x <= y) { res = oct(x, y); - assert(res == 1); + __goblint_check(res == 1); } res = oct(x, y); diff --git a/tests/regression/36-apron/46-no-context.c b/tests/regression/36-apron/46-no-context.c index 4792f78a77..e6b09407a2 100644 --- a/tests/regression/36-apron/46-no-context.c +++ b/tests/regression/36-apron/46-no-context.c @@ -18,7 +18,7 @@ void main() { int res; if (x <= y) { res = oct(x, y); - assert(res == 1); // UNKNOWN (indended by disabled context) + __goblint_check(res == 1); // UNKNOWN (indended by disabled context) } res = oct(x, y); diff --git a/tests/regression/36-apron/47-no-context-attribute.c b/tests/regression/36-apron/47-no-context-attribute.c index 724e0407ed..76a3280a75 100644 --- a/tests/regression/36-apron/47-no-context-attribute.c +++ b/tests/regression/36-apron/47-no-context-attribute.c @@ -19,7 +19,7 @@ void main() { int res; if (x <= y) { res = oct(x, y); - assert(res == 1); // UNKNOWN (indended by no-context attribute) + __goblint_check(res == 1); // UNKNOWN (indended by no-context attribute) } res = oct(x, y); diff --git a/tests/regression/36-apron/48-context-attribute.c b/tests/regression/36-apron/48-context-attribute.c index 7b70b23074..f1e0130806 100644 --- a/tests/regression/36-apron/48-context-attribute.c +++ b/tests/regression/36-apron/48-context-attribute.c @@ -19,7 +19,7 @@ void main() { int res; if (x <= y) { res = oct(x, y); - assert(res == 1); + __goblint_check(res == 1); } res = oct(x, y); diff --git a/tests/regression/36-apron/49-assert-refine.c b/tests/regression/36-apron/49-assert-refine.c new file mode 100644 index 0000000000..673f21a1cc --- /dev/null +++ b/tests/regression/36-apron/49-assert-refine.c @@ -0,0 +1,17 @@ +// SKIP PARAM: --sets ana.activated[+] apron +#include + +void main() { + int x, y, z; + + // TODO: make these asserts after distinction + __goblint_assume(x < y); // U NKNOWN! (refines) + __goblint_assume(y < z); // U NKNOWN! (refines) + + __goblint_assume(3 <= x); // U NKNOWN! (refines) + __goblint_assume(z <= 5); // U NKNOWN! (refines) + + __goblint_check(x == 3); + __goblint_check(y == 4); + __goblint_check(z == 5); +} diff --git a/tests/regression/36-apron/50-evalint.c b/tests/regression/36-apron/50-evalint.c index 37dc546e03..4f55ed91e2 100644 --- a/tests/regression/36-apron/50-evalint.c +++ b/tests/regression/36-apron/50-evalint.c @@ -6,7 +6,7 @@ extern int __VERIFIER_nondet_int(); void foo(int a, int *pb) { int b = *pb; // base knows a == 4 and b == 4, apron only knows a == 4 - assert(a == b); + __goblint_check(a == b); } void main() { @@ -17,18 +17,18 @@ void main() { int b = __VERIFIER_nondet_int(); //rand if (x < y && y < z) { // base doesn't know anything, apron knows x < y < z - assert(x < y); - assert(y < z); - assert(x < z); + __goblint_check(x < y); + __goblint_check(y < z); + __goblint_check(x < z); if (3 <= x && z <= 5) { // base knows 3 <= x and z <= 5, apron knows x == 3 and y == 4 and z == 5 a = y; // base should now know a == 4 via EvalInt query - assert(x == 3); - assert(y == 4); - assert(z == 5); - assert(a == 4); + __goblint_check(x == 3); + __goblint_check(y == 4); + __goblint_check(z == 5); + __goblint_check(a == 4); b = 4; foo(a, &b); // base should add a == 4 and b == 4 to context, apron only adds a == 4 diff --git a/tests/regression/36-apron/51-airline.c b/tests/regression/36-apron/51-airline.c index e0503a0b34..edb71a5889 100644 --- a/tests/regression/36-apron/51-airline.c +++ b/tests/regression/36-apron/51-airline.c @@ -39,7 +39,7 @@ int main(int argc, char **argv) { // pthread_join(threads[i], NULL); pthread_mutex_lock(&A); - assert(sold <= capacity); // not oversold + __goblint_check(sold <= capacity); // not oversold pthread_mutex_unlock(&A); } diff --git a/tests/regression/36-apron/52-queuesize.c b/tests/regression/36-apron/52-queuesize.c index 5855c6986d..99cd8acd20 100644 --- a/tests/regression/36-apron/52-queuesize.c +++ b/tests/regression/36-apron/52-queuesize.c @@ -12,43 +12,43 @@ pthread_mutex_t Q = PTHREAD_MUTEX_INITIALIZER; void pop() { pthread_mutex_lock(&Q); - assert(free >= 0); - assert(free <= capacity); - assert(used >= 0); - assert(used <= capacity); - assert(used + free == capacity); + __goblint_check(free >= 0); + __goblint_check(free <= capacity); + __goblint_check(used >= 0); + __goblint_check(used <= capacity); + __goblint_check(used + free == capacity); if (used >= 1) { used--; free++; } - assert(free >= 0); - assert(free <= capacity); - assert(used >= 0); - assert(used <= capacity); - assert(used + free == capacity); + __goblint_check(free >= 0); + __goblint_check(free <= capacity); + __goblint_check(used >= 0); + __goblint_check(used <= capacity); + __goblint_check(used + free == capacity); pthread_mutex_unlock(&Q); } void push() { pthread_mutex_lock(&Q); - assert(free >= 0); - assert(free <= capacity); - assert(used >= 0); - assert(used <= capacity); - assert(used + free == capacity); + __goblint_check(free >= 0); + __goblint_check(free <= capacity); + __goblint_check(used >= 0); + __goblint_check(used <= capacity); + __goblint_check(used + free == capacity); if (free >= 1) { free--; used++; } - assert(free >= 0); - assert(free <= capacity); - assert(used >= 0); - assert(used <= capacity); - assert(used + free == capacity); + __goblint_check(free >= 0); + __goblint_check(free <= capacity); + __goblint_check(used >= 0); + __goblint_check(used <= capacity); + __goblint_check(used + free == capacity); pthread_mutex_unlock(&Q); } @@ -64,11 +64,11 @@ int main() { free = capacity; used = 0; - assert(free >= 0); - assert(free <= capacity); - assert(used >= 0); - assert(used <= capacity); - assert(used + free == capacity); + __goblint_check(free >= 0); + __goblint_check(free <= capacity); + __goblint_check(used >= 0); + __goblint_check(used <= capacity); + __goblint_check(used + free == capacity); pthread_t worker1; pthread_t worker2; diff --git a/tests/regression/36-apron/53-queuesize-resize.c b/tests/regression/36-apron/53-queuesize-resize.c index f0d82287eb..4e8971734b 100644 --- a/tests/regression/36-apron/53-queuesize-resize.c +++ b/tests/regression/36-apron/53-queuesize-resize.c @@ -12,53 +12,53 @@ pthread_mutex_t Q = PTHREAD_MUTEX_INITIALIZER; void pop() { pthread_mutex_lock(&Q); - assert(free >= 0); - assert(free <= capacity); - assert(used >= 0); - assert(used <= capacity); - assert(used + free == capacity); + __goblint_check(free >= 0); + __goblint_check(free <= capacity); + __goblint_check(used >= 0); + __goblint_check(used <= capacity); + __goblint_check(used + free == capacity); if (used >= 1) { used--; free++; } - assert(free >= 0); - assert(free <= capacity); - assert(used >= 0); - assert(used <= capacity); - assert(used + free == capacity); + __goblint_check(free >= 0); + __goblint_check(free <= capacity); + __goblint_check(used >= 0); + __goblint_check(used <= capacity); + __goblint_check(used + free == capacity); pthread_mutex_unlock(&Q); } void push() { pthread_mutex_lock(&Q); - assert(free >= 0); - assert(free <= capacity); - assert(used >= 0); - assert(used <= capacity); - assert(used + free == capacity); + __goblint_check(free >= 0); + __goblint_check(free <= capacity); + __goblint_check(used >= 0); + __goblint_check(used <= capacity); + __goblint_check(used + free == capacity); if (free >= 1) { free--; used++; } - assert(free >= 0); - assert(free <= capacity); - assert(used >= 0); - assert(used <= capacity); - assert(used + free == capacity); + __goblint_check(free >= 0); + __goblint_check(free <= capacity); + __goblint_check(used >= 0); + __goblint_check(used <= capacity); + __goblint_check(used + free == capacity); pthread_mutex_unlock(&Q); } void resize() { pthread_mutex_lock(&Q); - assert(free >= 0); - assert(free <= capacity); - assert(used >= 0); - assert(used <= capacity); - assert(used + free == capacity); + __goblint_check(free >= 0); + __goblint_check(free <= capacity); + __goblint_check(used >= 0); + __goblint_check(used <= capacity); + __goblint_check(used + free == capacity); int new_capacity; new_capacity = __VERIFIER_nondet_int(); @@ -72,11 +72,11 @@ void resize() { capacity = new_capacity; } - assert(free >= 0); - assert(free <= capacity); - assert(used >= 0); - assert(used <= capacity); - assert(used + free == capacity); + __goblint_check(free >= 0); + __goblint_check(free <= capacity); + __goblint_check(used >= 0); + __goblint_check(used <= capacity); + __goblint_check(used + free == capacity); pthread_mutex_unlock(&Q); } @@ -92,11 +92,11 @@ int main() { free = capacity; used = 0; - assert(free >= 0); - assert(free <= capacity); - assert(used >= 0); - assert(used <= capacity); - assert(used + free == capacity); + __goblint_check(free >= 0); + __goblint_check(free <= capacity); + __goblint_check(used >= 0); + __goblint_check(used <= capacity); + __goblint_check(used + free == capacity); pthread_t worker1; pthread_t worker2; diff --git a/tests/regression/36-apron/54-account-2-const.c b/tests/regression/36-apron/54-account-2-const.c index 426fd0ff65..bc9323051e 100644 --- a/tests/regression/36-apron/54-account-2-const.c +++ b/tests/regression/36-apron/54-account-2-const.c @@ -18,18 +18,18 @@ void *funA(void *arg) { transfer = __VERIFIER_nondet_int(); if (transfer >= 0) { pthread_mutex_lock(&M); - assert(moneyA >= 0); - assert(moneyB >= 0); - assert(moneyA + moneyB == TOTAL); + __goblint_check(moneyA >= 0); + __goblint_check(moneyB >= 0); + __goblint_check(moneyA + moneyB == TOTAL); if (transfer <= moneyA) { moneyA -= transfer; moneyB += transfer; } - assert(moneyA >= 0); - assert(moneyB >= 0); - assert(moneyA + moneyB == TOTAL); + __goblint_check(moneyA >= 0); + __goblint_check(moneyB >= 0); + __goblint_check(moneyA + moneyB == TOTAL); pthread_mutex_unlock(&M); } } @@ -43,18 +43,18 @@ void *funB(void *arg) { transfer = __VERIFIER_nondet_int(); if (transfer >= 0) { pthread_mutex_lock(&M); - assert(moneyA >= 0); - assert(moneyB >= 0); - assert(moneyA + moneyB == TOTAL); + __goblint_check(moneyA >= 0); + __goblint_check(moneyB >= 0); + __goblint_check(moneyA + moneyB == TOTAL); if (transfer <= moneyB) { moneyB -= transfer; moneyA += transfer; } - assert(moneyA >= 0); - assert(moneyB >= 0); - assert(moneyA + moneyB == TOTAL); + __goblint_check(moneyA >= 0); + __goblint_check(moneyB >= 0); + __goblint_check(moneyA + moneyB == TOTAL); pthread_mutex_unlock(&M); } } @@ -66,9 +66,9 @@ int main(int argc, char **argv) { moneyA = __VERIFIER_nondet_int(); if (moneyA >= 0 && moneyA <= TOTAL) { moneyB = TOTAL - moneyA; - assert(moneyA >= 0); - assert(moneyB >= 0); - assert(moneyA + moneyB == TOTAL); + __goblint_check(moneyA >= 0); + __goblint_check(moneyB >= 0); + __goblint_check(moneyA + moneyB == TOTAL); pthread_t threadA; pthread_t threadB; @@ -76,9 +76,9 @@ int main(int argc, char **argv) { pthread_create(&threadB, NULL, funB, NULL); pthread_mutex_lock(&M); - assert(moneyA >= 0); - assert(moneyB >= 0); - assert(moneyA + moneyB == TOTAL); + __goblint_check(moneyA >= 0); + __goblint_check(moneyB >= 0); + __goblint_check(moneyA + moneyB == TOTAL); pthread_mutex_unlock(&M); } diff --git a/tests/regression/36-apron/55-account-2.c b/tests/regression/36-apron/55-account-2.c index cb3442371e..64ef958d7d 100644 --- a/tests/regression/36-apron/55-account-2.c +++ b/tests/regression/36-apron/55-account-2.c @@ -17,18 +17,18 @@ void *funA(void *arg) { transfer = __VERIFIER_nondet_int(); if (transfer >= 0) { pthread_mutex_lock(&M); - assert(moneyA >= 0); - assert(moneyB >= 0); - assert(moneyA + moneyB == total); + __goblint_check(moneyA >= 0); + __goblint_check(moneyB >= 0); + __goblint_check(moneyA + moneyB == total); if (transfer <= moneyA) { moneyA -= transfer; moneyB += transfer; } - assert(moneyA >= 0); - assert(moneyB >= 0); - assert(moneyA + moneyB == total); + __goblint_check(moneyA >= 0); + __goblint_check(moneyB >= 0); + __goblint_check(moneyA + moneyB == total); pthread_mutex_unlock(&M); } } @@ -42,18 +42,18 @@ void *funB(void *arg) { transfer = __VERIFIER_nondet_int(); if (transfer >= 0) { pthread_mutex_lock(&M); - assert(moneyA >= 0); - assert(moneyB >= 0); - assert(moneyA + moneyB == total); + __goblint_check(moneyA >= 0); + __goblint_check(moneyB >= 0); + __goblint_check(moneyA + moneyB == total); if (transfer <= moneyB) { moneyB -= transfer; moneyA += transfer; } - assert(moneyA >= 0); - assert(moneyB >= 0); - assert(moneyA + moneyB == total); + __goblint_check(moneyA >= 0); + __goblint_check(moneyB >= 0); + __goblint_check(moneyA + moneyB == total); pthread_mutex_unlock(&M); } } @@ -66,9 +66,9 @@ int main(int argc, char **argv) { moneyA = __VERIFIER_nondet_int(); if (total >= 0 && moneyA >= 0 && moneyA <= total) { moneyB = total - moneyA; - assert(moneyA >= 0); - assert(moneyB >= 0); - assert(moneyA + moneyB == total); + __goblint_check(moneyA >= 0); + __goblint_check(moneyB >= 0); + __goblint_check(moneyA + moneyB == total); pthread_t threadA; pthread_t threadB; @@ -76,9 +76,9 @@ int main(int argc, char **argv) { pthread_create(&threadB, NULL, funB, NULL); pthread_mutex_lock(&M); - assert(moneyA >= 0); - assert(moneyB >= 0); - assert(moneyA + moneyB == total); + __goblint_check(moneyA >= 0); + __goblint_check(moneyB >= 0); + __goblint_check(moneyA + moneyB == total); pthread_mutex_unlock(&M); } diff --git a/tests/regression/36-apron/56-vectorsize-eager-downsize.c b/tests/regression/36-apron/56-vectorsize-eager-downsize.c index 5d6cc785ef..d9a36ae1b8 100644 --- a/tests/regression/36-apron/56-vectorsize-eager-downsize.c +++ b/tests/regression/36-apron/56-vectorsize-eager-downsize.c @@ -20,11 +20,11 @@ void remove() { if (amount >= 0) { pthread_mutex_lock(&U); pthread_mutex_lock(&C); - assert(used >= 0); - assert(capacity >= 1); - assert(capacity <= MAX_CAPACITY); - assert(used <= capacity); - assert(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * + __goblint_check(used >= 0); + __goblint_check(capacity >= 1); + __goblint_check(capacity <= MAX_CAPACITY); + __goblint_check(used <= capacity); + __goblint_check(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * if (amount <= used) { used -= amount; @@ -36,11 +36,11 @@ void remove() { capacity = used; } - assert(used >= 0); - assert(capacity >= 1); - assert(capacity <= MAX_CAPACITY); - assert(used <= capacity); - assert(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * + __goblint_check(used >= 0); + __goblint_check(capacity >= 1); + __goblint_check(capacity <= MAX_CAPACITY); + __goblint_check(used <= capacity); + __goblint_check(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * pthread_mutex_unlock(&C); pthread_mutex_unlock(&U); } @@ -52,11 +52,11 @@ void append() { if (amount >= 0) { pthread_mutex_lock(&U); pthread_mutex_lock(&C); - assert(used >= 0); - assert(capacity >= 1); - assert(capacity <= MAX_CAPACITY); - assert(used <= capacity); - assert(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * + __goblint_check(used >= 0); + __goblint_check(capacity >= 1); + __goblint_check(capacity <= MAX_CAPACITY); + __goblint_check(used <= capacity); + __goblint_check(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * if (used <= MAX_CAPACITY - amount) { // used + amount <= MAX_CAPACITY, but without overflow in + int new_used = used + amount; @@ -67,11 +67,11 @@ void append() { used = new_used; } - assert(used >= 0); - assert(capacity >= 1); - assert(capacity <= MAX_CAPACITY); - assert(used <= capacity); - assert(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * + __goblint_check(used >= 0); + __goblint_check(capacity >= 1); + __goblint_check(capacity <= MAX_CAPACITY); + __goblint_check(used <= capacity); + __goblint_check(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * pthread_mutex_unlock(&C); pthread_mutex_unlock(&U); } @@ -88,11 +88,11 @@ void *worker(void *arg) { int main() { used = 0; capacity = 1; - assert(used >= 0); - assert(capacity >= 1); - assert(capacity <= MAX_CAPACITY); - assert(used <= capacity); - assert(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * + __goblint_check(used >= 0); + __goblint_check(capacity >= 1); + __goblint_check(capacity <= MAX_CAPACITY); + __goblint_check(used <= capacity); + __goblint_check(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * pthread_t worker1; pthread_t worker2; @@ -102,11 +102,11 @@ int main() { while (1) { pthread_mutex_lock(&U); pthread_mutex_lock(&C); - assert(used >= 0); - assert(capacity >= 1); - assert(capacity <= MAX_CAPACITY); - assert(used <= capacity); - assert(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * + __goblint_check(used >= 0); + __goblint_check(capacity >= 1); + __goblint_check(capacity <= MAX_CAPACITY); + __goblint_check(used <= capacity); + __goblint_check(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * pthread_mutex_unlock(&C); pthread_mutex_unlock(&U); } diff --git a/tests/regression/36-apron/57-vectorsize-lazy-downsize.c b/tests/regression/36-apron/57-vectorsize-lazy-downsize.c index dd5a56ed46..bc3a6e55c8 100644 --- a/tests/regression/36-apron/57-vectorsize-lazy-downsize.c +++ b/tests/regression/36-apron/57-vectorsize-lazy-downsize.c @@ -20,11 +20,11 @@ void remove() { if (amount >= 0) { pthread_mutex_lock(&U); pthread_mutex_lock(&C); - assert(used >= 0); - assert(capacity >= 1); - assert(capacity <= MAX_CAPACITY); - assert(used <= capacity); - assert(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * + __goblint_check(used >= 0); + __goblint_check(capacity >= 1); + __goblint_check(capacity <= MAX_CAPACITY); + __goblint_check(used <= capacity); + __goblint_check(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * if (amount <= used) { used -= amount; @@ -40,11 +40,11 @@ void remove() { } } - assert(used >= 0); - assert(capacity >= 1); - assert(capacity <= MAX_CAPACITY); - assert(used <= capacity); - assert(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * + __goblint_check(used >= 0); + __goblint_check(capacity >= 1); + __goblint_check(capacity <= MAX_CAPACITY); + __goblint_check(used <= capacity); + __goblint_check(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * pthread_mutex_unlock(&C); pthread_mutex_unlock(&U); } @@ -56,11 +56,11 @@ void append() { if (amount >= 0) { pthread_mutex_lock(&U); pthread_mutex_lock(&C); - assert(used >= 0); - assert(capacity >= 1); - assert(capacity <= MAX_CAPACITY); - assert(used <= capacity); - assert(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * + __goblint_check(used >= 0); + __goblint_check(capacity >= 1); + __goblint_check(capacity <= MAX_CAPACITY); + __goblint_check(used <= capacity); + __goblint_check(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * if (used <= MAX_CAPACITY - amount) { // used + amount <= MAX_CAPACITY, but without overflow in + int new_used = used + amount; @@ -71,11 +71,11 @@ void append() { used = new_used; } - assert(used >= 0); - assert(capacity >= 1); - assert(capacity <= MAX_CAPACITY); - assert(used <= capacity); - assert(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * + __goblint_check(used >= 0); + __goblint_check(capacity >= 1); + __goblint_check(capacity <= MAX_CAPACITY); + __goblint_check(used <= capacity); + __goblint_check(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * pthread_mutex_unlock(&C); pthread_mutex_unlock(&U); } @@ -92,11 +92,11 @@ void *worker(void *arg) { int main() { used = 0; capacity = 1; - assert(used >= 0); - assert(capacity >= 1); - assert(capacity <= MAX_CAPACITY); - assert(used <= capacity); - assert(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * + __goblint_check(used >= 0); + __goblint_check(capacity >= 1); + __goblint_check(capacity <= MAX_CAPACITY); + __goblint_check(used <= capacity); + __goblint_check(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * pthread_t worker1; pthread_t worker2; @@ -106,11 +106,11 @@ int main() { while (1) { pthread_mutex_lock(&U); pthread_mutex_lock(&C); - assert(used >= 0); - assert(capacity >= 1); - assert(capacity <= MAX_CAPACITY); - assert(used <= capacity); - assert(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * + __goblint_check(used >= 0); + __goblint_check(capacity >= 1); + __goblint_check(capacity <= MAX_CAPACITY); + __goblint_check(used <= capacity); + __goblint_check(used >= capacity - used - 1); // 2 * used >= capacity - 1, but without overflow in * pthread_mutex_unlock(&C); pthread_mutex_unlock(&U); } diff --git a/tests/regression/36-apron/58-queuesize-const.c b/tests/regression/36-apron/58-queuesize-const.c index cd636875a3..7b477c07e6 100644 --- a/tests/regression/36-apron/58-queuesize-const.c +++ b/tests/regression/36-apron/58-queuesize-const.c @@ -11,43 +11,43 @@ pthread_mutex_t Q = PTHREAD_MUTEX_INITIALIZER; void pop() { pthread_mutex_lock(&Q); - assert(free >= 0); - assert(free <= CAPACITY); - assert(used >= 0); - assert(used <= CAPACITY); - assert(used + free == CAPACITY); + __goblint_check(free >= 0); + __goblint_check(free <= CAPACITY); + __goblint_check(used >= 0); + __goblint_check(used <= CAPACITY); + __goblint_check(used + free == CAPACITY); if (used >= 1) { used--; free++; } - assert(free >= 0); - assert(free <= CAPACITY); - assert(used >= 0); - assert(used <= CAPACITY); - assert(used + free == CAPACITY); + __goblint_check(free >= 0); + __goblint_check(free <= CAPACITY); + __goblint_check(used >= 0); + __goblint_check(used <= CAPACITY); + __goblint_check(used + free == CAPACITY); pthread_mutex_unlock(&Q); } void push() { pthread_mutex_lock(&Q); - assert(free >= 0); - assert(free <= CAPACITY); - assert(used >= 0); - assert(used <= CAPACITY); - assert(used + free == CAPACITY); + __goblint_check(free >= 0); + __goblint_check(free <= CAPACITY); + __goblint_check(used >= 0); + __goblint_check(used <= CAPACITY); + __goblint_check(used + free == CAPACITY); if (free >= 1) { free--; used++; } - assert(free >= 0); - assert(free <= CAPACITY); - assert(used >= 0); - assert(used <= CAPACITY); - assert(used + free == CAPACITY); + __goblint_check(free >= 0); + __goblint_check(free <= CAPACITY); + __goblint_check(used >= 0); + __goblint_check(used <= CAPACITY); + __goblint_check(used + free == CAPACITY); pthread_mutex_unlock(&Q); } @@ -61,11 +61,11 @@ int main() { free = CAPACITY; used = 0; - assert(free >= 0); - assert(free <= CAPACITY); - assert(used >= 0); - assert(used <= CAPACITY); - assert(used + free == CAPACITY); + __goblint_check(free >= 0); + __goblint_check(free <= CAPACITY); + __goblint_check(used >= 0); + __goblint_check(used <= CAPACITY); + __goblint_check(used + free == CAPACITY); pthread_t worker1; pthread_t worker2; diff --git a/tests/regression/36-apron/60-evalint-interval.c b/tests/regression/36-apron/60-evalint-interval.c index 8b12453478..702829ba1a 100644 --- a/tests/regression/36-apron/60-evalint-interval.c +++ b/tests/regression/36-apron/60-evalint-interval.c @@ -6,8 +6,8 @@ extern int __VERIFIER_nondet_int(); void foo(int *pb) { int b = *pb; // base knows 4 <= a <= 5 and pb == &a, apron only knows nothing - assert(4 <= b); - assert(b <= 5); + __goblint_check(4 <= b); + __goblint_check(b <= 5); } void main() { @@ -18,18 +18,18 @@ void main() { int b = __VERIFIER_nondet_int(); //rand if (x < y && y < z) { // base doesn't know anything, apron knows x < y < z - assert(x < y); - assert(y < z); - assert(x < z); + __goblint_check(x < y); + __goblint_check(y < z); + __goblint_check(x < z); if (3 <= x && z <= 6) { // base only knows 3 <= x and z <= 6 a = y; // base should now know 4 <= a <= 5 via EvalInt query - assert(x <= 4); - assert(4 <= y); - assert(y <= 5); - assert(5 <= z); + __goblint_check(x <= 4); + __goblint_check(4 <= y); + __goblint_check(y <= 5); + __goblint_check(5 <= z); foo(&a); // base should add 4 <= a <= 5 and pb == &a to context, apron only adds nothing } diff --git a/tests/regression/36-apron/61-branched.c b/tests/regression/36-apron/61-branched.c index bbc3c5b334..99edb8311b 100644 --- a/tests/regression/36-apron/61-branched.c +++ b/tests/regression/36-apron/61-branched.c @@ -9,7 +9,7 @@ int global = 0; void *t_fun(void *arg) { global = 5; - assert(1); + __goblint_check(1); } int main(void) @@ -19,10 +19,10 @@ int main(void) if(i < 1) { pthread_create(&t, ((void *)0), t_fun, ((void *)0)); - assert(global == 0); //UNKNOWN! + __goblint_check(global == 0); //UNKNOWN! i++; } - assert(global == 0); //UNKNOWN! + __goblint_check(global == 0); //UNKNOWN! return 0; } diff --git a/tests/regression/36-apron/62-branched_intricate.c b/tests/regression/36-apron/62-branched_intricate.c index 0bb185539e..3dbaf689b2 100644 --- a/tests/regression/36-apron/62-branched_intricate.c +++ b/tests/regression/36-apron/62-branched_intricate.c @@ -9,7 +9,7 @@ int global = 0; void *t_fun(void *arg) { global = 5; - assert(1); + __goblint_check(1); } int main(void) @@ -20,7 +20,7 @@ int main(void) if(i < 1) { pthread_create(&t, ((void *)0), t_fun, ((void *)0)); - assert(global == 0); //UNKNOWN! + __goblint_check(global == 0); //UNKNOWN! i++; mt=1; } else { @@ -29,7 +29,7 @@ int main(void) if(!mt) { if(global<=5) {} else { - assert(1); // There must be a path that reaches this + __goblint_check(1); // There must be a path that reaches this } } diff --git a/tests/regression/36-apron/63-branched-not-too-brutal.c b/tests/regression/36-apron/63-branched-not-too-brutal.c index 2254600293..fb264051ea 100644 --- a/tests/regression/36-apron/63-branched-not-too-brutal.c +++ b/tests/regression/36-apron/63-branched-not-too-brutal.c @@ -24,10 +24,10 @@ int main(void) pthread_t t; pthread_create(&t, ((void *)0), t_fun, ((void *)0)); - assert(global == 0); //UNKNOWN! + __goblint_check(global == 0); //UNKNOWN! pthread_mutex_lock(&mutex); - assert(global == 0); + __goblint_check(global == 0); pthread_mutex_unlock(&mutex); return 0; } diff --git a/tests/regression/36-apron/64-dummy-sound.c b/tests/regression/36-apron/64-dummy-sound.c index b3d6de3552..87aa4f3b62 100644 --- a/tests/regression/36-apron/64-dummy-sound.c +++ b/tests/regression/36-apron/64-dummy-sound.c @@ -21,7 +21,7 @@ int main() { pthread_create(&id, NULL, t_fun, &x); // shouldn't have g, x, y in local apron state - assert(g == 42); // UNKNOWN! - assert(x == 10); // UNKNOWN! + __goblint_check(g == 42); // UNKNOWN! + __goblint_check(x == 10); // UNKNOWN! return 0; } \ No newline at end of file diff --git a/tests/regression/36-apron/68-pfscan-workers-strengthening.c b/tests/regression/36-apron/68-pfscan-workers-strengthening.c index 7ae8850dfa..c173e4bce3 100644 --- a/tests/regression/36-apron/68-pfscan-workers-strengthening.c +++ b/tests/regression/36-apron/68-pfscan-workers-strengthening.c @@ -21,7 +21,7 @@ void *worker(void *arg) { pthread_mutex_lock(& aworker_lock); aworkers --; - assert(aworkers <= nworkers); + __goblint_check(aworkers <= nworkers); pthread_mutex_unlock(& aworker_lock); return NULL; } diff --git a/tests/regression/36-apron/69-evalint-overflow.c b/tests/regression/36-apron/69-evalint-overflow.c index 4e8c4ca70d..ca2bd7c9af 100644 --- a/tests/regression/36-apron/69-evalint-overflow.c +++ b/tests/regression/36-apron/69-evalint-overflow.c @@ -8,5 +8,5 @@ int main(void) { x += 2; } - assert(1); + __goblint_check(1); } diff --git a/tests/regression/36-apron/70-signed-overflows.c b/tests/regression/36-apron/70-signed-overflows.c index 2a90b33af0..850fabb9f4 100644 --- a/tests/regression/36-apron/70-signed-overflows.c +++ b/tests/regression/36-apron/70-signed-overflows.c @@ -6,7 +6,7 @@ int main(void) { int x = 0; while(x != 42) { x++; - assert(x >= 1); + __goblint_check(x >= 1); } } diff --git a/tests/regression/36-apron/71-tid-toy1.c b/tests/regression/36-apron/71-tid-toy1.c index b719b85d36..427c3075b2 100644 --- a/tests/regression/36-apron/71-tid-toy1.c +++ b/tests/regression/36-apron/71-tid-toy1.c @@ -27,7 +27,7 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); pthread_mutex_lock(&A); @@ -36,7 +36,7 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); // t_fun always has the invariant it only is violated in main temporarily + __goblint_check(g == h); // t_fun always has the invariant it only is violated in main temporarily pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/72-tid-toy2.c b/tests/regression/36-apron/72-tid-toy2.c index 202af5d782..dd3d6631fe 100644 --- a/tests/regression/36-apron/72-tid-toy2.c +++ b/tests/regression/36-apron/72-tid-toy2.c @@ -14,7 +14,7 @@ void *t_fun(void *arg) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); pthread_mutex_lock(&A); @@ -23,7 +23,7 @@ void *t_fun(void *arg) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! This thread is multiple and needs to read from itself + __goblint_check(g == h); //UNKNOWN! This thread is multiple and needs to read from itself pthread_mutex_unlock(&A); return NULL; } @@ -37,7 +37,7 @@ int main(void) { } pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/73-tid-toy3.c b/tests/regression/36-apron/73-tid-toy3.c index b49278696d..fc43ed50ad 100644 --- a/tests/regression/36-apron/73-tid-toy3.c +++ b/tests/regression/36-apron/73-tid-toy3.c @@ -8,7 +8,7 @@ pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); return NULL; } @@ -20,14 +20,14 @@ int main(void) { h = 14; pthread_mutex_lock(&A); - assert(g == h); //FAIL + __goblint_check(g == h); //FAIL pthread_mutex_unlock(&A); pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); - assert(g == h); //FAIL + __goblint_check(g == h); //FAIL pthread_mutex_unlock(&A); pthread_mutex_lock(&A); @@ -36,7 +36,7 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); + __goblint_check(g == h); pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/74-tid-curious.c b/tests/regression/36-apron/74-tid-curious.c index 9d09ccea63..6b62886704 100644 --- a/tests/regression/36-apron/74-tid-curious.c +++ b/tests/regression/36-apron/74-tid-curious.c @@ -22,7 +22,7 @@ int main(void) { pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); - assert(g == h); //This succeeds as it can only be entered before t_fun grabs &A and never releases it again + __goblint_check(g == h); //This succeeds as it can only be entered before t_fun grabs &A and never releases it again pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/75-tid-toy5.c b/tests/regression/36-apron/75-tid-toy5.c index 3662d8d5db..062a90da4c 100644 --- a/tests/regression/36-apron/75-tid-toy5.c +++ b/tests/regression/36-apron/75-tid-toy5.c @@ -31,7 +31,7 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); //FAIL + __goblint_check(g == h); //FAIL pthread_mutex_unlock(&A); pthread_mutex_lock(&A); @@ -40,14 +40,14 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); + __goblint_check(g == h); pthread_mutex_unlock(&A); pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/76-tid-toy6.c b/tests/regression/36-apron/76-tid-toy6.c index 815015ad0f..9b6bb16cff 100644 --- a/tests/regression/36-apron/76-tid-toy6.c +++ b/tests/regression/36-apron/76-tid-toy6.c @@ -42,7 +42,7 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); //FAIL + __goblint_check(g == h); //FAIL pthread_mutex_unlock(&A); pthread_mutex_lock(&A); @@ -51,14 +51,14 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); + __goblint_check(g == h); pthread_mutex_unlock(&A); pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/77-tid-toy7.c b/tests/regression/36-apron/77-tid-toy7.c index e471a93582..d67b10708e 100644 --- a/tests/regression/36-apron/77-tid-toy7.c +++ b/tests/regression/36-apron/77-tid-toy7.c @@ -13,7 +13,7 @@ void *t_benign(void *arg) { void *t_more(void *arg) { // t_more is started multiple times, assert does not need to hold pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); pthread_mutex_lock(&A); @@ -26,7 +26,7 @@ void *t_more(void *arg) { void *t_fun(void *arg) { // t_more has not been started yet pthread_mutex_lock(&A); - assert(g == h); + __goblint_check(g == h); pthread_mutex_unlock(&A); pthread_t more[10]; @@ -34,12 +34,12 @@ void *t_fun(void *arg) { for(int i = 0; i <10;i++) { pthread_create(&more[i], NULL, t_more, NULL); pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); } pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); pthread_mutex_lock(&A); @@ -62,14 +62,14 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); + __goblint_check(g == h); pthread_mutex_unlock(&A); pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/78-tid-toy8.c b/tests/regression/36-apron/78-tid-toy8.c index 01c501a4af..573e06a148 100644 --- a/tests/regression/36-apron/78-tid-toy8.c +++ b/tests/regression/36-apron/78-tid-toy8.c @@ -13,7 +13,7 @@ void *t_benign(void *arg) { void *t_more(void *arg) { pthread_mutex_lock(&A); - assert(g == h); + __goblint_check(g == h); pthread_mutex_unlock(&A); pthread_mutex_lock(&A); @@ -26,7 +26,7 @@ void *t_more(void *arg) { void *t_fun(void *arg) { // t_more may be started by the main thread! pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); return NULL; @@ -45,21 +45,21 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); + __goblint_check(g == h); pthread_mutex_unlock(&A); pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); - assert(g == h); + __goblint_check(g == h); pthread_mutex_unlock(&A); pthread_t id; pthread_create(&id, NULL, t_more, NULL); pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/79-tid-toy9.c b/tests/regression/36-apron/79-tid-toy9.c index ab8c2dfdc6..3449479874 100644 --- a/tests/regression/36-apron/79-tid-toy9.c +++ b/tests/regression/36-apron/79-tid-toy9.c @@ -29,7 +29,7 @@ int main(void) { // This one succeeds despite what is described in the paper, and even without the must-join analysis :) pthread_mutex_lock(&A); - assert(g == h); + __goblint_check(g == h); pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/80-tid-toy10.c b/tests/regression/36-apron/80-tid-toy10.c index c4968cd2b0..8f9a14088b 100644 --- a/tests/regression/36-apron/80-tid-toy10.c +++ b/tests/regression/36-apron/80-tid-toy10.c @@ -29,7 +29,7 @@ int main(void) { pthread_join(id2, NULL); pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); pthread_mutex_lock(&A); @@ -38,7 +38,7 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); //FAIL + __goblint_check(g == h); //FAIL pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/81-tid-toy11.c b/tests/regression/36-apron/81-tid-toy11.c index fa1496aa28..9fe7d038e7 100644 --- a/tests/regression/36-apron/81-tid-toy11.c +++ b/tests/regression/36-apron/81-tid-toy11.c @@ -56,13 +56,13 @@ int main(void) { pthread_create(&id2, NULL, t_benign, NULL); pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); pthread_join(id2, NULL); pthread_mutex_lock(&A); - assert(g == h); // UNKNOWN! + __goblint_check(g == h); // UNKNOWN! pthread_mutex_unlock(&A); pthread_mutex_lock(&A); @@ -70,7 +70,7 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); + __goblint_check(g == h); pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/82-tid-toy12.c b/tests/regression/36-apron/82-tid-toy12.c index 14ca64dc97..bf6671235a 100644 --- a/tests/regression/36-apron/82-tid-toy12.c +++ b/tests/regression/36-apron/82-tid-toy12.c @@ -58,13 +58,13 @@ int main(void) { pthread_create(&id3, NULL, t_benign, NULL); pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); pthread_join(id2, NULL); pthread_mutex_lock(&A); - assert(g == h); // UNKNOWN! + __goblint_check(g == h); // UNKNOWN! pthread_mutex_unlock(&A); pthread_mutex_lock(&A); @@ -72,7 +72,7 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); // UNKNOWN! + __goblint_check(g == h); // UNKNOWN! pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/83-tid-toy13.c b/tests/regression/36-apron/83-tid-toy13.c index b64a7731ff..93b9233bad 100644 --- a/tests/regression/36-apron/83-tid-toy13.c +++ b/tests/regression/36-apron/83-tid-toy13.c @@ -58,13 +58,13 @@ int main(void) { } pthread_mutex_lock(&A); - assert(g == h); //UNKNOWN! + __goblint_check(g == h); //UNKNOWN! pthread_mutex_unlock(&A); pthread_join(id2, NULL); pthread_mutex_lock(&A); - assert(g == h); // UNKNOWN! + __goblint_check(g == h); // UNKNOWN! pthread_mutex_unlock(&A); pthread_mutex_lock(&A); @@ -72,7 +72,7 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); // UNKNOWN! + __goblint_check(g == h); // UNKNOWN! pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/86-branched-thread-creation.c b/tests/regression/36-apron/86-branched-thread-creation.c index 462d7e1299..186b868d06 100644 --- a/tests/regression/36-apron/86-branched-thread-creation.c +++ b/tests/regression/36-apron/86-branched-thread-creation.c @@ -40,7 +40,7 @@ int main(void) { if(!mt) { pthread_mutex_lock(&mutex); - assert(g==h); //MAYFAIL + __goblint_check(g==h); //MAYFAIL pthread_mutex_unlock(&mutex); } diff --git a/tests/regression/36-apron/87-sync.c b/tests/regression/36-apron/87-sync.c index 7b57f7ce9c..b66aed45df 100644 --- a/tests/regression/36-apron/87-sync.c +++ b/tests/regression/36-apron/87-sync.c @@ -9,7 +9,7 @@ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&mutex); - assert(g==h); + __goblint_check(g==h); pthread_mutex_unlock(&mutex); return NULL; } @@ -33,7 +33,7 @@ int main(void) { pthread_mutex_unlock(&mutex); pthread_mutex_lock(&mutex); - assert(g==h); + __goblint_check(g==h); pthread_mutex_unlock(&mutex); return 0; diff --git a/tests/regression/36-apron/88-mine14-no-threshhold.c b/tests/regression/36-apron/88-mine14-no-threshhold.c index 37a0d2ee74..e04bf213e0 100644 --- a/tests/regression/36-apron/88-mine14-no-threshhold.c +++ b/tests/regression/36-apron/88-mine14-no-threshhold.c @@ -27,7 +27,7 @@ int main(void) { pthread_create(&id, NULL, t_fun, NULL); pthread_create(&id2, NULL, t_fun, NULL); pthread_mutex_lock(&mutex); - assert(x <= 100); // TODO + __goblint_check(x <= 100); // TODO pthread_mutex_unlock(&mutex); return 0; } diff --git a/tests/regression/36-apron/89-mine14.c b/tests/regression/36-apron/89-mine14.c index 6b84d0b6a2..ec314d7911 100644 --- a/tests/regression/36-apron/89-mine14.c +++ b/tests/regression/36-apron/89-mine14.c @@ -29,7 +29,7 @@ int main(void) { pthread_create(&id, NULL, t_fun, NULL); pthread_create(&id2, NULL, t_fun, NULL); pthread_mutex_lock(&mutex); - assert(x <= 100); + __goblint_check(x <= 100); pthread_mutex_unlock(&mutex); return 0; } diff --git a/tests/regression/36-apron/90-mine14-5b.c b/tests/regression/36-apron/90-mine14-5b.c index 5cd16a7272..687c25f8ab 100644 --- a/tests/regression/36-apron/90-mine14-5b.c +++ b/tests/regression/36-apron/90-mine14-5b.c @@ -45,7 +45,7 @@ int main(void) { pthread_create(&id, NULL, t_fun, NULL); pthread_create(&id2, NULL, t_fun2, NULL); pthread_mutex_lock(&mutex); - assert(x==y); + __goblint_check(x==y); pthread_mutex_unlock(&mutex); return 0; } diff --git a/tests/regression/36-apron/91-mine14-5b-no-threshhold.c b/tests/regression/36-apron/91-mine14-5b-no-threshhold.c index 73e04e6465..82574c3e30 100644 --- a/tests/regression/36-apron/91-mine14-5b-no-threshhold.c +++ b/tests/regression/36-apron/91-mine14-5b-no-threshhold.c @@ -46,7 +46,7 @@ int main(void) { pthread_create(&id, NULL, t_fun, NULL); pthread_create(&id2, NULL, t_fun2, NULL); pthread_mutex_lock(&mutex); - assert(x==y); //TODO + __goblint_check(x==y); //TODO pthread_mutex_unlock(&mutex); return 0; } diff --git a/tests/regression/36-apron/92-traces-mutex-meet-cluster2.c b/tests/regression/36-apron/92-traces-mutex-meet-cluster2.c index f407968aa0..5f40d2340c 100644 --- a/tests/regression/36-apron/92-traces-mutex-meet-cluster2.c +++ b/tests/regression/36-apron/92-traces-mutex-meet-cluster2.c @@ -38,7 +38,7 @@ int main(void) { pthread_mutex_lock(&A); int z = h; - assert(z != 31); + __goblint_check(z != 31); pthread_mutex_unlock(&A); return 0; } diff --git a/tests/regression/36-apron/93-traces-mutex-meet-cluster12.c b/tests/regression/36-apron/93-traces-mutex-meet-cluster12.c index 21863aeb8e..fad572b901 100644 --- a/tests/regression/36-apron/93-traces-mutex-meet-cluster12.c +++ b/tests/regression/36-apron/93-traces-mutex-meet-cluster12.c @@ -36,8 +36,8 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == h); - assert(h == i); + __goblint_check(g == h); + __goblint_check(h == i); pthread_mutex_unlock(&A); return 0; } diff --git a/tests/regression/36-apron/94-simple-apron-interval.c b/tests/regression/36-apron/94-simple-apron-interval.c index 536a9f4f3b..267f25016b 100644 --- a/tests/regression/36-apron/94-simple-apron-interval.c +++ b/tests/regression/36-apron/94-simple-apron-interval.c @@ -11,15 +11,15 @@ void main(void) { X++; } - assert(X-N == 0); //UNKNOWN - assert(X == N); //UNKNOWN + __goblint_check(X-N == 0); //UNKNOWN + __goblint_check(X == N); //UNKNOWN if(X == N) { N = 8; } else { N = 42; } - assert(N == 8); // UNKNOWN - assert(N >= 8); - assert(N <= 42); + __goblint_check(N == 8); // UNKNOWN + __goblint_check(N >= 8); + __goblint_check(N <= 42); } diff --git a/tests/regression/36-apron/95-simple-polyhedra.c b/tests/regression/36-apron/95-simple-polyhedra.c index 1f7f690000..2f8ea5b4c5 100644 --- a/tests/regression/36-apron/95-simple-polyhedra.c +++ b/tests/regression/36-apron/95-simple-polyhedra.c @@ -9,8 +9,8 @@ void main(void) { X = 2 * N; - assert(X - 2 * N == 0); - assert(X == 2 * N); + __goblint_check(X - 2 * N == 0); + __goblint_check(X == 2 * N); if(X == 2 * N) { N = 8; diff --git a/tests/regression/36-apron/96-branched-thread-creation-apron-priv.c b/tests/regression/36-apron/96-branched-thread-creation-apron-priv.c index ec52eac516..82d67b10eb 100644 --- a/tests/regression/36-apron/96-branched-thread-creation-apron-priv.c +++ b/tests/regression/36-apron/96-branched-thread-creation-apron-priv.c @@ -26,7 +26,7 @@ int main() { // might need join strengthening to reveal unsoundness instead of going to top directly pthread_mutex_lock(&m); - assert(g == h); // UNKNOWN! + __goblint_check(g == h); // UNKNOWN! pthread_mutex_unlock(&m); return 0; diff --git a/tests/regression/36-apron/97-no-loc.c b/tests/regression/36-apron/97-no-loc.c index 31a2544513..22cf9ca635 100644 --- a/tests/regression/36-apron/97-no-loc.c +++ b/tests/regression/36-apron/97-no-loc.c @@ -40,7 +40,7 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == 12); + __goblint_check(g == 12); pthread_mutex_unlock(&A); // --------------------------------------------------------------------------- @@ -63,7 +63,7 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(h == 12); //TODO + __goblint_check(h == 12); //TODO pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/98-loc.c b/tests/regression/36-apron/98-loc.c index 2cdee3d241..ce25c0ca97 100644 --- a/tests/regression/36-apron/98-loc.c +++ b/tests/regression/36-apron/98-loc.c @@ -40,7 +40,7 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(g == 12); //TODO + __goblint_check(g == 12); //TODO pthread_mutex_unlock(&A); // --------------------------------------------------------------------------- @@ -63,7 +63,7 @@ int main(void) { pthread_mutex_unlock(&A); pthread_mutex_lock(&A); - assert(h == 12); + __goblint_check(h == 12); pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/36-apron/99-mine14-strengthening.c b/tests/regression/36-apron/99-mine14-strengthening.c index 10a440bf3d..c43620668e 100644 --- a/tests/regression/36-apron/99-mine14-strengthening.c +++ b/tests/regression/36-apron/99-mine14-strengthening.c @@ -30,7 +30,7 @@ int main(void) { pthread_create(&id, NULL, t_fun, NULL); pthread_create(&id2, NULL, t_fun, NULL); pthread_mutex_lock(&mutex); - assert(x <= 100); + __goblint_check(x <= 100); pthread_mutex_unlock(&mutex); return 0; } diff --git a/tests/regression/37-congruence/01-simple.c b/tests/regression/37-congruence/01-simple.c index 911538d97f..1b27bf346b 100644 --- a/tests/regression/37-congruence/01-simple.c +++ b/tests/regression/37-congruence/01-simple.c @@ -23,15 +23,15 @@ int main() { b = d % 2; // c is unknown - assert (c == 4); // UNKNOWN + __goblint_check(c == 4); // UNKNOWN // d should be 12 in the concrete domain and 4Z in the congr. domain - assert (d != 1); assert (d != 2); assert (d != 3); - assert (d == 12); // UNKNOWN + __goblint_check(d != 1); __goblint_check(d != 2); __goblint_check(d != 3); + __goblint_check(d == 12); // UNKNOWN // a should be 6 in the concrete domain and 2Z in the congr. domain - assert (a == 6); // UNKNOWN + __goblint_check(a == 6); // UNKNOWN // e should be -8 in the concrete domain and 4Z in the congr. domain - assert (e == -8); // UNKNOWN - assert (b == 0); + __goblint_check(e == -8); // UNKNOWN + __goblint_check(b == 0); return 0; } diff --git a/tests/regression/37-congruence/02-constants.c b/tests/regression/37-congruence/02-constants.c index 4121d4c63b..86c6ccef99 100644 --- a/tests/regression/37-congruence/02-constants.c +++ b/tests/regression/37-congruence/02-constants.c @@ -9,11 +9,11 @@ int main() { int c = -1; int d = -2; - assert (a + b == 3); assert (a + d == -1); - assert (a * b == 2); assert (b * c == -2); - assert (a / b == 0); assert (d / c == 2); - assert (b % a == 0); assert (d % c == 0); - assert (-a == -1); assert (-d == 2); + __goblint_check(a + b == 3); __goblint_check(a + d == -1); + __goblint_check(a * b == 2); __goblint_check(b * c == -2); + __goblint_check(a / b == 0); __goblint_check(d / c == 2); + __goblint_check(b % a == 0); __goblint_check(d % c == 0); + __goblint_check(-a == -1); __goblint_check(-d == 2); // logical operators int zero = 0; @@ -23,20 +23,20 @@ int main() { //arithmetic operations - assert ((zero || one) == 1); assert ((zero || zero) == 0); assert ((one || one) == 1); - assert ((zero && one) == 0); assert ((zero && zero) == 0); assert ((one && one) == 1); - assert (!one == 0); assert (!zero == 1); + __goblint_check((zero || one) == 1); __goblint_check((zero || zero) == 0); __goblint_check((one || one) == 1); + __goblint_check((zero && one) == 0); __goblint_check((zero && zero) == 0); __goblint_check((one && one) == 1); + __goblint_check(!one == 0); __goblint_check(!zero == 1); // bitwise operators - assert ((zero & zero) == 0); assert ((zero & one) == 0); assert ((one & zero) == 0); assert ((one & one) == 1); - assert ((zero | zero) == 0); assert ((zero | one) == 1); assert ((one | zero) == 1); assert ((one | one) == 1); - assert ((zero ^ zero) == 0); assert ((zero ^ one) == 1); assert ((one ^ zero) == 1); assert ((one ^ one) == 0); + __goblint_check((zero & zero) == 0); __goblint_check((zero & one) == 0); __goblint_check((one & zero) == 0); __goblint_check((one & one) == 1); + __goblint_check((zero | zero) == 0); __goblint_check((zero | one) == 1); __goblint_check((one | zero) == 1); __goblint_check((one | one) == 1); + __goblint_check((zero ^ zero) == 0); __goblint_check((zero ^ one) == 1); __goblint_check((one ^ zero) == 1); __goblint_check((one ^ one) == 0); // comparisons - assert ((a < b) == 1); - assert ((a > b) == 0); - assert ((a == b) == 0); - assert ((a != b) == 1); + __goblint_check((a < b) == 1); + __goblint_check((a > b) == 0); + __goblint_check((a == b) == 0); + __goblint_check((a != b) == 1); return 0; } diff --git a/tests/regression/37-congruence/03-interval-overflow.c b/tests/regression/37-congruence/03-interval-overflow.c index 563a5b0909..80f5ebdd43 100644 --- a/tests/regression/37-congruence/03-interval-overflow.c +++ b/tests/regression/37-congruence/03-interval-overflow.c @@ -13,17 +13,17 @@ int main(){ } signed char k = r - 80; - assert (k == 0); //UNKNOWN! + __goblint_check(k == 0); //UNKNOWN! signed char non_ov = r - 10; - assert (non_ov == -78); //UNKNOWN! + __goblint_check(non_ov == -78); //UNKNOWN! signed char m = r * 2; - assert (m == 0); //UNKNOWN! + __goblint_check(m == 0); //UNKNOWN! signed char l = r + (-80); - assert (l == 0); //UNKNOWN! + __goblint_check(l == 0); //UNKNOWN! int g; @@ -34,10 +34,10 @@ int main(){ } signed char f = g / (-1); - assert (f == 1); //UNKNOWN! + __goblint_check(f == 1); //UNKNOWN! signed char d = -g; - assert (d == 1); //UNKNOWN! + __goblint_check(d == 1); //UNKNOWN! return 0; diff --git a/tests/regression/37-congruence/04-branching.c b/tests/regression/37-congruence/04-branching.c index 2a03a37984..eee8fd55bf 100644 --- a/tests/regression/37-congruence/04-branching.c +++ b/tests/regression/37-congruence/04-branching.c @@ -5,16 +5,16 @@ int main(){ // A refinement of a congruence class should only take place for the == and != operator. int i; if (i==0){ - assert(i==0); + __goblint_check(i==0); } else { - assert(i!=0); //UNKNOWN + __goblint_check(i!=0); //UNKNOWN } int k; if (k > 0) { - assert (k > 0); //UNKNOWN + __goblint_check(k > 0); //UNKNOWN } else { - assert (k <= 0); //UNKNOWN + __goblint_check(k <= 0); //UNKNOWN } return 0; diff --git a/tests/regression/37-congruence/05-implicitunsignedconversion-1.c b/tests/regression/37-congruence/05-implicitunsignedconversion-1.c index 4532d0f67d..38d85ee8f8 100644 --- a/tests/regression/37-congruence/05-implicitunsignedconversion-1.c +++ b/tests/regression/37-congruence/05-implicitunsignedconversion-1.c @@ -12,10 +12,10 @@ int main() { if(plus_one < minus_one) { v1 = 1; - assert(1); + __goblint_check(1); } - assert(v1==1); + __goblint_check(v1==1); // from https://github.com/sosy-lab/sv-benchmarks/blob/master/c/bitvector-regression/integerpromotion-3.c unsigned char port = 0x5a; @@ -24,7 +24,7 @@ int main() { v2 = 2; } - assert(v2==2); // UNKNOWN + __goblint_check(v2==2); // UNKNOWN // from https://github.com/sosy-lab/sv-benchmarks/blob/master/c/bitvector-regression/signextension-1.c unsigned short int allbits = -1; @@ -46,7 +46,7 @@ int main() { v3=3; } - assert(v3==3); + __goblint_check(v3==3); // from https://github.com/sosy-lab/sv-benchmarks/blob/master/c/bitvector-regression/signextension2-2.c unsigned int allOne = -1; @@ -61,7 +61,7 @@ int main() { v4=4; } - assert(v4==4); + __goblint_check(v4==4); return (0); } diff --git a/tests/regression/37-congruence/06-refinements.c b/tests/regression/37-congruence/06-refinements.c index 245e9bad77..fa3dacf3d5 100644 --- a/tests/regression/37-congruence/06-refinements.c +++ b/tests/regression/37-congruence/06-refinements.c @@ -5,20 +5,20 @@ int main() { int top; int i = 0; if(top % 17 == 3) { - assert(top%17 ==3); + __goblint_check(top%17 ==3); if(top %17 != 3) { i = 12; } else { } } - assert(i ==0); + __goblint_check(i ==0); if(top % 17 == 0) { - assert(top%17 == 0); + __goblint_check(top%17 == 0); if(top %17 != 0) { i = 12; } } - assert(i == 0); + __goblint_check(i == 0); } diff --git a/tests/regression/37-congruence/07-refinements-o.c b/tests/regression/37-congruence/07-refinements-o.c index f680e7b1c4..5ba22a1fe3 100644 --- a/tests/regression/37-congruence/07-refinements-o.c +++ b/tests/regression/37-congruence/07-refinements-o.c @@ -5,26 +5,26 @@ void unsignedCase() { unsigned int top; unsigned int i = 0; if(top % 17 == 3) { - assert(top%17 ==3); + __goblint_check(top%17 ==3); if(top %17 != 3) { i = 12; } else { } } - assert(i ==0); + __goblint_check(i ==0); if(top % 17 == 0) { - assert(top%17 == 0); + __goblint_check(top%17 == 0); if(top %17 != 0) { i = 12; } } - assert(i == 0); + __goblint_check(i == 0); if(top % 3 == 17) { // This is unreachable in the concrete! - assert(top%17 == 3); //UNKNOWN! + __goblint_check(top%17 == 3); //UNKNOWN! } } @@ -32,26 +32,26 @@ int main() { int top; int i = 0; if(top % 17 == 3) { - assert(top%17 ==3); + __goblint_check(top%17 ==3); if(top %17 != 3) { i = 12; } else { } } - assert(i ==0); + __goblint_check(i ==0); if(top % 17 == 0) { - assert(top%17 == 0); + __goblint_check(top%17 == 0); if(top %17 != 0) { i = 12; } } - assert(i == 0); + __goblint_check(i == 0); if(top % 3 == 17) { // This is unreachable in the concrete! - assert(top%17 == 3); //UNKNOWN! + __goblint_check(top%17 == 3); //UNKNOWN! } unsignedCase(); diff --git a/tests/regression/38-int-refinements/01-interval-congruence.c b/tests/regression/38-int-refinements/01-interval-congruence.c index cd4eacdd10..e5eda001bb 100644 --- a/tests/regression/38-int-refinements/01-interval-congruence.c +++ b/tests/regression/38-int-refinements/01-interval-congruence.c @@ -15,7 +15,7 @@ int main(){ if (k >= 3) { // After refinement with congruences, the lower bound should be 7 as the numbers 3 - 6 are not in the congr. class - assert (k < 7); // FAIL + __goblint_check(k < 7); // FAIL } int l; @@ -27,7 +27,7 @@ int main(){ if (l <= 41) { // Similarly to before, the upper bound should be 37 now. - assert (l > 37); // FAIL + __goblint_check(l > 37); // FAIL } return 0; } diff --git a/tests/regression/38-int-refinements/02-strange-ulong.c b/tests/regression/38-int-refinements/02-strange-ulong.c index bda92e3002..99e3c83136 100644 --- a/tests/regression/38-int-refinements/02-strange-ulong.c +++ b/tests/regression/38-int-refinements/02-strange-ulong.c @@ -12,7 +12,7 @@ int withint() { bla = &main; } - assert(1); // reachable + __goblint_check(1); // reachable return 0; } @@ -25,7 +25,7 @@ int withuint() { bla = &main; } - assert(1); // reachable + __goblint_check(1); // reachable return 0; } @@ -38,7 +38,7 @@ int withlong() { bla = &main; } - assert(1); // reachable + __goblint_check(1); // reachable return 0; } @@ -51,7 +51,7 @@ int withlonglong() { bla = &main; } - assert(1); // reachable + __goblint_check(1); // reachable return 0; } @@ -64,7 +64,7 @@ int withulonglong() { bla = &main; } - assert(1); // reachable + __goblint_check(1); // reachable return 0; } @@ -83,6 +83,6 @@ int main() { bla = &main; } - assert(1); // reachable + __goblint_check(1); // reachable return 0; } diff --git a/tests/regression/38-int-refinements/03-more-problem.c b/tests/regression/38-int-refinements/03-more-problem.c index 50abfa4af2..69bd916459 100644 --- a/tests/regression/38-int-refinements/03-more-problem.c +++ b/tests/regression/38-int-refinements/03-more-problem.c @@ -14,5 +14,5 @@ int main(void) ret = 1; } - assert(ret == 0); //UNKNOWN! + __goblint_check(ret == 0); //UNKNOWN! } diff --git a/tests/regression/39-signed-overflows/01-def_exc.c b/tests/regression/39-signed-overflows/01-def_exc.c index bc39abfe06..45e2b858c4 100644 --- a/tests/regression/39-signed-overflows/01-def_exc.c +++ b/tests/regression/39-signed-overflows/01-def_exc.c @@ -6,6 +6,6 @@ int main(void) { if(a != -1) { int s = a+1; - assert(s != 0); + __goblint_check(s != 0); } } diff --git a/tests/regression/39-signed-overflows/02-intervals.c b/tests/regression/39-signed-overflows/02-intervals.c index b60d6c51a5..febe423d48 100644 --- a/tests/regression/39-signed-overflows/02-intervals.c +++ b/tests/regression/39-signed-overflows/02-intervals.c @@ -5,7 +5,7 @@ int main(void) { int x = 0; while(x != 42) { x++; - assert(x >= 1); + __goblint_check(x >= 1); } } diff --git a/tests/regression/39-signed-overflows/03-cast-return-void-ptr.c b/tests/regression/39-signed-overflows/03-cast-return-void-ptr.c index 463a6f8359..24e33f009e 100644 --- a/tests/regression/39-signed-overflows/03-cast-return-void-ptr.c +++ b/tests/regression/39-signed-overflows/03-cast-return-void-ptr.c @@ -7,9 +7,9 @@ int empty() { int main(void) { if (!empty()==-1) { // if -1 is cast to void*, it makes both branches dead! - assert(1); // NOWARN (unreachable) + __goblint_check(1); // NOWARN (unreachable) } - assert(1); // reachable + __goblint_check(1); // reachable return 0; } diff --git a/tests/regression/39-signed-overflows/04-cast-unsigned-to-signed.c b/tests/regression/39-signed-overflows/04-cast-unsigned-to-signed.c index 63f1f8ef30..8f0ef17ef4 100644 --- a/tests/regression/39-signed-overflows/04-cast-unsigned-to-signed.c +++ b/tests/regression/39-signed-overflows/04-cast-unsigned-to-signed.c @@ -4,6 +4,6 @@ int main(void) { unsigned long x; long y = x; - assert(y >= 0); // UNKNOWN! + __goblint_check(y >= 0); // UNKNOWN! return 0; } diff --git a/tests/regression/39-signed-overflows/05-lower-constants.c b/tests/regression/39-signed-overflows/05-lower-constants.c index 26369931a0..cde2587edc 100644 --- a/tests/regression/39-signed-overflows/05-lower-constants.c +++ b/tests/regression/39-signed-overflows/05-lower-constants.c @@ -3,9 +3,9 @@ int main(void) { int x = INT_MAX + 1; - assert(x == INT_MIN); //UNKNOWN! + __goblint_check(x == INT_MIN); //UNKNOWN! int r = - INT_MIN; - assert(r == INT_MIN); //UNKNOWN! + __goblint_check(r == INT_MIN); //UNKNOWN! } diff --git a/tests/regression/41-stdlib/01-qsort.c b/tests/regression/41-stdlib/01-qsort.c index b9f01b523a..62fd58be4b 100644 --- a/tests/regression/41-stdlib/01-qsort.c +++ b/tests/regression/41-stdlib/01-qsort.c @@ -3,28 +3,28 @@ #include int cmp1(const void *a, const void *b) { - assert(1); // reachable + __goblint_check(1); // reachable return 0; } int cmp2(const void *a, const void *b) { - assert(a != NULL); - assert(b != NULL); + __goblint_check(a != NULL); + __goblint_check(b != NULL); return 0; } int cmp3(const void *a, const void *b) { - assert(1); // NOWARN (unreachable) + __goblint_check(1); // NOWARN (unreachable) return 0; } int cmp4(const void *a, const void *b) { int x = *((const int*) a); int y = *((const int*) b); - assert(-3 <= x); - assert(x <= 10); - assert(-3 <= y); - assert(y <= 10); + __goblint_check(-3 <= x); + __goblint_check(x <= 10); + __goblint_check(-3 <= y); + __goblint_check(y <= 10); return 0; } diff --git a/tests/regression/41-stdlib/02-bsearch.c b/tests/regression/41-stdlib/02-bsearch.c index b7eb49b0ec..157971c9ff 100644 --- a/tests/regression/41-stdlib/02-bsearch.c +++ b/tests/regression/41-stdlib/02-bsearch.c @@ -3,27 +3,27 @@ #include int cmp1(const void *a, const void *b) { - assert(1); // reachable + __goblint_check(1); // reachable return 0; } int cmp2(const void *a, const void *b) { - assert(a != NULL); - assert(b != NULL); + __goblint_check(a != NULL); + __goblint_check(b != NULL); return 0; } int cmp3(const void *a, const void *b) { - assert(1); // NOWARN (unreachable) + __goblint_check(1); // NOWARN (unreachable) return 0; } int cmp4(const void *a, const void *b) { int x = *((const int*) a); int y = *((const int*) b); - assert(x == 4); - assert(-3 <= y); - assert(y <= 10); + __goblint_check(x == 4); + __goblint_check(-3 <= y); + __goblint_check(y <= 10); return 0; } @@ -50,8 +50,8 @@ int main() { // bsearch hasn't invalidated array for (int i = 0; i < 7; i++) { - assert(-3 <= arr[i]); - assert(arr[i] <= 10); + __goblint_check(-3 <= arr[i]); + __goblint_check(arr[i] <= 10); } return 0; } \ No newline at end of file diff --git a/tests/regression/42-annotated-precision/01-def_exc.c b/tests/regression/42-annotated-precision/01-def_exc.c index 68a83ff2d2..82f06b2ee6 100644 --- a/tests/regression/42-annotated-precision/01-def_exc.c +++ b/tests/regression/42-annotated-precision/01-def_exc.c @@ -11,8 +11,8 @@ int f(int in) { int main() { int a = 0; - assert(a); // FAIL! + __goblint_check(a); // FAIL! a = f(a); - assert(a); + __goblint_check(a); return 0; } diff --git a/tests/regression/42-annotated-precision/02-interval.c b/tests/regression/42-annotated-precision/02-interval.c index 1d6593419f..4171e6fb59 100644 --- a/tests/regression/42-annotated-precision/02-interval.c +++ b/tests/regression/42-annotated-precision/02-interval.c @@ -11,8 +11,8 @@ int f(int in) { int main() { int a = 0; - assert(a); // FAIL! + __goblint_check(a); // FAIL! a = f(a); - assert(a); + __goblint_check(a); return 0; } diff --git a/tests/regression/42-annotated-precision/03-congruence.c b/tests/regression/42-annotated-precision/03-congruence.c index ff44541c47..b474fa5f1b 100644 --- a/tests/regression/42-annotated-precision/03-congruence.c +++ b/tests/regression/42-annotated-precision/03-congruence.c @@ -12,9 +12,9 @@ int f(int in) { int main() { int a = 0; int b = f(a); - assert(b); + __goblint_check(b); a = b % 2; b = f(a); - assert(b == 2); + __goblint_check(b == 2); return 0; } diff --git a/tests/regression/42-annotated-precision/04-struct.c b/tests/regression/42-annotated-precision/04-struct.c index 8977fcb52e..3755d0e4ef 100644 --- a/tests/regression/42-annotated-precision/04-struct.c +++ b/tests/regression/42-annotated-precision/04-struct.c @@ -19,12 +19,12 @@ int main() { a1.name = "John"; a1.i = 6; - assert(a1.i == 6); + __goblint_check(a1.i == 6); f(&a1); - assert(a1.i == 10); - assert(a1.i == b1.i); // FAIL! + __goblint_check(a1.i == 10); + __goblint_check(a1.i == b1.i); // FAIL! b1.i = a1.i % 5; - assert(b1.i); // FAIL! + __goblint_check(b1.i); // FAIL! return 0; } diff --git a/tests/regression/42-annotated-precision/05-array.c b/tests/regression/42-annotated-precision/05-array.c index 89cb95e4fa..1153738c69 100644 --- a/tests/regression/42-annotated-precision/05-array.c +++ b/tests/regression/42-annotated-precision/05-array.c @@ -9,7 +9,7 @@ int main() __attribute__ ((goblint_precision("interval"))); void f(int in[], int len) { - assert(in[0]); // FAIL! + __goblint_check(in[0]); // FAIL! int c[len]; for (int i = 0; i < len; i++) { c[i] = 1; @@ -30,13 +30,13 @@ int main() { bool b[] = {true, false}; char s[][] = {"Edward","Tom","Julia"}; - assert(a[0]); // FAIL! - assert(a[0] == a[1]); + __goblint_check(a[0]); // FAIL! + __goblint_check(a[0] == a[1]); f(a, (int) (sizeof(a) / sizeof(int))); - assert(a[0]); // FAIL! + __goblint_check(a[0]); // FAIL! g(b, (int) (sizeof(b) / sizeof(bool))); a[1] = 1; - assert(a[1]); // UNKNOWN! + __goblint_check(a[1]); // UNKNOWN! return 0; } diff --git a/tests/regression/42-annotated-precision/06-global.c b/tests/regression/42-annotated-precision/06-global.c index a3be38f9d6..76aef430c4 100644 --- a/tests/regression/42-annotated-precision/06-global.c +++ b/tests/regression/42-annotated-precision/06-global.c @@ -9,16 +9,16 @@ int g2 = 0; int inc(int in) { int b = in + 1; - assert(b); + __goblint_check(b); g2 = 1; return b; } int main() { int a = 0; - assert(g1); // FAIL! + __goblint_check(g1); // FAIL! a = inc(g1); - assert(a == g1); // FAIL! - assert(a == g2); // UNKNOWN! + __goblint_check(a == g1); // FAIL! + __goblint_check(a == g2); // UNKNOWN! return 0; } diff --git a/tests/regression/42-annotated-precision/07-missing_annotation.c b/tests/regression/42-annotated-precision/07-missing_annotation.c index 125a8391a5..7e2ccb9330 100644 --- a/tests/regression/42-annotated-precision/07-missing_annotation.c +++ b/tests/regression/42-annotated-precision/07-missing_annotation.c @@ -11,7 +11,7 @@ int f(int in) { int main() { int a = 1; - assert(a); // UNKNOWN! + __goblint_check(a); // UNKNOWN! a = f(a); return 0; } diff --git a/tests/regression/42-annotated-precision/08-22_01-simple_array.c b/tests/regression/42-annotated-precision/08-22_01-simple_array.c index 8967ea7a2d..debae41333 100644 --- a/tests/regression/42-annotated-precision/08-22_01-simple_array.c +++ b/tests/regression/42-annotated-precision/08-22_01-simple_array.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint #include int global; @@ -40,15 +40,15 @@ void example1(void) while (i < 42) { a[i] = 0; - assert(a[i] == 0); - assert(a[0] == 0); - assert(a[17] == 0); // UNKNOWN + __goblint_check(a[i] == 0); + __goblint_check(a[0] == 0); + __goblint_check(a[17] == 0); // UNKNOWN i++; } - assert(a[0] == 0); - assert(a[7] == 0); - assert(a[41] == 0); + __goblint_check(a[0] == 0); + __goblint_check(a[7] == 0); + __goblint_check(a[41] == 0); } // More complicated expression to index rather than just a variable @@ -58,14 +58,14 @@ void example2(void) { while (i < 43) { a[i - 1] = 0; - assert(a[i - 1] == 0); - assert(a[38] == 0); // UNKNOWN + __goblint_check(a[i - 1] == 0); + __goblint_check(a[38] == 0); // UNKNOWN i++; } - assert(a[0] == 0); - assert(a[7] == 0); - assert(a[41] == 0); + __goblint_check(a[0] == 0); + __goblint_check(a[7] == 0); + __goblint_check(a[41] == 0); } // Two values initialized in one loop @@ -80,10 +80,10 @@ void example3(void) { i++; } - assert(a[0] == 2); // FAIL - assert(a[41] == 0); // UNKNOWN - assert(a[41] == 1); // UNKNOWN - assert(a[41] == -1); // FAIL + __goblint_check(a[0] == 2); // FAIL + __goblint_check(a[41] == 0); // UNKNOWN + __goblint_check(a[41] == 1); // UNKNOWN + __goblint_check(a[41] == -1); // FAIL } // Example where initialization proceeds backwards @@ -96,10 +96,10 @@ void example4(void) { i--; } - assert(a[i+2] == 0); - assert(a[41] == 0); - assert(a[i] == 0); //UNKNOWN - assert(a[0] == 0); //UNKNOWN + __goblint_check(a[i+2] == 0); + __goblint_check(a[41] == 0); + __goblint_check(a[i] == 0); //UNKNOWN + __goblint_check(a[0] == 0); //UNKNOWN } // Example having two arrays partitioned according to one expression @@ -112,15 +112,15 @@ void example5(void) { a[i] = 2; b[41-i] = 0; - assert(b[7] == 0); //UNKNOWN - assert(a[5] == 2); //UNKNOWN + __goblint_check(b[7] == 0); //UNKNOWN + __goblint_check(a[5] == 2); //UNKNOWN i++; } - assert(a[0] == 2); - assert(a[41] == 2); - assert(b[0] == 0); - assert(b[41] == 0); + __goblint_check(a[0] == 2); + __goblint_check(a[41] == 2); + __goblint_check(b[0] == 0); + __goblint_check(b[41] == 0); } // Example showing array becoming partitioned according to different expressions @@ -135,22 +135,22 @@ void example6(void) { i++; } - assert(a[17] == 4); - assert(a[9] == 4); - assert(a[3] == 4); - assert(a[i-1] == 4); + __goblint_check(a[17] == 4); + __goblint_check(a[9] == 4); + __goblint_check(a[3] == 4); + __goblint_check(a[i-1] == 4); while(j<10) { a[j] = -1; j++; } - assert(a[3] == -1); - assert(a[0] == -1); - assert(a[j-1] == -1); - assert(a[j] == 4); - assert(a[17] == 4); - assert(a[j+5] == 4); + __goblint_check(a[3] == -1); + __goblint_check(a[0] == -1); + __goblint_check(a[j-1] == -1); + __goblint_check(a[j] == 4); + __goblint_check(a[17] == 4); + __goblint_check(a[j+5] == 4); } // This was the case where we thought we needed path-splitting @@ -162,15 +162,15 @@ void example7(void) { if(top) { while(i < 41) { a[i] = 0; - assert(a[i] == 0); + __goblint_check(a[i] == 0); i++; } } - assert(a[0] == 0); // UNKNOWN - assert(a[7] == 0); // UNKNOWN - assert(a[41] == 0); // UNKNOWN - assert(a[top] == 0); // UNKNOWN + __goblint_check(a[0] == 0); // UNKNOWN + __goblint_check(a[7] == 0); // UNKNOWN + __goblint_check(a[41] == 0); // UNKNOWN + __goblint_check(a[top] == 0); // UNKNOWN } // Check that the global variable is not used for partitioning @@ -178,37 +178,37 @@ void example8() { int a[10]; a[global] = 4; - assert(a[global] == 4); // UNKNOWN + __goblint_check(a[global] == 4); // UNKNOWN for(int i=0; i <5; i++) { a[i] = 42; } - assert(a[0] == 42); - assert(a[1] == 42); - assert(a[2] == 42); - assert(a[3] == 42); - assert(a[global] == 42); + __goblint_check(a[0] == 42); + __goblint_check(a[1] == 42); + __goblint_check(a[2] == 42); + __goblint_check(a[3] == 42); + __goblint_check(a[global] == 42); } // Check that arrays of types different from int are handeled correctly void example9() { char a[10]; int n; - assert(a[3] == 800); // FAIL + __goblint_check(a[3] == 800); // FAIL for(int i=0;i < 10; i++) { a[i] = 7; } - assert(a[0] == 7); - assert(a[3] == 7); + __goblint_check(a[0] == 7); + __goblint_check(a[3] == 7); a[3] = (char) n; - assert(a[3] == 800); //FAIL - assert(a[3] == 127); //UNKNOWN - assert(a[3] == -128); //UNKNOWN - assert(a[3] == -129); //FAIL + __goblint_check(a[3] == 800); //FAIL + __goblint_check(a[3] == 127); //UNKNOWN + __goblint_check(a[3] == -128); //UNKNOWN + __goblint_check(a[3] == -129); //FAIL } void example10() { @@ -217,5 +217,5 @@ void example10() { int i=5; a[i] = 7; - assert(a[5] == 7); + __goblint_check(a[5] == 7); } diff --git a/tests/regression/42-annotated-precision/09-22_02-pointers_array.c b/tests/regression/42-annotated-precision/09-22_02-pointers_array.c index f3f28963eb..13657eb1a7 100644 --- a/tests/regression/42-annotated-precision/09-22_02-pointers_array.c +++ b/tests/regression/42-annotated-precision/09-22_02-pointers_array.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint #include int main(void) __attribute__((goblint_precision("no-interval"))); @@ -47,12 +47,12 @@ void example1(void) { *ptr = 42; ptr++; - assert(a[0] == 42); - assert(a[1] == 42); // UNKNOWN + __goblint_check(a[0] == 42); + __goblint_check(a[1] == 42); // UNKNOWN *ptr = 42; - assert(a[0] == 42); - assert(a[1] == 42); + __goblint_check(a[0] == 42); + __goblint_check(a[1] == 42); ptr++; *ptr = 42; @@ -66,13 +66,13 @@ void example1(void) { int i = 5; - assert(a[i] == 42); + __goblint_check(a[i] == 42); if(top) { i++; } - assert(a[i] == 42); // UNKNOWN + __goblint_check(a[i] == 42); // UNKNOWN } // Tests correct handling when pointers may point to several different things @@ -86,19 +86,19 @@ void example2() { ptr = &array1; *ptr = 5; - assert(*ptr == 5); + __goblint_check(*ptr == 5); } else { ptr = &array2; *ptr = 5; - assert(*ptr == 5); + __goblint_check(*ptr == 5); } // Since ptr could point to different arrays, the update here can not be precise *ptr = 6; - assert(*ptr == 6); // UNKNOWN + __goblint_check(*ptr == 6); // UNKNOWN } void example3(void) { @@ -107,7 +107,7 @@ void example3(void) { for(int i =0; i <5; i++) { *ptr = 42; - assert(*ptr == 42); + __goblint_check(*ptr == 42); ptr++; } } @@ -119,7 +119,7 @@ void example4(void) { while(ptr <= end) { *ptr = 42; - assert(*ptr == 42); + __goblint_check(*ptr == 42); ptr++; } @@ -136,11 +136,11 @@ void example5(void) { ptr--; *ptr = 40; - assert(*ptr == 40); - assert(array1[4] == 42); - assert(array1[3] == 42); - assert(array1[2] == 40); - assert(array1[0] == 42); // UNKNOWN + __goblint_check(*ptr == 40); + __goblint_check(array1[4] == 42); + __goblint_check(array1[3] == 42); + __goblint_check(array1[2] == 40); + __goblint_check(array1[0] == 42); // UNKNOWN } void example6(void) { @@ -149,7 +149,7 @@ void example6(void) { *ptr = 5; int v = *ptr; - assert(v == 5); + __goblint_check(v == 5); ptr++; *ptr = 6; @@ -158,15 +158,15 @@ void example6(void) { // This is necessary for the tests that we are doing later int k = ptr-&array1; - assert(k == 2); + __goblint_check(k == 2); int m = ptr-array1; - assert(m == 2); + __goblint_check(m == 2); int* np = &array1; np++; np++; int x = *np; - assert(x==7); + __goblint_check(x==7); } void example7(void) { @@ -201,10 +201,10 @@ void example7(void) { // arr1 -> (-, [4,9]) // arr2 -> (-, [4,9]) int x = arr1[7]; - assert(x == 3); // FAIL - assert(x == 4); // UNKNOWN - assert(x == 9); // UNKNOWN - assert(x == 10); // FAIL + __goblint_check(x == 3); // FAIL + __goblint_check(x == 4); // UNKNOWN + __goblint_check(x == 9); // UNKNOWN + __goblint_check(x == 10); // FAIL } void example8(void) { @@ -220,12 +220,12 @@ void example8(void) { int* ptr = a[7]; int x = *(ptr+7); - assert(x == 3); //FAIL + __goblint_check(x == 3); //FAIL int (*ptr2)[42]; ptr2 = a+7; x = (*ptr2)[6]; - assert(x == 3); //FAIL + __goblint_check(x == 3); //FAIL printf("x is %d\n", x); } @@ -249,7 +249,7 @@ void example9() { a[14][0] = 3; ptr2 = a+7; y = (ptr2+1)[6]; - assert(*y == 3); + __goblint_check(*y == 3); } int example10() { @@ -265,13 +265,13 @@ int example10() { ptr = x[3].x; y = *(ptr + 3); - assert(y == 0); //FAIL + __goblint_check(y == 0); //FAIL printf("y is %d", y); } void foo(int (*a)[40]) { int x = (*(a + 29))[7]; - assert(x == 23); //UNKNOWN + __goblint_check(x == 23); //UNKNOWN } void example11() diff --git a/tests/regression/42-annotated-precision/10-22_03-multidimensional_arrays.c b/tests/regression/42-annotated-precision/10-22_03-multidimensional_arrays.c index 1160aa85c8..e888a56cff 100644 --- a/tests/regression/42-annotated-precision/10-22_03-multidimensional_arrays.c +++ b/tests/regression/42-annotated-precision/10-22_03-multidimensional_arrays.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint +// PARAM: --set solver td3 --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint #include void example1(void) __attribute__((goblint_precision("no-def_exc","interval"))); @@ -25,19 +25,19 @@ void example1(void) { j++; } - assert(a[i][0] == 42); - assert(a[i][9] == 42); - assert(a[3][9] == 42); // UNKNOWN + __goblint_check(a[i][0] == 42); + __goblint_check(a[i][9] == 42); + __goblint_check(a[3][9] == 42); // UNKNOWN i++; } - assert(a[0][0] == 42); - assert(a[2][5] == 42); - assert(a[8][9] == 42); - assert(a[3][7] == 42); - assert(a[9][9] == 42); // UNKNOWN - assert(a[9][2] == 42); // UNKNOWN + __goblint_check(a[0][0] == 42); + __goblint_check(a[2][5] == 42); + __goblint_check(a[8][9] == 42); + __goblint_check(a[3][7] == 42); + __goblint_check(a[9][9] == 42); // UNKNOWN + __goblint_check(a[9][2] == 42); // UNKNOWN } // Combines backwards- and forwards-iteration @@ -50,17 +50,17 @@ void example2(void) { while(j < 10) { array[i][j] = 4711; - assert(array[i-1][j+1] == 4711); //UNKNOWN + __goblint_check(array[i-1][j+1] == 4711); //UNKNOWN j++; } i--; } - assert(array[2][3] == 4711); - assert(array[0][9] == 4711); - assert(array[8][5] == 4711); - assert(array[2][1] == 4711); - assert(array[0][0] == 4711); - assert(array[7][5] == 4711); + __goblint_check(array[2][3] == 4711); + __goblint_check(array[0][9] == 4711); + __goblint_check(array[8][5] == 4711); + __goblint_check(array[2][1] == 4711); + __goblint_check(array[0][0] == 4711); + __goblint_check(array[7][5] == 4711); } diff --git a/tests/regression/42-annotated-precision/11-22_04-nesting_arrays.c b/tests/regression/42-annotated-precision/11-22_04-nesting_arrays.c index 0a79800ed7..751da5e185 100644 --- a/tests/regression/42-annotated-precision/11-22_04-nesting_arrays.c +++ b/tests/regression/42-annotated-precision/11-22_04-nesting_arrays.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint #include struct kala { @@ -57,23 +57,23 @@ void example1() { i++; // Check assertion that should only hold later does not already hold here - assert(l.a[4] == 42); //UNKNOWN + __goblint_check(l.a[4] == 42); //UNKNOWN } // Check the array is correctly initialized - assert(l.a[1] == 42); - assert(l.a[2] == 42); - assert(l.a[3] == 42); - assert(l.a[4] == 42); + __goblint_check(l.a[1] == 42); + __goblint_check(l.a[2] == 42); + __goblint_check(l.a[3] == 42); + __goblint_check(l.a[4] == 42); // Destructively assign to i i = top; // Check the array is still known to be completly initialized - assert(l.a[1] == 42); - assert(l.a[2] == 42); - assert(l.a[3] == 42); - assert(l.a[4] == 42); + __goblint_check(l.a[1] == 42); + __goblint_check(l.a[2] == 42); + __goblint_check(l.a[3] == 42); + __goblint_check(l.a[4] == 42); } void example2() { @@ -91,8 +91,8 @@ void example2() { } // Initialization has not proceeded this far - assert(kalas[4].a[0] == 8); //UNKNOWN - assert(kalas[0].a[0] == 8); + __goblint_check(kalas[4].a[0] == 8); //UNKNOWN + __goblint_check(kalas[0].a[0] == 8); } void example3() { @@ -101,7 +101,7 @@ void example3() { xnn.a[l] = 42; } - assert(xnn.a[3] == 42); + __goblint_check(xnn.a[3] == 42); } void example4() { @@ -116,7 +116,7 @@ void example4() { } } - assert(xs[3].a[0] == 7); + __goblint_check(xs[3].a[0] == 7); } void example5() { @@ -134,10 +134,10 @@ void example5() { i3++; } - assert(ua.a[i3 - 1] == 42); + __goblint_check(ua.a[i3 - 1] == 42); ua.b[0] = 3; - assert(ua.b[0] == 3); + __goblint_check(ua.b[0] == 3); // ------------------------------- union uStruct us; @@ -145,17 +145,17 @@ void example5() { us.b = 4; us.k.a[i4] = 0; - assert(us.b == 4); // UNKNOWN - assert(us.k.a[0] == 0); - assert(us.k.a[3] == 0); // UNKNOWN + __goblint_check(us.b == 4); // UNKNOWN + __goblint_check(us.k.a[0] == 0); + __goblint_check(us.k.a[3] == 0); // UNKNOWN while (i4 < 5) { us.k.a[i4] = 42; i4++; } - assert(us.k.a[1] == 42); - assert(us.k.a[0] == 0); // FAIL + __goblint_check(us.k.a[1] == 42); + __goblint_check(us.k.a[0] == 0); // FAIL } void example6() { @@ -175,7 +175,7 @@ void example6() { a[k.v] = 2; k.v = k.v+1; - assert(a[k.v] != 3); + __goblint_check(a[k.v] != 3); } void example7() { @@ -207,5 +207,5 @@ void example8() { a[ua.a[*ip]] = 42; ip++; - assert(a[ua.a[*ip]] == 42); //UNKNOWN + __goblint_check(a[ua.a[*ip]] == 42); //UNKNOWN } diff --git a/tests/regression/42-annotated-precision/12-22_06-interprocedural.c b/tests/regression/42-annotated-precision/12-22_06-interprocedural.c index 2b9febe09c..8d708d120c 100644 --- a/tests/regression/42-annotated-precision/12-22_06-interprocedural.c +++ b/tests/regression/42-annotated-precision/12-22_06-interprocedural.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint +// PARAM: --set solver td3 --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint #include void example1() __attribute__((goblint_precision("no-def_exc","interval"))); @@ -18,15 +18,15 @@ void example1() { init_array(a, 42); - assert(a[2] == 42); - assert(a[10] == 42); + __goblint_check(a[2] == 42); + __goblint_check(a[10] == 42); do_first(a); - assert(a[0] == 3); + __goblint_check(a[0] == 3); init_array(b,12); - assert(b[2] == 12); - assert(b[10] == 12); + __goblint_check(b[2] == 12); + __goblint_check(b[10] == 12); } void do_first(int* arr) { @@ -40,8 +40,8 @@ void init_array(int* arr, int val) { } arr[0] = val; - assert(arr[2] == val); - assert(arr[10] == val); + __goblint_check(arr[2] == val); + __goblint_check(arr[10] == val); } // ----------------------------------- Example 2 ------------------------------------------------------------------------------ @@ -52,21 +52,21 @@ void example2(void) { for(int i = 0; i < 20; i++) { arr[i] = 42; - assert(arr[i] == 42); + __goblint_check(arr[i] == 42); callee(arr); } - assert(arr[0] == 100); //FAIL - assert(arr[0] == 7); //UNKNOWN - assert(arr[0] == 42); //UNKNOWN + __goblint_check(arr[0] == 100); //FAIL + __goblint_check(arr[0] == 7); //UNKNOWN + __goblint_check(arr[0] == 42); //UNKNOWN - assert(arr[7] == 100); //FAIL - assert(arr[7] == 7); //UNKNOWN - assert(arr[7] == 42); //UNKNOWN + __goblint_check(arr[7] == 100); //FAIL + __goblint_check(arr[7] == 7); //UNKNOWN + __goblint_check(arr[7] == 42); //UNKNOWN - assert(arr[20] == 100); //FAIL - assert(arr[20] == 7); //UNKNOWN - assert(arr[20] == 42); //UNKNOWN + __goblint_check(arr[20] == 100); //FAIL + __goblint_check(arr[20] == 7); //UNKNOWN + __goblint_check(arr[20] == 42); //UNKNOWN } void callee(int* arr) { diff --git a/tests/regression/42-annotated-precision/13-22_07-global_array.c b/tests/regression/42-annotated-precision/13-22_07-global_array.c index 504780422f..5db3eb9054 100644 --- a/tests/regression/42-annotated-precision/13-22_07-global_array.c +++ b/tests/regression/42-annotated-precision/13-22_07-global_array.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint +// PARAM: --set solver td3 --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint #include int global_array[50]; @@ -10,8 +10,8 @@ int main(void) { some_func(); int x = global_array[5]; - assert(x == 0); //UNKNOWN - assert(x == 42); //UNKNOWN + __goblint_check(x == 0); //UNKNOWN + __goblint_check(x == 42); //UNKNOWN } @@ -23,5 +23,5 @@ void some_func(void) { } int x = global_array[0]; - assert(x == 42); //FAIL + __goblint_check(x == 42); //FAIL } diff --git a/tests/regression/42-annotated-precision/15-23_01-simple_array.c b/tests/regression/42-annotated-precision/15-23_01-simple_array.c index 9dc706d001..a7e02d826c 100644 --- a/tests/regression/42-annotated-precision/15-23_01-simple_array.c +++ b/tests/regression/42-annotated-precision/15-23_01-simple_array.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint #include int global; @@ -35,15 +35,15 @@ void example1(void) while (i < 42) { a[i] = 0; - assert(a[i] == 0); - assert(a[0] == 0); - assert(a[17] == 0); // UNKNOWN + __goblint_check(a[i] == 0); + __goblint_check(a[0] == 0); + __goblint_check(a[17] == 0); // UNKNOWN i++; } - assert(a[0] == 0); - assert(a[7] == 0); - assert(a[41] == 0); + __goblint_check(a[0] == 0); + __goblint_check(a[7] == 0); + __goblint_check(a[41] == 0); } // More complicated expression to index rather than just a variable @@ -53,14 +53,14 @@ void example2(void) { while (i < 43) { a[i - 1] = 0; - assert(a[i - 1] == 0); - assert(a[38] == 0); // UNKNOWN + __goblint_check(a[i - 1] == 0); + __goblint_check(a[38] == 0); // UNKNOWN i++; } - assert(a[0] == 0); - assert(a[7] == 0); - assert(a[41] == 0); + __goblint_check(a[0] == 0); + __goblint_check(a[7] == 0); + __goblint_check(a[41] == 0); } // Two values initialized in one loop @@ -75,10 +75,10 @@ void example3(void) { i++; } - assert(a[0] == 2); // FAIL - assert(a[41] == 0); // UNKNOWN - assert(a[41] == 1); // UNKNOWN - assert(a[41] == -1); // FAIL + __goblint_check(a[0] == 2); // FAIL + __goblint_check(a[41] == 0); // UNKNOWN + __goblint_check(a[41] == 1); // UNKNOWN + __goblint_check(a[41] == -1); // FAIL } // Example where initialization proceeds backwards @@ -91,10 +91,10 @@ void example4(void) { i--; } - assert(a[i+2] == 0); - assert(a[41] == 0); - assert(a[i] == 0); //UNKNOWN - assert(a[0] == 0); //UNKNOWN + __goblint_check(a[i+2] == 0); + __goblint_check(a[41] == 0); + __goblint_check(a[i] == 0); //UNKNOWN + __goblint_check(a[0] == 0); //UNKNOWN } // Example having two arrays partitioned according to one expression @@ -107,15 +107,15 @@ void example5(void) { a[i] = 2; b[41-i] = 0; - assert(b[7] == 0); //UNKNOWN - assert(a[5] == 2); //UNKNOWN + __goblint_check(b[7] == 0); //UNKNOWN + __goblint_check(a[5] == 2); //UNKNOWN i++; } - assert(a[0] == 2); - assert(a[41] == 2); - assert(b[0] == 0); - assert(b[41] == 0); + __goblint_check(a[0] == 2); + __goblint_check(a[41] == 2); + __goblint_check(b[0] == 0); + __goblint_check(b[41] == 0); } // Example showing array becoming partitioned according to different expressions @@ -130,22 +130,22 @@ void example6(void) { i++; } - assert(a[17] == 4); - assert(a[9] == 4); - assert(a[3] == 4); - assert(a[i-1] == 4); + __goblint_check(a[17] == 4); + __goblint_check(a[9] == 4); + __goblint_check(a[3] == 4); + __goblint_check(a[i-1] == 4); while(j<10) { a[j] = -1; j++; } - assert(a[3] == -1); - assert(a[0] == -1); - assert(a[j-1] == -1); - assert(a[j] == 4); - assert(a[17] == 4); - assert(a[j+5] == 4); + __goblint_check(a[3] == -1); + __goblint_check(a[0] == -1); + __goblint_check(a[j-1] == -1); + __goblint_check(a[j] == 4); + __goblint_check(a[17] == 4); + __goblint_check(a[j+5] == 4); } // This was the case where we thought we needed path-splitting @@ -157,15 +157,15 @@ void example7(void) { if(top) { while(i < 41) { a[i] = 0; - assert(a[i] == 0); + __goblint_check(a[i] == 0); i++; } } - assert(a[0] == 0); // UNKNOWN - assert(a[7] == 0); // UNKNOWN - assert(a[41] == 0); // UNKNOWN - assert(a[top] == 0); // UNKNOWN + __goblint_check(a[0] == 0); // UNKNOWN + __goblint_check(a[7] == 0); // UNKNOWN + __goblint_check(a[41] == 0); // UNKNOWN + __goblint_check(a[top] == 0); // UNKNOWN } // Check that the global variable is not used for partitioning @@ -173,15 +173,15 @@ void example8() { int a[10]; a[global] = 4; - assert(a[global] == 4); // UNKNOWN + __goblint_check(a[global] == 4); // UNKNOWN for(int i=0; i <5; i++) { a[i] = 42; } - assert(a[0] == 42); - assert(a[1] == 42); - assert(a[2] == 42); - assert(a[3] == 42); - assert(a[global] == 42); + __goblint_check(a[0] == 42); + __goblint_check(a[1] == 42); + __goblint_check(a[2] == 42); + __goblint_check(a[3] == 42); + __goblint_check(a[global] == 42); } diff --git a/tests/regression/42-annotated-precision/16-23_02-pointers_array.c b/tests/regression/42-annotated-precision/16-23_02-pointers_array.c index ac6d541f81..422c5a9ddb 100644 --- a/tests/regression/42-annotated-precision/16-23_02-pointers_array.c +++ b/tests/regression/42-annotated-precision/16-23_02-pointers_array.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint #include int main(void) __attribute__((goblint_precision("no-interval"))); @@ -32,12 +32,12 @@ void example1(void) { *ptr = 42; ptr++; - assert(a[0] == 42); - assert(a[1] == 42); // UNKNOWN + __goblint_check(a[0] == 42); + __goblint_check(a[1] == 42); // UNKNOWN *ptr = 42; - assert(a[0] == 42); - assert(a[1] == 42); + __goblint_check(a[0] == 42); + __goblint_check(a[1] == 42); ptr++; *ptr = 42; @@ -51,13 +51,13 @@ void example1(void) { int i = 5; - assert(a[i] == 42); + __goblint_check(a[i] == 42); if(top) { i++; } - assert(a[i] == 42); // UNKNOWN + __goblint_check(a[i] == 42); // UNKNOWN } // Tests correct handling when pointers may point to several different things @@ -71,19 +71,19 @@ void example2() { ptr = &array1; *ptr = 5; - assert(*ptr == 5); + __goblint_check(*ptr == 5); } else { ptr = &array2; *ptr = 5; - assert(*ptr == 5); + __goblint_check(*ptr == 5); } // Since ptr could point to different arrays, the update here can not be precise *ptr = 6; - assert(*ptr == 6); // UNKNOWN + __goblint_check(*ptr == 6); // UNKNOWN } void example3(void) { @@ -92,7 +92,7 @@ void example3(void) { for(int i =0; i <5; i++) { *ptr = 42; - assert(*ptr == 42); + __goblint_check(*ptr == 42); ptr++; } } @@ -104,7 +104,7 @@ void example4(void) { while(ptr <= end) { *ptr = 42; - assert(*ptr == 42); + __goblint_check(*ptr == 42); ptr++; } @@ -121,11 +121,11 @@ void example5(void) { ptr--; *ptr = 40; - assert(*ptr == 40); - assert(array1[4] == 42); - assert(array1[3] == 42); - assert(array1[2] == 40); - assert(array1[0] == 42); // UNKNOWN + __goblint_check(*ptr == 40); + __goblint_check(array1[4] == 42); + __goblint_check(array1[3] == 42); + __goblint_check(array1[2] == 40); + __goblint_check(array1[0] == 42); // UNKNOWN } void example6(void) { @@ -134,7 +134,7 @@ void example6(void) { *ptr = 5; int v = *ptr; - assert(v == 5); + __goblint_check(v == 5); ptr++; *ptr = 6; @@ -143,15 +143,15 @@ void example6(void) { // This is necessary for the tests that we are doing later int k = ptr-&array1; - assert(k == 2); + __goblint_check(k == 2); int m = ptr-array1; - assert(m == 2); + __goblint_check(m == 2); int* np = &array1; np++; np++; int x = *np; - assert(x==7); + __goblint_check(x==7); } void example7(void) { @@ -186,8 +186,8 @@ void example7(void) { // arr1 -> (-, [4,9]) // arr2 -> (-, [4,9]) int x = arr1[7]; - assert(x == 3); // FAIL - assert(x == 4); // UNKNOWN - assert(x == 9); // UNKNOWN - assert(x == 10); // FAIL + __goblint_check(x == 3); // FAIL + __goblint_check(x == 4); // UNKNOWN + __goblint_check(x == 9); // UNKNOWN + __goblint_check(x == 10); // FAIL } diff --git a/tests/regression/42-annotated-precision/17-23_03-multidimensional_arrays.c b/tests/regression/42-annotated-precision/17-23_03-multidimensional_arrays.c index 2597b8dd56..f05a538263 100644 --- a/tests/regression/42-annotated-precision/17-23_03-multidimensional_arrays.c +++ b/tests/regression/42-annotated-precision/17-23_03-multidimensional_arrays.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint +// PARAM: --set solver td3 --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint #include int main(void) { @@ -26,19 +26,19 @@ void example1(void) { j++; } - assert(a[i][0] == 42); - assert(a[i][9] == 42); - assert(a[3][9] == 42); // UNKNOWN + __goblint_check(a[i][0] == 42); + __goblint_check(a[i][9] == 42); + __goblint_check(a[3][9] == 42); // UNKNOWN i++; } - assert(a[0][0] == 42); - assert(a[2][5] == 42); - assert(a[8][9] == 42); - assert(a[3][7] == 42); - assert(a[9][9] == 42); // UNKNOWN - assert(a[9][2] == 42); // UNKNOWN + __goblint_check(a[0][0] == 42); + __goblint_check(a[2][5] == 42); + __goblint_check(a[8][9] == 42); + __goblint_check(a[3][7] == 42); + __goblint_check(a[9][9] == 42); // UNKNOWN + __goblint_check(a[9][2] == 42); // UNKNOWN } // Combines backwards- and forwards-iteration @@ -51,17 +51,17 @@ void example2(void) { while(j < 10) { array[i][j] = 4711; - assert(array[i-1][j+1] == 4711); //UNKNOWN + __goblint_check(array[i-1][j+1] == 4711); //UNKNOWN j++; } i--; } - assert(array[2][3] == 4711); - assert(array[0][9] == 4711); - assert(array[8][5] == 4711); - assert(array[2][1] == 4711); - assert(array[0][0] == 4711); - assert(array[7][5] == 4711); + __goblint_check(array[2][3] == 4711); + __goblint_check(array[0][9] == 4711); + __goblint_check(array[8][5] == 4711); + __goblint_check(array[2][1] == 4711); + __goblint_check(array[0][0] == 4711); + __goblint_check(array[7][5] == 4711); } diff --git a/tests/regression/42-annotated-precision/18-23_04-nesting_arrays.c b/tests/regression/42-annotated-precision/18-23_04-nesting_arrays.c index 88ba4e7c2d..30e634b5f7 100644 --- a/tests/regression/42-annotated-precision/18-23_04-nesting_arrays.c +++ b/tests/regression/42-annotated-precision/18-23_04-nesting_arrays.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint +// PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint #include struct kala { @@ -57,23 +57,23 @@ void example1() { i++; // Check assertion that should only hold later does not already hold here - assert(l.a[4] == 42); //UNKNOWN + __goblint_check(l.a[4] == 42); //UNKNOWN } // Check the array is correctly initialized - assert(l.a[1] == 42); - assert(l.a[2] == 42); - assert(l.a[3] == 42); - assert(l.a[4] == 42); + __goblint_check(l.a[1] == 42); + __goblint_check(l.a[2] == 42); + __goblint_check(l.a[3] == 42); + __goblint_check(l.a[4] == 42); // Destructively assign to i i = top; // Check the array is still known to be completely initialized - assert(l.a[1] == 42); - assert(l.a[2] == 42); - assert(l.a[3] == 42); - assert(l.a[4] == 42); + __goblint_check(l.a[1] == 42); + __goblint_check(l.a[2] == 42); + __goblint_check(l.a[3] == 42); + __goblint_check(l.a[4] == 42); } void example2() { @@ -91,8 +91,8 @@ void example2() { } // Initialization has not proceeded this far - assert(kalas[4].a[0] == 8); //UNKNOWN - assert(kalas[0].a[0] == 8); + __goblint_check(kalas[4].a[0] == 8); //UNKNOWN + __goblint_check(kalas[0].a[0] == 8); } void example3() { @@ -101,7 +101,7 @@ void example3() { xnn.a[l] = 42; } - assert(xnn.a[3] == 42); + __goblint_check(xnn.a[3] == 42); } void example4() { @@ -116,7 +116,7 @@ void example4() { } } - assert(xs[3].a[0] == 7); + __goblint_check(xs[3].a[0] == 7); } void example5() { @@ -134,10 +134,10 @@ void example5() { i3++; } - assert(ua.a[i3 - 1] == 42); + __goblint_check(ua.a[i3 - 1] == 42); ua.b[0] = 3; - assert(ua.b[0] == 3); + __goblint_check(ua.b[0] == 3); // ------------------------------- union uStruct us; @@ -145,17 +145,17 @@ void example5() { us.b = 4; us.k.a[i4] = 0; - assert(us.b == 4); // UNKNOWN - assert(us.k.a[0] == 0); - assert(us.k.a[3] == 0); // UNKNOWN + __goblint_check(us.b == 4); // UNKNOWN + __goblint_check(us.k.a[0] == 0); + __goblint_check(us.k.a[3] == 0); // UNKNOWN while (i4 < 5) { us.k.a[i4] = 42; i4++; } - assert(us.k.a[1] == 42); - assert(us.k.a[0] == 0); // FAIL + __goblint_check(us.k.a[1] == 42); + __goblint_check(us.k.a[0] == 0); // FAIL } void example6() { @@ -175,7 +175,7 @@ void example6() { a[k.v] = 2; k.v = k.v+1; - assert(a[k.v] != 3); + __goblint_check(a[k.v] != 3); } void example7() { @@ -207,5 +207,5 @@ void example8() { a[ua.a[*ip]] = 42; ip++; - assert(a[ua.a[*ip]] == 42); //UNKNOWN + __goblint_check(a[ua.a[*ip]] == 42); //UNKNOWN } diff --git a/tests/regression/42-annotated-precision/19-23_06-interprocedural.c b/tests/regression/42-annotated-precision/19-23_06-interprocedural.c index 66b0e031c1..ada456fb80 100644 --- a/tests/regression/42-annotated-precision/19-23_06-interprocedural.c +++ b/tests/regression/42-annotated-precision/19-23_06-interprocedural.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint +// PARAM: --set solver td3 --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint #include void example1() __attribute__((goblint_precision("no-def_exc","interval"))); @@ -17,15 +17,15 @@ void example1() { init_array(a, 42); - assert(a[2] == 42); - assert(a[10] == 42); + __goblint_check(a[2] == 42); + __goblint_check(a[10] == 42); do_first(a); - assert(a[0] == 3); + __goblint_check(a[0] == 3); init_array(b,12); - assert(b[2] == 12); - assert(b[10] == 12); + __goblint_check(b[2] == 12); + __goblint_check(b[10] == 12); } void do_first(int* arr) { @@ -39,8 +39,8 @@ void init_array(int* arr, int val) { } arr[0] = val; - assert(arr[2] == val); - assert(arr[10] == val); + __goblint_check(arr[2] == val); + __goblint_check(arr[10] == val); } // ----------------------------------- Example 2 ------------------------------------------------------------------------------ @@ -51,24 +51,24 @@ void example2(void) { for(int i = 0; i < 20; i++) { arr[i] = 42; - assert(arr[i] == 42); + __goblint_check(arr[i] == 42); callee(arr); } - assert(arr[0] == 100); //UNKNOWN - assert(arr[0] == 7); //UNKNOWN - assert(arr[0] == 42); //UNKNOWN + __goblint_check(arr[0] == 100); //UNKNOWN + __goblint_check(arr[0] == 7); //UNKNOWN + __goblint_check(arr[0] == 42); //UNKNOWN - assert(arr[7] == 100); //UNKNOWN - assert(arr[7] == 7); //UNKNOWN - assert(arr[7] == 42); //UNKNOWN + __goblint_check(arr[7] == 100); //UNKNOWN + __goblint_check(arr[7] == 7); //UNKNOWN + __goblint_check(arr[7] == 42); //UNKNOWN - assert(arr[20] == 100); //UNKNOWN - assert(arr[20] == 7); //UNKNOWN - assert(arr[20] == 42); //UNKNOWN + __goblint_check(arr[20] == 100); //UNKNOWN + __goblint_check(arr[20] == 7); //UNKNOWN + __goblint_check(arr[20] == 42); //UNKNOWN } void callee(int* arr) { arr[0] = 7; - assert(arr[0] == 7); + __goblint_check(arr[0] == 7); } diff --git a/tests/regression/42-annotated-precision/21-23_14-replace_with_const.c b/tests/regression/42-annotated-precision/21-23_14-replace_with_const.c index 907881cd87..0467f8cd5b 100644 --- a/tests/regression/42-annotated-precision/21-23_14-replace_with_const.c +++ b/tests/regression/42-annotated-precision/21-23_14-replace_with_const.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --enable ana.base.partition-arrays.partition-by-const-on-return --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint +// PARAM: --set solver td3 --set ana.base.arrays.domain partitioned --set ana.base.partition-arrays.keep-expr "last" --enable ana.base.partition-arrays.partition-by-const-on-return --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none --enable annotation.int.enabled --set ana.int.refinement fixpoint #include void example1() __attribute__((goblint_precision("no-def_exc","interval"))); @@ -15,15 +15,15 @@ void example1() { init_array(a, 42); - assert(a[2] == 42); - assert(a[10] == 42); + __goblint_check(a[2] == 42); + __goblint_check(a[10] == 42); do_first(a); - assert(a[0] == 3); + __goblint_check(a[0] == 3); init_array(b,12); - assert(b[2] == 12); - assert(b[10] == 12); + __goblint_check(b[2] == 12); + __goblint_check(b[10] == 12); } void do_first(int* arr) { @@ -36,6 +36,6 @@ void init_array(int* arr, int val) { arr[i] = val; } - assert(arr[2] == val); - assert(arr[10] == val); + __goblint_check(arr[2] == val); + __goblint_check(arr[10] == val); } diff --git a/tests/regression/42-annotated-precision/24-30_02-off.c b/tests/regression/42-annotated-precision/24-30_02-off.c index 6519f6c5b1..6be9fae98f 100644 --- a/tests/regression/42-annotated-precision/24-30_02-off.c +++ b/tests/regression/42-annotated-precision/24-30_02-off.c @@ -1,4 +1,4 @@ -// PARAM: --set solver td3 --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper']" --set ana.base.privatization none --disable exp.fast_global_inits --enable annotation.int.enabled --set ana.int.refinement fixpoint +// PARAM: --set solver td3 --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','escape','expRelation','mallocWrapper','assert']" --set ana.base.privatization none --disable exp.fast_global_inits --enable annotation.int.enabled --set ana.int.refinement fixpoint // This checks that partitioned arrays and fast_global_inits are no longer incompatible #include @@ -9,7 +9,7 @@ int main(void) __attribute__((goblint_precision("no-def_exc","interval"))); int main(void) { for(int i =0; i < 50; i++) { - assert(global_array[i] == 0); - assert(global_array_multi[i][1][1] == 0); + __goblint_check(global_array[i] == 0); + __goblint_check(global_array_multi[i][1][1] == 0); } } diff --git a/tests/regression/42-annotated-precision/25-34_01-nested.c b/tests/regression/42-annotated-precision/25-34_01-nested.c index 8fc32ba4f7..8e47b1edbb 100644 --- a/tests/regression/42-annotated-precision/25-34_01-nested.c +++ b/tests/regression/42-annotated-precision/25-34_01-nested.c @@ -14,5 +14,5 @@ void main() for (int j = 0; j < 10 ; j++) ; } - assert(i == 10); + __goblint_check(i == 10); } diff --git a/tests/regression/42-annotated-precision/26-34_02-hybrid.c b/tests/regression/42-annotated-precision/26-34_02-hybrid.c index e3bd714ba5..e29b8a1dd4 100644 --- a/tests/regression/42-annotated-precision/26-34_02-hybrid.c +++ b/tests/regression/42-annotated-precision/26-34_02-hybrid.c @@ -12,8 +12,8 @@ void main() while (1) { i++; for (int j=0; j < 10; j++) { - assert(0 <= i); // UNKNOWN - assert(i <= 10); + __goblint_check(0 <= i); // UNKNOWN + __goblint_check(i <= 10); } if (i>9) i=0; } diff --git a/tests/regression/42-annotated-precision/27-01_03-loops.c b/tests/regression/42-annotated-precision/27-01_03-loops.c index f5c9296a13..35aaf2afb3 100644 --- a/tests/regression/42-annotated-precision/27-01_03-loops.c +++ b/tests/regression/42-annotated-precision/27-01_03-loops.c @@ -12,9 +12,9 @@ int main () { j = 7; k = 5; } - assert(i == 10); //UNKNOWN - assert(k); //UNKNOWN + __goblint_check(i == 10); //UNKNOWN + __goblint_check(k); //UNKNOWN // k is currenlty 0 \sqcup 5, if we unfolded the loops it would be 5 - assert(j==7); + __goblint_check(j==7); return 0; } diff --git a/tests/regression/42-annotated-precision/28-02_36-calloc_struct.c b/tests/regression/42-annotated-precision/28-02_36-calloc_struct.c index 5be981f932..76c52fa75b 100644 --- a/tests/regression/42-annotated-precision/28-02_36-calloc_struct.c +++ b/tests/regression/42-annotated-precision/28-02_36-calloc_struct.c @@ -19,26 +19,26 @@ int main(void) { data e = {.x = 0, .y = 0}; - assert(d->x == e.x); - assert(d->y == e.y); + __goblint_check(d->x == e.x); + __goblint_check(d->y == e.y); int a = d -> x; int b = d -> y; - assert(a != 3); - assert(b != 4); + __goblint_check(a != 3); + __goblint_check(b != 4); d -> x = 3; d -> y = 4; data f = {.x = 3, .y = 3}; - assert(d->x == f.x); //UNKNOWN - assert(d->y == f.y); //UNKNOWN + __goblint_check(d->x == f.x); //UNKNOWN + __goblint_check(d->y == f.y); //UNKNOWN a = d -> x; b = d -> y; - assert(a == 3); //UNKNOWN - assert(b == 4); //UNKNOWN + __goblint_check(a == 3); //UNKNOWN + __goblint_check(b == 4); //UNKNOWN } diff --git a/tests/regression/42-annotated-precision/30-31_12-log-bitwise-enums.c b/tests/regression/42-annotated-precision/30-31_12-log-bitwise-enums.c index 1eab4ddc53..10e935c493 100644 --- a/tests/regression/42-annotated-precision/30-31_12-log-bitwise-enums.c +++ b/tests/regression/42-annotated-precision/30-31_12-log-bitwise-enums.c @@ -13,40 +13,40 @@ int main() { int z; // logical and - assert((x && y) == 1); + __goblint_check((x && y) == 1); z = x & y; // bitwise and - assert(z == 2); + __goblint_check(z == 2); // logical or - assert((x || y) == 1); + __goblint_check((x || y) == 1); - assert((x || 1) == 1); + __goblint_check((x || 1) == 1); z = x | y; // bitwise or - assert(z == 3); + __goblint_check(z == 3); z = x ^ y; // bitwise xor - assert(z == 1); + __goblint_check(z == 1); // logical negation - assert(!x == 0); + __goblint_check(!x == 0); z = !n; - assert(z == 1); + __goblint_check(z == 1); z = ~x; // bitwise negation - assert(z == -3); + __goblint_check(z == -3); z = x << y; // shift left - assert(z == 16); //UNKNOWN + __goblint_check(z == 16); //UNKNOWN z = m >> x; // shift right - assert(z == 6); //UNKNOWN + __goblint_check(z == 6); //UNKNOWN int one = 1; z = one / 10; - assert(z == 0); + __goblint_check(z == 0); return 0; } diff --git a/tests/regression/42-annotated-precision/31-37_04-branching.c b/tests/regression/42-annotated-precision/31-37_04-branching.c index b0a6a8aa5c..ae6dcfdb12 100644 --- a/tests/regression/42-annotated-precision/31-37_04-branching.c +++ b/tests/regression/42-annotated-precision/31-37_04-branching.c @@ -7,16 +7,16 @@ int main() { // A refinement of a congruence class should only take place for the == and != operator. int i; if (i==0){ - assert(i==0); + __goblint_check(i==0); } else { - assert(i!=0); //UNKNOWN + __goblint_check(i!=0); //UNKNOWN } int k; if (k > 0) { - assert (k > 0); //UNKNOWN + __goblint_check(k > 0); //UNKNOWN } else { - assert (k <= 0); //UNKNOWN + __goblint_check(k <= 0); //UNKNOWN } return 0; diff --git a/tests/regression/42-annotated-precision/32-01_03-loops_i.c b/tests/regression/42-annotated-precision/32-01_03-loops_i.c index c1209b24cb..011535a652 100644 --- a/tests/regression/42-annotated-precision/32-01_03-loops_i.c +++ b/tests/regression/42-annotated-precision/32-01_03-loops_i.c @@ -12,9 +12,9 @@ int main () { j = 7; k = 5; } - assert(i == 10); - assert(k); //UNKNOWN + __goblint_check(i == 10); + __goblint_check(k); //UNKNOWN // k is currenlty 0 \sqcup 5, if we unfolded the loops it would be 5 - assert(j==7); + __goblint_check(j==7); return 0; } diff --git a/tests/regression/42-annotated-precision/33-02_36-calloc_struct_i.c b/tests/regression/42-annotated-precision/33-02_36-calloc_struct_i.c index 02a05c84ce..46969ca160 100644 --- a/tests/regression/42-annotated-precision/33-02_36-calloc_struct_i.c +++ b/tests/regression/42-annotated-precision/33-02_36-calloc_struct_i.c @@ -18,26 +18,26 @@ int main(void) { data e = {.x = 0, .y = 0}; - assert(d->x == e.x); - assert(d->y == e.y); + __goblint_check(d->x == e.x); + __goblint_check(d->y == e.y); int a = d -> x; int b = d -> y; - assert(a != 3); - assert(b != 4); + __goblint_check(a != 3); + __goblint_check(b != 4); d -> x = 3; d -> y = 4; data f = {.x = 3, .y = 3}; - assert(d->x == f.x); //UNKNOWN - assert(d->y == f.y); //FAIL! + __goblint_check(d->x == f.x); //UNKNOWN + __goblint_check(d->y == f.y); //FAIL! a = d -> x; b = d -> y; - assert(a == 3); //UNKNOWN - assert(b == 4); //UNKNOWN + __goblint_check(a == 3); //UNKNOWN + __goblint_check(b == 4); //UNKNOWN } diff --git a/tests/regression/42-annotated-precision/35-31_12-log-bitwise-enums_i.c b/tests/regression/42-annotated-precision/35-31_12-log-bitwise-enums_i.c index b1737c0895..a09e178343 100644 --- a/tests/regression/42-annotated-precision/35-31_12-log-bitwise-enums_i.c +++ b/tests/regression/42-annotated-precision/35-31_12-log-bitwise-enums_i.c @@ -12,40 +12,40 @@ int main() { int z; // logical and - assert((x && y) == 1); + __goblint_check((x && y) == 1); z = x & y; // bitwise and - assert(z == 2); + __goblint_check(z == 2); // logical or - assert((x || y) == 1); + __goblint_check((x || y) == 1); - assert((x || 1) == 1); + __goblint_check((x || 1) == 1); z = x | y; // bitwise or - assert(z == 3); + __goblint_check(z == 3); z = x ^ y; // bitwise xor - assert(z == 1); + __goblint_check(z == 1); // logical negation - assert(!x == 0); + __goblint_check(!x == 0); z = !n; - assert(z == 1); + __goblint_check(z == 1); z = ~x; // bitwise negation - assert(z == -3); + __goblint_check(z == -3); z = x << y; // shift left - assert(z == 16); + __goblint_check(z == 16); z = m >> x; // shift right - assert(z == 6); + __goblint_check(z == 6); int one = 1; z = one / 10; - assert(z == 0); + __goblint_check(z == 0); return 0; } diff --git a/tests/regression/42-annotated-precision/36-37_04-branching_i.c b/tests/regression/42-annotated-precision/36-37_04-branching_i.c index a5244b3be7..657ba72d6d 100644 --- a/tests/regression/42-annotated-precision/36-37_04-branching_i.c +++ b/tests/regression/42-annotated-precision/36-37_04-branching_i.c @@ -7,16 +7,16 @@ int main() { // A refinement of a congruence class should only take place for the == and != operator. int i; if (i==0){ - assert(i==0); + __goblint_check(i==0); } else { - assert(i!=0); //UNKNOWN + __goblint_check(i!=0); //UNKNOWN } int k; if (k > 0) { - assert (k > 0); + __goblint_check(k > 0); } else { - assert (k <= 0); + __goblint_check(k <= 0); } return 0; diff --git a/tests/regression/42-annotated-precision/37-def_exc-via-option.c b/tests/regression/42-annotated-precision/37-def_exc-via-option.c index 99b75f6978..e5399846f0 100644 --- a/tests/regression/42-annotated-precision/37-def_exc-via-option.c +++ b/tests/regression/42-annotated-precision/37-def_exc-via-option.c @@ -8,8 +8,8 @@ int f(int in) { int main() { int a = 0; - assert(a); // FAIL! + __goblint_check(a); // FAIL! a = f(a); - assert(a); + __goblint_check(a); return 0; } diff --git a/tests/regression/43-struct-domain/01-single-thread.c b/tests/regression/43-struct-domain/01-single-thread.c index b783fea0f4..04c97fb134 100644 --- a/tests/regression/43-struct-domain/01-single-thread.c +++ b/tests/regression/43-struct-domain/01-single-thread.c @@ -60,18 +60,18 @@ int main() { if (functionToRun.id == 1) { // if (strcmp(functionToRun.name, "factorial") == 0) { fun f = functionToRun.ptr; - assert(f == factorial); + __goblint_check(f == factorial); int result = f(n); printf("Factorial of %d is %d\n", n, result); } else if (functionToRun.id == 2) { // } else if (strcmp(functionToRun.name, "inverse factorial") == 0) { fun f = functionToRun.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); int result = f(n); printf("Factorial of %d is %d\n", result, n); } else { fun f = functionToRun.ptr; - assert((void*)f == exit); + __goblint_check((void*)f == exit); printf("Exiting with code %d...\n", n); int result = f(n); } diff --git a/tests/regression/43-struct-domain/02-multi-thread.c b/tests/regression/43-struct-domain/02-multi-thread.c index 2192af46aa..01f7a8d10f 100644 --- a/tests/regression/43-struct-domain/02-multi-thread.c +++ b/tests/regression/43-struct-domain/02-multi-thread.c @@ -67,18 +67,18 @@ void *runCode(void *arguments) { if (functionToRun.id == 1) { // if (strcmp(functionToRun.name, "factorial") == 0) { fun f = functionToRun.ptr; - assert(f == factorial); // UNKNOWN! + __goblint_check(f == factorial); // UNKNOWN! int result = f(n); printf("Factorial of %d is %d\n", n, result); } else if (functionToRun.id == 2) { // } else if (strcmp(functionToRun.name, "inverse factorial") == 0) { fun f = functionToRun.ptr; - assert(f == inverseFactorial); // UNKNOWN! + __goblint_check(f == inverseFactorial); // UNKNOWN! int result = f(n); printf("Factorial of %d is %d\n", result, n); } else { fun f = functionToRun.ptr; - assert((void*)f == exit); // UNKNOWN! + __goblint_check((void*)f == exit); // UNKNOWN! printf("Exiting with code %d...\n", n); int result = f(n); } diff --git a/tests/regression/43-struct-domain/03-multi-thread-mutex.c b/tests/regression/43-struct-domain/03-multi-thread-mutex.c index 638bd3d723..bbaf5de006 100644 --- a/tests/regression/43-struct-domain/03-multi-thread-mutex.c +++ b/tests/regression/43-struct-domain/03-multi-thread-mutex.c @@ -68,18 +68,18 @@ void *runCode(void *arguments) { if (functionToRun.id == 1) { // if (strcmp(functionToRun.name, "factorial") == 0) { fun f = functionToRun.ptr; - assert(f == factorial); + __goblint_check(f == factorial); int result = f(n); printf("Factorial of %d is %d\n", n, result); } else if (functionToRun.id == 2) { // } else if (strcmp(functionToRun.name, "inverse factorial") == 0) { fun f = functionToRun.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); int result = f(n); printf("Factorial of %d is %d\n", result, n); } else { fun f = functionToRun.ptr; - assert((void*)f == exit); + __goblint_check((void*)f == exit); printf("Exiting with code %d...\n", n); int result = f(n); } diff --git a/tests/regression/43-struct-domain/04-small.c b/tests/regression/43-struct-domain/04-small.c index a814701b99..50c27a4164 100644 --- a/tests/regression/43-struct-domain/04-small.c +++ b/tests/regression/43-struct-domain/04-small.c @@ -49,13 +49,13 @@ int main() { typedef int (*fun)(int); if (functionToRun.id == 1) { fun f = functionToRun.ptr; - assert(f == factorial); + __goblint_check(f == factorial); int result = f(n); printf("Factorial of %d is %d\n", n, result); dead = 0; } else if (functionToRun.id == 2) { fun f = functionToRun.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); int result = f(n); printf("Factorial of %d is %d\n", result, n); dead = 0; @@ -65,7 +65,7 @@ int main() { int result = f(n); } - assert(dead != 1); + __goblint_check(dead != 1); return 0; } diff --git a/tests/regression/43-struct-domain/05-single-thread-widening.c b/tests/regression/43-struct-domain/05-single-thread-widening.c index 146813f058..06b971dfe9 100644 --- a/tests/regression/43-struct-domain/05-single-thread-widening.c +++ b/tests/regression/43-struct-domain/05-single-thread-widening.c @@ -65,19 +65,19 @@ int main() { typedef int (*fun)(int); if (functionToRun.id == 1) { fun f = functionToRun.ptr; - assert(f == factorial || (void*)f == exit); - assert((void*)f == exit); // TODO + __goblint_check(f == factorial || (void*)f == exit); + __goblint_check((void*)f == exit); // TODO int result = f(n); printf("Factorial of %d is %d\n", n, result); } else if (functionToRun.id == 2) { fun f = functionToRun.ptr; - assert(f == inverseFactorial || (void*)f == exit); - assert((void*)f == exit); // TODO + __goblint_check(f == inverseFactorial || (void*)f == exit); + __goblint_check((void*)f == exit); // TODO int result = f(n); printf("Factorial of %d is %d\n", result, n); } else { fun f = functionToRun.ptr; - assert((void*)f == exit); + __goblint_check((void*)f == exit); printf("Exiting with code %d...\n", n); int result = f(n); } diff --git a/tests/regression/43-struct-domain/06-many-choices.c b/tests/regression/43-struct-domain/06-many-choices.c index da68bb102b..c0cf841d38 100644 --- a/tests/regression/43-struct-domain/06-many-choices.c +++ b/tests/regression/43-struct-domain/06-many-choices.c @@ -115,12 +115,12 @@ int main() { typedef int (*fun)(int); if (functionToRun.id == 1) { fun f = functionToRun.ptr; - assert(f == factorial); + __goblint_check(f == factorial); int result = f(n); printf("Factorial of %d is %d\n", n, result); } else if (functionToRun.id == 2) { fun f = functionToRun.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); int result = f(n); printf("Factorial of %d is %d\n", result, n); } else { diff --git a/tests/regression/43-struct-domain/07-check-sets.c b/tests/regression/43-struct-domain/07-check-sets.c index 99cea7ef28..3da4ed82e6 100644 --- a/tests/regression/43-struct-domain/07-check-sets.c +++ b/tests/regression/43-struct-domain/07-check-sets.c @@ -115,17 +115,17 @@ int main() { typedef int (*fun)(int); if (functionToRun.id == 1) { fun f = functionToRun.ptr; - assert(f == factorial); + __goblint_check(f == factorial); int result = f(n); printf("Factorial of %d is %d\n", n, result); } else if (functionToRun.id == 2) { fun f = functionToRun.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); int result = f(n); printf("Factorial of %d is %d\n", result, n); } else { fun f = functionToRun.ptr; - assert((void*)f == exit); + __goblint_check((void*)f == exit); printf("Exiting with code %d...\n", n); int result = f(n); } diff --git a/tests/regression/43-struct-domain/08-nested-structs.c b/tests/regression/43-struct-domain/08-nested-structs.c index 76c1687528..45c918da90 100644 --- a/tests/regression/43-struct-domain/08-nested-structs.c +++ b/tests/regression/43-struct-domain/08-nested-structs.c @@ -80,13 +80,13 @@ int example1() { typedef int (*fun)(int); // if (task.f.id == 1) { // fun f = task.f.ptr; - // assert(f == factorial); + // __goblint_check(f == factorial); // if (task.taskId == 0) { - // assert(task.arg == 3); + // __goblint_check(task.arg == 3); // } else if (task.taskId == 1) { - // assert(task.arg == 5); + // __goblint_check(task.arg == 5); // } else if (task.taskId == 2) { - // assert(task.arg == 10); + // __goblint_check(task.arg == 10); // } // int result = f(task.arg); // printf("Factorial of %d is %d\n", task.arg, result); @@ -94,25 +94,25 @@ int example1() { if (task.f.id == 1) { fun f = task.f.ptr; - assert(f == factorial); + __goblint_check(f == factorial); if (task.taskId == 0) { - assert(task.arg == 3); + __goblint_check(task.arg == 3); } else if (task.taskId == 1) { - assert(task.arg == 5); + __goblint_check(task.arg == 5); } else if (task.taskId == 2) { - assert(task.arg == 10); + __goblint_check(task.arg == 10); } int result = f(task.arg); printf("Factorial of %d is %d\n", task.arg, result); } else if (task.f.id == 2) { fun f = task.f.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); if (task.taskId == 0) { - assert(task.arg == 6); + __goblint_check(task.arg == 6); } else if (task.taskId == 1) { - assert(task.arg == 120); + __goblint_check(task.arg == 120); } else if (task.taskId == 2) { - assert(task.arg == 3628800); + __goblint_check(task.arg == 3628800); } int result = f(task.arg); printf("Factorial of %d is %d\n", result, task.arg); @@ -177,25 +177,25 @@ int example2() { typedef int (*fun)(int); if (task.f.id == 1) { fun f = task.f.ptr; - assert(f == factorial); + __goblint_check(f == factorial); if (task.taskId == 0) { - assert(task.arg == 3); // UNKNOWN + __goblint_check(task.arg == 3); // UNKNOWN } else if (task.taskId == 1) { - assert(task.arg == 5); // UNKNOWN + __goblint_check(task.arg == 5); // UNKNOWN } else if (task.taskId == 2) { - assert(task.arg == 10); // UNKNOWN + __goblint_check(task.arg == 10); // UNKNOWN } int result = f(task.arg); printf("Factorial of %d is %d\n", task.arg, result); } else if (task.f.id == 2) { fun f = task.f.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); if (task.taskId == 0) { - assert(task.arg == 6); // UNKNOWN + __goblint_check(task.arg == 6); // UNKNOWN } else if (task.taskId == 1) { - assert(task.arg == 120); // UNKNOWN + __goblint_check(task.arg == 120); // UNKNOWN } else if (task.taskId == 2) { - assert(task.arg == 3628800); // UNKNOWN + __goblint_check(task.arg == 3628800); // UNKNOWN } int result = f(task.arg); printf("Factorial of %d is %d\n", result, task.arg); diff --git a/tests/regression/43-struct-domain/09-join-test.c b/tests/regression/43-struct-domain/09-join-test.c index 6c7b687ec3..6e95e5be97 100644 --- a/tests/regression/43-struct-domain/09-join-test.c +++ b/tests/regression/43-struct-domain/09-join-test.c @@ -60,12 +60,12 @@ int example1() { } if (functionToRun.id == 2) { - assert(functionToRun.ptr == f1 || functionToRun.ptr == f5); - assert(functionToRun.ptr != f3); + __goblint_check(functionToRun.ptr == f1 || functionToRun.ptr == f5); + __goblint_check(functionToRun.ptr != f3); } else if (functionToRun.id > 3 && functionToRun.id < 5) { - assert(functionToRun.ptr == f5 || functionToRun.ptr == f2 || functionToRun.ptr == f6); - assert(functionToRun.ptr != f3); - assert(functionToRun.ptr == f2 || functionToRun.ptr == f6); // TODO + __goblint_check(functionToRun.ptr == f5 || functionToRun.ptr == f2 || functionToRun.ptr == f6); + __goblint_check(functionToRun.ptr != f3); + __goblint_check(functionToRun.ptr == f2 || functionToRun.ptr == f6); // TODO } return 0; diff --git a/tests/regression/43-struct-domain/10-many-choices-intervals.c b/tests/regression/43-struct-domain/10-many-choices-intervals.c index 798205d027..2049c9a9ee 100644 --- a/tests/regression/43-struct-domain/10-many-choices-intervals.c +++ b/tests/regression/43-struct-domain/10-many-choices-intervals.c @@ -115,12 +115,12 @@ int main() { typedef int (*fun)(int); if (functionToRun.id == 1) { fun f = functionToRun.ptr; - assert(f == factorial); + __goblint_check(f == factorial); int result = f(n); printf("Factorial of %d is %d\n", n, result); } else if (functionToRun.id == 2) { fun f = functionToRun.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); int result = f(n); printf("Factorial of %d is %d\n", result, n); } else { diff --git a/tests/regression/43-struct-domain/11-normalize-top.c b/tests/regression/43-struct-domain/11-normalize-top.c index d23f30903b..a08d6de446 100644 --- a/tests/regression/43-struct-domain/11-normalize-top.c +++ b/tests/regression/43-struct-domain/11-normalize-top.c @@ -22,33 +22,33 @@ void example1() { // { first = top, second = top } and { first = 10, second = 20 } // Result should still be top since branch is not always taken! - assert(pair.first == 10); // UNKNOWN! - assert(pair.second == 20); // UNKNOWN! + __goblint_check(pair.first == 10); // UNKNOWN! + __goblint_check(pair.second == 20); // UNKNOWN! if (a > 10) { // The analysis currently cannot infer this, since a is not connected to struct - assert(pair.first == 10); // TODO - assert(pair.second == 20); // TODO + __goblint_check(pair.first == 10); // TODO + __goblint_check(pair.second == 20); // TODO } if (pair.first == 10) { - assert(pair.first == 10); // This is known from the if statement refine + __goblint_check(pair.first == 10); // This is known from the if statement refine // Since one variant is top, we still don't know what second is! - assert(pair.second == 20); // UNKNOWN! + __goblint_check(pair.second == 20); // UNKNOWN! } pair.first = a; pair.second = b; // Reset both to top, should be same state as before. - assert(pair.first == 10); // UNKNOWN! - assert(pair.second == 20); // UNKNOWN! + __goblint_check(pair.first == 10); // UNKNOWN! + __goblint_check(pair.second == 20); // UNKNOWN! pair.first = 10; pair.second = 20; // Set both to known state - should be working - assert(pair.first == 10); - assert(pair.second == 20); + __goblint_check(pair.first == 10); + __goblint_check(pair.second == 20); } diff --git a/tests/regression/43-struct-domain/13-intervals-branching-meet.c b/tests/regression/43-struct-domain/13-intervals-branching-meet.c index 683494da7e..605291da7f 100644 --- a/tests/regression/43-struct-domain/13-intervals-branching-meet.c +++ b/tests/regression/43-struct-domain/13-intervals-branching-meet.c @@ -25,13 +25,13 @@ void example1() { // This should be unreachable! b = 0; // This line is not dead if we --disable ana.base.structs.meet-condition } else if (pair.first == 10) { - assert(pair.second == 20); + __goblint_check(pair.second == 20); b = 1; } else if (pair.first == 20) { - assert(pair.second == 30); + __goblint_check(pair.second == 30); b = 1; } - assert(b == 1); + __goblint_check(b == 1); } diff --git a/tests/regression/43-struct-domain/14-single-thread-keyed.c b/tests/regression/43-struct-domain/14-single-thread-keyed.c index 99d667694e..ba377ded48 100644 --- a/tests/regression/43-struct-domain/14-single-thread-keyed.c +++ b/tests/regression/43-struct-domain/14-single-thread-keyed.c @@ -60,18 +60,18 @@ int main() { if (functionToRun.id == 1) { // if (strcmp(functionToRun.name, "factorial") == 0) { fun f = functionToRun.ptr; - assert(f == factorial); + __goblint_check(f == factorial); int result = f(n); printf("Factorial of %d is %d\n", n, result); } else if (functionToRun.id == 2) { // } else if (strcmp(functionToRun.name, "inverse factorial") == 0) { fun f = functionToRun.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); int result = f(n); printf("Factorial of %d is %d\n", result, n); } else { fun f = functionToRun.ptr; - assert((void*)f == exit); + __goblint_check((void*)f == exit); printf("Exiting with code %d...\n", n); int result = f(n); } diff --git a/tests/regression/43-struct-domain/15-multi-thread-keyed.c b/tests/regression/43-struct-domain/15-multi-thread-keyed.c index 8063f63e18..d484f5ed9c 100644 --- a/tests/regression/43-struct-domain/15-multi-thread-keyed.c +++ b/tests/regression/43-struct-domain/15-multi-thread-keyed.c @@ -67,18 +67,18 @@ void *runCode(void *arguments) { if (functionToRun.id == 1) { // if (strcmp(functionToRun.name, "factorial") == 0) { fun f = functionToRun.ptr; - assert(f == factorial); // UNKNOWN! + __goblint_check(f == factorial); // UNKNOWN! int result = f(n); printf("Factorial of %d is %d\n", n, result); } else if (functionToRun.id == 2) { // } else if (strcmp(functionToRun.name, "inverse factorial") == 0) { fun f = functionToRun.ptr; - assert(f == inverseFactorial); // UNKNOWN! + __goblint_check(f == inverseFactorial); // UNKNOWN! int result = f(n); printf("Factorial of %d is %d\n", result, n); } else { fun f = functionToRun.ptr; - assert((void*)f == exit); // UNKNOWN! + __goblint_check((void*)f == exit); // UNKNOWN! printf("Exiting with code %d...\n", n); int result = f(n); } diff --git a/tests/regression/43-struct-domain/16-multi-thread-mutex-keyed.c b/tests/regression/43-struct-domain/16-multi-thread-mutex-keyed.c index e34bae40e0..025be46ac2 100644 --- a/tests/regression/43-struct-domain/16-multi-thread-mutex-keyed.c +++ b/tests/regression/43-struct-domain/16-multi-thread-mutex-keyed.c @@ -68,18 +68,18 @@ void *runCode(void *arguments) { if (functionToRun.id == 1) { // if (strcmp(functionToRun.name, "factorial") == 0) { fun f = functionToRun.ptr; - assert(f == factorial); + __goblint_check(f == factorial); int result = f(n); printf("Factorial of %d is %d\n", n, result); } else if (functionToRun.id == 2) { // } else if (strcmp(functionToRun.name, "inverse factorial") == 0) { fun f = functionToRun.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); int result = f(n); printf("Factorial of %d is %d\n", result, n); } else { fun f = functionToRun.ptr; - assert((void*)f == exit); + __goblint_check((void*)f == exit); printf("Exiting with code %d...\n", n); int result = f(n); } diff --git a/tests/regression/43-struct-domain/17-small-keyed.c b/tests/regression/43-struct-domain/17-small-keyed.c index b15eb1d4f3..b4f768b7bd 100644 --- a/tests/regression/43-struct-domain/17-small-keyed.c +++ b/tests/regression/43-struct-domain/17-small-keyed.c @@ -49,13 +49,13 @@ int main() { typedef int (*fun)(int); if (functionToRun.id == 1) { fun f = functionToRun.ptr; - assert(f == factorial); + __goblint_check(f == factorial); int result = f(n); printf("Factorial of %d is %d\n", n, result); dead = 0; } else if (functionToRun.id == 2) { fun f = functionToRun.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); int result = f(n); printf("Factorial of %d is %d\n", result, n); dead = 0; @@ -65,7 +65,7 @@ int main() { int result = f(n); } - assert(dead != 1); + __goblint_check(dead != 1); return 0; } diff --git a/tests/regression/43-struct-domain/18-single-thread-widening-keyed.c b/tests/regression/43-struct-domain/18-single-thread-widening-keyed.c index 05f86ed221..f599db09fa 100644 --- a/tests/regression/43-struct-domain/18-single-thread-widening-keyed.c +++ b/tests/regression/43-struct-domain/18-single-thread-widening-keyed.c @@ -65,19 +65,19 @@ int main() { typedef int (*fun)(int); if (functionToRun.id == 1) { fun f = functionToRun.ptr; - assert(f == factorial || (void*)f == exit); - assert((void*)f == exit); // TODO + __goblint_check(f == factorial || (void*)f == exit); + __goblint_check((void*)f == exit); // TODO int result = f(n); printf("Factorial of %d is %d\n", n, result); } else if (functionToRun.id == 2) { fun f = functionToRun.ptr; - assert(f == inverseFactorial || (void*)f == exit); - assert((void*)f == exit); // TODO + __goblint_check(f == inverseFactorial || (void*)f == exit); + __goblint_check((void*)f == exit); // TODO int result = f(n); printf("Factorial of %d is %d\n", result, n); } else { fun f = functionToRun.ptr; - assert((void*)f == exit); + __goblint_check((void*)f == exit); printf("Exiting with code %d...\n", n); int result = f(n); } diff --git a/tests/regression/43-struct-domain/19-many-choices-keyed.c b/tests/regression/43-struct-domain/19-many-choices-keyed.c index e18ac1dd7f..16ff06649b 100644 --- a/tests/regression/43-struct-domain/19-many-choices-keyed.c +++ b/tests/regression/43-struct-domain/19-many-choices-keyed.c @@ -115,12 +115,12 @@ int main() { typedef int (*fun)(int); if (functionToRun.id == 1) { fun f = functionToRun.ptr; - assert(f == factorial); + __goblint_check(f == factorial); int result = f(n); printf("Factorial of %d is %d\n", n, result); } else if (functionToRun.id == 2) { fun f = functionToRun.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); int result = f(n); printf("Factorial of %d is %d\n", result, n); } else { diff --git a/tests/regression/43-struct-domain/20-check-sets-keyed.c b/tests/regression/43-struct-domain/20-check-sets-keyed.c index da89e0db29..f2718257f8 100644 --- a/tests/regression/43-struct-domain/20-check-sets-keyed.c +++ b/tests/regression/43-struct-domain/20-check-sets-keyed.c @@ -115,17 +115,17 @@ int main() { typedef int (*fun)(int); if (functionToRun.id == 1) { fun f = functionToRun.ptr; - assert(f == factorial); + __goblint_check(f == factorial); int result = f(n); printf("Factorial of %d is %d\n", n, result); } else if (functionToRun.id == 2) { fun f = functionToRun.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); int result = f(n); printf("Factorial of %d is %d\n", result, n); } else { fun f = functionToRun.ptr; - assert((void*)f == exit); + __goblint_check((void*)f == exit); printf("Exiting with code %d...\n", n); int result = f(n); } diff --git a/tests/regression/43-struct-domain/21-nested-structs-keyed.c b/tests/regression/43-struct-domain/21-nested-structs-keyed.c index a9722f3db2..a31f6d6e56 100644 --- a/tests/regression/43-struct-domain/21-nested-structs-keyed.c +++ b/tests/regression/43-struct-domain/21-nested-structs-keyed.c @@ -80,13 +80,13 @@ int example1() { typedef int (*fun)(int); // if (task.f.id == 1) { // fun f = task.f.ptr; - // assert(f == factorial); + // __goblint_check(f == factorial); // if (task.taskId == 0) { - // assert(task.arg == 3); + // __goblint_check(task.arg == 3); // } else if (task.taskId == 1) { - // assert(task.arg == 5); + // __goblint_check(task.arg == 5); // } else if (task.taskId == 2) { - // assert(task.arg == 10); + // __goblint_check(task.arg == 10); // } // int result = f(task.arg); // printf("Factorial of %d is %d\n", task.arg, result); @@ -94,25 +94,25 @@ int example1() { if (task.f.id == 1) { fun f = task.f.ptr; - assert(f == factorial); + __goblint_check(f == factorial); if (task.taskId == 0) { - assert(task.arg == 3); + __goblint_check(task.arg == 3); } else if (task.taskId == 1) { - assert(task.arg == 5); + __goblint_check(task.arg == 5); } else if (task.taskId == 2) { - assert(task.arg == 10); + __goblint_check(task.arg == 10); } int result = f(task.arg); printf("Factorial of %d is %d\n", task.arg, result); } else if (task.f.id == 2) { fun f = task.f.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); if (task.taskId == 0) { - assert(task.arg == 6); + __goblint_check(task.arg == 6); } else if (task.taskId == 1) { - assert(task.arg == 120); + __goblint_check(task.arg == 120); } else if (task.taskId == 2) { - assert(task.arg == 3628800); + __goblint_check(task.arg == 3628800); } int result = f(task.arg); printf("Factorial of %d is %d\n", result, task.arg); @@ -177,25 +177,25 @@ int example2() { typedef int (*fun)(int); if (task.f.id == 1) { fun f = task.f.ptr; - assert(f == factorial); + __goblint_check(f == factorial); if (task.taskId == 0) { - assert(task.arg == 3); // UNKNOWN + __goblint_check(task.arg == 3); // UNKNOWN } else if (task.taskId == 1) { - assert(task.arg == 5); // UNKNOWN + __goblint_check(task.arg == 5); // UNKNOWN } else if (task.taskId == 2) { - assert(task.arg == 10); // UNKNOWN + __goblint_check(task.arg == 10); // UNKNOWN } int result = f(task.arg); printf("Factorial of %d is %d\n", task.arg, result); } else if (task.f.id == 2) { fun f = task.f.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); if (task.taskId == 0) { - assert(task.arg == 6); // UNKNOWN + __goblint_check(task.arg == 6); // UNKNOWN } else if (task.taskId == 1) { - assert(task.arg == 120); // UNKNOWN + __goblint_check(task.arg == 120); // UNKNOWN } else if (task.taskId == 2) { - assert(task.arg == 3628800); // UNKNOWN + __goblint_check(task.arg == 3628800); // UNKNOWN } int result = f(task.arg); printf("Factorial of %d is %d\n", result, task.arg); diff --git a/tests/regression/43-struct-domain/22-join-test-keyed.c b/tests/regression/43-struct-domain/22-join-test-keyed.c index 9d5ec563f1..828ac895a8 100644 --- a/tests/regression/43-struct-domain/22-join-test-keyed.c +++ b/tests/regression/43-struct-domain/22-join-test-keyed.c @@ -60,10 +60,10 @@ int example1() { } if (functionToRun.id == 2) { - assert(functionToRun.ptr == f1 || functionToRun.ptr == f5); + __goblint_check(functionToRun.ptr == f1 || functionToRun.ptr == f5); } else if (functionToRun.id > 3 && functionToRun.id < 5) { - assert(functionToRun.ptr != f3); - assert(functionToRun.ptr == f2 || functionToRun.ptr == f6); + __goblint_check(functionToRun.ptr != f3); + __goblint_check(functionToRun.ptr == f2 || functionToRun.ptr == f6); } return 0; diff --git a/tests/regression/43-struct-domain/23-many-choices-intervals-keyed.c b/tests/regression/43-struct-domain/23-many-choices-intervals-keyed.c index e18ac1dd7f..16ff06649b 100644 --- a/tests/regression/43-struct-domain/23-many-choices-intervals-keyed.c +++ b/tests/regression/43-struct-domain/23-many-choices-intervals-keyed.c @@ -115,12 +115,12 @@ int main() { typedef int (*fun)(int); if (functionToRun.id == 1) { fun f = functionToRun.ptr; - assert(f == factorial); + __goblint_check(f == factorial); int result = f(n); printf("Factorial of %d is %d\n", n, result); } else if (functionToRun.id == 2) { fun f = functionToRun.ptr; - assert(f == inverseFactorial); + __goblint_check(f == inverseFactorial); int result = f(n); printf("Factorial of %d is %d\n", result, n); } else { diff --git a/tests/regression/43-struct-domain/24-normalize-top-keyed.c b/tests/regression/43-struct-domain/24-normalize-top-keyed.c index dcadaf9858..eb6436f8a7 100644 --- a/tests/regression/43-struct-domain/24-normalize-top-keyed.c +++ b/tests/regression/43-struct-domain/24-normalize-top-keyed.c @@ -22,33 +22,33 @@ void example1() { // { first = top, second = top } and { first = 10, second = 20 } // Result should still be top since branch is not always taken! - assert(pair.first == 10); // UNKNOWN! - assert(pair.second == 20); // UNKNOWN! + __goblint_check(pair.first == 10); // UNKNOWN! + __goblint_check(pair.second == 20); // UNKNOWN! if (a > 10) { // The analysis currently cannot infer this, since a is not connected to struct - assert(pair.first == 10); // TODO - assert(pair.second == 20); // TODO + __goblint_check(pair.first == 10); // TODO + __goblint_check(pair.second == 20); // TODO } if (pair.first == 10) { - assert(pair.first == 10); // This is known from the if statement refine + __goblint_check(pair.first == 10); // This is known from the if statement refine // Since one variant is top, we still don't know what second is! - assert(pair.second == 20); // UNKNOWN! + __goblint_check(pair.second == 20); // UNKNOWN! } pair.first = a; pair.second = b; // Reset both to top, should be same state as before. - assert(pair.first == 10); // UNKNOWN! - assert(pair.second == 20); // UNKNOWN! + __goblint_check(pair.first == 10); // UNKNOWN! + __goblint_check(pair.second == 20); // UNKNOWN! pair.first = 10; pair.second = 20; // Set both to known state - should be working - assert(pair.first == 10); - assert(pair.second == 20); + __goblint_check(pair.first == 10); + __goblint_check(pair.second == 20); } diff --git a/tests/regression/43-struct-domain/26-intervals-branching-meet-keyed.c b/tests/regression/43-struct-domain/26-intervals-branching-meet-keyed.c index 83ab4ef4c8..848f893d63 100644 --- a/tests/regression/43-struct-domain/26-intervals-branching-meet-keyed.c +++ b/tests/regression/43-struct-domain/26-intervals-branching-meet-keyed.c @@ -25,13 +25,13 @@ void example1() { // This should be unreachable! b = 0; // This line is not dead if we --disable ana.base.structs.meet-condition } else if (pair.first == 10) { - assert(pair.second == 20); + __goblint_check(pair.second == 20); b = 1; } else if (pair.first == 20) { - assert(pair.second == 30); + __goblint_check(pair.second == 30); b = 1; } - assert(b == 1); + __goblint_check(b == 1); } diff --git a/tests/regression/44-trier_analyzer/04-D0.c b/tests/regression/44-trier_analyzer/04-D0.c index 5539d2efda..9c347ecc93 100644 --- a/tests/regression/44-trier_analyzer/04-D0.c +++ b/tests/regression/44-trier_analyzer/04-D0.c @@ -7,6 +7,6 @@ main () { a = 0; b = 0; b = scanf("%d",&a); - assert(a == 0); //UNKNOWN! - assert(b == 0); //UNKNOWN! + __goblint_check(a == 0); //UNKNOWN! + __goblint_check(b == 0); //UNKNOWN! } diff --git a/tests/regression/44-trier_analyzer/05-D1.c b/tests/regression/44-trier_analyzer/05-D1.c index 644d41514c..4513e6e1d8 100644 --- a/tests/regression/44-trier_analyzer/05-D1.c +++ b/tests/regression/44-trier_analyzer/05-D1.c @@ -6,5 +6,5 @@ main () { int a; a = 0; a = scanf("%d",&a); - assert(a == 0); //UNKNOWN! + __goblint_check(a == 0); //UNKNOWN! } diff --git a/tests/regression/44-trier_analyzer/06-D2.c b/tests/regression/44-trier_analyzer/06-D2.c index 4d527b354b..8c759d45f0 100644 --- a/tests/regression/44-trier_analyzer/06-D2.c +++ b/tests/regression/44-trier_analyzer/06-D2.c @@ -6,5 +6,5 @@ main () { int a; a = 0; a = printf("%d\n",a); - assert(a == 0); //UNKNOWN! + __goblint_check(a == 0); //UNKNOWN! } diff --git a/tests/regression/44-trier_analyzer/07-exit.c b/tests/regression/44-trier_analyzer/07-exit.c index edeed3cc4f..8664418213 100644 --- a/tests/regression/44-trier_analyzer/07-exit.c +++ b/tests/regression/44-trier_analyzer/07-exit.c @@ -11,7 +11,7 @@ main () { printf("Immediate exit.\n"); exit(0); } - assert (x !=0); + __goblint_check(x !=0); printf("The number was not zero.\n"); return 0; } diff --git a/tests/regression/44-trier_analyzer/08-G0.c b/tests/regression/44-trier_analyzer/08-G0.c index c80e14a6dd..6fa29ae922 100644 --- a/tests/regression/44-trier_analyzer/08-G0.c +++ b/tests/regression/44-trier_analyzer/08-G0.c @@ -11,6 +11,6 @@ void proc () { main () { proc(); - assert(i == 11); + __goblint_check(i == 11); printf("The square is %d .\n", i * i); } diff --git a/tests/regression/44-trier_analyzer/09-G1.c b/tests/regression/44-trier_analyzer/09-G1.c index e93bf14a24..46bd769171 100644 --- a/tests/regression/44-trier_analyzer/09-G1.c +++ b/tests/regression/44-trier_analyzer/09-G1.c @@ -12,6 +12,6 @@ int proc() { main () { i = proc(); - assert(i == 0); + __goblint_check(i == 0); printf("%d\n", i); } diff --git a/tests/regression/44-trier_analyzer/10-G2.c b/tests/regression/44-trier_analyzer/10-G2.c index 178b589a1c..3a594dfea5 100644 --- a/tests/regression/44-trier_analyzer/10-G2.c +++ b/tests/regression/44-trier_analyzer/10-G2.c @@ -8,6 +8,6 @@ int i; main () { i = -2; scanf("%d",&i); - assert(i == -2); //UNKNOWN! + __goblint_check(i == -2); //UNKNOWN! printf("The square is %d .\n", i * i); } diff --git a/tests/regression/44-trier_analyzer/11-G3.c b/tests/regression/44-trier_analyzer/11-G3.c index 4347ceb114..203b12b077 100644 --- a/tests/regression/44-trier_analyzer/11-G3.c +++ b/tests/regression/44-trier_analyzer/11-G3.c @@ -9,7 +9,7 @@ main () { int k; i = -2; scanf("%d",&i); - assert(i == -2); //UNKNOWN! + __goblint_check(i == -2); //UNKNOWN! k = i * i; printf("The square is %d .\n", k); } diff --git a/tests/regression/44-trier_analyzer/12-if.c b/tests/regression/44-trier_analyzer/12-if.c index 2d25ddc243..dc58684a34 100644 --- a/tests/regression/44-trier_analyzer/12-if.c +++ b/tests/regression/44-trier_analyzer/12-if.c @@ -7,11 +7,11 @@ main () { int x; scanf("%d",&x); if (x == 0) { - assert(x==0); + __goblint_check(x==0); printf("Equal to zero.\n"); } else { - assert(x!=0); + __goblint_check(x!=0); printf("Non-zero.\n"); } return 0; diff --git a/tests/regression/44-trier_analyzer/18-P4.c b/tests/regression/44-trier_analyzer/18-P4.c index 8de590706f..96da535e2c 100644 --- a/tests/regression/44-trier_analyzer/18-P4.c +++ b/tests/regression/44-trier_analyzer/18-P4.c @@ -11,6 +11,6 @@ void *awful(int **u) { main () { int *p; awful(&p); - assert(*p == 5); //UNKNOWN! + __goblint_check(*p == 5); //UNKNOWN! printf("%d\n", *p); } diff --git a/tests/regression/44-trier_analyzer/19-P5.c b/tests/regression/44-trier_analyzer/19-P5.c index 4a935ca27d..4897b37db9 100644 --- a/tests/regression/44-trier_analyzer/19-P5.c +++ b/tests/regression/44-trier_analyzer/19-P5.c @@ -5,5 +5,5 @@ void proc(int *x, int *y) {} main () { int z = 1; proc(&z, &z); - assert(z == 1); + __goblint_check(z == 1); } diff --git a/tests/regression/44-trier_analyzer/20-Pchain.c b/tests/regression/44-trier_analyzer/20-Pchain.c index 8f7d31b840..4eacb77222 100644 --- a/tests/regression/44-trier_analyzer/20-Pchain.c +++ b/tests/regression/44-trier_analyzer/20-Pchain.c @@ -27,8 +27,8 @@ main () { tail = tail -> next; } printf("That's all.\n"); - assert(head->cAtom == 0); - assert(tail->cAtom != 0); //TODO + __goblint_check(head->cAtom == 0); + __goblint_check(tail->cAtom != 0); //TODO printf("1. %c\n", head -> cAtom); printf("2. %c\n", tail -> cAtom); return 0; diff --git a/tests/regression/44-trier_analyzer/21-Pproc.c b/tests/regression/44-trier_analyzer/21-Pproc.c index c5dd7bca6d..e7dd9d6a38 100644 --- a/tests/regression/44-trier_analyzer/21-Pproc.c +++ b/tests/regression/44-trier_analyzer/21-Pproc.c @@ -25,6 +25,6 @@ main () { while (i < 11) a(&sum, &i); - assert(i == 11); + __goblint_check(i == 11); printf("%d\n", sum); } diff --git a/tests/regression/44-trier_analyzer/22-proov.c b/tests/regression/44-trier_analyzer/22-proov.c index 77057c71d9..c86f764de4 100644 --- a/tests/regression/44-trier_analyzer/22-proov.c +++ b/tests/regression/44-trier_analyzer/22-proov.c @@ -19,6 +19,6 @@ int main() { int b = abi2(0); char c = 'A'; char res = b - a - 16; - assert(res == 0); + __goblint_check(res == 0); return res; } diff --git a/tests/regression/44-trier_analyzer/24-rec1.c b/tests/regression/44-trier_analyzer/24-rec1.c index 2a124939eb..a6fbf5c4c8 100644 --- a/tests/regression/44-trier_analyzer/24-rec1.c +++ b/tests/regression/44-trier_analyzer/24-rec1.c @@ -12,5 +12,5 @@ char rec (int x) { main () { char c = rec(1); - assert(c == 'b'); + __goblint_check(c == 'b'); } diff --git a/tests/regression/44-trier_analyzer/25-rec2.c b/tests/regression/44-trier_analyzer/25-rec2.c index bb3460f3ea..653a5ce63e 100644 --- a/tests/regression/44-trier_analyzer/25-rec2.c +++ b/tests/regression/44-trier_analyzer/25-rec2.c @@ -20,5 +20,5 @@ main () { int a; scanf("%d",&a); rec(&a, a); - assert(a != 0); + __goblint_check(a != 0); } diff --git a/tests/regression/44-trier_analyzer/26-rec3.c b/tests/regression/44-trier_analyzer/26-rec3.c index 3d513b8525..7ecdf52f1a 100644 --- a/tests/regression/44-trier_analyzer/26-rec3.c +++ b/tests/regression/44-trier_analyzer/26-rec3.c @@ -13,7 +13,7 @@ void rec (int *p) { i = (*p); p = &i; rec(p); - assert(p == &i); //UNKNOWN! + __goblint_check(p == &i); //UNKNOWN! return; } } diff --git a/tests/regression/44-trier_analyzer/27-rec4.c b/tests/regression/44-trier_analyzer/27-rec4.c index 5cff119e43..9f50c3d928 100644 --- a/tests/regression/44-trier_analyzer/27-rec4.c +++ b/tests/regression/44-trier_analyzer/27-rec4.c @@ -14,7 +14,7 @@ void rec (int **u, int i) { u = (int **)malloc(sizeof(int *)); int** v = u; rec(u, i); - assert(v == u); //TODO + __goblint_check(v == u); //TODO return; } } diff --git a/tests/regression/44-trier_analyzer/28-rec5.c b/tests/regression/44-trier_analyzer/28-rec5.c index 33c2bb8bbd..84080b4acd 100644 --- a/tests/regression/44-trier_analyzer/28-rec5.c +++ b/tests/regression/44-trier_analyzer/28-rec5.c @@ -13,7 +13,7 @@ void rec (int **u, int i) { i++; u = &a; rec(u, i); - assert(u == &a); // Holds here, we are not dereferencing u + __goblint_check(u == &a); // Holds here, we are not dereferencing u return; } } diff --git a/tests/regression/44-trier_analyzer/29-rec6.c b/tests/regression/44-trier_analyzer/29-rec6.c index 0592e6b154..9977b42f09 100644 --- a/tests/regression/44-trier_analyzer/29-rec6.c +++ b/tests/regression/44-trier_analyzer/29-rec6.c @@ -11,7 +11,7 @@ void rec (int **u, int i) { **u = 12; rec(u, i + 1); // u may be changed in the recursive call! - assert(**u == 12); //UNKNOWN! + __goblint_check(**u == 12); //UNKNOWN! (*u) = &i; return; } diff --git a/tests/regression/44-trier_analyzer/30-rec7.c b/tests/regression/44-trier_analyzer/30-rec7.c index 53b1287789..46af4c0f41 100644 --- a/tests/regression/44-trier_analyzer/30-rec7.c +++ b/tests/regression/44-trier_analyzer/30-rec7.c @@ -11,7 +11,7 @@ void rec (int **u, int i) { **u = 12; rec(u, i + 1); // u may be changed in the recursive call! - assert(**u == 12); //UNKNOWN! + __goblint_check(**u == 12); //UNKNOWN! if (1) { int a; (*u) = &a; diff --git a/tests/regression/44-trier_analyzer/31-rec8.c b/tests/regression/44-trier_analyzer/31-rec8.c index 9990c81448..76f476acda 100644 --- a/tests/regression/44-trier_analyzer/31-rec8.c +++ b/tests/regression/44-trier_analyzer/31-rec8.c @@ -5,7 +5,7 @@ extern int scanf(char *, ...); int *rec(int i) { int *p; if (!i) { - assert(i == 0); + __goblint_check(i == 0); p = rec(i + 1); } return &i; diff --git a/tests/regression/44-trier_analyzer/32-rec9.c b/tests/regression/44-trier_analyzer/32-rec9.c index 69d92f06c5..e65c9282a0 100644 --- a/tests/regression/44-trier_analyzer/32-rec9.c +++ b/tests/regression/44-trier_analyzer/32-rec9.c @@ -16,5 +16,5 @@ main() { ind = 1; } - assert(ind == 0); + __goblint_check(ind == 0); } diff --git a/tests/regression/44-trier_analyzer/34-S0.c b/tests/regression/44-trier_analyzer/34-S0.c index 8a2798b209..ef6ac496d9 100644 --- a/tests/regression/44-trier_analyzer/34-S0.c +++ b/tests/regression/44-trier_analyzer/34-S0.c @@ -21,6 +21,6 @@ main () { init(&d, 2, 2); c = d; d.im = -3; - assert(d.re == 1); // TODO (float) + __goblint_check(d.re == 1); // TODO (float) print(&c); } diff --git a/tests/regression/44-trier_analyzer/35-S1.c b/tests/regression/44-trier_analyzer/35-S1.c index 005304b9b1..1565464200 100644 --- a/tests/regression/44-trier_analyzer/35-S1.c +++ b/tests/regression/44-trier_analyzer/35-S1.c @@ -5,7 +5,7 @@ extern int printf(char *, ...); struct bad {int cont; struct bad *next;}; void proc (struct bad *z) { - assert(z->cont == 1); + __goblint_check(z->cont == 1); printf ("%d\n",z -> cont); } diff --git a/tests/regression/44-trier_analyzer/36-S2.c b/tests/regression/44-trier_analyzer/36-S2.c index 13930b4aea..dd943ddb51 100644 --- a/tests/regression/44-trier_analyzer/36-S2.c +++ b/tests/regression/44-trier_analyzer/36-S2.c @@ -9,7 +9,7 @@ struct bad {int cont; int *away;}; void p (int *i) { if (*i) { - assert(i != 0); + __goblint_check(i != 0); printf ("%d\n",*i); } else { diff --git a/tests/regression/44-trier_analyzer/37-S3.c b/tests/regression/44-trier_analyzer/37-S3.c index 229d975ccf..a62ad771f9 100644 --- a/tests/regression/44-trier_analyzer/37-S3.c +++ b/tests/regression/44-trier_analyzer/37-S3.c @@ -16,7 +16,7 @@ main () { d = c; x = d.im; printf("%d\n",x); - assert(x); //UNKNOWN! - assert(d.re == 1); + __goblint_check(x); //UNKNOWN! + __goblint_check(d.re == 1); return 0; } diff --git a/tests/regression/44-trier_analyzer/38-S4.c b/tests/regression/44-trier_analyzer/38-S4.c index 6cddacbc68..6a92b0ec4d 100644 --- a/tests/regression/44-trier_analyzer/38-S4.c +++ b/tests/regression/44-trier_analyzer/38-S4.c @@ -18,7 +18,7 @@ main () { d = c; x = d->im; printf("%d\n",x); - assert(x); //UNKNOWN! - assert(d->re == 1); + __goblint_check(x); //UNKNOWN! + __goblint_check(d->re == 1); return 0; } diff --git a/tests/regression/44-trier_analyzer/39-S5.c b/tests/regression/44-trier_analyzer/39-S5.c index 007088b766..fe793e20a3 100644 --- a/tests/regression/44-trier_analyzer/39-S5.c +++ b/tests/regression/44-trier_analyzer/39-S5.c @@ -14,6 +14,6 @@ main () { c.re = 1; d = c; x = d.im; - assert(d.re == 1); //TODO (float) + __goblint_check(d.re == 1); //TODO (float) printf("%d\n",x); } diff --git a/tests/regression/44-trier_analyzer/40-S6.c b/tests/regression/44-trier_analyzer/40-S6.c index 0ad387aad1..a77f8a2bd7 100644 --- a/tests/regression/44-trier_analyzer/40-S6.c +++ b/tests/regression/44-trier_analyzer/40-S6.c @@ -16,6 +16,6 @@ main () { c->re = 1; d = c; x = d->im; - assert(d->re == 1); //TODO (floats) + __goblint_check(d->re == 1); //TODO (floats) printf("%d\n",x); } diff --git a/tests/regression/44-trier_analyzer/41-strcpy.c b/tests/regression/44-trier_analyzer/41-strcpy.c index 44f31f9b00..12dd295afe 100644 --- a/tests/regression/44-trier_analyzer/41-strcpy.c +++ b/tests/regression/44-trier_analyzer/41-strcpy.c @@ -9,7 +9,7 @@ main () { strcpy (t, "Bye-bye!\n"); y = strcpy (s, t); - assert(*y == 'B'); //TODO + __goblint_check(*y == 'B'); //TODO char c = *y; printf ("%s", y); diff --git a/tests/regression/44-trier_analyzer/42-switch.c b/tests/regression/44-trier_analyzer/42-switch.c index f08d97185c..11cbb32731 100644 --- a/tests/regression/44-trier_analyzer/42-switch.c +++ b/tests/regression/44-trier_analyzer/42-switch.c @@ -28,5 +28,5 @@ int main() { int i; scanf("%d",&i); printf("%d\n",proov(i)); - assert(g == 0); //FAIL + __goblint_check(g == 0); //FAIL } diff --git a/tests/regression/44-trier_analyzer/43-thread.c b/tests/regression/44-trier_analyzer/43-thread.c index 7e6e51b396..084fee2c05 100644 --- a/tests/regression/44-trier_analyzer/43-thread.c +++ b/tests/regression/44-trier_analyzer/43-thread.c @@ -12,7 +12,7 @@ void *sumP (void *x) { i++; sum += i; } - assert(i == 10); + __goblint_check(i == 10); printf("%d\n", sum); } @@ -24,7 +24,7 @@ void *prodP (void *x) { i++; prod *= i; } - assert(i == 10); + __goblint_check(i == 10); printf("%d\n", prod); } diff --git a/tests/regression/44-trier_analyzer/44-while.c b/tests/regression/44-trier_analyzer/44-while.c index 2628f73758..4a344ba061 100644 --- a/tests/regression/44-trier_analyzer/44-while.c +++ b/tests/regression/44-trier_analyzer/44-while.c @@ -10,6 +10,6 @@ main() { sum += i; i++; } - assert(i == 11); + __goblint_check(i == 11); printf("%d\n",sum); } diff --git a/tests/regression/45-escape/01-local-in-pthread.c b/tests/regression/45-escape/01-local-in-pthread.c index 93ea854593..6d408d1b31 100644 --- a/tests/regression/45-escape/01-local-in-pthread.c +++ b/tests/regression/45-escape/01-local-in-pthread.c @@ -19,10 +19,10 @@ int main(){ int x2 = 35; pthread_t thread; pthread_create(&thread, NULL, foo, ptr); - assert(x2 == 35); + __goblint_check(x2 == 35); *ptr = &x2; sleep(4); // to make sure that we actually fail the assert when running. - assert(x2 == 35); // UNKNOWN! + __goblint_check(x2 == 35); // UNKNOWN! pthread_join(thread, NULL); return 0; } diff --git a/tests/regression/45-escape/02-local-in-global.c b/tests/regression/45-escape/02-local-in-global.c index 1c4632e484..279ef52f3a 100644 --- a/tests/regression/45-escape/02-local-in-global.c +++ b/tests/regression/45-escape/02-local-in-global.c @@ -11,11 +11,11 @@ void *foo(void* p){ int main(){ int x = 0; gptr = &x; - assert(x==0); + __goblint_check(x==0); pthread_t thread; pthread_create(&thread, NULL, foo, NULL); sleep(3); - assert(x == 0); // UNKNOWN! + __goblint_check(x == 0); // UNKNOWN! pthread_join(thread, NULL); return 0; } diff --git a/tests/regression/45-escape/03-local-in-pthread-a.c b/tests/regression/45-escape/03-local-in-pthread-a.c index 91cd7d2db1..30dfbbcee7 100644 --- a/tests/regression/45-escape/03-local-in-pthread-a.c +++ b/tests/regression/45-escape/03-local-in-pthread-a.c @@ -11,8 +11,8 @@ void *foo(void* p){ int* ip = *((int**) p); printf("ip is %d\n", *ip); // To check that in (01) even without modification both &x and &x2 are possible here - assert(*ip == 0); //UNKNOWN! - assert(*ip == 35); //UNKNOWN! + __goblint_check(*ip == 0); //UNKNOWN! + __goblint_check(*ip == 35); //UNKNOWN! return NULL; } diff --git a/tests/regression/45-escape/04-imprecision.c b/tests/regression/45-escape/04-imprecision.c index 50b0b90128..7561f16c74 100644 --- a/tests/regression/45-escape/04-imprecision.c +++ b/tests/regression/45-escape/04-imprecision.c @@ -15,14 +15,14 @@ int main(){ int y = 0; gptr = &y; gptr = &x; - assert(x==0); + __goblint_check(x==0); pthread_t thread; pthread_create(&thread, NULL, foo, NULL); sleep(3); - assert(x == 0); // UNKNOWN! - assert(y == 0); //TODO + __goblint_check(x == 0); // UNKNOWN! + __goblint_check(y == 0); //TODO y = 5; - assert(y == 5); //TODO + __goblint_check(y == 5); //TODO pthread_join(thread, NULL); return 0; } diff --git a/tests/regression/45-escape/05-global-single-threaded.c b/tests/regression/45-escape/05-global-single-threaded.c index 9342509cb0..68ea4d3b41 100644 --- a/tests/regression/45-escape/05-global-single-threaded.c +++ b/tests/regression/45-escape/05-global-single-threaded.c @@ -3,7 +3,7 @@ int* ptr; int nine = 9; int other() { - assert(*ptr == 8); //UNKNOWN! + __goblint_check(*ptr == 8); //UNKNOWN! } int main() diff --git a/tests/regression/46-apron2/05-pointer-multilevel.c b/tests/regression/46-apron2/05-pointer-multilevel.c index 4c46f9844c..ff660674d3 100644 --- a/tests/regression/46-apron2/05-pointer-multilevel.c +++ b/tests/regression/46-apron2/05-pointer-multilevel.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization top +// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization top #include extern int __VERIFIER_nondet_int(); @@ -11,19 +11,19 @@ void change(int *p) { (*p)++; otherchange(p); int* ptr = &p; - assert(*p ==7); + __goblint_check(*p ==7); } int g; int main() { int c = __VERIFIER_nondet_int(); g = 3; - assert(g != 3); // FAIL - assert(g == 3); + __goblint_check(g != 3); // FAIL + __goblint_check(g == 3); int a = 5; int *p = &a; change(p); - assert(a == 5); //FAIL - assert(a - 7 == 0); + __goblint_check(a == 5); //FAIL + __goblint_check(a - 7 == 0); return 0; } diff --git a/tests/regression/46-apron2/06-pointer-multilevel-two.c b/tests/regression/46-apron2/06-pointer-multilevel-two.c index eba0b08bf9..86e9c90616 100644 --- a/tests/regression/46-apron2/06-pointer-multilevel-two.c +++ b/tests/regression/46-apron2/06-pointer-multilevel-two.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization top +// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization top #include extern int __VERIFIER_nondet_int(); @@ -6,19 +6,19 @@ extern int __VERIFIER_nondet_int(); void change(int *p,int i) { (*p)++; int* ptr = &p; - assert(*p == 6); + __goblint_check(*p == 6); } int g; int main() { int c = __VERIFIER_nondet_int(); g = 3; - assert(g != 3); // FAIL - assert(g == 3); + __goblint_check(g != 3); // FAIL + __goblint_check(g == 3); int a = 5; int *p = &a; change(p, a); - assert(a == 5); //FAIL - assert(a - 6 == 0); // Apron used to find \bot here (!) + __goblint_check(a == 5); //FAIL + __goblint_check(a - 6 == 0); // Apron used to find \bot here (!) return 0; } diff --git a/tests/regression/46-apron2/07-escaping-recursion.c b/tests/regression/46-apron2/07-escaping-recursion.c index 428b25bfab..9173ab5d38 100644 --- a/tests/regression/46-apron2/07-escaping-recursion.c +++ b/tests/regression/46-apron2/07-escaping-recursion.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization top +// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization top // Copy of 01/52 for Apron #include @@ -9,18 +9,18 @@ int rec(int i,int* ptr) { if(i == 0) { rec(5,&x); // Recursive call may have modified x - assert(x == 17); //UNKNOWN! + __goblint_check(x == 17); //UNKNOWN! // If we analyse this with int contexts, there is no other x that is reachable, so this // update is strong x = 17; - assert(x == 17); + __goblint_check(x == 17); } else { x = 31; // ptr points to the outer x, it is unaffected by this assignment // and should be 17 - assert(*ptr == 31); //UNKNOWN! + __goblint_check(*ptr == 31); //UNKNOWN! if(top) { ptr = &x; @@ -28,19 +28,19 @@ int rec(int i,int* ptr) { // ptr may now point to both the inner and the outer x *ptr = 12; - assert(*ptr == 12); //UNKNOWN! - assert(x == 12); //UNKNOWN! + __goblint_check(*ptr == 12); //UNKNOWN! + __goblint_check(x == 12); //UNKNOWN! if(*ptr == 12) { - assert(x == 12); //UNKNOWN! + __goblint_check(x == 12); //UNKNOWN! } // ptr may still point to the outer instance - assert(ptr == &x); //UNKNOWN! + __goblint_check(ptr == &x); //UNKNOWN! // Another copy of x is reachable, so we are conservative and do a weak update x = 31; - assert(x == 31); // UNKNOWN + __goblint_check(x == 31); // UNKNOWN } return 0; } diff --git a/tests/regression/46-apron2/08-escape-local-in-pthread-dummy.c b/tests/regression/46-apron2/08-escape-local-in-pthread-dummy.c index efc7f8e964..d121a88c16 100644 --- a/tests/regression/46-apron2/08-escape-local-in-pthread-dummy.c +++ b/tests/regression/46-apron2/08-escape-local-in-pthread-dummy.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization top +// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization top // Copy of 45 01 for apron #include #include @@ -21,11 +21,11 @@ int main(){ int x2 = 35; pthread_t thread; pthread_create(&thread, NULL, foo, ptr); - assert(x2 == 35); + __goblint_check(x2 == 35); *ptr = &x2; sleep(4); // to make sure that we actually fail the assert when running. - assert(x2 == 42); //UNKNOWN! - assert(x2 == 35); //UNKNOWN! + __goblint_check(x2 == 42); //UNKNOWN! + __goblint_check(x2 == 35); //UNKNOWN! pthread_join(thread, NULL); return 0; } diff --git a/tests/regression/46-apron2/09-escape-local-in-pthread-mm.c b/tests/regression/46-apron2/09-escape-local-in-pthread-mm.c index 985fbc429e..3723fb46fd 100644 --- a/tests/regression/46-apron2/09-escape-local-in-pthread-mm.c +++ b/tests/regression/46-apron2/09-escape-local-in-pthread-mm.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization mutex-meet +// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization mutex-meet // Copy of 45 01 for apron #include #include @@ -21,11 +21,11 @@ int main(){ int x2 = 35; pthread_t thread; pthread_create(&thread, NULL, foo, ptr); - assert(x2 == 35); + __goblint_check(x2 == 35); *ptr = &x2; sleep(4); // to make sure that we actually fail the assert when running. - assert(x2 == 42); //UNKNOWN! - assert(x2 == 35); //UNKNOWN! + __goblint_check(x2 == 42); //UNKNOWN! + __goblint_check(x2 == 35); //UNKNOWN! pthread_join(thread, NULL); return 0; } diff --git a/tests/regression/46-apron2/10-escape-local-in-pthread-mm-tid.c b/tests/regression/46-apron2/10-escape-local-in-pthread-mm-tid.c index f183b7032a..60ed084c1b 100644 --- a/tests/regression/46-apron2/10-escape-local-in-pthread-mm-tid.c +++ b/tests/regression/46-apron2/10-escape-local-in-pthread-mm-tid.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.path_sens[+] threadflag --set ana.base.privatization none --set ana.apron.privatization mutex-meet-tid +// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert','apron','escape']" --set ana.path_sens[+] threadflag --set ana.base.privatization none --set ana.apron.privatization mutex-meet-tid // Copy of 45 01 for apron #include #include @@ -21,11 +21,11 @@ int main(){ int x2 = 35; pthread_t thread; pthread_create(&thread, NULL, foo, ptr); - assert(x2 == 35); + __goblint_check(x2 == 35); *ptr = &x2; sleep(4); // to make sure that we actually fail the assert when running. - assert(x2 == 42); //UNKNOWN! - assert(x2 == 35); //UNKNOWN! + __goblint_check(x2 == 42); //UNKNOWN! + __goblint_check(x2 == 35); //UNKNOWN! pthread_join(thread, NULL); return 0; } diff --git a/tests/regression/46-apron2/11-names.c b/tests/regression/46-apron2/11-names.c index 650de77f7b..46a0ffadd8 100644 --- a/tests/regression/46-apron2/11-names.c +++ b/tests/regression/46-apron2/11-names.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization top +// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization top #include extern int __VERIFIER_nondet_int(); @@ -8,7 +8,7 @@ void change(int *p) { int a; (*p)++; a++; - assert(a == 7); //UNKNOWN! + __goblint_check(a == 7); //UNKNOWN! } int g; @@ -17,7 +17,7 @@ int main() { int a = 5; int *p = &a; change(p); - assert(a == 5); //FAIL - assert(a - 6 == 0); // Apron used to find \bot here (!) + __goblint_check(a == 5); //FAIL + __goblint_check(a - 6 == 0); // Apron used to find \bot here (!) return 0; } diff --git a/tests/regression/46-apron2/12-escape-local-in-pthread-simple.c b/tests/regression/46-apron2/12-escape-local-in-pthread-simple.c index ce27844ebb..d4439c9d9f 100644 --- a/tests/regression/46-apron2/12-escape-local-in-pthread-simple.c +++ b/tests/regression/46-apron2/12-escape-local-in-pthread-simple.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization mutex-meet +// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization mutex-meet // Copy of 45 01 for apron #include #include @@ -20,10 +20,10 @@ int main(){ pthread_t thread; pthread_create(&thread, NULL, foo, xp); sleep(4); // to make sure that we actually fail the assert when running. - assert(x == 42); //UNKNOWN! - assert(x == 0); //UNKNOWN! - assert(x <= 50); - assert(g == 8); + __goblint_check(x == 42); //UNKNOWN! + __goblint_check(x == 0); //UNKNOWN! + __goblint_check(x <= 50); + __goblint_check(g == 8); pthread_join(thread, NULL); return 0; } diff --git a/tests/regression/46-apron2/13-initializer.c b/tests/regression/46-apron2/13-initializer.c index 47c91b69fe..9d655732da 100644 --- a/tests/regression/46-apron2/13-initializer.c +++ b/tests/regression/46-apron2/13-initializer.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.path_sens[+] threadflag --set ana.base.privatization none --set ana.apron.privatization mutex-meet-tid +// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert','apron','escape']" --set ana.path_sens[+] threadflag --set ana.base.privatization none --set ana.apron.privatization mutex-meet-tid #include #include #include @@ -15,9 +15,9 @@ int main(){ int y; g = y; h = y; - assert(g == h); + __goblint_check(g == h); pthread_create(&thread, NULL, foo, NULL); - assert(g == h); //TODO We would like to be able to prove that this holds (but can't as we lose g = h) + __goblint_check(g == h); //TODO We would like to be able to prove that this holds (but can't as we lose g = h) pthread_join(thread, NULL); return 0; } diff --git a/tests/regression/46-apron2/14-invalidate.c b/tests/regression/46-apron2/14-invalidate.c index 48f756337b..cce1159e6c 100644 --- a/tests/regression/46-apron2/14-invalidate.c +++ b/tests/regression/46-apron2/14-invalidate.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.path_sens[+] threadflag --set ana.base.privatization none --set ana.apron.privatization mutex-meet-tid +// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert','apron','escape']" --set ana.path_sens[+] threadflag --set ana.base.privatization none --set ana.apron.privatization mutex-meet-tid #include #include #include @@ -10,6 +10,6 @@ void munge(int* ptr); int main(void) { int p = 5; munge(&p); - assert(p == 5); //UNKNOWN! + __goblint_check(p == 5); //UNKNOWN! return 0; } diff --git a/tests/regression/46-apron2/15-invalidate-threadreturn.c b/tests/regression/46-apron2/15-invalidate-threadreturn.c index 235cb65997..908eb7ab02 100644 --- a/tests/regression/46-apron2/15-invalidate-threadreturn.c +++ b/tests/regression/46-apron2/15-invalidate-threadreturn.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.path_sens[+] threadflag --set ana.base.privatization none --set ana.apron.privatization mutex-meet-tid +// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert','apron','escape']" --set ana.path_sens[+] threadflag --set ana.base.privatization none --set ana.apron.privatization mutex-meet-tid #include #include #include @@ -15,6 +15,6 @@ int main(){ int y = 8; pthread_create(&thread, NULL, foo, NULL); pthread_join(thread, &y); - assert(y==8); //UNKNOWN! + __goblint_check(y==8); //UNKNOWN! return 0; } diff --git a/tests/regression/46-apron2/16-rel-offset.c b/tests/regression/46-apron2/16-rel-offset.c index 0aab95caee..dea473905f 100644 --- a/tests/regression/46-apron2/16-rel-offset.c +++ b/tests/regression/46-apron2/16-rel-offset.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.path_sens[+] threadflag --set ana.base.privatization none --set ana.apron.privatization mutex-meet-tid --set ana.base.arrays.domain partitioned +// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert','apron','escape']" --set ana.path_sens[+] threadflag --set ana.base.privatization none --set ana.apron.privatization mutex-meet-tid --set ana.base.arrays.domain partitioned #include #include #include @@ -14,13 +14,13 @@ int main(){ x = y; int z = *ptr == x; - assert(x==y); - assert(z == 1); - assert(*ptr == x); - assert(*ptr == y); - assert(y == y); + __goblint_check(x==y); + __goblint_check(z == 1); + __goblint_check(*ptr == x); + __goblint_check(*ptr == y); + __goblint_check(y == y); - assert(arr[*ptr == x] == 4); + __goblint_check(arr[*ptr == x] == 4); return 0; diff --git a/tests/regression/46-apron2/17-passing.c b/tests/regression/46-apron2/17-passing.c index 15858cd7ff..463d5554af 100644 --- a/tests/regression/46-apron2/17-passing.c +++ b/tests/regression/46-apron2/17-passing.c @@ -1,4 +1,4 @@ -// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.path_sens[+] threadflag --set ana.base.privatization none --set ana.apron.privatization mutex-meet-tid --set ana.base.arrays.domain partitioned +// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','assert','apron','escape']" --set ana.path_sens[+] threadflag --set ana.base.privatization none --set ana.apron.privatization mutex-meet-tid --set ana.base.arrays.domain partitioned #include #include #include @@ -11,11 +11,11 @@ int main(){ int y; x = y; fun2(); - assert(x==y); + __goblint_check(x==y); fun(&x); - assert(x==y); + __goblint_check(x==y); fun3(&myblorg); - assert(x==y); + __goblint_check(x==y); return 0; } diff --git a/tests/regression/46-apron2/18-evalint-torture.c b/tests/regression/46-apron2/18-evalint-torture.c index 298261c16e..37d8d3736a 100644 --- a/tests/regression/46-apron2/18-evalint-torture.c +++ b/tests/regression/46-apron2/18-evalint-torture.c @@ -22,7 +22,7 @@ int main() { z = 3; w = 4; -#define A1 assert(x + y + z + w == 10); // NOWARN (macro) +#define A1 __goblint_check(x + y + z + w == 10); // NOWARN (macro) #define A2 A1 A1 #define A4 A2 A2 #define A8 A4 A4 diff --git a/tests/regression/46-apron2/19-tid-toy-10-exit.c b/tests/regression/46-apron2/19-tid-toy-10-exit.c index 15576f2232..4a846acd41 100644 --- a/tests/regression/46-apron2/19-tid-toy-10-exit.c +++ b/tests/regression/46-apron2/19-tid-toy-10-exit.c @@ -38,7 +38,7 @@ int main(void) { pthread_join(id2, NULL); pthread_mutex_lock(&A); - assert(g == 12); //UNKNOWN! + __goblint_check(g == 12); //UNKNOWN! pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/46-apron2/20-inprecise-returns.c b/tests/regression/46-apron2/20-inprecise-returns.c index 43606db8eb..3d7e2a5e7d 100644 --- a/tests/regression/46-apron2/20-inprecise-returns.c +++ b/tests/regression/46-apron2/20-inprecise-returns.c @@ -50,7 +50,7 @@ int main(void) { pthread_join(id2, NULL); pthread_mutex_lock(&A); - assert(g == h); + __goblint_check(g == h); pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/46-apron2/21-tid-toy-10-exit-othert.c b/tests/regression/46-apron2/21-tid-toy-10-exit-othert.c index 9aa0c7053e..bd3fe483ef 100644 --- a/tests/regression/46-apron2/21-tid-toy-10-exit-othert.c +++ b/tests/regression/46-apron2/21-tid-toy-10-exit-othert.c @@ -53,7 +53,7 @@ int main(void) { pthread_join(id2, NULL); pthread_mutex_lock(&A); - assert(g == 10); //UNKNOWN! + __goblint_check(g == 10); //UNKNOWN! pthread_mutex_unlock(&A); return 0; diff --git a/tests/regression/52-apron-mukherjee/01-mukherjee_reorder_2.c b/tests/regression/52-apron-mukherjee/01-mukherjee_reorder_2.c index 1b79d17e0c..0d211d2bcb 100644 --- a/tests/regression/52-apron-mukherjee/01-mukherjee_reorder_2.c +++ b/tests/regression/52-apron-mukherjee/01-mukherjee_reorder_2.c @@ -55,7 +55,7 @@ void *iSet_2(void *param) { void *iCheck_1(void *param) { pthread_mutex_lock(&mut_lock); - assert(a + b == 0); + __goblint_check(a + b == 0); pthread_mutex_unlock(&mut_lock); return NULL; @@ -63,7 +63,7 @@ void *iCheck_1(void *param) { void *iCheck_2(void *param) { pthread_mutex_lock(&mut_lock); - assert(a + b == 0); + __goblint_check(a + b == 0); pthread_mutex_unlock(&mut_lock); return NULL; diff --git a/tests/regression/52-apron-mukherjee/02-mukherjee_sigma.c b/tests/regression/52-apron-mukherjee/02-mukherjee_sigma.c index c4cda1e25b..0e7690f60c 100644 --- a/tests/regression/52-apron-mukherjee/02-mukherjee_sigma.c +++ b/tests/regression/52-apron-mukherjee/02-mukherjee_sigma.c @@ -14,7 +14,7 @@ pthread_mutex_t mut_lock = PTHREAD_MUTEX_INITIALIZER; void *thread1(void * arg) { - assert(array_index <= 4); + __goblint_check(array_index <= 4); pthread_mutex_lock(&mut_lock); switch (array_index) { case 0: @@ -36,7 +36,7 @@ void *thread1(void * arg) void *thread2(void * arg) { - assert(array_index <= 4); + __goblint_check(array_index <= 4); pthread_mutex_lock(&mut_lock); switch (array_index) { case 0: @@ -58,7 +58,7 @@ void *thread2(void * arg) void *thread3(void * arg) { - assert(array_index <= 4); + __goblint_check(array_index <= 4); pthread_mutex_lock(&mut_lock); switch (array_index) { case 0: @@ -80,7 +80,7 @@ void *thread3(void * arg) void *thread4(void * arg) { - assert(array_index <= 4); + __goblint_check(array_index <= 4); pthread_mutex_lock(&mut_lock); switch (array_index) { case 0: @@ -137,7 +137,7 @@ int main() sum = array_0 + array_1 + array_2 + array_3; - assert(sum == SIGMA); //UNKNOWN! <-- wrong, different threads might use the same array offset when writing + __goblint_check(sum == SIGMA); //UNKNOWN! <-- wrong, different threads might use the same array offset when writing return 0; } diff --git a/tests/regression/52-apron-mukherjee/03-mukherjee_sssc12.c b/tests/regression/52-apron-mukherjee/03-mukherjee_sssc12.c index 3320835be1..607bb0d020 100644 --- a/tests/regression/52-apron-mukherjee/03-mukherjee_sssc12.c +++ b/tests/regression/52-apron-mukherjee/03-mukherjee_sssc12.c @@ -23,8 +23,8 @@ void* thr1(void* arg) { pthread_mutex_unlock(&lock); while(c < end) { - assert(c >= 0); - assert(c <= temp); + __goblint_check(c >= 0); + __goblint_check(c <= temp); c = c +1; } return NULL; @@ -45,8 +45,8 @@ void* thr2(void* arg) { pthread_mutex_unlock(&lock); while(c < end) { - assert(c >= 0); - assert(c <= temp); + __goblint_check(c >= 0); + __goblint_check(c <= temp); c = c +1; } return NULL; diff --git a/tests/regression/52-apron-mukherjee/04-mukherjee_spin2003.c b/tests/regression/52-apron-mukherjee/04-mukherjee_spin2003.c index c878ec5aeb..9ef8e1274c 100644 --- a/tests/regression/52-apron-mukherjee/04-mukherjee_spin2003.c +++ b/tests/regression/52-apron-mukherjee/04-mukherjee_spin2003.c @@ -12,7 +12,7 @@ void* T1_Spin(void* arg){ x = 0; x = 1; - assert(x >= 1); + __goblint_check(x >= 1); pthread_mutex_unlock(&lock); return NULL; } @@ -22,7 +22,7 @@ void* T2_Spin(void* arg){ x = 0; x = 1; - assert(x >= 1); + __goblint_check(x >= 1); pthread_mutex_unlock(&lock); return NULL; } diff --git a/tests/regression/52-apron-mukherjee/05-mukherjee_simpleLoop.c b/tests/regression/52-apron-mukherjee/05-mukherjee_simpleLoop.c index 79a5d69552..647f336a81 100644 --- a/tests/regression/52-apron-mukherjee/05-mukherjee_simpleLoop.c +++ b/tests/regression/52-apron-mukherjee/05-mukherjee_simpleLoop.c @@ -14,7 +14,7 @@ void* T1_SL(void* arg){ for(j = i + 1; j < y; j++) { for(k = j; k < z; k++) { pthread_mutex_lock(&lock); - assert(k > i); + __goblint_check(k > i); pthread_mutex_unlock(&lock); } } @@ -29,7 +29,7 @@ void* T2_SL(void* arg){ for(j = i + 1; j < y; j++) { for(k = j; k < z; k++) { pthread_mutex_lock(&lock); - assert(k > i); + __goblint_check(k > i); pthread_mutex_unlock(&lock); } } diff --git a/tests/regression/52-apron-mukherjee/06-mukherjee_simpleLoop5.c b/tests/regression/52-apron-mukherjee/06-mukherjee_simpleLoop5.c index 42e9e649ef..ff731c1dec 100644 --- a/tests/regression/52-apron-mukherjee/06-mukherjee_simpleLoop5.c +++ b/tests/regression/52-apron-mukherjee/06-mukherjee_simpleLoop5.c @@ -10,7 +10,7 @@ pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; void* T1_SL5(void* arg){ while(1) { pthread_mutex_lock(&lock); - assert(a != b); //TODO requires disjunctions + __goblint_check(a != b); //TODO requires disjunctions pthread_mutex_unlock(&lock); } return NULL; diff --git a/tests/regression/52-apron-mukherjee/07-mukherjee_DoubleLock_P3.c b/tests/regression/52-apron-mukherjee/07-mukherjee_DoubleLock_P3.c index 384bccd89b..2a47f60010 100644 --- a/tests/regression/52-apron-mukherjee/07-mukherjee_DoubleLock_P3.c +++ b/tests/regression/52-apron-mukherjee/07-mukherjee_DoubleLock_P3.c @@ -22,7 +22,7 @@ void* T1_DLP3(void* arg){ void* T2_DLP3(void* arg){ pthread_mutex_lock(&lock); - assert(count >= -1); + __goblint_check(count >= -1); pthread_mutex_unlock(&lock); return NULL; } diff --git a/tests/regression/52-apron-mukherjee/08-mukherjee_unverif.c b/tests/regression/52-apron-mukherjee/08-mukherjee_unverif.c index a888419547..e2f5dd178f 100644 --- a/tests/regression/52-apron-mukherjee/08-mukherjee_unverif.c +++ b/tests/regression/52-apron-mukherjee/08-mukherjee_unverif.c @@ -18,7 +18,7 @@ void* thr1(void* arg){ if(r == 1){ s = s + 1; l = l + 1; - assert(s == l); // TODO + __goblint_check(s == l); // TODO } pthread_mutex_unlock(&lock); @@ -35,7 +35,7 @@ void* thr2(void* arg){ if(r == 1){ s = s + 1; l = l + 1; - assert(s == l); // TODO + __goblint_check(s == l); // TODO } pthread_mutex_unlock(&lock); diff --git a/tests/regression/52-apron-mukherjee/09-mukherjee_fib_Bench.c b/tests/regression/52-apron-mukherjee/09-mukherjee_fib_Bench.c index 06e81c1c1c..7492a0f8fb 100644 --- a/tests/regression/52-apron-mukherjee/09-mukherjee_fib_Bench.c +++ b/tests/regression/52-apron-mukherjee/09-mukherjee_fib_Bench.c @@ -39,8 +39,8 @@ int main() { pthread_join(t1, 0); pthread_join(t2, 0); - assert(i < 144); //TODO - assert(j < 144); //TODO + __goblint_check(i < 144); //TODO + __goblint_check(j < 144); //TODO return 0; } diff --git a/tests/regression/52-apron-mukherjee/10-mukherjee_fib_Bench_Longer.c b/tests/regression/52-apron-mukherjee/10-mukherjee_fib_Bench_Longer.c index 0da5a88ce9..1bad4d727a 100644 --- a/tests/regression/52-apron-mukherjee/10-mukherjee_fib_Bench_Longer.c +++ b/tests/regression/52-apron-mukherjee/10-mukherjee_fib_Bench_Longer.c @@ -39,8 +39,8 @@ int main() { pthread_join(t1, 0); pthread_join(t2, 0); - assert(i < 377); //TODO - assert(j < 377); //TODO + __goblint_check(i < 377); //TODO + __goblint_check(j < 377); //TODO return 0; } diff --git a/tests/regression/52-apron-mukherjee/11-mukherjee_indexer.c b/tests/regression/52-apron-mukherjee/11-mukherjee_indexer.c index ac7f984441..96f9723ecc 100644 --- a/tests/regression/52-apron-mukherjee/11-mukherjee_indexer.c +++ b/tests/regression/52-apron-mukherjee/11-mukherjee_indexer.c @@ -16,7 +16,7 @@ void* W1_Indexer(void* arg){ w = (++m) * 12; h = (w*7) % SIZE; - assert(h>=0); + __goblint_check(h>=0); rv = 0; h = rv + 1; @@ -44,7 +44,7 @@ void* W2_Indexer(void* arg){ w = (++m) * 12; h = (w*7) % SIZE; - assert(h>=0); + __goblint_check(h>=0); rv = 0; h = rv + 1; diff --git a/tests/regression/52-apron-mukherjee/12-mukherjee_twostage_3.c b/tests/regression/52-apron-mukherjee/12-mukherjee_twostage_3.c index 03d2f0862b..96589c547a 100644 --- a/tests/regression/52-apron-mukherjee/12-mukherjee_twostage_3.c +++ b/tests/regression/52-apron-mukherjee/12-mukherjee_twostage_3.c @@ -40,8 +40,8 @@ void* iRThread_1(void* arg){ pthread_mutex_unlock(&lock); if(t1 != 0) { - assert(t2 != (t1+1)); //UNKNOWN! - assert(t2 == (t1+1)); //UNKNOWN! + __goblint_check(t2 != (t1+1)); //UNKNOWN! + __goblint_check(t2 == (t1+1)); //UNKNOWN! } return 0; } diff --git a/tests/regression/52-apron-mukherjee/13-mukherjee_singleton_with_uninit.c b/tests/regression/52-apron-mukherjee/13-mukherjee_singleton_with_uninit.c index caa497aab0..e299fc3d05 100644 --- a/tests/regression/52-apron-mukherjee/13-mukherjee_singleton_with_uninit.c +++ b/tests/regression/52-apron-mukherjee/13-mukherjee_singleton_with_uninit.c @@ -29,6 +29,6 @@ int main() { pthread_join(t1, 0); pthread_join(t2, 0); - assert(x <= 5); + __goblint_check(x <= 5); return 0; } diff --git a/tests/regression/52-apron-mukherjee/14-mukherjee_stack.c b/tests/regression/52-apron-mukherjee/14-mukherjee_stack.c index 78b4a98dbb..79144dfde8 100644 --- a/tests/regression/52-apron-mukherjee/14-mukherjee_stack.c +++ b/tests/regression/52-apron-mukherjee/14-mukherjee_stack.c @@ -20,7 +20,7 @@ void* T1_Stack(void* arg) { pthread_mutex_unlock(&m); for(i=0; i= 0); // UNKNOWN! + __goblint_check(num >= 0); // UNKNOWN! - assert(num <= 1); // UNKNOWN! + __goblint_check(num <= 1); // UNKNOWN! return 0; } diff --git a/tests/regression/52-apron-mukherjee/18-mukherjee_qw2004.c b/tests/regression/52-apron-mukherjee/18-mukherjee_qw2004.c index 4d3b7e8b5c..d3d81ad204 100644 --- a/tests/regression/52-apron-mukherjee/18-mukherjee_qw2004.c +++ b/tests/regression/52-apron-mukherjee/18-mukherjee_qw2004.c @@ -19,7 +19,7 @@ void* T1_QW2004(void* arg) { else stopped--; - assert(pendingIo == stopped); + __goblint_check(pendingIo == stopped); pthread_mutex_unlock(&m); return NULL; } @@ -43,12 +43,12 @@ int main() { stopped++; status = 0; } - assert(pendingIo == stopped); + __goblint_check(pendingIo == stopped); pthread_mutex_unlock(&m); pthread_mutex_lock(&m); if (status == 0) - assert(pendingIo == stopped); + __goblint_check(pendingIo == stopped); pthread_mutex_unlock(&m); pthread_mutex_lock(&m); @@ -60,7 +60,7 @@ int main() { if (pending == 0) stoppingEvent = 1; - assert(pendingIo == stopped); + __goblint_check(pendingIo == stopped); pthread_mutex_unlock(&m); return 0; } diff --git a/tests/regression/54-unroll_arrays/01-simple_array.c b/tests/regression/54-unroll_arrays/01-simple_array.c index e05815f273..550016d422 100644 --- a/tests/regression/54-unroll_arrays/01-simple_array.c +++ b/tests/regression/54-unroll_arrays/01-simple_array.c @@ -14,13 +14,13 @@ void example1() { a[4] = 4; a[6] = 6; a[10] = 10; - assert(a[0] == 0); //UNKNOWN - assert(a[4] == 4); - assert(a[6] == 6); //UNKNOWN + __goblint_check(a[0] == 0); //UNKNOWN + __goblint_check(a[4] == 4); + __goblint_check(a[6] == 6); //UNKNOWN int i = 4; a[i] = 7; - assert(a[4] == 7); + __goblint_check(a[4] == 7); } //array same length of factor @@ -32,10 +32,10 @@ void example2() { a[3] = 4; a[4] = 5; - assert(a[0] == 1); - assert(a[1] == 2); - assert(a[2] == 3); - assert(a[3] == 0); //FAIL - assert(a[4] == 0); //FAIL + __goblint_check(a[0] == 1); + __goblint_check(a[1] == 2); + __goblint_check(a[2] == 3); + __goblint_check(a[3] == 0); //FAIL + __goblint_check(a[4] == 0); //FAIL } diff --git a/tests/regression/54-unroll_arrays/02-simple_array_in_loops.c b/tests/regression/54-unroll_arrays/02-simple_array_in_loops.c index 0eeab24a23..63f5f1b4b5 100644 --- a/tests/regression/54-unroll_arrays/02-simple_array_in_loops.c +++ b/tests/regression/54-unroll_arrays/02-simple_array_in_loops.c @@ -18,15 +18,15 @@ void example1(void) while (i < 42) { a[i] = 0; - assert(a[i] == 0); // UNKNOWN - assert(a[0] == 0); // UNKNOWN - assert(a[17] == 0); + __goblint_check(a[i] == 0); // UNKNOWN + __goblint_check(a[0] == 0); // UNKNOWN + __goblint_check(a[17] == 0); i++; } - assert(a[0] == 0); // UNKNOWN - assert(a[7] == 0); - assert(a[41] == 0); + __goblint_check(a[0] == 0); // UNKNOWN + __goblint_check(a[7] == 0); + __goblint_check(a[41] == 0); } @@ -34,16 +34,16 @@ void example1(void) void example2() { char a[10]; int n; - assert(a[3] == 800); // FAIL (char cannot be 800) - assert(a[3] == 127); // UNKNOWN! + __goblint_check(a[3] == 800); // FAIL (char cannot be 800) + __goblint_check(a[3] == 127); // UNKNOWN! for(int i=0;i < 10; i++) { a[i] = 7; } a[3] = (char) n; - assert(a[3] == 800); //FAIL - assert(a[3] == 127); //UNKNOWN - assert(a[3] == -128); //UNKNOWN - assert(a[3] == -129); //FAIL + __goblint_check(a[3] == 800); //FAIL + __goblint_check(a[3] == 127); //UNKNOWN + __goblint_check(a[3] == -128); //UNKNOWN + __goblint_check(a[3] == -129); //FAIL } diff --git a/tests/regression/55-loop-unrolling/01-simple-cases.c b/tests/regression/55-loop-unrolling/01-simple-cases.c index b87a4c26d1..2f68403446 100644 --- a/tests/regression/55-loop-unrolling/01-simple-cases.c +++ b/tests/regression/55-loop-unrolling/01-simple-cases.c @@ -29,8 +29,8 @@ void example1(void) i++; } - assert(a[0] == 0); // UNKNOWN - assert(a[3] == 3); // UNKNOWN + __goblint_check(a[0] == 0); // UNKNOWN + __goblint_check(a[3] == 3); // UNKNOWN } // Do-while loop simple example @@ -44,8 +44,8 @@ void example2(void) i++; } while (i<=5); - assert(a[0] == 0); // UNKNOWN - assert(a[3] == 3); // UNKNOWN + __goblint_check(a[0] == 0); // UNKNOWN + __goblint_check(a[3] == 3); // UNKNOWN } // Initialization not completed, yet the array representation is not precise @@ -59,9 +59,9 @@ void example3(void) i++; } - assert(a[0] == 0); // UNKNOWN - assert(a[3] == 0); // UNKNOWN - assert(a[7] == 0); // UNKNOWN + __goblint_check(a[0] == 0); // UNKNOWN + __goblint_check(a[3] == 0); // UNKNOWN + __goblint_check(a[7] == 0); // UNKNOWN } // Example with increased precision. Goblint detects in which iteration it is during the unrolled part. @@ -72,15 +72,15 @@ void example4(void) int first_iteration = 1; while (i < 10) { - if (first_iteration == 1) assert(i==0); - else if (i > 5) assert(i == 6); // UNKNOWN + if (first_iteration == 1) __goblint_check(i==0); + else if (i > 5) __goblint_check(i == 6); // UNKNOWN first_iteration = 0; a[i] = 0; i++; } - assert(a[0] == 0); - assert(first_iteration == 0); + __goblint_check(a[0] == 0); + __goblint_check(first_iteration == 0); } @@ -96,17 +96,17 @@ void example5(void) a[i] = 0; top += i; if(i==2){ - assert(top == 3); + __goblint_check(top == 3); } else{ - assert(top == 3); // FAIL + __goblint_check(top == 3); // FAIL } i++; } - assert(a[0] == 0); - assert(a[3] == 0); - assert(top == 6); + __goblint_check(a[0] == 0); + __goblint_check(a[3] == 0); + __goblint_check(top == 6); } // Loop has less iterations than the unrolling factor @@ -118,13 +118,13 @@ void example6(void) while (i < 3) { a[i] = 0; - assert(a[0]==0); + __goblint_check(a[0]==0); i++; } - assert(a[0] == 0); - assert(a[3] == 0); - assert(top == 6); // FAIL + __goblint_check(a[0] == 0); + __goblint_check(a[3] == 0); + __goblint_check(top == 6); // FAIL } // There is a call on the loop's condition @@ -144,8 +144,8 @@ void example7(void) a[i] = i; ++i; } - assert(a[0] == 0); //UNKNOWN - assert(a[6] == 0); //UNKNOWN + __goblint_check(a[0] == 0); //UNKNOWN + __goblint_check(a[6] == 0); //UNKNOWN } // nested loops diff --git a/tests/regression/55-loop-unrolling/02-break.c b/tests/regression/55-loop-unrolling/02-break.c index 4c50630380..4f8d8d5f8c 100644 --- a/tests/regression/55-loop-unrolling/02-break.c +++ b/tests/regression/55-loop-unrolling/02-break.c @@ -14,6 +14,6 @@ int main(void) { break; } - assert(r==17); + __goblint_check(r==17); return 0; } diff --git a/tests/regression/55-loop-unrolling/03-break-right-place.c b/tests/regression/55-loop-unrolling/03-break-right-place.c index 25b679bafa..6e737de0fa 100644 --- a/tests/regression/55-loop-unrolling/03-break-right-place.c +++ b/tests/regression/55-loop-unrolling/03-break-right-place.c @@ -14,5 +14,5 @@ int main(void) { i++; } - assert(i == 0); + __goblint_check(i == 0); } diff --git a/tests/regression/55-loop-unrolling/04-simple.c b/tests/regression/55-loop-unrolling/04-simple.c index 6ee29d15ce..6223b948a4 100644 --- a/tests/regression/55-loop-unrolling/04-simple.c +++ b/tests/regression/55-loop-unrolling/04-simple.c @@ -12,6 +12,6 @@ void main(void) i++; } - assert(a[0] == 0); - assert(a[3] == 3); + __goblint_check(a[0] == 0); + __goblint_check(a[3] == 3); } diff --git a/tests/regression/55-loop-unrolling/05-continue.c b/tests/regression/55-loop-unrolling/05-continue.c index c661da5beb..604af572d4 100644 --- a/tests/regression/55-loop-unrolling/05-continue.c +++ b/tests/regression/55-loop-unrolling/05-continue.c @@ -16,5 +16,5 @@ void main(void) j++; } - assert(j==3); + __goblint_check(j==3); } diff --git a/tests/regression/55-loop-unrolling/06-simple-cases-unrolled.c b/tests/regression/55-loop-unrolling/06-simple-cases-unrolled.c index 8ab6d6020a..b77d8bfa4a 100644 --- a/tests/regression/55-loop-unrolling/06-simple-cases-unrolled.c +++ b/tests/regression/55-loop-unrolling/06-simple-cases-unrolled.c @@ -29,8 +29,8 @@ void example1(void) i++; } - assert(a[0] == 0); - assert(a[3] == 3); + __goblint_check(a[0] == 0); + __goblint_check(a[3] == 3); } // Do-while loop simple example @@ -44,8 +44,8 @@ void example2(void) i++; } while (i<=5); - assert(a[0] == 0); - assert(a[3] == 3); + __goblint_check(a[0] == 0); + __goblint_check(a[3] == 3); } // Initialization not completed, yet the array representation is not precise @@ -59,9 +59,9 @@ void example3(void) i++; } - assert(a[0] == 0); - assert(a[3] == 0); // FAIL - assert(a[7] == 0); // UNKNOWN + __goblint_check(a[0] == 0); + __goblint_check(a[3] == 0); // FAIL + __goblint_check(a[7] == 0); // UNKNOWN } // Example with increased precision. Goblint detects in which iteration it is during the unrolled part. @@ -72,15 +72,15 @@ void example4(void) int first_iteration = 1; while (i < 10) { - if (first_iteration == 1) assert(i==0); - else if (i > 5) assert(i == 6); // UNKNOWN + if (first_iteration == 1) __goblint_check(i==0); + else if (i > 5) __goblint_check(i == 6); // UNKNOWN first_iteration = 0; a[i] = 0; i++; } - assert(a[0] == 0); - assert(first_iteration == 0); + __goblint_check(a[0] == 0); + __goblint_check(first_iteration == 0); } @@ -96,17 +96,17 @@ void example5(void) a[i] = 0; top += i; if(i==2){ - assert(top == 3); + __goblint_check(top == 3); } else{ - assert(top == 3); // FAIL + __goblint_check(top == 3); // FAIL } i++; } - assert(a[0] == 0); - assert(a[3] == 0); - assert(top == 6); + __goblint_check(a[0] == 0); + __goblint_check(a[3] == 0); + __goblint_check(top == 6); } // Loop has less iterations than the unrolling factor @@ -118,13 +118,13 @@ void example6(void) while (i < 3) { a[i] = 0; - assert(a[0]==0); + __goblint_check(a[0]==0); i++; } - assert(a[0] == 0); - assert(a[3] == 0); //UNKNOWN! - assert(top == 6); // FAIL + __goblint_check(a[0] == 0); + __goblint_check(a[3] == 0); //UNKNOWN! + __goblint_check(top == 6); // FAIL } // There is a call on the loop's condition @@ -144,8 +144,8 @@ void example7(void) a[i] = i; ++i; } - assert(a[0] == 0); //UNKNOWN - assert(a[6] == 0); //UNKNOWN + __goblint_check(a[0] == 0); //UNKNOWN + __goblint_check(a[6] == 0); //UNKNOWN } // nested loops diff --git a/tests/regression/55-loop-unrolling/07-nested-unroll.c b/tests/regression/55-loop-unrolling/07-nested-unroll.c index 223d6a43eb..764ecc7532 100644 --- a/tests/regression/55-loop-unrolling/07-nested-unroll.c +++ b/tests/regression/55-loop-unrolling/07-nested-unroll.c @@ -11,7 +11,7 @@ int main(void) { for(int i=0;i<5; i++) { for(int j=0;j <5; j++) { - assert(arr[i][j] == i+j); + __goblint_check(arr[i][j] == i+j); } } } diff --git a/tests/regression/57-floats/01-base.c b/tests/regression/57-floats/01-base.c index 86af7068c5..68bf6f3fda 100644 --- a/tests/regression/57-floats/01-base.c +++ b/tests/regression/57-floats/01-base.c @@ -9,38 +9,38 @@ int main() { // ensure that complex floats just do not do anything double _Complex cplx = 0.; - assert(cplx == 0.); // UNKNOWN + __goblint_check(cplx == 0.); // UNKNOWN double x, a = 2., b = 3. + 1; float y, c = 2.f, d = 3.f + 1; long double z, e = 2.l, f = 3.l + 1; - assert(x == 2.); // UNKNOWN! - assert(y == 2.f); // UNKNOWN! - assert(z == 2.l); // UNKNOWN! + __goblint_check(x == 2.); // UNKNOWN! + __goblint_check(y == 2.f); // UNKNOWN! + __goblint_check(z == 2.l); // UNKNOWN! - assert(a == 2.); // SUCCESS - assert(a < 10.); // SUCCESS - assert(a > 10.); // FAIL + __goblint_check(a == 2.); // SUCCESS + __goblint_check(a < 10.); // SUCCESS + __goblint_check(a > 10.); // FAIL - assert(c == 2.f); // SUCCESS - assert(c < 10.f); // SUCCESS - assert(c > 10.f); // FAIL + __goblint_check(c == 2.f); // SUCCESS + __goblint_check(c < 10.f); // SUCCESS + __goblint_check(c > 10.f); // FAIL - assert(e == 2.f); // SUCCESS - assert(e < 10.f); // SUCCESS - assert(e > 10.f); // FAIL + __goblint_check(e == 2.f); // SUCCESS + __goblint_check(e < 10.f); // SUCCESS + __goblint_check(e > 10.f); // FAIL x = (a + b) / 2.; // naive way of computing the middle y = (c + d) / 2.; // naive way of computing the middle z = (e + f) / 2.; // naive way of computing the middle - assert(x == 3.); // SUCCESS - assert(y == 3.f); // SUCCESS - assert(z == 3.f); // SUCCESS + __goblint_check(x == 3.); // SUCCESS + __goblint_check(y == 3.f); // SUCCESS + __goblint_check(z == 3.f); // SUCCESS - assert(-97. == x - 100.); - assert(-97.f == y - 100.f); - assert(-97.f == z - 100.f); + __goblint_check(-97. == x - 100.); + __goblint_check(-97.f == y - 100.f); + __goblint_check(-97.f == z - 100.f); return 0; } diff --git a/tests/regression/57-floats/02-node_configuration.c b/tests/regression/57-floats/02-node_configuration.c index 47a81d1429..6d8a46e15c 100644 --- a/tests/regression/57-floats/02-node_configuration.c +++ b/tests/regression/57-floats/02-node_configuration.c @@ -7,7 +7,7 @@ void test() __attribute__((goblint_precision("float-interval"))); int main() { double a = 2.; - assert(a == 2.); // UNKNOWN + __goblint_check(a == 2.); // UNKNOWN test(); return 0; } @@ -15,5 +15,5 @@ int main() void test() { double b = 2.; - assert(b == 2.); // SUCCESS + __goblint_check(b == 2.); // SUCCESS } diff --git a/tests/regression/57-floats/04-casts.c b/tests/regression/57-floats/04-casts.c index c04c936aa2..02269eb9c2 100644 --- a/tests/regression/57-floats/04-casts.c +++ b/tests/regression/57-floats/04-casts.c @@ -23,87 +23,87 @@ int main() unsigned u; // Casts from double/float/long double into different variants of ints - assert((int)0.0); // FAIL - assert((long)0.0); // FAIL - assert((unsigned)0.0); // FAIL - assert((int)0.0f); // FAIL - assert((long)0.0f); // FAIL - assert((unsigned)0.0f); // FAIL - assert((int)0.0l); // FAIL - assert((long)0.0l); // FAIL - assert((unsigned)0.0l); // FAIL - - assert((unsigned)1.0); // SUCCESS - assert((long)2.0); // SUCCESS - assert((int)3.0); // SUCCESS - assert((unsigned)1.0f); // SUCCESS - assert((long)2.0f); // SUCCESS - assert((int)3.0f); // SUCCESS - assert((unsigned)1.0l); // SUCCESS - assert((long)2.0l); // SUCCESS - assert((int)3.0l); // SUCCESS + __goblint_check((int)0.0); // FAIL + __goblint_check((long)0.0); // FAIL + __goblint_check((unsigned)0.0); // FAIL + __goblint_check((int)0.0f); // FAIL + __goblint_check((long)0.0f); // FAIL + __goblint_check((unsigned)0.0f); // FAIL + __goblint_check((int)0.0l); // FAIL + __goblint_check((long)0.0l); // FAIL + __goblint_check((unsigned)0.0l); // FAIL + + __goblint_check((unsigned)1.0); // SUCCESS + __goblint_check((long)2.0); // SUCCESS + __goblint_check((int)3.0); // SUCCESS + __goblint_check((unsigned)1.0f); // SUCCESS + __goblint_check((long)2.0f); // SUCCESS + __goblint_check((int)3.0f); // SUCCESS + __goblint_check((unsigned)1.0l); // SUCCESS + __goblint_check((long)2.0l); // SUCCESS + __goblint_check((int)3.0l); // SUCCESS // Cast from int into double/float/long double - assert((double)0); // FAIL - assert((double)0l); // FAIL - assert((double)0u); // FAIL + __goblint_check((double)0); // FAIL + __goblint_check((double)0l); // FAIL + __goblint_check((double)0u); // FAIL - assert((double)1u); // SUCCESS - assert((double)2l); // SUCCESS - assert((double)3); // SUCCESS + __goblint_check((double)1u); // SUCCESS + __goblint_check((double)2l); // SUCCESS + __goblint_check((double)3); // SUCCESS - assert((float)0); // FAIL - assert((float)0l); // FAIL - assert((float)0u); // FAIL + __goblint_check((float)0); // FAIL + __goblint_check((float)0l); // FAIL + __goblint_check((float)0u); // FAIL - assert((float)1u); // SUCCESS - assert((float)2l); // SUCCESS - assert((float)3); // SUCCESS + __goblint_check((float)1u); // SUCCESS + __goblint_check((float)2l); // SUCCESS + __goblint_check((float)3); // SUCCESS - assert((long double)0); // FAIL - assert((long double)0l); // FAIL - assert((long double)0u); // FAIL + __goblint_check((long double)0); // FAIL + __goblint_check((long double)0l); // FAIL + __goblint_check((long double)0u); // FAIL - assert((long double)1u); // SUCCESS - assert((long double)2l); // SUCCESS - assert((long double)3); // SUCCESS + __goblint_check((long double)1u); // SUCCESS + __goblint_check((long double)2l); // SUCCESS + __goblint_check((long double)3); // SUCCESS // cast with ranges RANGE(i, -5, 5); value = (double)i; - assert(-5. <= value && value <= 5.f); // SUCCESS + __goblint_check(-5. <= value && value <= 5.f); // SUCCESS value2 = (float)i; - assert(-5.f <= value2 && value2 <= 5.); // SUCCESS + __goblint_check(-5.f <= value2 && value2 <= 5.); // SUCCESS value3 = (long double)i; - assert(-5.f <= value3 && value3 <= 5.l); // SUCCESS + __goblint_check(-5.f <= value3 && value3 <= 5.l); // SUCCESS RANGE(l, 10, 20); value = l; - assert(10.f <= value && value <= 20.); // SUCCESS + __goblint_check(10.f <= value && value <= 20.); // SUCCESS value2 = l; - assert(10.l <= value2 && value2 <= 20.f); // SUCCESS + __goblint_check(10.l <= value2 && value2 <= 20.f); // SUCCESS value3 = l; - assert(10. <= value2 && value2 <= 20.); // SUCCESS + __goblint_check(10. <= value2 && value2 <= 20.); // SUCCESS RANGE(u, 100, 1000); value = u; - assert(value > 1.); // SUCCESS + __goblint_check(value > 1.); // SUCCESS value2 = u; - assert(value2 > 1.f); // SUCCESS + __goblint_check(value2 > 1.f); // SUCCESS value3 = u; - assert(value2 > 1.l); // SUCCESS + __goblint_check(value2 > 1.l); // SUCCESS RANGE(value, -10.f, 10.); i = (int)value; - assert(-10 <= i && i <= 10); // SUCCESS + __goblint_check(-10 <= i && i <= 10); // SUCCESS RANGE(value2, -10.f, 10.); i = (int)value2; - assert(-10 <= i && i <= 10); // SUCCESS + __goblint_check(-10 <= i && i <= 10); // SUCCESS RANGE(value3, -10.l, 10.); i = (int)value3; - assert(-10 <= i && i <= 10); // SUCCESS + __goblint_check(-10 <= i && i <= 10); // SUCCESS return 0; } diff --git a/tests/regression/57-floats/05-invariant.c b/tests/regression/57-floats/05-invariant.c index 1b4a7dc1a9..c4e730f38b 100644 --- a/tests/regression/57-floats/05-invariant.c +++ b/tests/regression/57-floats/05-invariant.c @@ -26,95 +26,95 @@ int main() if (a != 1.) { // this would require a exclusion list etc. - assert(a != 1.); // UNKNOWN + __goblint_check(a != 1.); // UNKNOWN } if (a == 1.) { - assert(a == 1.); // SUCCESS + __goblint_check(a == 1.); // SUCCESS } if (b == 1.f) { - assert(b == 1.f); // SUCCESS + __goblint_check(b == 1.f); // SUCCESS } if (a <= 5.) { - assert(a <= 5.); // SUCCESS + __goblint_check(a <= 5.); // SUCCESS } if (b <= 5.f) { - assert(b <= 5.f); // SUCCESS + __goblint_check(b <= 5.f); // SUCCESS } if (c <= 5.f) { - assert(c <= 5.f); // SUCCESS + __goblint_check(c <= 5.f); // SUCCESS } if (a <= 5. && a >= -5.) { - assert(a <= 5. && a >= -5.); // SUCCESS + __goblint_check(a <= 5. && a >= -5.); // SUCCESS } if (b <= 5.f && b >= -5.f) { - assert(b <= 5. && b >= -5.); // SUCCESS + __goblint_check(b <= 5. && b >= -5.); // SUCCESS } if (a + 5.f < 10.f) { - assert(a <= 5.); // SUCCESS + __goblint_check(a <= 5.); // SUCCESS } if (b + 5.f < 10.f) { - assert(b <= 5.l); // SUCCESS + __goblint_check(b <= 5.l); // SUCCESS } if (c + 5.f < 10.f) { - assert(c <= 5.f); // SUCCESS + __goblint_check(c <= 5.f); // SUCCESS } if (a * 2. < 6.f) { - assert(a <= 3.); // SUCCESS + __goblint_check(a <= 3.); // SUCCESS } if (b * 2.f < 6.f) { - assert(b <= 3.f); // SUCCESS + __goblint_check(b <= 3.f); // SUCCESS } if (c * 2. < 6.f) { - assert(c <= 3.f); // SUCCESS + __goblint_check(c <= 3.f); // SUCCESS } if (a / 3. > 10.) { - assert(a >= 30.); // SUCCESS + __goblint_check(a >= 30.); // SUCCESS } if (b / 3.f > 10.f) { - assert(b >= 30); // SUCCESS + __goblint_check(b >= 30); // SUCCESS } if (a < 10) { - assert(a < 10.); // SUCCESS + __goblint_check(a < 10.); // SUCCESS } if (b < 10) { - assert(b < 10.f); // SUCCESS + __goblint_check(b < 10.f); // SUCCESS } if (c < 10) { - assert(c < 10.l); // SUCCESS + __goblint_check(c < 10.l); // SUCCESS } if (a > 1.) { - assert(a < 1.); // FAIL + __goblint_check(a < 1.); // FAIL if (a < 1.) { - assert(0); // NOWARN + __goblint_check(0); // NOWARN return 1; } } diff --git a/tests/regression/57-floats/06-library_functions.c b/tests/regression/57-floats/06-library_functions.c index ce8720c95c..d6b377167f 100644 --- a/tests/regression/57-floats/06-library_functions.c +++ b/tests/regression/57-floats/06-library_functions.c @@ -10,75 +10,75 @@ int main() double nan = __builtin_nan(""); //__buitin_isfinite(x): - assert(__builtin_isfinite(1.0)); // SUCCESS - assert(__builtin_isfinite(inf)); // UNKNOWN - assert(__builtin_isfinite(nan)); // UNKNOWN + __goblint_check(__builtin_isfinite(1.0)); // SUCCESS + __goblint_check(__builtin_isfinite(inf)); // UNKNOWN + __goblint_check(__builtin_isfinite(nan)); // UNKNOWN //__buitin_isinf(x): - assert(__builtin_isinf(1.0)); // FAIL - assert(__builtin_isinf(inf)); // UNKNOWN - assert(__builtin_isinf(nan)); // UNKNOWN + __goblint_check(__builtin_isinf(1.0)); // FAIL + __goblint_check(__builtin_isinf(inf)); // UNKNOWN + __goblint_check(__builtin_isinf(nan)); // UNKNOWN //__buitin_isinf_sign(x): - assert(__builtin_isinf_sign(1.0)); // FAIL - assert(__builtin_isinf_sign(inf)); // UNKNOWN - assert(__builtin_isinf_sign(-inf)); // UNKNOWN - assert(__builtin_isinf_sign(nan)); // UNKNOWN + __goblint_check(__builtin_isinf_sign(1.0)); // FAIL + __goblint_check(__builtin_isinf_sign(inf)); // UNKNOWN + __goblint_check(__builtin_isinf_sign(-inf)); // UNKNOWN + __goblint_check(__builtin_isinf_sign(nan)); // UNKNOWN //__buitin_isnan(x): - assert(__builtin_isnan(1.0)); // FAIL - assert(__builtin_isnan(inf)); // UNKNOWN - assert(__builtin_isnan(nan)); // UNKNOWN + __goblint_check(__builtin_isnan(1.0)); // FAIL + __goblint_check(__builtin_isnan(inf)); // UNKNOWN + __goblint_check(__builtin_isnan(nan)); // UNKNOWN //__buitin_isnormal(x): - assert(__builtin_isnormal(dbl_min)); // SUCCESS - assert(__builtin_isnormal(0.0)); // FAIL - assert(__builtin_isnormal(dbl_min / 2)); // FAIL - assert(__builtin_isnormal(inf)); // UNKNOWN - assert(__builtin_isnormal(nan)); // UNKNOWN + __goblint_check(__builtin_isnormal(dbl_min)); // SUCCESS + __goblint_check(__builtin_isnormal(0.0)); // FAIL + __goblint_check(__builtin_isnormal(dbl_min / 2)); // FAIL + __goblint_check(__builtin_isnormal(inf)); // UNKNOWN + __goblint_check(__builtin_isnormal(nan)); // UNKNOWN //__buitin_signbit(x): - assert(__builtin_signbit(1.0)); // FAIL - assert(__builtin_signbit(-1.0)); // SUCCESS - assert(__builtin_signbit(0.0)); // UNKNOWN - assert(__builtin_signbit(inf)); // UNKNOWN - assert(__builtin_signbit(-inf)); // UNKNOWN - assert(__builtin_signbit(nan)); // UNKNOWN + __goblint_check(__builtin_signbit(1.0)); // FAIL + __goblint_check(__builtin_signbit(-1.0)); // SUCCESS + __goblint_check(__builtin_signbit(0.0)); // UNKNOWN + __goblint_check(__builtin_signbit(inf)); // UNKNOWN + __goblint_check(__builtin_signbit(-inf)); // UNKNOWN + __goblint_check(__builtin_signbit(nan)); // UNKNOWN // fabs(x): - assert(4. == fabs(-4.)); // SUCCESS - assert(0. <= fabs(cos(0.1))); // SUCCESS - assert(0. <= fabs(-inf)); // UNKNOWN - assert(0. <= fabs(nan)); // UNKNOWN + __goblint_check(4. == fabs(-4.)); // SUCCESS + __goblint_check(0. <= fabs(cos(0.1))); // SUCCESS + __goblint_check(0. <= fabs(-inf)); // UNKNOWN + __goblint_check(0. <= fabs(nan)); // UNKNOWN double greater_than_pi = 3.142; // acos(x): - assert((0. <= acos(0.1)) && (acos(0.1) <= greater_than_pi)); // SUCCESS - assert(acos(1.) == 0.); // SUCCESS + __goblint_check((0. <= acos(0.1)) && (acos(0.1) <= greater_than_pi)); // SUCCESS + __goblint_check(acos(1.) == 0.); // SUCCESS acos(2.0); // WARN: Domain error might occur: acos argument might be outside of [-1., 1.] // asin(x): - assert(((-greater_than_pi / 2.) <= asin(0.1)) && (asin(0.1) <= (greater_than_pi / 2.))); // SUCCESS - assert(asin(0.) == 0.); // SUCCESS + __goblint_check(((-greater_than_pi / 2.) <= asin(0.1)) && (asin(0.1) <= (greater_than_pi / 2.))); // SUCCESS + __goblint_check(asin(0.) == 0.); // SUCCESS asin(2.0); // WARN: Domain error might occur: asin argument might be outside of [-1., 1.] // atan(x): - assert(((-greater_than_pi / 2.) <= atan(0.1)) && (atan(0.1) <= (greater_than_pi / 2.))); // SUCCESS - assert(atan(0.) == 0.); // SUCCESS + __goblint_check(((-greater_than_pi / 2.) <= atan(0.1)) && (atan(0.1) <= (greater_than_pi / 2.))); // SUCCESS + __goblint_check(atan(0.) == 0.); // SUCCESS // atan2(y, x) - assert(((-greater_than_pi / 2.) <= atan2(0.1, 0.2)) && (atan2(0.1, 0.2) <= (greater_than_pi / 2.))); // SUCCESS + __goblint_check(((-greater_than_pi / 2.) <= atan2(0.1, 0.2)) && (atan2(0.1, 0.2) <= (greater_than_pi / 2.))); // SUCCESS // cos(x) - assert((-1. <= cos(0.1)) && (cos(0.1) <= 1.)); // SUCCESS - assert(cos(0.) == 1.); // SUCCESS + __goblint_check((-1. <= cos(0.1)) && (cos(0.1) <= 1.)); // SUCCESS + __goblint_check(cos(0.) == 1.); // SUCCESS // sin(x) - assert((-1. <= sin(0.1)) && (sin(0.1) <= 1.)); // SUCCESS - assert(sin(0.) == 0.); // SUCCESS + __goblint_check((-1. <= sin(0.1)) && (sin(0.1) <= 1.)); // SUCCESS + __goblint_check(sin(0.) == 0.); // SUCCESS // tan(x) - assert(tan(0.) == 0.); // SUCCESS + __goblint_check(tan(0.) == 0.); // SUCCESS // unimplemented math.h function, should not invalidate globals: j0(0.1); // NOWARN diff --git a/tests/regression/57-floats/08-bit_casts.c b/tests/regression/57-floats/08-bit_casts.c index 8180a28919..accf3fae54 100644 --- a/tests/regression/57-floats/08-bit_casts.c +++ b/tests/regression/57-floats/08-bit_casts.c @@ -13,20 +13,20 @@ int main() a.word = 3212836864; float b = a.value; - assert(b == -1.0f); // UNKNOWN! + __goblint_check(b == -1.0f); // UNKNOWN! A a2; a2.value = -1.0f; unsigned int b2 = a2.word; - assert(b2 == 1.0f); // UNKNOWN! + __goblint_check(b2 == 1.0f); // UNKNOWN! int x = 100; float y = *(float *)(&a); - assert(y == 100.f); // UNKNOWN! + __goblint_check(y == 100.f); // UNKNOWN! double i = 100.0; unsigned j = *(unsigned *)(&i); - assert(j == 100); // UNKNOWN! + __goblint_check(j == 100); // UNKNOWN! return 0; } diff --git a/tests/regression/57-floats/09-svcomp_float_req_bl_1252b.c b/tests/regression/57-floats/09-svcomp_float_req_bl_1252b.c index c4f0302059..4c242129c0 100644 --- a/tests/regression/57-floats/09-svcomp_float_req_bl_1252b.c +++ b/tests/regression/57-floats/09-svcomp_float_req_bl_1252b.c @@ -83,9 +83,9 @@ int main() float y = -0.0f; float res = fmax_float(x, y); // y is -0 and x is +0, the result shall be +0 - assert(res == 0.0f); // SUCCESS - assert(__signbit_float(res) == 1); // UNKNOWN! - assert(!(res == 0.0f && __signbit_float(res) == 0)); // UNKNOWN! + __goblint_check(res == 0.0f); // SUCCESS + __goblint_check(__signbit_float(res) == 1); // UNKNOWN! + __goblint_check(!(res == 0.0f && __signbit_float(res) == 0)); // UNKNOWN! return 0; } diff --git a/tests/regression/57-floats/10-svcomp_floats_cbmc_regression_float11.c b/tests/regression/57-floats/10-svcomp_floats_cbmc_regression_float11.c index f0951a07c4..a5350cd8f9 100644 --- a/tests/regression/57-floats/10-svcomp_floats_cbmc_regression_float11.c +++ b/tests/regression/57-floats/10-svcomp_floats_cbmc_regression_float11.c @@ -39,12 +39,12 @@ int main() if(!(0<1)) {success = 0;} if(!(1>-0)) {success = 0;} if(!(-0<1)) {success = 0;} - + if(!(!(0.999f<0.0f))) {success = 0;} if(!(!(-0.999f>-0.0f))) {success = 0;} if(!(!(0.999f<=0.0f))) {success = 0;} if(!(!(-0.999f>=-0.0f))) {success = 0;} - assert(success); // SUCCESS - assert(unknown); // UNKNOWN + __goblint_check(success); // SUCCESS + __goblint_check(unknown); // UNKNOWN } diff --git a/tests/regression/57-floats/11-advanced_invariants.c b/tests/regression/57-floats/11-advanced_invariants.c index b15c60e02a..a5914d9d84 100644 --- a/tests/regression/57-floats/11-advanced_invariants.c +++ b/tests/regression/57-floats/11-advanced_invariants.c @@ -12,7 +12,7 @@ int main() double high_number = 340281981556000088756250604298070654976.; double next = 340281981556000126535182467255232364544.; double distance_to_next = next - high_number; - assert(high_number + distance_to_next == next); // SUCCESS + __goblint_check(high_number + distance_to_next == next); // SUCCESS // make a definitly finite! if (d) @@ -27,30 +27,30 @@ int main() if (a + high_number <= high_number) { // the mathematical solution with `a <= 0` is obviously not the only one here - assert(a <= 0.); // UNKNOWN! + __goblint_check(a <= 0.); // UNKNOWN! // assuming the rounding mode "nearest", `a` had to be below `distance_to_next / 2` // (as half-way cases are always rounded away from zero) - assert(a < (distance_to_next / 2)); // UNKNOWN! + __goblint_check(a < (distance_to_next / 2)); // UNKNOWN! // ... this than also has to be unknown - assert(a <= (distance_to_next / 2)); // UNKNOWN! + __goblint_check(a <= (distance_to_next / 2)); // UNKNOWN! // with up/down as rounding mode -> a only has to be below `distance_to_next` - assert(a < distance_to_next); // UNKNOWN - assert(a <= distance_to_next); // SUCCESS + __goblint_check(a < distance_to_next); // UNKNOWN + __goblint_check(a <= distance_to_next); // SUCCESS } double one = 1.; if (a * one >= next) { // the mathematical solution again would be `a >= next` but does not take the rounding mode into account - assert(a >= next); // UNKNOWN! + __goblint_check(a >= next); // UNKNOWN! // assuming the rounding mode "nearest", `a` had to be at least `high_number + distance_to_next / 2` // (as half-way cases are always rounded away from zero) - assert(a - high_number >= (distance_to_next / 2)); // UNKNOWN! + __goblint_check(a - high_number >= (distance_to_next / 2)); // UNKNOWN! // ... this than also has to be unknown - assert(a - high_number > (distance_to_next / 2)); // UNKNOWN! + __goblint_check(a - high_number > (distance_to_next / 2)); // UNKNOWN! // with up/down as rounding mode -> a only has to be above `high_number` - assert(a > high_number); // UNKNOWN - assert(a >= high_number); // SUCCESS + __goblint_check(a > high_number); // UNKNOWN + __goblint_check(a >= high_number); // SUCCESS } return 0; diff --git a/tests/regression/57-floats/12-subtraction_assignment.c b/tests/regression/57-floats/12-subtraction_assignment.c index 8f3627921f..75e5c8d7c6 100644 --- a/tests/regression/57-floats/12-subtraction_assignment.c +++ b/tests/regression/57-floats/12-subtraction_assignment.c @@ -11,11 +11,11 @@ int main() z = 1 - 1.0; - assert(z == 0.); // SUCCESS + __goblint_check(z == 0.); // SUCCESS if (0.) { x = z;} if (0 == (0. + 1.)) { x = z;} - assert(0); // FAIL + __goblint_check(0); // FAIL } diff --git a/tests/regression/57-floats/13-refine-branch.c b/tests/regression/57-floats/13-refine-branch.c index b50fc7a393..b0dab09fc3 100644 --- a/tests/regression/57-floats/13-refine-branch.c +++ b/tests/regression/57-floats/13-refine-branch.c @@ -7,7 +7,7 @@ int main() if(z) { // z may NOT be refined to range only in the values of int here(!) - assert(__builtin_isfinite(z)); //UNKNOWN! + __goblint_check(__builtin_isfinite(z)); //UNKNOWN! } else { } diff --git a/tests/regression/99-tutorials/01-first.c b/tests/regression/99-tutorials/01-first.c index 8d7c1058c5..32a6f63178 100644 --- a/tests/regression/99-tutorials/01-first.c +++ b/tests/regression/99-tutorials/01-first.c @@ -14,7 +14,7 @@ int main() { // The above code branches on an uninitialized variable. // The value of x could be either 5 or 7. - assert(x > 0); // TODO: Thus, this assertion should hold! + __goblint_check(x > 0); // TODO: Thus, this assertion should hold! return 0; } diff --git a/tests/regression/99-tutorials/02-first-extend.c b/tests/regression/99-tutorials/02-first-extend.c index 4a56b13d19..9b896c6b9e 100644 --- a/tests/regression/99-tutorials/02-first-extend.c +++ b/tests/regression/99-tutorials/02-first-extend.c @@ -14,7 +14,7 @@ int main() { // The above code branches on an uninitialized variable. // The value of x could be either 5 or 0. - assert(x > -1); // TODO: Thus, this assertion should hold! + __goblint_check(x > -1); // TODO: Thus, this assertion should hold! return 0; }