From 64e9512c13ab589fc725458188b4700a2a3fcd2e Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Fri, 2 Sep 2016 10:22:38 +0100 Subject: [PATCH 01/71] add the option existing-coverage Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 1 + src/cbmc/cbmc_parse_options.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 3b0d7b5bc6a..44922b7918b 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -1140,6 +1140,7 @@ void cbmc_parse_optionst::help() " --no-assumptions ignore user assumptions\n" " --error-label label check that label is unreachable\n" " --cover CC create test-suite with coverage criterion CC\n" + " --existing-coverage file instrument non-covered test goals\n" " --mm MM memory consistency model for concurrent programs\n" "\n" "Java Bytecode frontend options:\n" diff --git a/src/cbmc/cbmc_parse_options.h b/src/cbmc/cbmc_parse_options.h index 33fe0ba5175..1882f57a738 100644 --- a/src/cbmc/cbmc_parse_options.h +++ b/src/cbmc/cbmc_parse_options.h @@ -54,6 +54,7 @@ class optionst; "(round-to-nearest)(round-to-plus-inf)(round-to-minus-inf)(round-to-zero)" \ "(graphml-cex):" \ "(localize-faults)(localize-faults-method):" \ + "(existing-coverage):" \ "(floatbv)(all-claims)(all-properties)" // legacy, and will eventually disappear class cbmc_parse_optionst: From 5da372fcc487b7aec6b274102ac9fdf9150bf105 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Fri, 2 Sep 2016 12:32:09 +0100 Subject: [PATCH 02/71] check whether the user has provided a valid json file for --existing-coverage Signed-off-by: Lucas Cordeiro --- src/cbmc/Makefile | 1 + src/cbmc/cbmc_parse_options.cpp | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/cbmc/Makefile b/src/cbmc/Makefile index 8440c92fa1b..8bd53417622 100644 --- a/src/cbmc/Makefile +++ b/src/cbmc/Makefile @@ -27,6 +27,7 @@ OBJ += ../ansi-c/ansi-c$(LIBEXT) \ ../xmllang/xmllang$(LIBEXT) \ ../assembler/assembler$(LIBEXT) \ ../solvers/solvers$(LIBEXT) \ + ../json/json$(LIBEXT) \ ../util/util$(LIBEXT) INCLUDES= -I .. diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 44922b7918b..8432683c510 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -50,6 +50,8 @@ Author: Daniel Kroening, kroening@kroening.com #include +#include + #include "cbmc_solvers.h" #include "cbmc_parse_options.h" #include "bmc.h" @@ -458,6 +460,10 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options) if(cmdline.isset("graphml-cex")) options.set_option("graphml-cex", cmdline.get_value("graphml-cex")); + + if(cmdline.isset("existing-coverage")) + options.set_option("existing-coverage", cmdline.get_value("existing-coverage")); + } /*******************************************************************\ @@ -945,7 +951,25 @@ bool cbmc_parse_optionst::process_goto_program( // add loop ids goto_functions.compute_loop_numbers(); - + + // instrument non-covered test goals + if(cmdline.isset("existing-coverage")) + { + //get file with covered test goals + const std::string coverage=cmdline.get_value("existing-coverage"); + + jsont json; + + //check coverage file + if(parse_json(coverage, get_message_handler(), json)) + { + messaget message(get_message_handler()); + message.error() << coverage << " file is not a valid json file" + << messaget::eom; + return true; + } + } + // instrument cover goals if(cmdline.isset("cover")) From 40aa14a2113c78e23e296c8757cf77dbec83a91a Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Fri, 2 Sep 2016 15:31:16 +0100 Subject: [PATCH 03/71] get the line of each goal Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 8432683c510..d19e98f75a5 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -968,6 +968,34 @@ bool cbmc_parse_optionst::process_goto_program( << messaget::eom; return true; } + + //make sure that we have an array of elements + if(!json.is_array()) + { + messaget message(get_message_handler()); + message.error() << "expecting an array in the " << coverage << " file, but got " + << json << messaget::eom; + return true; + } + + for(jsont::arrayt::const_iterator + it=json.array.begin(); + it!=json.array.end(); + it++) + { + //get the goals array + if ((*it)["goals"].is_array()) + { + for(jsont::arrayt::const_iterator + itg=(*it)["goals"].array.begin(); + itg!=(*it)["goals"].array.end(); + itg++) + { + //get the line of each goal + const unsigned int line=std::stoi((*itg)["sourceLocation"]["line"].value); + } + } + } } // instrument cover goals From ac40ed5437e9de620139f1aec62efc294ee26a72 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Fri, 2 Sep 2016 16:28:21 +0100 Subject: [PATCH 04/71] generate goals only if they do not exist in the json file Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 7 +++++-- src/goto-instrument/cover.cpp | 27 ++++++++++++++++++++++++++- src/goto-instrument/cover.h | 2 ++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index d19e98f75a5..8c02cf4df52 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -952,9 +952,11 @@ bool cbmc_parse_optionst::process_goto_program( // add loop ids goto_functions.compute_loop_numbers(); - // instrument non-covered test goals + // check existing test goals if(cmdline.isset("existing-coverage")) { + status() << "Check existing coverage goals" << eom; + //get file with covered test goals const std::string coverage=cmdline.get_value("existing-coverage"); @@ -992,7 +994,8 @@ bool cbmc_parse_optionst::process_goto_program( itg++) { //get the line of each goal - const unsigned int line=std::stoi((*itg)["sourceLocation"]["line"].value); + const std::string line=(*itg)["sourceLocation"]["line"].value; + set_existing_goals(line); } } } diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index bb6e70d443e..45d845950cb 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -17,6 +17,8 @@ Date: May 2016 #include "cover.h" +std::vector existing_goals; + class basic_blockst { public: @@ -68,6 +70,23 @@ class basic_blockst /*******************************************************************\ +Function: set_existing_goals + + Inputs: + + Outputs: + + Purpose: + +\*******************************************************************/ + +void set_existing_goals(std::string goal) +{ + existing_goals.push_back(goal); +} + +/*******************************************************************\ + Function: as_string Inputs: @@ -1120,7 +1139,13 @@ void instrument_cover_goals( source_locationt source_location= basic_blocks.source_location_map[block_nr]; - if(!source_location.get_file().empty() && + //check whether the current goal already exists + std::vector::iterator it; + it = find (existing_goals.begin(), existing_goals.end(), + source_location.get_line().c_str()); + + if(it == existing_goals.end() && + !source_location.get_file().empty() && source_location.get_file()[0]!='<') { std::string comment="block "+b; diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index cf51972f6e6..56f8cb7122e 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -17,6 +17,8 @@ enum class coverage_criteriont { LOCATION, BRANCH, DECISION, CONDITION, PATH, MCDC, ASSERTION, COVER }; +void set_existing_goals(std::string goal); + void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, From 14e5dc5955567d496afeac400380c2fef696aa6f Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 12:03:22 +0100 Subject: [PATCH 05/71] refactor the code for checking existing coverage Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 102 +++++++++++++++--------------- src/goto-instrument/cover.cpp | 45 +++++++++---- src/goto-instrument/cover.h | 18 ++++-- src/symex/symex_parse_options.cpp | 3 +- 4 files changed, 100 insertions(+), 68 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 8c02cf4df52..2e63d065786 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -952,55 +952,6 @@ bool cbmc_parse_optionst::process_goto_program( // add loop ids goto_functions.compute_loop_numbers(); - // check existing test goals - if(cmdline.isset("existing-coverage")) - { - status() << "Check existing coverage goals" << eom; - - //get file with covered test goals - const std::string coverage=cmdline.get_value("existing-coverage"); - - jsont json; - - //check coverage file - if(parse_json(coverage, get_message_handler(), json)) - { - messaget message(get_message_handler()); - message.error() << coverage << " file is not a valid json file" - << messaget::eom; - return true; - } - - //make sure that we have an array of elements - if(!json.is_array()) - { - messaget message(get_message_handler()); - message.error() << "expecting an array in the " << coverage << " file, but got " - << json << messaget::eom; - return true; - } - - for(jsont::arrayt::const_iterator - it=json.array.begin(); - it!=json.array.end(); - it++) - { - //get the goals array - if ((*it)["goals"].is_array()) - { - for(jsont::arrayt::const_iterator - itg=(*it)["goals"].array.begin(); - itg!=(*it)["goals"].array.end(); - itg++) - { - //get the line of each goal - const std::string line=(*itg)["sourceLocation"]["line"].value; - set_existing_goals(line); - } - } - } - } - // instrument cover goals if(cmdline.isset("cover")) @@ -1030,9 +981,58 @@ bool cbmc_parse_optionst::process_goto_program( error() << "unknown coverage criterion" << eom; return true; } - + + // check existing test goals + coverage_goals goals; + if(cmdline.isset("existing-coverage")) + { + status() << "Check existing coverage goals" << eom; + + //get file with covered test goals + const std::string coverage=cmdline.get_value("existing-coverage"); + + jsont json; + + //check coverage file + if(parse_json(coverage, get_message_handler(), json)) + { + messaget message(get_message_handler()); + message.error() << coverage << " file is not a valid json file" + << messaget::eom; + return true; + } + + //make sure that we have an array of elements + if(!json.is_array()) + { + messaget message(get_message_handler()); + message.error() << "expecting an array in the " << coverage << " file, but got " + << json << messaget::eom; + return true; + } + + for(jsont::arrayt::const_iterator + it=json.array.begin(); + it!=json.array.end(); + it++) + { + //get the goals array + if ((*it)["goals"].is_array()) + { + for(jsont::arrayt::const_iterator + itg=(*it)["goals"].array.begin(); + itg!=(*it)["goals"].array.end(); + itg++) + { + //get the line of each goal + const std::string line=(*itg)["sourceLocation"]["line"].value; + goals.set_goals(line); + } + } + } + } status() << "Instrumenting coverage goals" << eom; - instrument_cover_goals(symbol_table, goto_functions, c); + instrument_cover_goals(symbol_table, goto_functions, c, goals); goto_functions.update(); } diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 45d845950cb..04d3097531c 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -17,8 +17,6 @@ Date: May 2016 #include "cover.h" -std::vector existing_goals; - class basic_blockst { public: @@ -70,7 +68,7 @@ class basic_blockst /*******************************************************************\ -Function: set_existing_goals +Function: coverage_goals::set_goals Inputs: @@ -80,11 +78,35 @@ Function: set_existing_goals \*******************************************************************/ -void set_existing_goals(std::string goal) +void coverage_goals::set_goals(std::string goal) { existing_goals.push_back(goal); } +/*******************************************************************\ + +Function: coverage_goals::get_goals + + Inputs: + + Outputs: + + Purpose: + +\*******************************************************************/ + +const bool coverage_goals::get_goals(const char* goal) +{ + std::vector::iterator it; + it = find (existing_goals.begin(), existing_goals.end(), goal); + + if(it == existing_goals.end()) + return true; + else + return false; +} + + /*******************************************************************\ Function: as_string @@ -1077,7 +1099,8 @@ Function: instrument_cover_goals void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, - coverage_criteriont criterion) + coverage_criteriont criterion, + coverage_goals &goals) { const namespacet ns(symbol_table); basic_blockst basic_blocks(goto_program); @@ -1140,11 +1163,7 @@ void instrument_cover_goals( basic_blocks.source_location_map[block_nr]; //check whether the current goal already exists - std::vector::iterator it; - it = find (existing_goals.begin(), existing_goals.end(), - source_location.get_line().c_str()); - - if(it == existing_goals.end() && + if(goals.get_goals(source_location.get_line().c_str()) && !source_location.get_file().empty() && source_location.get_file()[0]!='<') { @@ -1379,7 +1398,8 @@ Function: instrument_cover_goals void instrument_cover_goals( const symbol_tablet &symbol_table, goto_functionst &goto_functions, - coverage_criteriont criterion) + coverage_criteriont criterion, + coverage_goals &goals) { Forall_goto_functions(f_it, goto_functions) { @@ -1387,6 +1407,7 @@ void instrument_cover_goals( f_it->first=="__CPROVER_initialize") continue; - instrument_cover_goals(symbol_table, f_it->second.body, criterion); + instrument_cover_goals(symbol_table, f_it->second.body, + criterion, goals); } } diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index 56f8cb7122e..3cd41f06bc0 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -13,20 +13,30 @@ Date: May 2016 #include +class coverage_goals +{ +public: + void set_goals(std::string goal); + const bool get_goals(const char* goal); + +private: + std::vector existing_goals; +}; + enum class coverage_criteriont { LOCATION, BRANCH, DECISION, CONDITION, PATH, MCDC, ASSERTION, COVER }; -void set_existing_goals(std::string goal); - void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, - coverage_criteriont); + coverage_criteriont, + coverage_goals &goals); void instrument_cover_goals( const symbol_tablet &symbol_table, goto_functionst &goto_functions, - coverage_criteriont); + coverage_criteriont, + coverage_goals &goals); #endif diff --git a/src/symex/symex_parse_options.cpp b/src/symex/symex_parse_options.cpp index 2fbee65e2ad..5ac7fb001d8 100644 --- a/src/symex/symex_parse_options.cpp +++ b/src/symex/symex_parse_options.cpp @@ -442,7 +442,8 @@ bool symex_parse_optionst::process_goto_program(const optionst &options) } status() << "Instrumenting coverge goals" << eom; - instrument_cover_goals(symbol_table, goto_model.goto_functions, c); + coverage_goals goals; + instrument_cover_goals(symbol_table, goto_model.goto_functions, c, goals); goto_model.goto_functions.update(); } From 97ebd80e5812a4d67907787260e98adbd240a764 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 12:04:37 +0100 Subject: [PATCH 06/71] add test cases to check existing coverage Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location2/main.c | 13 + regression/cbmc-cover/location2/main.json | 197 ++++++ regression/cbmc-cover/location2/test.desc | 8 + regression/cbmc-cover/location3/main.c | 13 + regression/cbmc-cover/location3/main.json | 187 ++++++ regression/cbmc-cover/location3/test.desc | 9 + regression/cbmc-cover/location4/main.c | 41 ++ regression/cbmc-cover/location4/main.json | 633 ++++++++++++++++++ .../cbmc-cover/location4/single-linked-list.c | 51 ++ .../cbmc-cover/location4/single-linked-list.h | 14 + regression/cbmc-cover/location4/test.desc | 8 + 11 files changed, 1174 insertions(+) create mode 100644 regression/cbmc-cover/location2/main.c create mode 100644 regression/cbmc-cover/location2/main.json create mode 100644 regression/cbmc-cover/location2/test.desc create mode 100644 regression/cbmc-cover/location3/main.c create mode 100644 regression/cbmc-cover/location3/main.json create mode 100644 regression/cbmc-cover/location3/test.desc create mode 100644 regression/cbmc-cover/location4/main.c create mode 100644 regression/cbmc-cover/location4/main.json create mode 100644 regression/cbmc-cover/location4/single-linked-list.c create mode 100644 regression/cbmc-cover/location4/single-linked-list.h create mode 100644 regression/cbmc-cover/location4/test.desc diff --git a/regression/cbmc-cover/location2/main.c b/regression/cbmc-cover/location2/main.c new file mode 100644 index 00000000000..9a0b65d37f6 --- /dev/null +++ b/regression/cbmc-cover/location2/main.c @@ -0,0 +1,13 @@ +int main() +{ + int i, j; + + i = 1; + + if(j > 0) + j += i; + else + j = 0; + + assert(i != j); +} diff --git a/regression/cbmc-cover/location2/main.json b/regression/cbmc-cover/location2/main.json new file mode 100644 index 00000000000..57c35d49321 --- /dev/null +++ b/regression/cbmc-cover/location2/main.json @@ -0,0 +1,197 @@ +[ +{ + "program": "CBMC 5.5" +}, +{ + "messageText": "CBMC version 5.5 64-bit x86_64 linux", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Parsing main.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Converting", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking main", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "function `assert' is not declared", + "messageType": "WARNING" +}, +{ + "messageText": "Generating GOTO Program", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Adding CPROVER library (x86_64)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Removal of function pointers and virtual functions", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Partial Inlining", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generic Property Instrumentation", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Instrumenting coverage goals", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Starting Bounded Model Checking", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "size of program expression: 45 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 4 VCC(s), 4 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 4 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "265 variables, 522 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "265 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.001s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "main.coverage.1", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "3" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "main.coverage.2", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "main.coverage.3", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "main.coverage.4", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "12" + }, + "status": "satisfied" + } + ], + "goalsCovered": 4, + "tests": [ + { + "coveredGoals": [ "main.coverage.1", "main.coverage.3", "main.coverage.4" ], + "inputs": [ ] + }, + { + "coveredGoals": [ "main.coverage.2" ], + "inputs": [ ] + } + ], + "totalGoals": 4 +}, +{ + "messageText": "** 4 of 4 covered (100.0%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 2 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location2/test.desc b/regression/cbmc-cover/location2/test.desc new file mode 100644 index 00000000000..010956452e1 --- /dev/null +++ b/regression/cbmc-cover/location2/test.desc @@ -0,0 +1,8 @@ +CORE +main.c +--cover location --existing-coverage main.json +^EXIT=0$ +^SIGNAL=0$ +^\*\* 0 of 0 covered (100.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location3/main.c b/regression/cbmc-cover/location3/main.c new file mode 100644 index 00000000000..9a0b65d37f6 --- /dev/null +++ b/regression/cbmc-cover/location3/main.c @@ -0,0 +1,13 @@ +int main() +{ + int i, j; + + i = 1; + + if(j > 0) + j += i; + else + j = 0; + + assert(i != j); +} diff --git a/regression/cbmc-cover/location3/main.json b/regression/cbmc-cover/location3/main.json new file mode 100644 index 00000000000..f0721a496e7 --- /dev/null +++ b/regression/cbmc-cover/location3/main.json @@ -0,0 +1,187 @@ +[ +{ + "program": "CBMC 5.5" +}, +{ + "messageText": "CBMC version 5.5 64-bit x86_64 linux", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Parsing main.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Converting", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking main", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "function `assert' is not declared", + "messageType": "WARNING" +}, +{ + "messageText": "Generating GOTO Program", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Adding CPROVER library (x86_64)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Removal of function pointers and virtual functions", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Partial Inlining", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generic Property Instrumentation", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Instrumenting coverage goals", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Starting Bounded Model Checking", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "size of program expression: 45 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 4 VCC(s), 4 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 4 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "265 variables, 522 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "265 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.001s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "main.coverage.1", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "3" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "main.coverage.2", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "main.coverage.4", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "12" + }, + "status": "satisfied" + } + ], + "goalsCovered": 4, + "tests": [ + { + "coveredGoals": [ "main.coverage.1", "main.coverage.3", "main.coverage.4" ], + "inputs": [ ] + }, + { + "coveredGoals": [ "main.coverage.2" ], + "inputs": [ ] + } + ], + "totalGoals": 4 +}, +{ + "messageText": "** 4 of 4 covered (100.0%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 2 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location3/test.desc b/regression/cbmc-cover/location3/test.desc new file mode 100644 index 00000000000..a621fc0f941 --- /dev/null +++ b/regression/cbmc-cover/location3/test.desc @@ -0,0 +1,9 @@ +CORE +main.c +--cover location --existing-coverage main.json +^EXIT=0$ +^SIGNAL=0$ +^\[main.coverage.1\] file main.c line 10 function main block 3: SATISFIED$ +^\*\* 1 of 1 covered (100.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location4/main.c b/regression/cbmc-cover/location4/main.c new file mode 100644 index 00000000000..ca92d1abc09 --- /dev/null +++ b/regression/cbmc-cover/location4/main.c @@ -0,0 +1,41 @@ +#include +#include +#include "single-linked-list.h" + +int main(void) +{ + + int i; + mlist *mylist, *temp; + + insert_list(mylist,2); + insert_list(mylist,5); + insert_list(mylist,1); + insert_list(mylist,3); + + mylist = head; + + printf("list all elements: "); + while(mylist) + { + printf("%d ", mylist->key); + mylist = mylist->next; + } + printf("\n"); + + temp = search_list(mylist,2); + printf("search for element 2: %s\n", temp->key == 2 ? "found" : "not found"); + assert(temp->key == 2); + + delete_list(temp); + + mylist = head; + + printf("list all elements except 2: "); + while(mylist) + { + printf("%d ", mylist->key); + mylist = mylist->next; + } + printf("\n"); +} diff --git a/regression/cbmc-cover/location4/main.json b/regression/cbmc-cover/location4/main.json new file mode 100644 index 00000000000..114e0638022 --- /dev/null +++ b/regression/cbmc-cover/location4/main.json @@ -0,0 +1,633 @@ +[ +{ + "program": "CBMC 5.5" +}, +{ + "messageText": "CBMC version 5.5 64-bit x86_64 linux", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Parsing main.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Parsing single-linked-list.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Converting", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking main", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking single-linked-list", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generating GOTO Program", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Adding CPROVER library (x86_64)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Removal of function pointers and virtual functions", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Partial Inlining", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generic Property Instrumentation", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Instrumenting coverage goals", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Starting Bounded Model Checking", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop main.0 iteration 1 (2 max) file main.c line 19 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop main.0 iteration 2 (2 max) file main.c line 19 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop search_list.0 iteration 1 (2 max) file single-linked-list.c line 10 function search_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop search_list.0 iteration 2 (2 max) file single-linked-list.c line 10 function search_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop delete_list.0 iteration 1 (2 max) file single-linked-list.c line 23 function delete_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop delete_list.0 iteration 2 (2 max) file single-linked-list.c line 23 function delete_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop main.1 iteration 1 (2 max) file main.c line 35 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop main.1 iteration 2 (2 max) file main.c line 35 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "size of program expression: 358 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 57 VCC(s), 57 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 40 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "3368 variables, 1698 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "3368 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.007s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "free called for new[] object", + "goal": "", + "sourceLocation": { + "file": "", + "function": "free", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "main.coverage.1", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "main.coverage.2", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "12" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "main.coverage.3", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "13" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "main.coverage.4", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "14" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "main.coverage.5", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "16" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "main.coverage.6", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "19" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "main.coverage.7", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "main.coverage.8", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "main.coverage.9", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "main.coverage.10", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 11", + "goal": "main.coverage.11", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "32" + }, + "status": "failed" + }, + { + "description": "block 12", + "goal": "main.coverage.12", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "35" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "main.coverage.13", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "37" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "main.coverage.14", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "40" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "search_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "9" + }, + "status": "failed" + }, + { + "description": "block 2", + "goal": "search_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 3", + "goal": "search_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 4", + "goal": "search_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 5", + "goal": "search_list.coverage.5", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 6", + "goal": "search_list.coverage.6", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 7", + "goal": "search_list.coverage.7", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "15" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "delete_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "19" + }, + "status": "failed" + }, + { + "description": "block 2", + "goal": "delete_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 3", + "goal": "delete_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 4", + "goal": "delete_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 5", + "goal": "delete_list.coverage.5", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "29" + }, + "status": "failed" + }, + { + "description": "block 6", + "goal": "delete_list.coverage.6", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 7", + "goal": "delete_list.coverage.7", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 8", + "goal": "delete_list.coverage.8", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "delete_list.coverage.9", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "delete_list.coverage.10", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 11", + "goal": "delete_list.coverage.11", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 12", + "goal": "delete_list.coverage.12", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "delete_list.coverage.13", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "delete_list.coverage.14", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "insert_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "37" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "insert_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "40" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "insert_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "45" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "insert_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "48" + }, + "status": "satisfied" + } + ], + "goalsCovered": 11, + "tests": [ + { + "coveredGoals": [ "main.coverage.1", "main.coverage.2", "main.coverage.3", "main.coverage.4", "main.coverage.5", "main.coverage.6", "main.coverage.7", "insert_list.coverage.1", "insert_list.coverage.2", "insert_list.coverage.3", "insert_list.coverage.4" ], + "inputs": [ ] + } + ], + "totalGoals": 40 +}, +{ + "messageText": "** 11 of 40 covered (27.5%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 2 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location4/single-linked-list.c b/regression/cbmc-cover/location4/single-linked-list.c new file mode 100644 index 00000000000..30fe7a0ced0 --- /dev/null +++ b/regression/cbmc-cover/location4/single-linked-list.c @@ -0,0 +1,51 @@ +#include +#include +#include + +#include "single-linked-list.h" + +mlist* search_list(mlist *l, int k) +{ + l = head; + while(l!=NULL && l->key!=k) + { + l = l->next; + } + return l; +} + +int delete_list(mlist *l) +{ + mlist *tmp; + tmp = head; + if (head != l) + { + while(tmp->next!=l) + tmp = tmp->next; + tmp->next = l->next; + } + else + { + head = l->next; + } + free(l); + return 0; +} + +int insert_list(mlist *l, int k) +{ + l = (mlist*)malloc(sizeof(mlist)); + if (head==NULL) + { + l->key = k; + l->next = NULL; + } + else + { + l->key = k; + l->next = head; + } + head = l; + return 0; +} + diff --git a/regression/cbmc-cover/location4/single-linked-list.h b/regression/cbmc-cover/location4/single-linked-list.h new file mode 100644 index 00000000000..4d274a6a1e2 --- /dev/null +++ b/regression/cbmc-cover/location4/single-linked-list.h @@ -0,0 +1,14 @@ +#ifndef SINGLE_LINKED_LIST_H_ +#define SINGLE_LINKED_LIST_H_ + +typedef struct list { + int key; + struct list *next; +} mlist; + +mlist *head; +mlist* search_list(mlist *l, int k); +int delete_list(mlist *l); +int insert_list(mlist *l, int k); + +#endif /* SINGLE_LINKED_LIST_H_ */ diff --git a/regression/cbmc-cover/location4/test.desc b/regression/cbmc-cover/location4/test.desc new file mode 100644 index 00000000000..d9eaa8195c0 --- /dev/null +++ b/regression/cbmc-cover/location4/test.desc @@ -0,0 +1,8 @@ +CORE +main.c +single-linked-list.c --cover location --existing-coverage main.json --unwind 2 +^EXIT=0$ +^SIGNAL=0$ +^\*\* 0 of 1 covered (0.0%) +-- +^warning: ignoring From 3895bdc4cf836bf9572ba046419dacfc0ced9055 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 13:14:51 +0100 Subject: [PATCH 07/71] add more test cases to check existing coverage Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location5/main.c | 41 ++ regression/cbmc-cover/location5/main.json | 623 ++++++++++++++++++ .../cbmc-cover/location5/single-linked-list.c | 51 ++ .../cbmc-cover/location5/single-linked-list.h | 14 + regression/cbmc-cover/location5/test.desc | 9 + .../cbmc-cover/location6/if_expr1.class | Bin 0 -> 758 bytes regression/cbmc-cover/location6/if_expr1.java | 12 + regression/cbmc-cover/location6/if_expr1.json | 485 ++++++++++++++ regression/cbmc-cover/location6/test.desc | 8 + src/goto-instrument/cover.cpp | 2 +- src/goto-instrument/cover.h | 2 +- 11 files changed, 1245 insertions(+), 2 deletions(-) create mode 100644 regression/cbmc-cover/location5/main.c create mode 100644 regression/cbmc-cover/location5/main.json create mode 100644 regression/cbmc-cover/location5/single-linked-list.c create mode 100644 regression/cbmc-cover/location5/single-linked-list.h create mode 100644 regression/cbmc-cover/location5/test.desc create mode 100644 regression/cbmc-cover/location6/if_expr1.class create mode 100644 regression/cbmc-cover/location6/if_expr1.java create mode 100644 regression/cbmc-cover/location6/if_expr1.json create mode 100644 regression/cbmc-cover/location6/test.desc diff --git a/regression/cbmc-cover/location5/main.c b/regression/cbmc-cover/location5/main.c new file mode 100644 index 00000000000..ca92d1abc09 --- /dev/null +++ b/regression/cbmc-cover/location5/main.c @@ -0,0 +1,41 @@ +#include +#include +#include "single-linked-list.h" + +int main(void) +{ + + int i; + mlist *mylist, *temp; + + insert_list(mylist,2); + insert_list(mylist,5); + insert_list(mylist,1); + insert_list(mylist,3); + + mylist = head; + + printf("list all elements: "); + while(mylist) + { + printf("%d ", mylist->key); + mylist = mylist->next; + } + printf("\n"); + + temp = search_list(mylist,2); + printf("search for element 2: %s\n", temp->key == 2 ? "found" : "not found"); + assert(temp->key == 2); + + delete_list(temp); + + mylist = head; + + printf("list all elements except 2: "); + while(mylist) + { + printf("%d ", mylist->key); + mylist = mylist->next; + } + printf("\n"); +} diff --git a/regression/cbmc-cover/location5/main.json b/regression/cbmc-cover/location5/main.json new file mode 100644 index 00000000000..486ba8033d4 --- /dev/null +++ b/regression/cbmc-cover/location5/main.json @@ -0,0 +1,623 @@ +[ +{ + "program": "CBMC 5.5" +}, +{ + "messageText": "CBMC version 5.5 64-bit x86_64 linux", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Parsing main.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Parsing single-linked-list.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Converting", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking main", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking single-linked-list", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generating GOTO Program", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Adding CPROVER library (x86_64)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Removal of function pointers and virtual functions", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Partial Inlining", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generic Property Instrumentation", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Instrumenting coverage goals", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Starting Bounded Model Checking", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop main.0 iteration 1 (2 max) file main.c line 19 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop main.0 iteration 2 (2 max) file main.c line 19 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop search_list.0 iteration 1 (2 max) file single-linked-list.c line 10 function search_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop search_list.0 iteration 2 (2 max) file single-linked-list.c line 10 function search_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop delete_list.0 iteration 1 (2 max) file single-linked-list.c line 23 function delete_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop delete_list.0 iteration 2 (2 max) file single-linked-list.c line 23 function delete_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop main.1 iteration 1 (2 max) file main.c line 35 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop main.1 iteration 2 (2 max) file main.c line 35 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "size of program expression: 358 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 57 VCC(s), 57 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 40 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "3368 variables, 1698 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "3368 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.007s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "free called for new[] object", + "goal": "", + "sourceLocation": { + "file": "", + "function": "free", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "main.coverage.1", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "main.coverage.2", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "12" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "main.coverage.3", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "13" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "main.coverage.5", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "16" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "main.coverage.6", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "19" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "main.coverage.7", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "main.coverage.8", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "main.coverage.9", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "main.coverage.10", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 11", + "goal": "main.coverage.11", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "32" + }, + "status": "failed" + }, + { + "description": "block 12", + "goal": "main.coverage.12", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "35" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "main.coverage.13", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "37" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "main.coverage.14", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "40" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "search_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "9" + }, + "status": "failed" + }, + { + "description": "block 2", + "goal": "search_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 3", + "goal": "search_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 4", + "goal": "search_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 5", + "goal": "search_list.coverage.5", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 6", + "goal": "search_list.coverage.6", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 7", + "goal": "search_list.coverage.7", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "15" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "delete_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "19" + }, + "status": "failed" + }, + { + "description": "block 2", + "goal": "delete_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 3", + "goal": "delete_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 4", + "goal": "delete_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 5", + "goal": "delete_list.coverage.5", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "29" + }, + "status": "failed" + }, + { + "description": "block 6", + "goal": "delete_list.coverage.6", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 7", + "goal": "delete_list.coverage.7", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 8", + "goal": "delete_list.coverage.8", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "delete_list.coverage.9", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "delete_list.coverage.10", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 11", + "goal": "delete_list.coverage.11", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 12", + "goal": "delete_list.coverage.12", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "delete_list.coverage.13", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "delete_list.coverage.14", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "insert_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "37" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "insert_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "40" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "insert_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "45" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "insert_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "48" + }, + "status": "satisfied" + } + ], + "goalsCovered": 11, + "tests": [ + { + "coveredGoals": [ "main.coverage.1", "main.coverage.2", "main.coverage.3", "main.coverage.4", "main.coverage.5", "main.coverage.6", "main.coverage.7", "insert_list.coverage.1", "insert_list.coverage.2", "insert_list.coverage.3", "insert_list.coverage.4" ], + "inputs": [ ] + } + ], + "totalGoals": 40 +}, +{ + "messageText": "** 11 of 40 covered (27.5%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 2 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location5/single-linked-list.c b/regression/cbmc-cover/location5/single-linked-list.c new file mode 100644 index 00000000000..30fe7a0ced0 --- /dev/null +++ b/regression/cbmc-cover/location5/single-linked-list.c @@ -0,0 +1,51 @@ +#include +#include +#include + +#include "single-linked-list.h" + +mlist* search_list(mlist *l, int k) +{ + l = head; + while(l!=NULL && l->key!=k) + { + l = l->next; + } + return l; +} + +int delete_list(mlist *l) +{ + mlist *tmp; + tmp = head; + if (head != l) + { + while(tmp->next!=l) + tmp = tmp->next; + tmp->next = l->next; + } + else + { + head = l->next; + } + free(l); + return 0; +} + +int insert_list(mlist *l, int k) +{ + l = (mlist*)malloc(sizeof(mlist)); + if (head==NULL) + { + l->key = k; + l->next = NULL; + } + else + { + l->key = k; + l->next = head; + } + head = l; + return 0; +} + diff --git a/regression/cbmc-cover/location5/single-linked-list.h b/regression/cbmc-cover/location5/single-linked-list.h new file mode 100644 index 00000000000..4d274a6a1e2 --- /dev/null +++ b/regression/cbmc-cover/location5/single-linked-list.h @@ -0,0 +1,14 @@ +#ifndef SINGLE_LINKED_LIST_H_ +#define SINGLE_LINKED_LIST_H_ + +typedef struct list { + int key; + struct list *next; +} mlist; + +mlist *head; +mlist* search_list(mlist *l, int k); +int delete_list(mlist *l); +int insert_list(mlist *l, int k); + +#endif /* SINGLE_LINKED_LIST_H_ */ diff --git a/regression/cbmc-cover/location5/test.desc b/regression/cbmc-cover/location5/test.desc new file mode 100644 index 00000000000..16c53355a24 --- /dev/null +++ b/regression/cbmc-cover/location5/test.desc @@ -0,0 +1,9 @@ +CORE +main.c +single-linked-list.c --cover location --existing-coverage main.json --unwind 2 +^EXIT=0$ +^SIGNAL=0$ +^\[main.coverage.1\] file main.c line 14 function main block 4: SATISFIED$ +^\*\* 1 of 2 covered (50.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location6/if_expr1.class b/regression/cbmc-cover/location6/if_expr1.class new file mode 100644 index 0000000000000000000000000000000000000000..80db60b2bb12be71e852c51b64c3619a4a3ef71f GIT binary patch literal 758 zcmY*WO-~b16g_V`)7P0!b=q2}Z4pt>f**|uJF1ZsOh^zGH74M~Os7xsu$^gUrUuvk z3pTi8Ehdm?qI-W6G2S=QjxOHUz31L@&w0OofBOMo6^|^KsG7KmnuR(VCOGCeZdou; z<(Ri{8w(tF7|M%o6p1jFfgf$i$n6b8pMmW&WZTl0@iT@@bNMxc-U<4G;rh1p#m;!x z6X7cbro_;dKEq7&&Gw=D!EFs(|De^4L+Kx^slq}xcD?s6-O&}^+C1{aC?Vvy%aCh( zgDWPh8;nCwypXDILB4w{jz-~=$EvLj8wHL<8%wyyaoJM2W4lOVn5y vWeVvu+zo:()V", + "messageType": "WARNING" +}, +{ + "messageText": "size of program expression: 110 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 19 VCC(s), 19 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 20 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 2976 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 10", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 11", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 14", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 39 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 22 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 2 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.014s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "coverage.1", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.2", + "sourceLocation": { + "file": "if_expr1.java", + "line": "5" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.3", + "sourceLocation": { + "file": "if_expr1.java", + "line": "5" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.4", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.5", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.6", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "coverage.7", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "coverage.8", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "coverage.9", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "coverage.10", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "coverage.11", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 11", + "goal": "coverage.12", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 12", + "goal": "coverage.13", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "coverage.14", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "coverage.15", + "sourceLocation": { + "file": "if_expr1.java", + "line": "11" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.16", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.17", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.18", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.19", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.20", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + } + ], + "goalsCovered": 15, + "tests": [ + { + "coveredGoals": [ "coverage.2", "coverage.3", "coverage.5", "coverage.6", "coverage.11", "coverage.12", "coverage.15", "coverage.16", "coverage.17", "coverage.19", "coverage.20" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.18" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.4", "coverage.7" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.8" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + } + ], + "totalGoals": 20 +}, +{ + "messageText": "** 15 of 20 covered (75.0%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 5 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location6/test.desc b/regression/cbmc-cover/location6/test.desc new file mode 100644 index 00000000000..f9fe6010e6b --- /dev/null +++ b/regression/cbmc-cover/location6/test.desc @@ -0,0 +1,8 @@ +CORE +if_expr1.class +--cover location --existing-coverage if_expr1.json +^EXIT=0$ +^SIGNAL=0$ +^\*\* 0 of 0 covered (100.0%) +-- +^warning: ignoring diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 04d3097531c..acfcdf06ae0 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -95,7 +95,7 @@ Function: coverage_goals::get_goals \*******************************************************************/ -const bool coverage_goals::get_goals(const char* goal) +bool coverage_goals::get_goals(const char* goal) { std::vector::iterator it; it = find (existing_goals.begin(), existing_goals.end(), goal); diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index 3cd41f06bc0..f00659de1b8 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -17,7 +17,7 @@ class coverage_goals { public: void set_goals(std::string goal); - const bool get_goals(const char* goal); + bool get_goals(const char* goal); private: std::vector existing_goals; From 766d22183ef7f828b503d04b9279d457e5d025aa Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 13:58:51 +0100 Subject: [PATCH 08/71] add more test cases to check existing coverage Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location6/if_expr1.json | 2 +- regression/cbmc-cover/location6/test.desc | 2 +- .../cbmc-cover/location7/if_expr1.class | Bin 0 -> 758 bytes regression/cbmc-cover/location7/if_expr1.java | 12 + regression/cbmc-cover/location7/if_expr1.json | 476 ++++++++++ regression/cbmc-cover/location7/test.desc | 9 + regression/cbmc-cover/location8/A.class | Bin 0 -> 183 bytes regression/cbmc-cover/location8/B.class | Bin 0 -> 183 bytes .../cbmc-cover/location8/if_acmp1.class | Bin 0 -> 1044 bytes regression/cbmc-cover/location8/if_acmp1.java | 36 + regression/cbmc-cover/location8/if_acmp1.json | 882 ++++++++++++++++++ regression/cbmc-cover/location8/test.desc | 8 + regression/cbmc-cover/location9/A.class | Bin 0 -> 183 bytes regression/cbmc-cover/location9/B.class | Bin 0 -> 183 bytes .../cbmc-cover/location9/if_acmp1.class | Bin 0 -> 1044 bytes regression/cbmc-cover/location9/if_acmp1.java | 36 + regression/cbmc-cover/location9/if_acmp1.json | 855 +++++++++++++++++ regression/cbmc-cover/location9/test.desc | 11 + src/cbmc/cbmc_parse_options.cpp | 2 +- 19 files changed, 2328 insertions(+), 3 deletions(-) create mode 100644 regression/cbmc-cover/location7/if_expr1.class create mode 100644 regression/cbmc-cover/location7/if_expr1.java create mode 100644 regression/cbmc-cover/location7/if_expr1.json create mode 100644 regression/cbmc-cover/location7/test.desc create mode 100644 regression/cbmc-cover/location8/A.class create mode 100644 regression/cbmc-cover/location8/B.class create mode 100644 regression/cbmc-cover/location8/if_acmp1.class create mode 100644 regression/cbmc-cover/location8/if_acmp1.java create mode 100644 regression/cbmc-cover/location8/if_acmp1.json create mode 100644 regression/cbmc-cover/location8/test.desc create mode 100644 regression/cbmc-cover/location9/A.class create mode 100644 regression/cbmc-cover/location9/B.class create mode 100644 regression/cbmc-cover/location9/if_acmp1.class create mode 100644 regression/cbmc-cover/location9/if_acmp1.java create mode 100644 regression/cbmc-cover/location9/if_acmp1.json create mode 100644 regression/cbmc-cover/location9/test.desc diff --git a/regression/cbmc-cover/location6/if_expr1.json b/regression/cbmc-cover/location6/if_expr1.json index 41521afe690..9415f24f359 100644 --- a/regression/cbmc-cover/location6/if_expr1.json +++ b/regression/cbmc-cover/location6/if_expr1.json @@ -235,7 +235,7 @@ "messageType": "STATUS-MESSAGE" }, { - "messageText": "Runtime decision procedure: 0.014s", + "messageText": "Runtime decision procedure: 0.011s", "messageType": "STATUS-MESSAGE" }, { diff --git a/regression/cbmc-cover/location6/test.desc b/regression/cbmc-cover/location6/test.desc index f9fe6010e6b..b47c983d68a 100644 --- a/regression/cbmc-cover/location6/test.desc +++ b/regression/cbmc-cover/location6/test.desc @@ -3,6 +3,6 @@ if_expr1.class --cover location --existing-coverage if_expr1.json ^EXIT=0$ ^SIGNAL=0$ -^\*\* 0 of 0 covered (100.0%) +^\*\* 0 of 0 covered (100.0%)$ -- ^warning: ignoring diff --git a/regression/cbmc-cover/location7/if_expr1.class b/regression/cbmc-cover/location7/if_expr1.class new file mode 100644 index 0000000000000000000000000000000000000000..80db60b2bb12be71e852c51b64c3619a4a3ef71f GIT binary patch literal 758 zcmY*WO-~b16g_V`)7P0!b=q2}Z4pt>f**|uJF1ZsOh^zGH74M~Os7xsu$^gUrUuvk z3pTi8Ehdm?qI-W6G2S=QjxOHUz31L@&w0OofBOMo6^|^KsG7KmnuR(VCOGCeZdou; z<(Ri{8w(tF7|M%o6p1jFfgf$i$n6b8pMmW&WZTl0@iT@@bNMxc-U<4G;rh1p#m;!x z6X7cbro_;dKEq7&&Gw=D!EFs(|De^4L+Kx^slq}xcD?s6-O&}^+C1{aC?Vvy%aCh( zgDWPh8;nCwypXDILB4w{jz-~=$EvLj8wHL<8%wyyaoJM2W4lOVn5y vWeVvu+zo:()V", + "messageType": "WARNING" +}, +{ + "messageText": "size of program expression: 110 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 19 VCC(s), 19 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 20 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 2976 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 10", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 11", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 14", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 39 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 22 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 2 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.011s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "coverage.1", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.2", + "sourceLocation": { + "file": "if_expr1.java", + "line": "5" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.3", + "sourceLocation": { + "file": "if_expr1.java", + "line": "5" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.4", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.5", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.6", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "coverage.7", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "coverage.8", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "coverage.9", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "coverage.10", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "coverage.11", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 11", + "goal": "coverage.12", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 12", + "goal": "coverage.13", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "coverage.14", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.16", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.17", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.18", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.19", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.20", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + } + ], + "goalsCovered": 15, + "tests": [ + { + "coveredGoals": [ "coverage.2", "coverage.3", "coverage.5", "coverage.6", "coverage.11", "coverage.12", "coverage.15", "coverage.16", "coverage.17", "coverage.19", "coverage.20" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.18" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.4", "coverage.7" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.8" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + } + ], + "totalGoals": 20 +}, +{ + "messageText": "** 15 of 20 covered (75.0%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 5 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location7/test.desc b/regression/cbmc-cover/location7/test.desc new file mode 100644 index 00000000000..ea38fff1940 --- /dev/null +++ b/regression/cbmc-cover/location7/test.desc @@ -0,0 +1,9 @@ +CORE +if_expr1.class +--cover location --existing-coverage if_expr1.json +^EXIT=0$ +^SIGNAL=0$ +^\[coverage.1\] file if_expr1.java line 11 block 14: SATISFIED$ +^\*\* 1 of 1 covered (100.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location8/A.class b/regression/cbmc-cover/location8/A.class new file mode 100644 index 0000000000000000000000000000000000000000..6ee0b76170fb10d3eb70f55956456784e60b583d GIT binary patch literal 183 zcmX^0Z`VEs1_l!bUM>b^1}=66ZgvJ9Mg}&U%)HDJJ4Oa(4b3n{1{UZ1lvG9rexJ;| zRKL>Pq|~C2#H1Xc2v=}^X;E^jTPBFZo0%4$n4DW+sF#&kmdL}v!obSN!05=xAOPa) z=OpH(>-#5Vr6!j!C@?Sqtpfo@AOb^1}=66ZgvJ9Mg}&U%)HDJJ4Oa(4b3n{1{UZ1lvG9rexJ;| zRKL>Pq|~C2#H1Xc2v=}^X;E^jTPBFZo0%4$n4DW+sF#&kmdL}v!obSN!05!tAOPa) z=OpH(>-#5Vr6!j!C@?Sqtpfo@AOag1pQ2s^Gp zLMjLi6C9HoI8qw@OmSS$FpY~GX@>Ze)o9qR=hSPB8&1R8s@P=)w!xq*I5o$+#?Y6Z zS!a-z>t&lEQgmweYO}g!yZ1yegS>5fn@eQVGsUHO3anaAjbR}Dptxf_wq`3Hbe=a?a;MA~PgE|e;*uG(6?>6YwUj_46~9&TEt>h9%BqNI)p zqC}FKvPB(XoMT9Kdo8vHy6L)gS4SKP2DM#*BcmgW97D95a%XGDE_tNJe>l_3-N5Av z$wkAJ?S|vpwA#QJsjSmVSTrff(Mh70ID;WZrxCJ@teiOjdrb!hgT9In za!Mw~bQYo0v`P`G9U^f50DZSJuR8H!&E$cK5Q6B(z)23v:()V", + "messageType": "WARNING" +}, +{ + "messageText": "size of program expression: 223 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 42 VCC(s), 42 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 61 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 191 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 10", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 14", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 18", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 22", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 26", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 30", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 34", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 38", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 42", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 46", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 47", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 51", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 25 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 11", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 15", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 19", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 23", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 27", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 31", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 35", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 39", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 43", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 48", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 25 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.011s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "coverage.1", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "4" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.2", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.3", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.4", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.5", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.6", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "15" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.7", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "15" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.8", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "16" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.9", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "17" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.10", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "18" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "coverage.11", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "19" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "coverage.12", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "coverage.13", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "coverage.14", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "coverage.15", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 11", + "goal": "coverage.16", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 12", + "goal": "coverage.17", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "coverage.18", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "coverage.19", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "satisfied" + }, + { + "description": "block 15", + "goal": "coverage.20", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "satisfied" + }, + { + "description": "block 16", + "goal": "coverage.21", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 17", + "goal": "coverage.22", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 18", + "goal": "coverage.23", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "satisfied" + }, + { + "description": "block 19", + "goal": "coverage.24", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "satisfied" + }, + { + "description": "block 20", + "goal": "coverage.25", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 21", + "goal": "coverage.26", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 22", + "goal": "coverage.27", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "satisfied" + }, + { + "description": "block 23", + "goal": "coverage.28", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "satisfied" + }, + { + "description": "block 24", + "goal": "coverage.29", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 25", + "goal": "coverage.30", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 26", + "goal": "coverage.31", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "satisfied" + }, + { + "description": "block 27", + "goal": "coverage.32", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "satisfied" + }, + { + "description": "block 28", + "goal": "coverage.33", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 29", + "goal": "coverage.34", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 30", + "goal": "coverage.35", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "satisfied" + }, + { + "description": "block 31", + "goal": "coverage.36", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "satisfied" + }, + { + "description": "block 32", + "goal": "coverage.37", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 33", + "goal": "coverage.38", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 34", + "goal": "coverage.39", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "satisfied" + }, + { + "description": "block 35", + "goal": "coverage.40", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "satisfied" + }, + { + "description": "block 36", + "goal": "coverage.41", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "failed" + }, + { + "description": "block 37", + "goal": "coverage.42", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "failed" + }, + { + "description": "block 38", + "goal": "coverage.43", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "satisfied" + }, + { + "description": "block 39", + "goal": "coverage.44", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "satisfied" + }, + { + "description": "block 40", + "goal": "coverage.45", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "failed" + }, + { + "description": "block 41", + "goal": "coverage.46", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "failed" + }, + { + "description": "block 42", + "goal": "coverage.47", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "29" + }, + "status": "satisfied" + }, + { + "description": "block 43", + "goal": "coverage.48", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "satisfied" + }, + { + "description": "block 44", + "goal": "coverage.49", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 45", + "goal": "coverage.50", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 46", + "goal": "coverage.51", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "31" + }, + "status": "satisfied" + }, + { + "description": "block 47", + "goal": "coverage.52", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "31" + }, + "status": "satisfied" + }, + { + "description": "block 48", + "goal": "coverage.53", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "satisfied" + }, + { + "description": "block 49", + "goal": "coverage.54", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "failed" + }, + { + "description": "block 50", + "goal": "coverage.55", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "failed" + }, + { + "description": "block 51", + "goal": "coverage.56", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "35" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.57", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.58", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.59", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.60", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.61", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + } + ], + "goalsCovered": 38, + "tests": [ + { + "coveredGoals": [ "coverage.1", "coverage.2", "coverage.3", "coverage.4", "coverage.6", "coverage.7", "coverage.8", "coverage.9", "coverage.10", "coverage.11", "coverage.15", "coverage.19", "coverage.23", "coverage.27", "coverage.31", "coverage.35", "coverage.39", "coverage.43", "coverage.47", "coverage.51", "coverage.52", "coverage.56", "coverage.57", "coverage.58", "coverage.59", "coverage.61" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.12", "coverage.16", "coverage.20", "coverage.24", "coverage.28", "coverage.32", "coverage.36", "coverage.40", "coverage.44", "coverage.48", "coverage.53", "coverage.60" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + } + ], + "totalGoals": 61 +}, +{ + "messageText": "** 38 of 61 covered (62.3%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 3 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location8/test.desc b/regression/cbmc-cover/location8/test.desc new file mode 100644 index 00000000000..bb29eb24d60 --- /dev/null +++ b/regression/cbmc-cover/location8/test.desc @@ -0,0 +1,8 @@ +CORE +if_acmp1.class +--cover location --existing-coverage if_acmp1.json +^EXIT=0$ +^SIGNAL=0$ +^\*\* 0 of 0 covered (100.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location9/A.class b/regression/cbmc-cover/location9/A.class new file mode 100644 index 0000000000000000000000000000000000000000..6ee0b76170fb10d3eb70f55956456784e60b583d GIT binary patch literal 183 zcmX^0Z`VEs1_l!bUM>b^1}=66ZgvJ9Mg}&U%)HDJJ4Oa(4b3n{1{UZ1lvG9rexJ;| zRKL>Pq|~C2#H1Xc2v=}^X;E^jTPBFZo0%4$n4DW+sF#&kmdL}v!obSN!05=xAOPa) z=OpH(>-#5Vr6!j!C@?Sqtpfo@AOb^1}=66ZgvJ9Mg}&U%)HDJJ4Oa(4b3n{1{UZ1lvG9rexJ;| zRKL>Pq|~C2#H1Xc2v=}^X;E^jTPBFZo0%4$n4DW+sF#&kmdL}v!obSN!05!tAOPa) z=OpH(>-#5Vr6!j!C@?Sqtpfo@AOag1pQ2s^Gp zLMjLi6C9HoI8qw@OmSS$FpY~GX@>Ze)o9qR=hSPB8&1R8s@P=)w!xq*I5o$+#?Y6Z zS!a-z>t&lEQgmweYO}g!yZ1yegS>5fn@eQVGsUHO3anaAjbR}Dptxf_wq`3Hbe=a?a;MA~PgE|e;*uG(6?>6YwUj_46~9&TEt>h9%BqNI)p zqC}FKvPB(XoMT9Kdo8vHy6L)gS4SKP2DM#*BcmgW97D95a%XGDE_tNJe>l_3-N5Av z$wkAJ?S|vpwA#QJsjSmVSTrff(Mh70ID;WZrxCJ@teiOjdrb!hgT9In za!Mw~bQYo0v`P`G9U^f50DZSJuR8H!&E$cK5Q6B(z)23v:()V", + "messageType": "WARNING" +}, +{ + "messageText": "size of program expression: 223 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 42 VCC(s), 42 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 61 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 191 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 10", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 14", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 18", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 22", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 26", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 30", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 34", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 38", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 42", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 46", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 47", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 51", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 25 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 11", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 15", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 19", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 23", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 27", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 31", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 35", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 39", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 43", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 48", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 25 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.011s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "coverage.1", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "4" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.2", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.3", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.4", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.5", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.6", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "15" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.7", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "15" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.9", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "17" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "coverage.12", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "coverage.13", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "coverage.14", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "coverage.15", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 11", + "goal": "coverage.16", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 12", + "goal": "coverage.17", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "coverage.18", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "coverage.19", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "satisfied" + }, + { + "description": "block 15", + "goal": "coverage.20", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "satisfied" + }, + { + "description": "block 16", + "goal": "coverage.21", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 17", + "goal": "coverage.22", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 18", + "goal": "coverage.23", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "satisfied" + }, + { + "description": "block 19", + "goal": "coverage.24", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "satisfied" + }, + { + "description": "block 20", + "goal": "coverage.25", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 21", + "goal": "coverage.26", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 22", + "goal": "coverage.27", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "satisfied" + }, + { + "description": "block 23", + "goal": "coverage.28", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "satisfied" + }, + { + "description": "block 24", + "goal": "coverage.29", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 25", + "goal": "coverage.30", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 26", + "goal": "coverage.31", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "satisfied" + }, + { + "description": "block 27", + "goal": "coverage.32", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "satisfied" + }, + { + "description": "block 28", + "goal": "coverage.33", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 29", + "goal": "coverage.34", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 30", + "goal": "coverage.35", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "satisfied" + }, + { + "description": "block 31", + "goal": "coverage.36", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "satisfied" + }, + { + "description": "block 32", + "goal": "coverage.37", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 33", + "goal": "coverage.38", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 34", + "goal": "coverage.39", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "satisfied" + }, + { + "description": "block 35", + "goal": "coverage.40", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "satisfied" + }, + { + "description": "block 36", + "goal": "coverage.41", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "failed" + }, + { + "description": "block 37", + "goal": "coverage.42", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "failed" + }, + { + "description": "block 38", + "goal": "coverage.43", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "satisfied" + }, + { + "description": "block 39", + "goal": "coverage.44", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "satisfied" + }, + { + "description": "block 40", + "goal": "coverage.45", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "failed" + }, + { + "description": "block 41", + "goal": "coverage.46", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "failed" + }, + { + "description": "block 42", + "goal": "coverage.47", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "29" + }, + "status": "satisfied" + }, + { + "description": "block 43", + "goal": "coverage.48", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "satisfied" + }, + { + "description": "block 44", + "goal": "coverage.49", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 45", + "goal": "coverage.50", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 46", + "goal": "coverage.51", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "31" + }, + "status": "satisfied" + }, + { + "description": "block 47", + "goal": "coverage.52", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "31" + }, + "status": "satisfied" + }, + { + "description": "block 48", + "goal": "coverage.53", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "satisfied" + }, + { + "description": "block 49", + "goal": "coverage.54", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "failed" + }, + { + "description": "block 50", + "goal": "coverage.55", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "failed" + }, + { + "description": "block 51", + "goal": "coverage.56", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "35" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.57", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.58", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.59", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.60", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.61", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + } + ], + "goalsCovered": 38, + "tests": [ + { + "coveredGoals": [ "coverage.1", "coverage.2", "coverage.3", "coverage.4", "coverage.6", "coverage.7", "coverage.8", "coverage.9", "coverage.10", "coverage.11", "coverage.15", "coverage.19", "coverage.23", "coverage.27", "coverage.31", "coverage.35", "coverage.39", "coverage.43", "coverage.47", "coverage.51", "coverage.52", "coverage.56", "coverage.57", "coverage.58", "coverage.59", "coverage.61" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.12", "coverage.16", "coverage.20", "coverage.24", "coverage.28", "coverage.32", "coverage.36", "coverage.40", "coverage.44", "coverage.48", "coverage.53", "coverage.60" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + } + ], + "totalGoals": 61 +}, +{ + "messageText": "** 38 of 61 covered (62.3%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 3 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location9/test.desc b/regression/cbmc-cover/location9/test.desc new file mode 100644 index 00000000000..b80a98c1894 --- /dev/null +++ b/regression/cbmc-cover/location9/test.desc @@ -0,0 +1,11 @@ +CORE +if_acmp1.class +--cover location --existing-coverage if_acmp1.json +^EXIT=0$ +^SIGNAL=0$ +^\[coverage.1\] file if_acmp1.java line 16 block 3: SATISFIED$ +^\[coverage.2\] file if_acmp1.java line 18 block 5: SATISFIED$ +^\[coverage.3\] file if_acmp1.java line 19 block 6: SATISFIED$ +^\*\* 3 of 3 covered (100.0%) +-- +^warning: ignoring diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 2e63d065786..9e3332f41d8 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -1024,7 +1024,7 @@ bool cbmc_parse_optionst::process_goto_program( itg!=(*it)["goals"].array.end(); itg++) { - //get the line of each goal + //get the line of each existing goal const std::string line=(*itg)["sourceLocation"]["line"].value; goals.set_goals(line); } From 9a4a1f9009bf249913623c3dd3304f9421a31dcb Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 14:12:09 +0100 Subject: [PATCH 09/71] remove whitespace Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index acfcdf06ae0..0b7dd223686 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -103,7 +103,7 @@ bool coverage_goals::get_goals(const char* goal) if(it == existing_goals.end()) return true; else - return false; + return false; } From 84f03306c47f2ccb7cf9f438fc7a94f0698b8462 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 14:15:38 +0100 Subject: [PATCH 10/71] code refactoring to check existing goals Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 4 ++-- src/goto-instrument/cover.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 0b7dd223686..95d3fd6e076 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -95,7 +95,7 @@ Function: coverage_goals::get_goals \*******************************************************************/ -bool coverage_goals::get_goals(const char* goal) +bool coverage_goals::is_existing_goal(const char* goal) { std::vector::iterator it; it = find (existing_goals.begin(), existing_goals.end(), goal); @@ -1163,7 +1163,7 @@ void instrument_cover_goals( basic_blocks.source_location_map[block_nr]; //check whether the current goal already exists - if(goals.get_goals(source_location.get_line().c_str()) && + if(goals.is_existing_goal(source_location.get_line().c_str()) && !source_location.get_file().empty() && source_location.get_file()[0]!='<') { diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index f00659de1b8..ad28c042282 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -16,11 +16,11 @@ Date: May 2016 class coverage_goals { public: - void set_goals(std::string goal); - bool get_goals(const char* goal); + void set_goals(std::string goal); + bool is_existing_goal(const char* goal); private: - std::vector existing_goals; + std::vector existing_goals; }; enum class coverage_criteriont { From 2be7e4e72ac352e0bb99f6a2b5a8d0cfa2a06c6a Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 09:59:59 +0100 Subject: [PATCH 11/71] replace coverage_goals by coverage_goalst Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 2 +- src/goto-instrument/cover.cpp | 12 ++++++------ src/goto-instrument/cover.h | 6 +++--- src/symex/symex_parse_options.cpp | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 9e3332f41d8..3bb2620616f 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -983,7 +983,7 @@ bool cbmc_parse_optionst::process_goto_program( } // check existing test goals - coverage_goals goals; + coverage_goalst goals; if(cmdline.isset("existing-coverage")) { status() << "Check existing coverage goals" << eom; diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 95d3fd6e076..a6eaf1664e4 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -68,7 +68,7 @@ class basic_blockst /*******************************************************************\ -Function: coverage_goals::set_goals +Function: coverage_goalst::set_goals Inputs: @@ -78,14 +78,14 @@ Function: coverage_goals::set_goals \*******************************************************************/ -void coverage_goals::set_goals(std::string goal) +void coverage_goalst::set_goals(std::string goal) { existing_goals.push_back(goal); } /*******************************************************************\ -Function: coverage_goals::get_goals +Function: coverage_goalst::is_existing_goal Inputs: @@ -95,7 +95,7 @@ Function: coverage_goals::get_goals \*******************************************************************/ -bool coverage_goals::is_existing_goal(const char* goal) +bool coverage_goalst::is_existing_goal(const char* goal) { std::vector::iterator it; it = find (existing_goals.begin(), existing_goals.end(), goal); @@ -1100,7 +1100,7 @@ void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, coverage_criteriont criterion, - coverage_goals &goals) + coverage_goalst &goals) { const namespacet ns(symbol_table); basic_blockst basic_blocks(goto_program); @@ -1399,7 +1399,7 @@ void instrument_cover_goals( const symbol_tablet &symbol_table, goto_functionst &goto_functions, coverage_criteriont criterion, - coverage_goals &goals) + coverage_goalst &goals) { Forall_goto_functions(f_it, goto_functions) { diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index ad28c042282..5fe22d5a992 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -13,7 +13,7 @@ Date: May 2016 #include -class coverage_goals +class coverage_goalst { public: void set_goals(std::string goal); @@ -31,12 +31,12 @@ void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, coverage_criteriont, - coverage_goals &goals); + coverage_goalst &goals); void instrument_cover_goals( const symbol_tablet &symbol_table, goto_functionst &goto_functions, coverage_criteriont, - coverage_goals &goals); + coverage_goalst &goals); #endif diff --git a/src/symex/symex_parse_options.cpp b/src/symex/symex_parse_options.cpp index 5ac7fb001d8..433a32f73f3 100644 --- a/src/symex/symex_parse_options.cpp +++ b/src/symex/symex_parse_options.cpp @@ -442,7 +442,7 @@ bool symex_parse_optionst::process_goto_program(const optionst &options) } status() << "Instrumenting coverge goals" << eom; - coverage_goals goals; + coverage_goalst goals; instrument_cover_goals(symbol_table, goto_model.goto_functions, c, goals); goto_model.goto_functions.update(); } From 82665956a7b0c82c36066f5cce22f500d71550a0 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 10:11:28 +0100 Subject: [PATCH 12/71] default variant of instrument_cover_goals that uses an empty set of existing goals Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 30 ++++++++++++++++++++++++++++++ src/goto-instrument/cover.h | 5 +++++ src/symex/symex_parse_options.cpp | 3 +-- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index a6eaf1664e4..f0e54168a91 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -1411,3 +1411,33 @@ void instrument_cover_goals( criterion, goals); } } + +/*******************************************************************\ + +Function: instrument_cover_goals + + Inputs: + + Outputs: + + Purpose: + +\*******************************************************************/ + +void instrument_cover_goals( + const symbol_tablet &symbol_table, + goto_functionst &goto_functions, + coverage_criteriont criterion) +{ + Forall_goto_functions(f_it, goto_functions) + { + if(f_it->first==ID__start || + f_it->first=="__CPROVER_initialize") + continue; + + //empty set of existing goals + coverage_goalst goals; + instrument_cover_goals(symbol_table, f_it->second.body, + criterion, goals); + } +} diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index 5fe22d5a992..a1e917edf83 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -39,4 +39,9 @@ void instrument_cover_goals( coverage_criteriont, coverage_goalst &goals); +void instrument_cover_goals( + const symbol_tablet &symbol_table, + goto_functionst &goto_functions, + coverage_criteriont); + #endif diff --git a/src/symex/symex_parse_options.cpp b/src/symex/symex_parse_options.cpp index 433a32f73f3..2fbee65e2ad 100644 --- a/src/symex/symex_parse_options.cpp +++ b/src/symex/symex_parse_options.cpp @@ -442,8 +442,7 @@ bool symex_parse_optionst::process_goto_program(const optionst &options) } status() << "Instrumenting coverge goals" << eom; - coverage_goalst goals; - instrument_cover_goals(symbol_table, goto_model.goto_functions, c, goals); + instrument_cover_goals(symbol_table, goto_model.goto_functions, c); goto_model.goto_functions.update(); } From cf1fdeaca99879beca5f56f9df6965f0ed93fea5 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 10:19:04 +0100 Subject: [PATCH 13/71] a goal should be identified by a source_locationt Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 7 ++++--- src/goto-instrument/cover.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index f0e54168a91..18003786328 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -95,10 +95,11 @@ Function: coverage_goalst::is_existing_goal \*******************************************************************/ -bool coverage_goalst::is_existing_goal(const char* goal) +bool coverage_goalst::is_existing_goal(source_locationt source_location) { std::vector::iterator it; - it = find (existing_goals.begin(), existing_goals.end(), goal); + it = find (existing_goals.begin(), existing_goals.end(), + source_location.get_line().c_str()); if(it == existing_goals.end()) return true; @@ -1163,7 +1164,7 @@ void instrument_cover_goals( basic_blocks.source_location_map[block_nr]; //check whether the current goal already exists - if(goals.is_existing_goal(source_location.get_line().c_str()) && + if(goals.is_existing_goal(source_location) && !source_location.get_file().empty() && source_location.get_file()[0]!='<') { diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index a1e917edf83..b1a4e50b8ca 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -17,7 +17,7 @@ class coverage_goalst { public: void set_goals(std::string goal); - bool is_existing_goal(const char* goal); + bool is_existing_goal(source_locationt source_location); private: std::vector existing_goals; From 031603b68254cea65c2325a021db3668d2fe7d7d Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 14:28:24 +0100 Subject: [PATCH 14/71] implement get_coverage method Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 43 ++---------------------- src/goto-instrument/Makefile | 1 + src/goto-instrument/cover.cpp | 58 +++++++++++++++++++++++++++++++++ src/goto-instrument/cover.h | 2 ++ src/symex/Makefile | 1 + 5 files changed, 64 insertions(+), 41 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 3bb2620616f..fc7ed8853ad 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -50,8 +50,6 @@ Author: Daniel Kroening, kroening@kroening.com #include -#include - #include "cbmc_solvers.h" #include "cbmc_parse_options.h" #include "bmc.h" @@ -990,47 +988,10 @@ bool cbmc_parse_optionst::process_goto_program( //get file with covered test goals const std::string coverage=cmdline.get_value("existing-coverage"); + goals.get_coverage(coverage,get_message_handler()); - jsont json; - - //check coverage file - if(parse_json(coverage, get_message_handler(), json)) - { - messaget message(get_message_handler()); - message.error() << coverage << " file is not a valid json file" - << messaget::eom; - return true; - } - - //make sure that we have an array of elements - if(!json.is_array()) - { - messaget message(get_message_handler()); - message.error() << "expecting an array in the " << coverage << " file, but got " - << json << messaget::eom; - return true; - } - - for(jsont::arrayt::const_iterator - it=json.array.begin(); - it!=json.array.end(); - it++) - { - //get the goals array - if ((*it)["goals"].is_array()) - { - for(jsont::arrayt::const_iterator - itg=(*it)["goals"].array.begin(); - itg!=(*it)["goals"].array.end(); - itg++) - { - //get the line of each existing goal - const std::string line=(*itg)["sourceLocation"]["line"].value; - goals.set_goals(line); - } - } - } } + status() << "Instrumenting coverage goals" << eom; instrument_cover_goals(symbol_table, goto_functions, c, goals); goto_functions.update(); diff --git a/src/goto-instrument/Makefile b/src/goto-instrument/Makefile index fd44907bb11..fddf70a5d51 100644 --- a/src/goto-instrument/Makefile +++ b/src/goto-instrument/Makefile @@ -37,6 +37,7 @@ OBJ += ../ansi-c/ansi-c$(LIBEXT) \ ../langapi/langapi$(LIBEXT) \ ../xmllang/xmllang$(LIBEXT) \ ../util/util$(LIBEXT) \ + ../json/json$(LIBEXT) \ ../solvers/solvers$(LIBEXT) INCLUDES= -I .. diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 18003786328..427346eecb4 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -15,6 +15,8 @@ Date: May 2016 #include #include +#include + #include "cover.h" class basic_blockst @@ -68,6 +70,62 @@ class basic_blockst /*******************************************************************\ +Function: coverage_goalst::get_coverage + + Inputs: + + Outputs: + + Purpose: + +\*******************************************************************/ + +void coverage_goalst::get_coverage(const std::string &coverage, + message_handlert &message_handler) +{ + jsont json; + + //check coverage file + if(parse_json(coverage, message_handler, json)) + { + messaget message(message_handler); + message.error() << coverage << " file is not a valid json file" + << messaget::eom; + exit(0); + } + + //make sure that we have an array of elements + if(!json.is_array()) + { + messaget message(message_handler); + message.error() << "expecting an array in the " << coverage << " file, but got " + << json << messaget::eom; + exit(0); + } + + for(jsont::arrayt::const_iterator + it=json.array.begin(); + it!=json.array.end(); + it++) + { + //get the goals array + if ((*it)["goals"].is_array()) + { + for(jsont::arrayt::const_iterator + itg=(*it)["goals"].array.begin(); + itg!=(*it)["goals"].array.end(); + itg++) + { + //get the line of each existing goal + const std::string line=(*itg)["sourceLocation"]["line"].value; + set_goals(line); + } + } + } +} + +/*******************************************************************\ + Function: coverage_goalst::set_goals Inputs: diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index b1a4e50b8ca..37398f3251e 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -16,6 +16,8 @@ Date: May 2016 class coverage_goalst { public: + void get_coverage(const std::string &coverage, + message_handlert &message_handler); void set_goals(std::string goal); bool is_existing_goal(source_locationt source_location); diff --git a/src/symex/Makefile b/src/symex/Makefile index 1f8e27ce063..42632b58d7b 100644 --- a/src/symex/Makefile +++ b/src/symex/Makefile @@ -16,6 +16,7 @@ OBJ += ../ansi-c/ansi-c$(LIBEXT) \ ../goto-symex/rewrite_union$(OBJEXT) \ ../pointer-analysis/dereference$(OBJEXT) \ ../goto-instrument/cover$(OBJEXT) \ + ../json/json$(LIBEXT) \ ../path-symex/path-symex$(LIBEXT) INCLUDES= -I .. From 270dea259e141d5e4a90a070c32f3062be6cb9e2 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 15:15:52 +0100 Subject: [PATCH 15/71] a goal should be identified by a source_locationt Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 22 +++++++++++++++------- src/goto-instrument/cover.h | 4 ++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 427346eecb4..70dc25acb91 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -8,6 +8,8 @@ Date: May 2016 \*******************************************************************/ +#include + #include #include @@ -84,6 +86,7 @@ void coverage_goalst::get_coverage(const std::string &coverage, message_handlert &message_handler) { jsont json; + source_locationt source_location; //check coverage file if(parse_json(coverage, message_handler, json)) @@ -103,6 +106,7 @@ void coverage_goalst::get_coverage(const std::string &coverage, exit(0); } + irep_idt line_number; for(jsont::arrayt::const_iterator it=json.array.begin(); it!=json.array.end(); @@ -117,8 +121,9 @@ void coverage_goalst::get_coverage(const std::string &coverage, itg++) { //get the line of each existing goal - const std::string line=(*itg)["sourceLocation"]["line"].value; - set_goals(line); + line_number=(*itg)["sourceLocation"]["line"].value; + source_location.set_line(line_number); + set_goals(source_location); } } } @@ -136,7 +141,7 @@ Function: coverage_goalst::set_goals \*******************************************************************/ -void coverage_goalst::set_goals(std::string goal) +void coverage_goalst::set_goals(source_locationt goal) { existing_goals.push_back(goal); } @@ -155,10 +160,13 @@ Function: coverage_goalst::is_existing_goal bool coverage_goalst::is_existing_goal(source_locationt source_location) { - std::vector::iterator it; - it = find (existing_goals.begin(), existing_goals.end(), - source_location.get_line().c_str()); - + std::vector::iterator it = existing_goals.begin(); + while (it!=existing_goals.end()) + { + if (!source_location.get_line().compare(it->get_line())) + break; + ++it; + } if(it == existing_goals.end()) return true; else diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index 37398f3251e..ba086d58154 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -18,11 +18,11 @@ class coverage_goalst public: void get_coverage(const std::string &coverage, message_handlert &message_handler); - void set_goals(std::string goal); + void set_goals(source_locationt goal); bool is_existing_goal(source_locationt source_location); private: - std::vector existing_goals; + std::vector existing_goals; }; enum class coverage_criteriont { From 76b4a3457027d5f444c6222ac9656b1c6b475cbb Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 15:44:05 +0100 Subject: [PATCH 16/71] method to construct a coverage_goalst object Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 6 +++--- src/goto-instrument/cover.cpp | 6 ++++-- src/goto-instrument/cover.h | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index fc7ed8853ad..05286737664 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -980,16 +980,16 @@ bool cbmc_parse_optionst::process_goto_program( return true; } + // check existing test goals coverage_goalst goals; if(cmdline.isset("existing-coverage")) { status() << "Check existing coverage goals" << eom; - //get file with covered test goals const std::string coverage=cmdline.get_value("existing-coverage"); - goals.get_coverage(coverage,get_message_handler()); - + //get a coverage_goalst object + goals = coverage_goalst::get_coverage_goals(coverage,get_message_handler());; } status() << "Instrumenting coverage goals" << eom; diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 70dc25acb91..9d1480d301c 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -82,10 +82,11 @@ Function: coverage_goalst::get_coverage \*******************************************************************/ -void coverage_goalst::get_coverage(const std::string &coverage, +coverage_goalst coverage_goalst::get_coverage_goals(const std::string &coverage, message_handlert &message_handler) { jsont json; + coverage_goalst goals; source_locationt source_location; //check coverage file @@ -123,10 +124,11 @@ void coverage_goalst::get_coverage(const std::string &coverage, //get the line of each existing goal line_number=(*itg)["sourceLocation"]["line"].value; source_location.set_line(line_number); - set_goals(source_location); + goals.set_goals(source_location); } } } + return goals; } /*******************************************************************\ diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index ba086d58154..9eb85b3c7d2 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -16,8 +16,8 @@ Date: May 2016 class coverage_goalst { public: - void get_coverage(const std::string &coverage, - message_handlert &message_handler); + static coverage_goalst get_coverage_goals(const std::string &coverage, + message_handlert &message_handler); void set_goals(source_locationt goal); bool is_existing_goal(source_locationt source_location); From 863f9042b4aaee5cc37b7c3ba2836bb3f525f7d3 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 16:01:15 +0100 Subject: [PATCH 17/71] remove iostream Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 9d1480d301c..20c34102908 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -8,8 +8,6 @@ Date: May 2016 \*******************************************************************/ -#include - #include #include From 5bcc8152d3e8c6be8baa17128a1a3583a43c5949 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Thu, 8 Sep 2016 15:19:19 +0100 Subject: [PATCH 18/71] use json file suggested at github issue #187 Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 20c34102908..44b7345552a 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -8,6 +8,8 @@ Date: May 2016 \*******************************************************************/ +#include + #include #include @@ -105,24 +107,34 @@ coverage_goalst coverage_goalst::get_coverage_goals(const std::string &coverage, exit(0); } - irep_idt line_number; + irep_idt file, function, line; for(jsont::arrayt::const_iterator it=json.array.begin(); it!=json.array.end(); it++) { - //get the goals array - if ((*it)["goals"].is_array()) + + //get the file of each existing goal + file=(*it)["file"].value; + source_location.set_file(file); + + //get the function of each existing goal + function=(*it)["function"].value; + source_location.set_function(function); + + //get the lines array + if ((*it)["lines"].is_array()) { for(jsont::arrayt::const_iterator - itg=(*it)["goals"].array.begin(); - itg!=(*it)["goals"].array.end(); + itg=(*it)["lines"].array.begin(); + itg!=(*it)["lines"].array.end(); itg++) { //get the line of each existing goal - line_number=(*itg)["sourceLocation"]["line"].value; - source_location.set_line(line_number); + line=(*itg)["number"].value; + source_location.set_line(line); goals.set_goals(source_location); + } } } @@ -163,7 +175,9 @@ bool coverage_goalst::is_existing_goal(source_locationt source_location) std::vector::iterator it = existing_goals.begin(); while (it!=existing_goals.end()) { - if (!source_location.get_line().compare(it->get_line())) + if (!source_location.get_file().compare(it->get_file()) && + !source_location.get_function().compare(it->get_function()) && + !source_location.get_line().compare(it->get_line())) break; ++it; } From 138f89c283b35c2fd2440b55bb2da1d2e2368626 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Thu, 8 Sep 2016 15:20:24 +0100 Subject: [PATCH 19/71] use json file as suggested at github issue #187 Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location2/main.json | 197 +--- regression/cbmc-cover/location3/main.json | 187 +--- regression/cbmc-cover/location4/main.json | 638 +------------ regression/cbmc-cover/location5/main.json | 628 +------------ regression/cbmc-cover/location6/if_expr1.json | 486 +--------- regression/cbmc-cover/location7/if_expr1.json | 476 +--------- regression/cbmc-cover/location8/if_acmp1.json | 883 +----------------- regression/cbmc-cover/location9/if_acmp1.json | 856 +---------------- 8 files changed, 21 insertions(+), 4330 deletions(-) diff --git a/regression/cbmc-cover/location2/main.json b/regression/cbmc-cover/location2/main.json index 57c35d49321..1fd3d2cd7ba 100644 --- a/regression/cbmc-cover/location2/main.json +++ b/regression/cbmc-cover/location2/main.json @@ -1,197 +1,2 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing main.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking main", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "function `assert' is not declared", - "messageType": "WARNING" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "size of program expression: 45 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 4 VCC(s), 4 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 4 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "265 variables, 522 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "265 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.001s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "main.coverage.1", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "3" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "main.coverage.2", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "main.coverage.3", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "main.coverage.4", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "12" - }, - "status": "satisfied" - } - ], - "goalsCovered": 4, - "tests": [ - { - "coveredGoals": [ "main.coverage.1", "main.coverage.3", "main.coverage.4" ], - "inputs": [ ] - }, - { - "coveredGoals": [ "main.coverage.2" ], - "inputs": [ ] - } - ], - "totalGoals": 4 -}, -{ - "messageText": "** 4 of 4 covered (100.0%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 2 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "main.c", "function": "main", "lines": [ {"number": 3}, {"number": 8}, {"number": 10}, {"number": 12} ] } ] diff --git a/regression/cbmc-cover/location3/main.json b/regression/cbmc-cover/location3/main.json index f0721a496e7..dc7fb615202 100644 --- a/regression/cbmc-cover/location3/main.json +++ b/regression/cbmc-cover/location3/main.json @@ -1,187 +1,2 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing main.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking main", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "function `assert' is not declared", - "messageType": "WARNING" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "size of program expression: 45 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 4 VCC(s), 4 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 4 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "265 variables, 522 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "265 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.001s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "main.coverage.1", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "3" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "main.coverage.2", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "main.coverage.4", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "12" - }, - "status": "satisfied" - } - ], - "goalsCovered": 4, - "tests": [ - { - "coveredGoals": [ "main.coverage.1", "main.coverage.3", "main.coverage.4" ], - "inputs": [ ] - }, - { - "coveredGoals": [ "main.coverage.2" ], - "inputs": [ ] - } - ], - "totalGoals": 4 -}, -{ - "messageText": "** 4 of 4 covered (100.0%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 2 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "main.c", "function": "main", "lines": [ {"number": 3}, {"number": 8}, {"number": 12} ] } ] diff --git a/regression/cbmc-cover/location4/main.json b/regression/cbmc-cover/location4/main.json index 114e0638022..d5b80c03a30 100644 --- a/regression/cbmc-cover/location4/main.json +++ b/regression/cbmc-cover/location4/main.json @@ -1,633 +1,7 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing main.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Parsing single-linked-list.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking main", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking single-linked-list", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop main.0 iteration 1 (2 max) file main.c line 19 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop main.0 iteration 2 (2 max) file main.c line 19 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop search_list.0 iteration 1 (2 max) file single-linked-list.c line 10 function search_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop search_list.0 iteration 2 (2 max) file single-linked-list.c line 10 function search_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop delete_list.0 iteration 1 (2 max) file single-linked-list.c line 23 function delete_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop delete_list.0 iteration 2 (2 max) file single-linked-list.c line 23 function delete_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop main.1 iteration 1 (2 max) file main.c line 35 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop main.1 iteration 2 (2 max) file main.c line 35 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "size of program expression: 358 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 57 VCC(s), 57 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 40 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "3368 variables, 1698 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "3368 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.007s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "free called for new[] object", - "goal": "", - "sourceLocation": { - "file": "", - "function": "free", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "main.coverage.1", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "main.coverage.2", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "12" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "main.coverage.3", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "13" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "main.coverage.4", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "14" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "main.coverage.5", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "16" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "main.coverage.6", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "19" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "main.coverage.7", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "main.coverage.8", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "main.coverage.9", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "main.coverage.10", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 11", - "goal": "main.coverage.11", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "32" - }, - "status": "failed" - }, - { - "description": "block 12", - "goal": "main.coverage.12", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "35" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "main.coverage.13", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "37" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "main.coverage.14", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "40" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "search_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "9" - }, - "status": "failed" - }, - { - "description": "block 2", - "goal": "search_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 3", - "goal": "search_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 4", - "goal": "search_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 5", - "goal": "search_list.coverage.5", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 6", - "goal": "search_list.coverage.6", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 7", - "goal": "search_list.coverage.7", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "15" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "delete_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "19" - }, - "status": "failed" - }, - { - "description": "block 2", - "goal": "delete_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 3", - "goal": "delete_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 4", - "goal": "delete_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 5", - "goal": "delete_list.coverage.5", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "29" - }, - "status": "failed" - }, - { - "description": "block 6", - "goal": "delete_list.coverage.6", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 7", - "goal": "delete_list.coverage.7", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 8", - "goal": "delete_list.coverage.8", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "delete_list.coverage.9", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "delete_list.coverage.10", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 11", - "goal": "delete_list.coverage.11", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 12", - "goal": "delete_list.coverage.12", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "delete_list.coverage.13", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "delete_list.coverage.14", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "insert_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "37" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "insert_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "40" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "insert_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "45" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "insert_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "48" - }, - "status": "satisfied" - } - ], - "goalsCovered": 11, - "tests": [ - { - "coveredGoals": [ "main.coverage.1", "main.coverage.2", "main.coverage.3", "main.coverage.4", "main.coverage.5", "main.coverage.6", "main.coverage.7", "insert_list.coverage.1", "insert_list.coverage.2", "insert_list.coverage.3", "insert_list.coverage.4" ], - "inputs": [ ] - } - ], - "totalGoals": 40 -}, -{ - "messageText": "** 11 of 40 covered (27.5%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 2 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "", "function": "free", "lines": [ {"number": 22} ] }, +{ "file": "main.c", "function": "main", "lines": [ {"number": 8}, {"number": 12}, {"number": 13}, {"number": 14}, {"number": 16}, {"number": 19}, {"number": 21}, {"number": 24}, {"number": 26}, {"number": 30}, {"number": 32}, {"number": 35}, {"number": 37}, {"number": 40} ] }, +{"file": "single-linked-list.c", "function": "search_list", "lines": [ {"number": 9}, {"number": 10}, {"number": 15} ] }, +{"file": "single-linked-list.c", "function": "delete_list", "lines": [ {"number": 19}, {"number": 23}, {"number": 24}, {"number": 25}, {"number": 29}, {"number": 31}, {"number": 37}, {"number": 40}, {"number": 45}, {"number": 48} ] }, +{"file": "single-linked-list.c", "function": "insert_list", "lines": [ {"number": 37}, {"number": 40}, {"number": 45}, {"number": 48} ] } ] + diff --git a/regression/cbmc-cover/location5/main.json b/regression/cbmc-cover/location5/main.json index 486ba8033d4..86c5b8fd0ee 100644 --- a/regression/cbmc-cover/location5/main.json +++ b/regression/cbmc-cover/location5/main.json @@ -1,623 +1,7 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing main.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Parsing single-linked-list.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking main", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking single-linked-list", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop main.0 iteration 1 (2 max) file main.c line 19 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop main.0 iteration 2 (2 max) file main.c line 19 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop search_list.0 iteration 1 (2 max) file single-linked-list.c line 10 function search_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop search_list.0 iteration 2 (2 max) file single-linked-list.c line 10 function search_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop delete_list.0 iteration 1 (2 max) file single-linked-list.c line 23 function delete_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop delete_list.0 iteration 2 (2 max) file single-linked-list.c line 23 function delete_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop main.1 iteration 1 (2 max) file main.c line 35 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop main.1 iteration 2 (2 max) file main.c line 35 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "size of program expression: 358 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 57 VCC(s), 57 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 40 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "3368 variables, 1698 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "3368 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.007s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "free called for new[] object", - "goal": "", - "sourceLocation": { - "file": "", - "function": "free", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "main.coverage.1", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "main.coverage.2", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "12" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "main.coverage.3", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "13" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "main.coverage.5", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "16" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "main.coverage.6", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "19" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "main.coverage.7", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "main.coverage.8", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "main.coverage.9", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "main.coverage.10", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 11", - "goal": "main.coverage.11", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "32" - }, - "status": "failed" - }, - { - "description": "block 12", - "goal": "main.coverage.12", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "35" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "main.coverage.13", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "37" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "main.coverage.14", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "40" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "search_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "9" - }, - "status": "failed" - }, - { - "description": "block 2", - "goal": "search_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 3", - "goal": "search_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 4", - "goal": "search_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 5", - "goal": "search_list.coverage.5", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 6", - "goal": "search_list.coverage.6", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 7", - "goal": "search_list.coverage.7", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "15" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "delete_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "19" - }, - "status": "failed" - }, - { - "description": "block 2", - "goal": "delete_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 3", - "goal": "delete_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 4", - "goal": "delete_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 5", - "goal": "delete_list.coverage.5", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "29" - }, - "status": "failed" - }, - { - "description": "block 6", - "goal": "delete_list.coverage.6", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 7", - "goal": "delete_list.coverage.7", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 8", - "goal": "delete_list.coverage.8", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "delete_list.coverage.9", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "delete_list.coverage.10", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 11", - "goal": "delete_list.coverage.11", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 12", - "goal": "delete_list.coverage.12", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "delete_list.coverage.13", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "delete_list.coverage.14", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "insert_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "37" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "insert_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "40" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "insert_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "45" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "insert_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "48" - }, - "status": "satisfied" - } - ], - "goalsCovered": 11, - "tests": [ - { - "coveredGoals": [ "main.coverage.1", "main.coverage.2", "main.coverage.3", "main.coverage.4", "main.coverage.5", "main.coverage.6", "main.coverage.7", "insert_list.coverage.1", "insert_list.coverage.2", "insert_list.coverage.3", "insert_list.coverage.4" ], - "inputs": [ ] - } - ], - "totalGoals": 40 -}, -{ - "messageText": "** 11 of 40 covered (27.5%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 2 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "", "function": "free", "lines": [ {"number": 22} ] }, +{ "file": "main.c", "function": "main", "lines": [ {"number": 8}, {"number": 12}, {"number": 13}, {"number": 16}, {"number": 19}, {"number": 21}, {"number": 24}, {"number": 26}, {"number": 30}, {"number": 32}, {"number": 35}, {"number": 37}, {"number": 40} ] }, +{"file": "single-linked-list.c", "function": "search_list", "lines": [ {"number": 9}, {"number": 10}, {"number": 15} ] }, +{"file": "single-linked-list.c", "function": "delete_list", "lines": [ {"number": 19}, {"number": 23}, {"number": 24}, {"number": 25}, {"number": 29}, {"number": 31}, {"number": 37}, {"number": 40}, {"number": 45}, {"number": 48} ] }, +{"file": "single-linked-list.c", "function": "insert_list", "lines": [ {"number": 37}, {"number": 40}, {"number": 45}, {"number": 48} ] } ] + diff --git a/regression/cbmc-cover/location6/if_expr1.json b/regression/cbmc-cover/location6/if_expr1.json index 9415f24f359..09d4eaa4fca 100644 --- a/regression/cbmc-cover/location6/if_expr1.json +++ b/regression/cbmc-cover/location6/if_expr1.json @@ -1,485 +1,3 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing if_expr1.class", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Java main class: if_expr1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "failed to load class `java.lang.String'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.io.IOException'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Class'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.AssertionError'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.System'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.io.InputStream'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Object'", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Class.desiredAssertionStatus:()Z", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.io.InputStream.read:()I", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.AssertionError.:()V", - "messageType": "WARNING" -}, -{ - "messageText": "size of program expression: 110 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 19 VCC(s), 19 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 20 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 2976 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 10", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 11", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 14", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 39 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 22 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 2 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.011s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "coverage.1", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.2", - "sourceLocation": { - "file": "if_expr1.java", - "line": "5" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.3", - "sourceLocation": { - "file": "if_expr1.java", - "line": "5" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.4", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.5", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.6", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "coverage.7", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "coverage.8", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "coverage.9", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "coverage.10", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "coverage.11", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 11", - "goal": "coverage.12", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 12", - "goal": "coverage.13", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "coverage.14", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "coverage.15", - "sourceLocation": { - "file": "if_expr1.java", - "line": "11" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.16", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.17", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.18", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.19", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.20", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - } - ], - "goalsCovered": 15, - "tests": [ - { - "coveredGoals": [ "coverage.2", "coverage.3", "coverage.5", "coverage.6", "coverage.11", "coverage.12", "coverage.15", "coverage.16", "coverage.17", "coverage.19", "coverage.20" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.18" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.4", "coverage.7" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.8" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - } - ], - "totalGoals": 20 -}, -{ - "messageText": "** 15 of 20 covered (75.0%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 5 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "if_expr1.java", "lines": [ {"number": 1}, {"number": 5}, {"number": 6}, {"number": 8}, {"number": 10}, {"number": 11} ] } ] + diff --git a/regression/cbmc-cover/location7/if_expr1.json b/regression/cbmc-cover/location7/if_expr1.json index a0d320755f2..1d1bbb6f552 100644 --- a/regression/cbmc-cover/location7/if_expr1.json +++ b/regression/cbmc-cover/location7/if_expr1.json @@ -1,476 +1,2 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing if_expr1.class", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Java main class: if_expr1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "failed to load class `java.lang.String'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.io.IOException'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Class'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.AssertionError'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.System'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.io.InputStream'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Object'", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Class.desiredAssertionStatus:()Z", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.io.InputStream.read:()I", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.AssertionError.:()V", - "messageType": "WARNING" -}, -{ - "messageText": "size of program expression: 110 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 19 VCC(s), 19 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 20 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 2976 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 10", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 11", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 14", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 39 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 22 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 2 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.011s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "coverage.1", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.2", - "sourceLocation": { - "file": "if_expr1.java", - "line": "5" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.3", - "sourceLocation": { - "file": "if_expr1.java", - "line": "5" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.4", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.5", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.6", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "coverage.7", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "coverage.8", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "coverage.9", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "coverage.10", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "coverage.11", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 11", - "goal": "coverage.12", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 12", - "goal": "coverage.13", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "coverage.14", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.16", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.17", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.18", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.19", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.20", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - } - ], - "goalsCovered": 15, - "tests": [ - { - "coveredGoals": [ "coverage.2", "coverage.3", "coverage.5", "coverage.6", "coverage.11", "coverage.12", "coverage.15", "coverage.16", "coverage.17", "coverage.19", "coverage.20" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.18" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.4", "coverage.7" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.8" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - } - ], - "totalGoals": 20 -}, -{ - "messageText": "** 15 of 20 covered (75.0%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 5 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "if_expr1.java", "lines": [ {"number": 1}, {"number": 5}, {"number": 6}, {"number": 8}, {"number": 10} ] } ] diff --git a/regression/cbmc-cover/location8/if_acmp1.json b/regression/cbmc-cover/location8/if_acmp1.json index c1623228f3e..de4ebb6c29d 100644 --- a/regression/cbmc-cover/location8/if_acmp1.json +++ b/regression/cbmc-cover/location8/if_acmp1.json @@ -1,882 +1,3 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing if_acmp1.class", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Java main class: if_acmp1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "failed to load class `java.lang.String'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Class'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.AssertionError'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Object'", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Class.desiredAssertionStatus:()Z", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Object.:()V", - "messageType": "WARNING" -}, -{ - "messageText": "size of program expression: 223 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 42 VCC(s), 42 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 61 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 191 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 10", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 14", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 18", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 22", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 26", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 30", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 34", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 38", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 42", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 46", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 47", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 51", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 25 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 11", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 15", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 19", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 23", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 27", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 31", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 35", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 39", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 43", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 48", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 25 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.011s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "coverage.1", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "4" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.2", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.3", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.4", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.5", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.6", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "15" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.7", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "15" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.8", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "16" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.9", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "17" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.10", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "18" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "coverage.11", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "19" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "coverage.12", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "coverage.13", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "coverage.14", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "coverage.15", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 11", - "goal": "coverage.16", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 12", - "goal": "coverage.17", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "coverage.18", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "coverage.19", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "satisfied" - }, - { - "description": "block 15", - "goal": "coverage.20", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "satisfied" - }, - { - "description": "block 16", - "goal": "coverage.21", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 17", - "goal": "coverage.22", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 18", - "goal": "coverage.23", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "satisfied" - }, - { - "description": "block 19", - "goal": "coverage.24", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "satisfied" - }, - { - "description": "block 20", - "goal": "coverage.25", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 21", - "goal": "coverage.26", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 22", - "goal": "coverage.27", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "satisfied" - }, - { - "description": "block 23", - "goal": "coverage.28", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "satisfied" - }, - { - "description": "block 24", - "goal": "coverage.29", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 25", - "goal": "coverage.30", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 26", - "goal": "coverage.31", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "satisfied" - }, - { - "description": "block 27", - "goal": "coverage.32", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "satisfied" - }, - { - "description": "block 28", - "goal": "coverage.33", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 29", - "goal": "coverage.34", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 30", - "goal": "coverage.35", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "satisfied" - }, - { - "description": "block 31", - "goal": "coverage.36", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "satisfied" - }, - { - "description": "block 32", - "goal": "coverage.37", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 33", - "goal": "coverage.38", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 34", - "goal": "coverage.39", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "satisfied" - }, - { - "description": "block 35", - "goal": "coverage.40", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "satisfied" - }, - { - "description": "block 36", - "goal": "coverage.41", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "failed" - }, - { - "description": "block 37", - "goal": "coverage.42", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "failed" - }, - { - "description": "block 38", - "goal": "coverage.43", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "satisfied" - }, - { - "description": "block 39", - "goal": "coverage.44", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "satisfied" - }, - { - "description": "block 40", - "goal": "coverage.45", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "failed" - }, - { - "description": "block 41", - "goal": "coverage.46", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "failed" - }, - { - "description": "block 42", - "goal": "coverage.47", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "29" - }, - "status": "satisfied" - }, - { - "description": "block 43", - "goal": "coverage.48", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "satisfied" - }, - { - "description": "block 44", - "goal": "coverage.49", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 45", - "goal": "coverage.50", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 46", - "goal": "coverage.51", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "31" - }, - "status": "satisfied" - }, - { - "description": "block 47", - "goal": "coverage.52", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "31" - }, - "status": "satisfied" - }, - { - "description": "block 48", - "goal": "coverage.53", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "satisfied" - }, - { - "description": "block 49", - "goal": "coverage.54", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "failed" - }, - { - "description": "block 50", - "goal": "coverage.55", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "failed" - }, - { - "description": "block 51", - "goal": "coverage.56", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "35" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.57", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.58", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.59", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.60", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.61", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - } - ], - "goalsCovered": 38, - "tests": [ - { - "coveredGoals": [ "coverage.1", "coverage.2", "coverage.3", "coverage.4", "coverage.6", "coverage.7", "coverage.8", "coverage.9", "coverage.10", "coverage.11", "coverage.15", "coverage.19", "coverage.23", "coverage.27", "coverage.31", "coverage.35", "coverage.39", "coverage.43", "coverage.47", "coverage.51", "coverage.52", "coverage.56", "coverage.57", "coverage.58", "coverage.59", "coverage.61" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.12", "coverage.16", "coverage.20", "coverage.24", "coverage.28", "coverage.32", "coverage.36", "coverage.40", "coverage.44", "coverage.48", "coverage.53", "coverage.60" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - } - ], - "totalGoals": 61 -}, -{ - "messageText": "** 38 of 61 covered (62.3%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 3 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "if_acmp1.java", "lines": [ {"number": 4}, {"number": 1}, {"number": 10}, {"number": 7}, {"number": 15}, {"number": 16}, {"number": 17}, {"number": 18}, {"number": 19}, {"number": 20}, {"number": 21}, {"number": 22}, {"number": 23}, {"number": 24}, {"number": 25}, {"number": 26}, {"number": 27}, {"number": 28}, {"number": 29}, {"number": 30}, {"number": 31}, {"number": 34}, {"number": 35} ] } ] + diff --git a/regression/cbmc-cover/location9/if_acmp1.json b/regression/cbmc-cover/location9/if_acmp1.json index 9e7fdc9f456..8d48cb86fa0 100644 --- a/regression/cbmc-cover/location9/if_acmp1.json +++ b/regression/cbmc-cover/location9/if_acmp1.json @@ -1,855 +1,3 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing if_acmp1.class", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Java main class: if_acmp1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "failed to load class `java.lang.String'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Class'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.AssertionError'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Object'", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Class.desiredAssertionStatus:()Z", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Object.:()V", - "messageType": "WARNING" -}, -{ - "messageText": "size of program expression: 223 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 42 VCC(s), 42 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 61 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 191 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 10", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 14", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 18", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 22", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 26", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 30", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 34", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 38", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 42", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 46", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 47", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 51", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 25 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 11", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 15", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 19", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 23", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 27", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 31", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 35", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 39", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 43", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 48", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 25 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.011s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "coverage.1", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "4" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.2", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.3", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.4", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.5", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.6", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "15" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.7", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "15" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.9", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "17" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "coverage.12", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "coverage.13", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "coverage.14", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "coverage.15", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 11", - "goal": "coverage.16", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 12", - "goal": "coverage.17", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "coverage.18", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "coverage.19", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "satisfied" - }, - { - "description": "block 15", - "goal": "coverage.20", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "satisfied" - }, - { - "description": "block 16", - "goal": "coverage.21", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 17", - "goal": "coverage.22", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 18", - "goal": "coverage.23", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "satisfied" - }, - { - "description": "block 19", - "goal": "coverage.24", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "satisfied" - }, - { - "description": "block 20", - "goal": "coverage.25", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 21", - "goal": "coverage.26", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 22", - "goal": "coverage.27", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "satisfied" - }, - { - "description": "block 23", - "goal": "coverage.28", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "satisfied" - }, - { - "description": "block 24", - "goal": "coverage.29", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 25", - "goal": "coverage.30", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 26", - "goal": "coverage.31", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "satisfied" - }, - { - "description": "block 27", - "goal": "coverage.32", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "satisfied" - }, - { - "description": "block 28", - "goal": "coverage.33", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 29", - "goal": "coverage.34", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 30", - "goal": "coverage.35", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "satisfied" - }, - { - "description": "block 31", - "goal": "coverage.36", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "satisfied" - }, - { - "description": "block 32", - "goal": "coverage.37", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 33", - "goal": "coverage.38", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 34", - "goal": "coverage.39", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "satisfied" - }, - { - "description": "block 35", - "goal": "coverage.40", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "satisfied" - }, - { - "description": "block 36", - "goal": "coverage.41", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "failed" - }, - { - "description": "block 37", - "goal": "coverage.42", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "failed" - }, - { - "description": "block 38", - "goal": "coverage.43", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "satisfied" - }, - { - "description": "block 39", - "goal": "coverage.44", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "satisfied" - }, - { - "description": "block 40", - "goal": "coverage.45", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "failed" - }, - { - "description": "block 41", - "goal": "coverage.46", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "failed" - }, - { - "description": "block 42", - "goal": "coverage.47", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "29" - }, - "status": "satisfied" - }, - { - "description": "block 43", - "goal": "coverage.48", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "satisfied" - }, - { - "description": "block 44", - "goal": "coverage.49", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 45", - "goal": "coverage.50", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 46", - "goal": "coverage.51", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "31" - }, - "status": "satisfied" - }, - { - "description": "block 47", - "goal": "coverage.52", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "31" - }, - "status": "satisfied" - }, - { - "description": "block 48", - "goal": "coverage.53", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "satisfied" - }, - { - "description": "block 49", - "goal": "coverage.54", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "failed" - }, - { - "description": "block 50", - "goal": "coverage.55", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "failed" - }, - { - "description": "block 51", - "goal": "coverage.56", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "35" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.57", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.58", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.59", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.60", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.61", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - } - ], - "goalsCovered": 38, - "tests": [ - { - "coveredGoals": [ "coverage.1", "coverage.2", "coverage.3", "coverage.4", "coverage.6", "coverage.7", "coverage.8", "coverage.9", "coverage.10", "coverage.11", "coverage.15", "coverage.19", "coverage.23", "coverage.27", "coverage.31", "coverage.35", "coverage.39", "coverage.43", "coverage.47", "coverage.51", "coverage.52", "coverage.56", "coverage.57", "coverage.58", "coverage.59", "coverage.61" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.12", "coverage.16", "coverage.20", "coverage.24", "coverage.28", "coverage.32", "coverage.36", "coverage.40", "coverage.44", "coverage.48", "coverage.53", "coverage.60" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - } - ], - "totalGoals": 61 -}, -{ - "messageText": "** 38 of 61 covered (62.3%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 3 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "if_acmp1.java", "lines": [ {"number": 4}, {"number": 1}, {"number": 10}, {"number": 7}, {"number": 15}, {"number": 17}, {"number": 20}, {"number": 21}, {"number": 22}, {"number": 23}, {"number": 24}, {"number": 25}, {"number": 26}, {"number": 27}, {"number": 28}, {"number": 29}, {"number": 30}, {"number": 31}, {"number": 34}, {"number": 35} ] } ] + From 48e5ebbd8739839c73435514bb97d1503508f572 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Thu, 8 Sep 2016 15:30:46 +0100 Subject: [PATCH 20/71] remove space Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 44b7345552a..0fe251bec04 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -131,10 +131,9 @@ coverage_goalst coverage_goalst::get_coverage_goals(const std::string &coverage, itg++) { //get the line of each existing goal - line=(*itg)["number"].value; - source_location.set_line(line); - goals.set_goals(source_location); - + line=(*itg)["number"].value; + source_location.set_line(line); + goals.set_goals(source_location); } } } From 7e39b53c7cb7ee25ee41e312a12c572f93f3e38c Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 19 Sep 2016 15:44:54 +0100 Subject: [PATCH 21/71] fix merge Signed-off-by: Lucas Cordeiro --- regression/cbmc-concurrency/deadlock1/main.c | 45 +-- regression/cbmc-concurrency/deadlock2/main.c | 46 +-- .../cbmc-concurrency/norace_array1/main.c | 52 +-- .../cbmc-concurrency/norace_scalar1/main.c | 52 +-- .../cbmc-concurrency/norace_struct1/main.c | 52 +-- .../cbmc-concurrency/struct_and_array1/main.c | 80 ++--- .../cbmc-from-CVS/Struct_Pointer2/main.c | 54 +-- .../cbmc-from-CVS/Unbounded_Array5/main.c | 40 +-- .../cbmc-from-CVS/return2/tcas_v23_523.c | 336 +++++++++--------- regression/cbmc-with-incr/Float-div1/main.c | 100 +++--- .../cbmc-with-incr/Float-to-double2/main.c | 24 +- regression/cbmc-with-incr/Float19/main.c | 48 +-- regression/cbmc-with-incr/Float20/main.c | 112 +++--- regression/cbmc-with-incr/Float21/main.c | 132 +++---- regression/cbmc-with-incr/Recursion4/main.c | 34 +- regression/cpp-from-CVS/Array1/main.cpp | 22 +- regression/cpp-from-CVS/Array2/main.cpp | 22 +- regression/cpp/Decltype2/main.cpp | 28 +- regression/cpp/Decltype3/main.cpp | 36 +- 19 files changed, 658 insertions(+), 657 deletions(-) diff --git a/regression/cbmc-concurrency/deadlock1/main.c b/regression/cbmc-concurrency/deadlock1/main.c index 2e134bc5f9d..b162c3a4284 100644 --- a/regression/cbmc-concurrency/deadlock1/main.c +++ b/regression/cbmc-concurrency/deadlock1/main.c @@ -1,22 +1,23 @@ -#include -#include -#include - -pthread_mutex_t lock_never_unlock_002_glb_mutex = PTHREAD_MUTEX_INITIALIZER; - -void* lock_never_unlock_002_tsk_001(void* pram) { - pthread_mutex_lock(&lock_never_unlock_002_glb_mutex); - return NULL; -} - -void main() { - pthread_t tid1; - pthread_t tid2; - pthread_mutex_init(&lock_never_unlock_002_glb_mutex, NULL); - pthread_create(&tid1, NULL, lock_never_unlock_002_tsk_001, NULL); - pthread_create(&tid2, NULL, lock_never_unlock_002_tsk_001, NULL); - pthread_join(tid1, NULL); - pthread_join(tid2, NULL); - // deadlock in the threads; assertion should not be reachable - assert(0); -} +#include +#include +#include + +pthread_mutex_t lock_never_unlock_002_glb_mutex = PTHREAD_MUTEX_INITIALIZER; + +void* lock_never_unlock_002_tsk_001(void* pram) { + pthread_mutex_lock(&lock_never_unlock_002_glb_mutex); + return NULL; +} + +void main() { + pthread_t tid1; + pthread_t tid2; + pthread_mutex_init(&lock_never_unlock_002_glb_mutex, NULL); + pthread_create(&tid1, NULL, lock_never_unlock_002_tsk_001, NULL); + pthread_create(&tid2, NULL, lock_never_unlock_002_tsk_001, NULL); + pthread_join(tid1, NULL); + pthread_join(tid2, NULL); + // deadlock in the threads; assertion should not be reachable + assert(0); +} + diff --git a/regression/cbmc-concurrency/deadlock2/main.c b/regression/cbmc-concurrency/deadlock2/main.c index c2ebc9b9a01..d8000f2027d 100644 --- a/regression/cbmc-concurrency/deadlock2/main.c +++ b/regression/cbmc-concurrency/deadlock2/main.c @@ -1,23 +1,23 @@ -#include -#include -#include - -pthread_mutex_t lock_never_unlock_002_glb_mutex = PTHREAD_MUTEX_INITIALIZER; - -void* lock_never_unlock_002_tsk_001(void* pram) { - pthread_mutex_lock(&lock_never_unlock_002_glb_mutex); - pthread_mutex_unlock(&lock_never_unlock_002_glb_mutex); - return NULL; -} - -void main() { - pthread_t tid1; - pthread_t tid2; - pthread_mutex_init(&lock_never_unlock_002_glb_mutex, NULL); - pthread_create(&tid1, NULL, lock_never_unlock_002_tsk_001, NULL); - pthread_create(&tid2, NULL, lock_never_unlock_002_tsk_001, NULL); - pthread_join(tid1, NULL); - pthread_join(tid2, NULL); - // no deadlock in the threads; assertion should be reached - assert(0); -} +#include +#include +#include + +pthread_mutex_t lock_never_unlock_002_glb_mutex = PTHREAD_MUTEX_INITIALIZER; + +void* lock_never_unlock_002_tsk_001(void* pram) { + pthread_mutex_lock(&lock_never_unlock_002_glb_mutex); + pthread_mutex_unlock(&lock_never_unlock_002_glb_mutex); + return NULL; +} + +void main() { + pthread_t tid1; + pthread_t tid2; + pthread_mutex_init(&lock_never_unlock_002_glb_mutex, NULL); + pthread_create(&tid1, NULL, lock_never_unlock_002_tsk_001, NULL); + pthread_create(&tid2, NULL, lock_never_unlock_002_tsk_001, NULL); + pthread_join(tid1, NULL); + pthread_join(tid2, NULL); + // no deadlock in the threads; assertion should be reached + assert(0); +} diff --git a/regression/cbmc-concurrency/norace_array1/main.c b/regression/cbmc-concurrency/norace_array1/main.c index debc6871438..721065d6182 100644 --- a/regression/cbmc-concurrency/norace_array1/main.c +++ b/regression/cbmc-concurrency/norace_array1/main.c @@ -1,26 +1,26 @@ -#include -#include - -int s[2]; - -void* thread_0(void* arg) -{ - s[0] = 2; - assert(s[0] == 2); - return NULL; -} - -void* thread_1(void* arg) -{ - s[1] = 1; - assert(s[1] == 1); - return NULL; -} - -int main(void) -{ - pthread_t thread0, thread1; - pthread_create(&thread0, NULL, thread_0, 0); - pthread_create(&thread1, NULL, thread_1, 0); - return 0; -} +#include +#include + +int s[2]; + +void* thread_0(void* arg) +{ + s[0] = 2; + assert(s[0] == 2); + return NULL; +} + +void* thread_1(void* arg) +{ + s[1] = 1; + assert(s[1] == 1); + return NULL; +} + +int main(void) +{ + pthread_t thread0, thread1; + pthread_create(&thread0, NULL, thread_0, 0); + pthread_create(&thread1, NULL, thread_1, 0); + return 0; +} diff --git a/regression/cbmc-concurrency/norace_scalar1/main.c b/regression/cbmc-concurrency/norace_scalar1/main.c index 8c39510fd73..eb5baf7fd6a 100644 --- a/regression/cbmc-concurrency/norace_scalar1/main.c +++ b/regression/cbmc-concurrency/norace_scalar1/main.c @@ -1,26 +1,26 @@ -#include -#include - -int f0, f1; - -void* thread_0(void* arg) -{ - f0 = 2; - assert(f0 == 2); - return NULL; -} - -void* thread_1(void* arg) -{ - f1 = 1; - assert(f1 == 1); - return NULL; -} - -int main(void) -{ - pthread_t thread0, thread1; - pthread_create(&thread0, NULL, thread_0, 0); - pthread_create(&thread1, NULL, thread_1, 0); - return 0; -} +#include +#include + +int f0, f1; + +void* thread_0(void* arg) +{ + f0 = 2; + assert(f0 == 2); + return NULL; +} + +void* thread_1(void* arg) +{ + f1 = 1; + assert(f1 == 1); + return NULL; +} + +int main(void) +{ + pthread_t thread0, thread1; + pthread_create(&thread0, NULL, thread_0, 0); + pthread_create(&thread1, NULL, thread_1, 0); + return 0; +} diff --git a/regression/cbmc-concurrency/norace_struct1/main.c b/regression/cbmc-concurrency/norace_struct1/main.c index 1fca06df093..31dd7e324e3 100644 --- a/regression/cbmc-concurrency/norace_struct1/main.c +++ b/regression/cbmc-concurrency/norace_struct1/main.c @@ -1,26 +1,26 @@ -#include -#include - -struct { int f0; int f1; } s; - -void* thread_0(void* arg) -{ - s.f0 = 2; - assert(s.f0 == 2); - return NULL; -} - -void* thread_1(void* arg) -{ - s.f1 = 1; - assert(s.f1 == 1); - return NULL; -} - -int main(void) -{ - pthread_t thread0, thread1; - pthread_create(&thread0, NULL, thread_0, 0); - pthread_create(&thread1, NULL, thread_1, 0); - return 0; -} +#include +#include + +struct { int f0; int f1; } s; + +void* thread_0(void* arg) +{ + s.f0 = 2; + assert(s.f0 == 2); + return NULL; +} + +void* thread_1(void* arg) +{ + s.f1 = 1; + assert(s.f1 == 1); + return NULL; +} + +int main(void) +{ + pthread_t thread0, thread1; + pthread_create(&thread0, NULL, thread_0, 0); + pthread_create(&thread1, NULL, thread_1, 0); + return 0; +} diff --git a/regression/cbmc-concurrency/struct_and_array1/main.c b/regression/cbmc-concurrency/struct_and_array1/main.c index cc3dd606089..42164904232 100644 --- a/regression/cbmc-concurrency/struct_and_array1/main.c +++ b/regression/cbmc-concurrency/struct_and_array1/main.c @@ -1,40 +1,40 @@ -#include - -typedef struct st_t -{ - unsigned char x; - unsigned char y; -} ST; - -ST st; - -char my_array[10]; - -_Bool done1, done2; - -void *foo1(void *arg1) -{ - st.x = 1; - my_array[1]=1; - done1 = 1; -} - -void *foo2(void *arg2) -{ - st.y = 1; - my_array[2]=2; - done2 = 1; -} - -int main() -{ - pthread_t t; - pthread_create(&t,NULL,foo1,NULL); - pthread_create(&t,NULL,foo2,NULL); - - if(done1 && done2) - { - assert(st.x==st.y); - assert(my_array[1]==my_array[2]); - } -} +#include + +typedef struct st_t +{ + unsigned char x; + unsigned char y; +} ST; + +ST st; + +char my_array[10]; + +_Bool done1, done2; + +void *foo1(void *arg1) +{ + st.x = 1; + my_array[1]=1; + done1 = 1; +} + +void *foo2(void *arg2) +{ + st.y = 1; + my_array[2]=2; + done2 = 1; +} + +int main() +{ + pthread_t t; + pthread_create(&t,NULL,foo1,NULL); + pthread_create(&t,NULL,foo2,NULL); + + if(done1 && done2) + { + assert(st.x==st.y); + assert(my_array[1]==my_array[2]); + } +} diff --git a/regression/cbmc-from-CVS/Struct_Pointer2/main.c b/regression/cbmc-from-CVS/Struct_Pointer2/main.c index b50cfcd0f97..bf8ab0817c2 100644 --- a/regression/cbmc-from-CVS/Struct_Pointer2/main.c +++ b/regression/cbmc-from-CVS/Struct_Pointer2/main.c @@ -1,27 +1,27 @@ -#include -#include - -struct mylist -{ - int data; - struct mylist *next; -}; - -int main() -{ - struct mylist *p; - - // Allocations: - p=malloc( sizeof(struct mylist ) ); - p->data=1; - p->next=malloc( sizeof(struct mylist ) ); - p->next->data=2; - p->next->next=malloc( sizeof(struct mylist ) ); - p->next->next->data=3; - p->next->next->next=malloc( sizeof(struct mylist ) ); - p->next->next->next->data=4; - - assert(p->next->next->data==3); - - return 0; -} +#include +#include + +struct mylist +{ + int data; + struct mylist *next; +}; + +int main() +{ + struct mylist *p; + + // Allocations: + p=malloc( sizeof(struct mylist ) ); + p->data=1; + p->next=malloc( sizeof(struct mylist ) ); + p->next->data=2; + p->next->next=malloc( sizeof(struct mylist ) ); + p->next->next->data=3; + p->next->next->next=malloc( sizeof(struct mylist ) ); + p->next->next->next->data=4; + + assert(p->next->next->data==3); + + return 0; +} diff --git a/regression/cbmc-from-CVS/Unbounded_Array5/main.c b/regression/cbmc-from-CVS/Unbounded_Array5/main.c index d797c3c2923..aebfa1e3a94 100644 --- a/regression/cbmc-from-CVS/Unbounded_Array5/main.c +++ b/regression/cbmc-from-CVS/Unbounded_Array5/main.c @@ -1,20 +1,20 @@ -int mem[__CPROVER_constant_infinity_uint]; - -int main() -{ - int i, j, mem_j; - - mem[0] = 0; - mem[1] = 1; - - mem[j] = 1; - mem_j = mem[j]; - assert(mem_j == 1); - - mem[i] = mem[mem_j]; - - unsigned xxxi=mem[i]; - unsigned xxx1=mem[1]; - - __CPROVER_assert(xxxi == xxx1, "Check infinite mem"); -} +int mem[__CPROVER_constant_infinity_uint]; + +int main() +{ + int i, j, mem_j; + + mem[0] = 0; + mem[1] = 1; + + mem[j] = 1; + mem_j = mem[j]; + assert(mem_j == 1); + + mem[i] = mem[mem_j]; + + unsigned xxxi=mem[i]; + unsigned xxx1=mem[1]; + + __CPROVER_assert(xxxi == xxx1, "Check infinite mem"); +} diff --git a/regression/cbmc-from-CVS/return2/tcas_v23_523.c b/regression/cbmc-from-CVS/return2/tcas_v23_523.c index 6670715a6d2..4504d9c4dd4 100644 --- a/regression/cbmc-from-CVS/return2/tcas_v23_523.c +++ b/regression/cbmc-from-CVS/return2/tcas_v23_523.c @@ -1,171 +1,171 @@ - -/* -*- Last-Edit: Fri Jan 29 11:13:27 1993 by Tarak S. Goradia; -*- */ + +/* -*- Last-Edit: Fri Jan 29 11:13:27 1993 by Tarak S. Goradia; -*- */ /* $Log: tcas_v23_523.c,v $ /* Revision 1.1 2006-04-04 08:38:22 kroening /* more -/* - * Revision 1.2 1993/03/12 19:29:50 foster - * Correct logic bug which didn't allow output of 2 - hf - * */ - -#include - -#define OLEV 600 /* in feets/minute */ -#define MAXALTDIFF 600 /* max altitude difference in feet */ -#define MINSEP 300 /* min separation in feet */ -#define NOZCROSS 100 /* in feet */ - /* variables */ - -typedef int bool; - -int Cur_Vertical_Sep; -bool High_Confidence; -bool Two_of_Three_Reports_Valid; - -int Own_Tracked_Alt; -int Own_Tracked_Alt_Rate; -int Other_Tracked_Alt; - -int Alt_Layer_Value; /* 0, 1, 2, 3 */ -int Positive_RA_Alt_Thresh[4]; - -int Up_Separation; -int Down_Separation; - - /* state variables */ -int Other_RAC; /* NO_INTENT, DO_NOT_CLIMB, DO_NOT_DESCEND */ -#define NO_INTENT 0 -#define DO_NOT_CLIMB 1 -#define DO_NOT_DESCEND 2 - -int Other_Capability; /* TCAS_TA, OTHER */ -#define TCAS_TA 1 -#define OTHER 2 - -int Climb_Inhibit; /* true/false */ - -#define UNRESOLVED 0 -#define UPWARD_RA 1 -#define DOWNWARD_RA 2 - -int ALIM(); -int Inhibit_Biased_Climb(); -bool Non_Crossing_Biased_Climb(); -bool Non_Crossing_Biased_Descend(); -bool Own_Below_Threat(); -bool Own_Above_Threat(); -int alt_sep_test(); -void initialize() -{ - Positive_RA_Alt_Thresh[0] = 400; - Positive_RA_Alt_Thresh[1] = 500; - Positive_RA_Alt_Thresh[2] = 640; - Positive_RA_Alt_Thresh[3] = 740; -} - -int ALIM () -{ - return Positive_RA_Alt_Thresh[Alt_Layer_Value]; -} - -int Inhibit_Biased_Climb () -{ - return (Climb_Inhibit ? Up_Separation + NOZCROSS : Up_Separation); -} - -bool Non_Crossing_Biased_Climb() -{ - int upward_preferred; - int upward_crossing_situation; - bool result; - - upward_preferred = Inhibit_Biased_Climb() > Down_Separation; - if (upward_preferred) - { - result = !(Own_Below_Threat()) || ((Own_Below_Threat()) && (!(Down_Separation >= ALIM()))); - } - else - { - result = Own_Above_Threat() && (Cur_Vertical_Sep >= MINSEP) && (Up_Separation >= ALIM()); - } - return result; -} - -bool Non_Crossing_Biased_Descend() -{ - int upward_preferred; - int upward_crossing_situation; - bool result; - - upward_preferred = (Up_Separation + NOZCROSS) > Down_Separation; - if (upward_preferred) - { - result = Own_Below_Threat() && (Cur_Vertical_Sep >= MINSEP) && (Down_Separation >= ALIM()); - } - else - { - result = !(Own_Above_Threat()) || ((Own_Above_Threat()) && (Up_Separation >= ALIM())); - } - return result; -} - -bool Own_Below_Threat() -{ - return (Own_Tracked_Alt < Other_Tracked_Alt); -} - -bool Own_Above_Threat() -{ - return (Other_Tracked_Alt < Own_Tracked_Alt); -} - -int alt_sep_test() -{ - bool enabled, tcas_equipped, intent_not_known; - bool need_upward_RA, need_downward_RA; - int alt_sep; - - enabled = High_Confidence && (Own_Tracked_Alt_Rate <= OLEV) && (Cur_Vertical_Sep > MAXALTDIFF); - tcas_equipped = Other_Capability == TCAS_TA; - intent_not_known = Two_of_Three_Reports_Valid && Other_RAC == NO_INTENT; - - alt_sep = UNRESOLVED; - - if (enabled && ((tcas_equipped && intent_not_known) || !tcas_equipped)) - { - need_upward_RA = Non_Crossing_Biased_Climb() && Own_Below_Threat(); - need_downward_RA = Non_Crossing_Biased_Descend() && Own_Above_Threat(); - if (need_upward_RA && need_downward_RA) - /* unreachable: requires Own_Below_Threat and Own_Above_Threat - to both be true - that requires Own_Tracked_Alt < Other_Tracked_Alt - and Other_Tracked_Alt < Own_Tracked_Alt, which isn't possible */ - alt_sep = UNRESOLVED; - else if (need_upward_RA) - alt_sep = UPWARD_RA; - else if (need_downward_RA) - alt_sep = DOWNWARD_RA; - else - alt_sep = UNRESOLVED; - } - - return alt_sep; -} - -main(int argc, char*argv[]) -{ - - initialize(); - Cur_Vertical_Sep = 860; - High_Confidence = 1; - Two_of_Three_Reports_Valid = 1; - Own_Tracked_Alt = 618; - Own_Tracked_Alt_Rate = 329; - Other_Tracked_Alt = 574; - Alt_Layer_Value = 4; - Up_Separation = 893; - Down_Separation = 914; - Other_RAC = 0; - Other_Capability = 2; - Climb_Inhibit = 0; - assert(alt_sep_test()==0); -} +/* + * Revision 1.2 1993/03/12 19:29:50 foster + * Correct logic bug which didn't allow output of 2 - hf + * */ + +#include + +#define OLEV 600 /* in feets/minute */ +#define MAXALTDIFF 600 /* max altitude difference in feet */ +#define MINSEP 300 /* min separation in feet */ +#define NOZCROSS 100 /* in feet */ + /* variables */ + +typedef int bool; + +int Cur_Vertical_Sep; +bool High_Confidence; +bool Two_of_Three_Reports_Valid; + +int Own_Tracked_Alt; +int Own_Tracked_Alt_Rate; +int Other_Tracked_Alt; + +int Alt_Layer_Value; /* 0, 1, 2, 3 */ +int Positive_RA_Alt_Thresh[4]; + +int Up_Separation; +int Down_Separation; + + /* state variables */ +int Other_RAC; /* NO_INTENT, DO_NOT_CLIMB, DO_NOT_DESCEND */ +#define NO_INTENT 0 +#define DO_NOT_CLIMB 1 +#define DO_NOT_DESCEND 2 + +int Other_Capability; /* TCAS_TA, OTHER */ +#define TCAS_TA 1 +#define OTHER 2 + +int Climb_Inhibit; /* true/false */ + +#define UNRESOLVED 0 +#define UPWARD_RA 1 +#define DOWNWARD_RA 2 + +int ALIM(); +int Inhibit_Biased_Climb(); +bool Non_Crossing_Biased_Climb(); +bool Non_Crossing_Biased_Descend(); +bool Own_Below_Threat(); +bool Own_Above_Threat(); +int alt_sep_test(); +void initialize() +{ + Positive_RA_Alt_Thresh[0] = 400; + Positive_RA_Alt_Thresh[1] = 500; + Positive_RA_Alt_Thresh[2] = 640; + Positive_RA_Alt_Thresh[3] = 740; +} + +int ALIM () +{ + return Positive_RA_Alt_Thresh[Alt_Layer_Value]; +} + +int Inhibit_Biased_Climb () +{ + return (Climb_Inhibit ? Up_Separation + NOZCROSS : Up_Separation); +} + +bool Non_Crossing_Biased_Climb() +{ + int upward_preferred; + int upward_crossing_situation; + bool result; + + upward_preferred = Inhibit_Biased_Climb() > Down_Separation; + if (upward_preferred) + { + result = !(Own_Below_Threat()) || ((Own_Below_Threat()) && (!(Down_Separation >= ALIM()))); + } + else + { + result = Own_Above_Threat() && (Cur_Vertical_Sep >= MINSEP) && (Up_Separation >= ALIM()); + } + return result; +} + +bool Non_Crossing_Biased_Descend() +{ + int upward_preferred; + int upward_crossing_situation; + bool result; + + upward_preferred = (Up_Separation + NOZCROSS) > Down_Separation; + if (upward_preferred) + { + result = Own_Below_Threat() && (Cur_Vertical_Sep >= MINSEP) && (Down_Separation >= ALIM()); + } + else + { + result = !(Own_Above_Threat()) || ((Own_Above_Threat()) && (Up_Separation >= ALIM())); + } + return result; +} + +bool Own_Below_Threat() +{ + return (Own_Tracked_Alt < Other_Tracked_Alt); +} + +bool Own_Above_Threat() +{ + return (Other_Tracked_Alt < Own_Tracked_Alt); +} + +int alt_sep_test() +{ + bool enabled, tcas_equipped, intent_not_known; + bool need_upward_RA, need_downward_RA; + int alt_sep; + + enabled = High_Confidence && (Own_Tracked_Alt_Rate <= OLEV) && (Cur_Vertical_Sep > MAXALTDIFF); + tcas_equipped = Other_Capability == TCAS_TA; + intent_not_known = Two_of_Three_Reports_Valid && Other_RAC == NO_INTENT; + + alt_sep = UNRESOLVED; + + if (enabled && ((tcas_equipped && intent_not_known) || !tcas_equipped)) + { + need_upward_RA = Non_Crossing_Biased_Climb() && Own_Below_Threat(); + need_downward_RA = Non_Crossing_Biased_Descend() && Own_Above_Threat(); + if (need_upward_RA && need_downward_RA) + /* unreachable: requires Own_Below_Threat and Own_Above_Threat + to both be true - that requires Own_Tracked_Alt < Other_Tracked_Alt + and Other_Tracked_Alt < Own_Tracked_Alt, which isn't possible */ + alt_sep = UNRESOLVED; + else if (need_upward_RA) + alt_sep = UPWARD_RA; + else if (need_downward_RA) + alt_sep = DOWNWARD_RA; + else + alt_sep = UNRESOLVED; + } + + return alt_sep; +} + +main(int argc, char*argv[]) +{ + + initialize(); + Cur_Vertical_Sep = 860; + High_Confidence = 1; + Two_of_Three_Reports_Valid = 1; + Own_Tracked_Alt = 618; + Own_Tracked_Alt_Rate = 329; + Other_Tracked_Alt = 574; + Alt_Layer_Value = 4; + Up_Separation = 893; + Down_Separation = 914; + Other_RAC = 0; + Other_Capability = 2; + Climb_Inhibit = 0; + assert(alt_sep_test()==0); +} diff --git a/regression/cbmc-with-incr/Float-div1/main.c b/regression/cbmc-with-incr/Float-div1/main.c index dee31965dac..63f8512a7c2 100644 --- a/regression/cbmc-with-incr/Float-div1/main.c +++ b/regression/cbmc-with-incr/Float-div1/main.c @@ -1,50 +1,50 @@ -#include -#include - -#ifdef __GNUC__ -void inductiveStepHunt (float startState) -{ - float target = 0x1.fffffep-3f; - - __CPROVER_assume((0 < startState) && (fpclassify(startState) == FP_NORMAL) && (0x1p-126f <= startState)); - - float secondPoint = (target / startState); - - float nextState = (startState + secondPoint) / 2; - - float oneAfter = (target / nextState); - - assert(oneAfter > 0); -} - -void simplifiedInductiveStepHunt (float nextState) -{ - float target = 0x1.fffffep-3f; - - // Implies nextState == 0x1p+124f; - __CPROVER_assume((0x1.fffffep+123f < nextState) && (nextState < 0x1.000002p+124f)); - - float oneAfter = (target / nextState); - - // Is true and correctly proven by constant evaluation - // Note that this is the smallest normal number - assert(0x1.fffffep-3f / 0x1p+124f == 0x1p-126f); - - assert(oneAfter > 0); -} -#endif - -int main (void) -{ - #ifdef __GNUC__ - // inductiveStepHunt(0x1p+125f); - // simplifiedInductiveStepHunt(0x1p+124f); - - float f, g; - - inductiveStepHunt(f); - simplifiedInductiveStepHunt(g); - #endif - - return 0; -} +#include +#include + +#ifdef __GNUC__ +void inductiveStepHunt (float startState) +{ + float target = 0x1.fffffep-3f; + + __CPROVER_assume((0 < startState) && (fpclassify(startState) == FP_NORMAL) && (0x1p-126f <= startState)); + + float secondPoint = (target / startState); + + float nextState = (startState + secondPoint) / 2; + + float oneAfter = (target / nextState); + + assert(oneAfter > 0); +} + +void simplifiedInductiveStepHunt (float nextState) +{ + float target = 0x1.fffffep-3f; + + // Implies nextState == 0x1p+124f; + __CPROVER_assume((0x1.fffffep+123f < nextState) && (nextState < 0x1.000002p+124f)); + + float oneAfter = (target / nextState); + + // Is true and correctly proven by constant evaluation + // Note that this is the smallest normal number + assert(0x1.fffffep-3f / 0x1p+124f == 0x1p-126f); + + assert(oneAfter > 0); +} +#endif + +int main (void) +{ + #ifdef __GNUC__ + // inductiveStepHunt(0x1p+125f); + // simplifiedInductiveStepHunt(0x1p+124f); + + float f, g; + + inductiveStepHunt(f); + simplifiedInductiveStepHunt(g); + #endif + + return 0; +} diff --git a/regression/cbmc-with-incr/Float-to-double2/main.c b/regression/cbmc-with-incr/Float-to-double2/main.c index 43ab0927eab..2db129fd08f 100644 --- a/regression/cbmc-with-incr/Float-to-double2/main.c +++ b/regression/cbmc-with-incr/Float-to-double2/main.c @@ -1,12 +1,12 @@ -#include - -int main(void) -{ - float f = -0x1.0p-127f; - double d = -0x1.0p-127; - double fp = (double)f; - - assert(d == fp); - - return 0; -} +#include + +int main(void) +{ + float f = -0x1.0p-127f; + double d = -0x1.0p-127; + double fp = (double)f; + + assert(d == fp); + + return 0; +} diff --git a/regression/cbmc-with-incr/Float19/main.c b/regression/cbmc-with-incr/Float19/main.c index bc09c89924d..56b5548c602 100644 --- a/regression/cbmc-with-incr/Float19/main.c +++ b/regression/cbmc-with-incr/Float19/main.c @@ -1,24 +1,24 @@ -#include -#include - -#ifdef __GNUC__ - -void f00 (float f) -{ - if (f > 0x1.FFFFFEp+127) { - assert(isinf(f)); - } -} - -#endif - -int main (void) -{ - #ifdef __GNUC__ - float f; - - f00(f); - #endif - - return 0; -} +#include +#include + +#ifdef __GNUC__ + +void f00 (float f) +{ + if (f > 0x1.FFFFFEp+127) { + assert(isinf(f)); + } +} + +#endif + +int main (void) +{ + #ifdef __GNUC__ + float f; + + f00(f); + #endif + + return 0; +} diff --git a/regression/cbmc-with-incr/Float20/main.c b/regression/cbmc-with-incr/Float20/main.c index dfacc8bac6d..b730f0d4f18 100644 --- a/regression/cbmc-with-incr/Float20/main.c +++ b/regression/cbmc-with-incr/Float20/main.c @@ -1,56 +1,56 @@ -/* -** float-rounder-bug.c -** -** Martin Brain -** martin.brain@cs.ox.ac.uk -** 20/05/13 -** -** Another manifestation of the casting bug. -** If the number is in (0,0x1p-126) it is rounded to zero rather than a subnormal number. -*/ -#define FULP 1 - -void bug (float min) { - __CPROVER_assume(min == 0x1.fffffep-105f); - float modifier = (0x1.0p-23 * (1< -#include - -float nondet_float(void); - -int main (void) -{ - #ifdef __GNUC__ - - float smallestNormalFloat = 0x1.0p-126f; - float largestSubnormalFloat = 0x1.fffffcp-127f; - - double v = 0x1.FFFFFFp-127; - - float f; - - - // Check the encodings are correct - assert(fpclassify(largestSubnormalFloat) == FP_SUBNORMAL); - - f = nondet_float(); - __CPROVER_assume(fpclassify(f) == FP_SUBNORMAL); - assert(f <= largestSubnormalFloat); - - - assert(fpclassify(smallestNormalFloat) == FP_NORMAL); - - f = nondet_float(); - __CPROVER_assume(fpclassify(f) == FP_NORMAL); - assert(smallestNormalFloat <= fabs(f)); - - assert(largestSubnormalFloat < smallestNormalFloat); - - - // Check the ordering as doubles - assert(((double)largestSubnormalFloat) < ((double)smallestNormalFloat)); - assert(((double)largestSubnormalFloat) < v); - assert(v < ((double)smallestNormalFloat)); - - - // Check coercion to float - assert((float)((double)largestSubnormalFloat) == largestSubnormalFloat); - assert((float)((double)smallestNormalFloat) == smallestNormalFloat); - - assert(((double)smallestNormalFloat) - v <= v - ((double)largestSubnormalFloat)); - assert(((float)v) == smallestNormalFloat); - - f = nondet_float(); - __CPROVER_assume(fpclassify(f) == FP_SUBNORMAL); - assert( ((float)((double)f)) == f ); - - #endif - - return 0; -} +/* +** subnormal-boundary.c +** +** Martin Brain +** martin.brain@cs.ox.ac.uk +** 25/07/12 +** +** Regression tests for casting and classification around the subnormal boundary. +** +*/ + +#include +#include + +float nondet_float(void); + +int main (void) +{ + #ifdef __GNUC__ + + float smallestNormalFloat = 0x1.0p-126f; + float largestSubnormalFloat = 0x1.fffffcp-127f; + + double v = 0x1.FFFFFFp-127; + + float f; + + + // Check the encodings are correct + assert(fpclassify(largestSubnormalFloat) == FP_SUBNORMAL); + + f = nondet_float(); + __CPROVER_assume(fpclassify(f) == FP_SUBNORMAL); + assert(f <= largestSubnormalFloat); + + + assert(fpclassify(smallestNormalFloat) == FP_NORMAL); + + f = nondet_float(); + __CPROVER_assume(fpclassify(f) == FP_NORMAL); + assert(smallestNormalFloat <= fabs(f)); + + assert(largestSubnormalFloat < smallestNormalFloat); + + + // Check the ordering as doubles + assert(((double)largestSubnormalFloat) < ((double)smallestNormalFloat)); + assert(((double)largestSubnormalFloat) < v); + assert(v < ((double)smallestNormalFloat)); + + + // Check coercion to float + assert((float)((double)largestSubnormalFloat) == largestSubnormalFloat); + assert((float)((double)smallestNormalFloat) == smallestNormalFloat); + + assert(((double)smallestNormalFloat) - v <= v - ((double)largestSubnormalFloat)); + assert(((float)v) == smallestNormalFloat); + + f = nondet_float(); + __CPROVER_assume(fpclassify(f) == FP_SUBNORMAL); + assert( ((float)((double)f)) == f ); + + #endif + + return 0; +} diff --git a/regression/cbmc-with-incr/Recursion4/main.c b/regression/cbmc-with-incr/Recursion4/main.c index 00198d60574..c2cc4c13ae1 100644 --- a/regression/cbmc-with-incr/Recursion4/main.c +++ b/regression/cbmc-with-incr/Recursion4/main.c @@ -1,17 +1,17 @@ -int factorial2(int i) -{ - if(i==0) return 1; - - // tmp_result gets renamed during recursion! - int tmp_result; - tmp_result=factorial2(0); - return tmp_result; -} - -int main() -{ - int result_factorial; - result_factorial=factorial2(1); - assert(result_factorial==1); - return 0; -} +int factorial2(int i) +{ + if(i==0) return 1; + + // tmp_result gets renamed during recursion! + int tmp_result; + tmp_result=factorial2(0); + return tmp_result; +} + +int main() +{ + int result_factorial; + result_factorial=factorial2(1); + assert(result_factorial==1); + return 0; +} diff --git a/regression/cpp-from-CVS/Array1/main.cpp b/regression/cpp-from-CVS/Array1/main.cpp index 8c77e5c8f89..ba02b972c16 100644 --- a/regression/cpp-from-CVS/Array1/main.cpp +++ b/regression/cpp-from-CVS/Array1/main.cpp @@ -1,11 +1,11 @@ -int y[5][4][3][2]; - -int main() -{ - for(int i=0; i<5; i++) - for(int j=0; j<4; j++) - for(int k=0; k<3; k++) - for(int l=0; l<2; l++) - y[i][j][k][l]=2; -} - +int y[5][4][3][2]; + +int main() +{ + for(int i=0; i<5; i++) + for(int j=0; j<4; j++) + for(int k=0; k<3; k++) + for(int l=0; l<2; l++) + y[i][j][k][l]=2; +} + diff --git a/regression/cpp-from-CVS/Array2/main.cpp b/regression/cpp-from-CVS/Array2/main.cpp index 5359e4e8149..0e3e35b8ad3 100644 --- a/regression/cpp-from-CVS/Array2/main.cpp +++ b/regression/cpp-from-CVS/Array2/main.cpp @@ -1,11 +1,11 @@ -int y[2][3][4][5]; - -int main() -{ - for(int i=0; i<5; i++) - for(int j=0; j<4; j++) - for(int k=0; k<3; k++) - for(int l=0; l<2; l++) - y[i][j][k][l]=2; // out-of-bounds -} - +int y[2][3][4][5]; + +int main() +{ + for(int i=0; i<5; i++) + for(int j=0; j<4; j++) + for(int k=0; k<3; k++) + for(int l=0; l<2; l++) + y[i][j][k][l]=2; // out-of-bounds +} + diff --git a/regression/cpp/Decltype2/main.cpp b/regression/cpp/Decltype2/main.cpp index f315130f21a..ba26a736059 100644 --- a/regression/cpp/Decltype2/main.cpp +++ b/regression/cpp/Decltype2/main.cpp @@ -1,14 +1,14 @@ -// C++11 -// decltype is a C++11 feature to get the "declared type" of an expression. -// It is similar to 'typeof' but handles reference types "properly". - -class base {}; -class derived : public base {}; - -derived d; - -decltype(static_cast(&d)) z; - -int main() -{ -} +// C++11 +// decltype is a C++11 feature to get the "declared type" of an expression. +// It is similar to 'typeof' but handles reference types "properly". + +class base {}; +class derived : public base {}; + +derived d; + +decltype(static_cast(&d)) z; + +int main() +{ +} diff --git a/regression/cpp/Decltype3/main.cpp b/regression/cpp/Decltype3/main.cpp index 0ded9d5c44f..e0a95f38b00 100644 --- a/regression/cpp/Decltype3/main.cpp +++ b/regression/cpp/Decltype3/main.cpp @@ -1,18 +1,18 @@ -// C++11 -// decltype is a C++11 feature to get the "declared type" of an expression. -// It is similar to 'typeof' but handles reference types "properly". - -template -struct whatever { - int f00 (const B b) { - typedef decltype(static_cast(b)) T; - T z; - return 1; - } -}; - -whatever thing; - -int main() -{ -} +// C++11 +// decltype is a C++11 feature to get the "declared type" of an expression. +// It is similar to 'typeof' but handles reference types "properly". + +template +struct whatever { + int f00 (const B b) { + typedef decltype(static_cast(b)) T; + T z; + return 1; + } +}; + +whatever thing; + +int main() +{ +} From 5a8f14dfe599fec5a2db2e369a1ca442efbe15d1 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Fri, 2 Sep 2016 10:22:38 +0100 Subject: [PATCH 22/71] add the option existing-coverage Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 1 + src/cbmc/cbmc_parse_options.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 3b0d7b5bc6a..44922b7918b 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -1140,6 +1140,7 @@ void cbmc_parse_optionst::help() " --no-assumptions ignore user assumptions\n" " --error-label label check that label is unreachable\n" " --cover CC create test-suite with coverage criterion CC\n" + " --existing-coverage file instrument non-covered test goals\n" " --mm MM memory consistency model for concurrent programs\n" "\n" "Java Bytecode frontend options:\n" diff --git a/src/cbmc/cbmc_parse_options.h b/src/cbmc/cbmc_parse_options.h index 33fe0ba5175..1882f57a738 100644 --- a/src/cbmc/cbmc_parse_options.h +++ b/src/cbmc/cbmc_parse_options.h @@ -54,6 +54,7 @@ class optionst; "(round-to-nearest)(round-to-plus-inf)(round-to-minus-inf)(round-to-zero)" \ "(graphml-cex):" \ "(localize-faults)(localize-faults-method):" \ + "(existing-coverage):" \ "(floatbv)(all-claims)(all-properties)" // legacy, and will eventually disappear class cbmc_parse_optionst: From e067182f16149843ae30695571eb0e0c5cf91e25 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Fri, 2 Sep 2016 12:32:09 +0100 Subject: [PATCH 23/71] check whether the user has provided a valid json file for --existing-coverage Signed-off-by: Lucas Cordeiro --- src/cbmc/Makefile | 1 + src/cbmc/cbmc_parse_options.cpp | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/cbmc/Makefile b/src/cbmc/Makefile index 8440c92fa1b..8bd53417622 100644 --- a/src/cbmc/Makefile +++ b/src/cbmc/Makefile @@ -27,6 +27,7 @@ OBJ += ../ansi-c/ansi-c$(LIBEXT) \ ../xmllang/xmllang$(LIBEXT) \ ../assembler/assembler$(LIBEXT) \ ../solvers/solvers$(LIBEXT) \ + ../json/json$(LIBEXT) \ ../util/util$(LIBEXT) INCLUDES= -I .. diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 44922b7918b..8432683c510 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -50,6 +50,8 @@ Author: Daniel Kroening, kroening@kroening.com #include +#include + #include "cbmc_solvers.h" #include "cbmc_parse_options.h" #include "bmc.h" @@ -458,6 +460,10 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options) if(cmdline.isset("graphml-cex")) options.set_option("graphml-cex", cmdline.get_value("graphml-cex")); + + if(cmdline.isset("existing-coverage")) + options.set_option("existing-coverage", cmdline.get_value("existing-coverage")); + } /*******************************************************************\ @@ -945,7 +951,25 @@ bool cbmc_parse_optionst::process_goto_program( // add loop ids goto_functions.compute_loop_numbers(); - + + // instrument non-covered test goals + if(cmdline.isset("existing-coverage")) + { + //get file with covered test goals + const std::string coverage=cmdline.get_value("existing-coverage"); + + jsont json; + + //check coverage file + if(parse_json(coverage, get_message_handler(), json)) + { + messaget message(get_message_handler()); + message.error() << coverage << " file is not a valid json file" + << messaget::eom; + return true; + } + } + // instrument cover goals if(cmdline.isset("cover")) From c904f8cbef4c042abac1b12b7a657b6f7b68fd48 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Fri, 2 Sep 2016 15:31:16 +0100 Subject: [PATCH 24/71] get the line of each goal Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 8432683c510..d19e98f75a5 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -968,6 +968,34 @@ bool cbmc_parse_optionst::process_goto_program( << messaget::eom; return true; } + + //make sure that we have an array of elements + if(!json.is_array()) + { + messaget message(get_message_handler()); + message.error() << "expecting an array in the " << coverage << " file, but got " + << json << messaget::eom; + return true; + } + + for(jsont::arrayt::const_iterator + it=json.array.begin(); + it!=json.array.end(); + it++) + { + //get the goals array + if ((*it)["goals"].is_array()) + { + for(jsont::arrayt::const_iterator + itg=(*it)["goals"].array.begin(); + itg!=(*it)["goals"].array.end(); + itg++) + { + //get the line of each goal + const unsigned int line=std::stoi((*itg)["sourceLocation"]["line"].value); + } + } + } } // instrument cover goals From a7e78365578383a99b49cc00b59647afed0e652f Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Fri, 2 Sep 2016 16:28:21 +0100 Subject: [PATCH 25/71] generate goals only if they do not exist in the json file Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 7 +++++-- src/goto-instrument/cover.cpp | 27 ++++++++++++++++++++++++++- src/goto-instrument/cover.h | 2 ++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index d19e98f75a5..8c02cf4df52 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -952,9 +952,11 @@ bool cbmc_parse_optionst::process_goto_program( // add loop ids goto_functions.compute_loop_numbers(); - // instrument non-covered test goals + // check existing test goals if(cmdline.isset("existing-coverage")) { + status() << "Check existing coverage goals" << eom; + //get file with covered test goals const std::string coverage=cmdline.get_value("existing-coverage"); @@ -992,7 +994,8 @@ bool cbmc_parse_optionst::process_goto_program( itg++) { //get the line of each goal - const unsigned int line=std::stoi((*itg)["sourceLocation"]["line"].value); + const std::string line=(*itg)["sourceLocation"]["line"].value; + set_existing_goals(line); } } } diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index bb6e70d443e..45d845950cb 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -17,6 +17,8 @@ Date: May 2016 #include "cover.h" +std::vector existing_goals; + class basic_blockst { public: @@ -68,6 +70,23 @@ class basic_blockst /*******************************************************************\ +Function: set_existing_goals + + Inputs: + + Outputs: + + Purpose: + +\*******************************************************************/ + +void set_existing_goals(std::string goal) +{ + existing_goals.push_back(goal); +} + +/*******************************************************************\ + Function: as_string Inputs: @@ -1120,7 +1139,13 @@ void instrument_cover_goals( source_locationt source_location= basic_blocks.source_location_map[block_nr]; - if(!source_location.get_file().empty() && + //check whether the current goal already exists + std::vector::iterator it; + it = find (existing_goals.begin(), existing_goals.end(), + source_location.get_line().c_str()); + + if(it == existing_goals.end() && + !source_location.get_file().empty() && source_location.get_file()[0]!='<') { std::string comment="block "+b; diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index cf51972f6e6..56f8cb7122e 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -17,6 +17,8 @@ enum class coverage_criteriont { LOCATION, BRANCH, DECISION, CONDITION, PATH, MCDC, ASSERTION, COVER }; +void set_existing_goals(std::string goal); + void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, From b688f1cb37d6a6c03b6be3c4910e0ce2fec4a2d9 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 12:03:22 +0100 Subject: [PATCH 26/71] refactor the code for checking existing coverage Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 102 +++++++++++++++--------------- src/goto-instrument/cover.cpp | 45 +++++++++---- src/goto-instrument/cover.h | 18 ++++-- src/symex/symex_parse_options.cpp | 3 +- 4 files changed, 100 insertions(+), 68 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 8c02cf4df52..2e63d065786 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -952,55 +952,6 @@ bool cbmc_parse_optionst::process_goto_program( // add loop ids goto_functions.compute_loop_numbers(); - // check existing test goals - if(cmdline.isset("existing-coverage")) - { - status() << "Check existing coverage goals" << eom; - - //get file with covered test goals - const std::string coverage=cmdline.get_value("existing-coverage"); - - jsont json; - - //check coverage file - if(parse_json(coverage, get_message_handler(), json)) - { - messaget message(get_message_handler()); - message.error() << coverage << " file is not a valid json file" - << messaget::eom; - return true; - } - - //make sure that we have an array of elements - if(!json.is_array()) - { - messaget message(get_message_handler()); - message.error() << "expecting an array in the " << coverage << " file, but got " - << json << messaget::eom; - return true; - } - - for(jsont::arrayt::const_iterator - it=json.array.begin(); - it!=json.array.end(); - it++) - { - //get the goals array - if ((*it)["goals"].is_array()) - { - for(jsont::arrayt::const_iterator - itg=(*it)["goals"].array.begin(); - itg!=(*it)["goals"].array.end(); - itg++) - { - //get the line of each goal - const std::string line=(*itg)["sourceLocation"]["line"].value; - set_existing_goals(line); - } - } - } - } - // instrument cover goals if(cmdline.isset("cover")) @@ -1030,9 +981,58 @@ bool cbmc_parse_optionst::process_goto_program( error() << "unknown coverage criterion" << eom; return true; } - + + // check existing test goals + coverage_goals goals; + if(cmdline.isset("existing-coverage")) + { + status() << "Check existing coverage goals" << eom; + + //get file with covered test goals + const std::string coverage=cmdline.get_value("existing-coverage"); + + jsont json; + + //check coverage file + if(parse_json(coverage, get_message_handler(), json)) + { + messaget message(get_message_handler()); + message.error() << coverage << " file is not a valid json file" + << messaget::eom; + return true; + } + + //make sure that we have an array of elements + if(!json.is_array()) + { + messaget message(get_message_handler()); + message.error() << "expecting an array in the " << coverage << " file, but got " + << json << messaget::eom; + return true; + } + + for(jsont::arrayt::const_iterator + it=json.array.begin(); + it!=json.array.end(); + it++) + { + //get the goals array + if ((*it)["goals"].is_array()) + { + for(jsont::arrayt::const_iterator + itg=(*it)["goals"].array.begin(); + itg!=(*it)["goals"].array.end(); + itg++) + { + //get the line of each goal + const std::string line=(*itg)["sourceLocation"]["line"].value; + goals.set_goals(line); + } + } + } + } status() << "Instrumenting coverage goals" << eom; - instrument_cover_goals(symbol_table, goto_functions, c); + instrument_cover_goals(symbol_table, goto_functions, c, goals); goto_functions.update(); } diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 45d845950cb..04d3097531c 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -17,8 +17,6 @@ Date: May 2016 #include "cover.h" -std::vector existing_goals; - class basic_blockst { public: @@ -70,7 +68,7 @@ class basic_blockst /*******************************************************************\ -Function: set_existing_goals +Function: coverage_goals::set_goals Inputs: @@ -80,11 +78,35 @@ Function: set_existing_goals \*******************************************************************/ -void set_existing_goals(std::string goal) +void coverage_goals::set_goals(std::string goal) { existing_goals.push_back(goal); } +/*******************************************************************\ + +Function: coverage_goals::get_goals + + Inputs: + + Outputs: + + Purpose: + +\*******************************************************************/ + +const bool coverage_goals::get_goals(const char* goal) +{ + std::vector::iterator it; + it = find (existing_goals.begin(), existing_goals.end(), goal); + + if(it == existing_goals.end()) + return true; + else + return false; +} + + /*******************************************************************\ Function: as_string @@ -1077,7 +1099,8 @@ Function: instrument_cover_goals void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, - coverage_criteriont criterion) + coverage_criteriont criterion, + coverage_goals &goals) { const namespacet ns(symbol_table); basic_blockst basic_blocks(goto_program); @@ -1140,11 +1163,7 @@ void instrument_cover_goals( basic_blocks.source_location_map[block_nr]; //check whether the current goal already exists - std::vector::iterator it; - it = find (existing_goals.begin(), existing_goals.end(), - source_location.get_line().c_str()); - - if(it == existing_goals.end() && + if(goals.get_goals(source_location.get_line().c_str()) && !source_location.get_file().empty() && source_location.get_file()[0]!='<') { @@ -1379,7 +1398,8 @@ Function: instrument_cover_goals void instrument_cover_goals( const symbol_tablet &symbol_table, goto_functionst &goto_functions, - coverage_criteriont criterion) + coverage_criteriont criterion, + coverage_goals &goals) { Forall_goto_functions(f_it, goto_functions) { @@ -1387,6 +1407,7 @@ void instrument_cover_goals( f_it->first=="__CPROVER_initialize") continue; - instrument_cover_goals(symbol_table, f_it->second.body, criterion); + instrument_cover_goals(symbol_table, f_it->second.body, + criterion, goals); } } diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index 56f8cb7122e..3cd41f06bc0 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -13,20 +13,30 @@ Date: May 2016 #include +class coverage_goals +{ +public: + void set_goals(std::string goal); + const bool get_goals(const char* goal); + +private: + std::vector existing_goals; +}; + enum class coverage_criteriont { LOCATION, BRANCH, DECISION, CONDITION, PATH, MCDC, ASSERTION, COVER }; -void set_existing_goals(std::string goal); - void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, - coverage_criteriont); + coverage_criteriont, + coverage_goals &goals); void instrument_cover_goals( const symbol_tablet &symbol_table, goto_functionst &goto_functions, - coverage_criteriont); + coverage_criteriont, + coverage_goals &goals); #endif diff --git a/src/symex/symex_parse_options.cpp b/src/symex/symex_parse_options.cpp index 2fbee65e2ad..5ac7fb001d8 100644 --- a/src/symex/symex_parse_options.cpp +++ b/src/symex/symex_parse_options.cpp @@ -442,7 +442,8 @@ bool symex_parse_optionst::process_goto_program(const optionst &options) } status() << "Instrumenting coverge goals" << eom; - instrument_cover_goals(symbol_table, goto_model.goto_functions, c); + coverage_goals goals; + instrument_cover_goals(symbol_table, goto_model.goto_functions, c, goals); goto_model.goto_functions.update(); } From 74b76f6d1040f88e4af1e3f8af58c2967d69e155 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 12:04:37 +0100 Subject: [PATCH 27/71] add test cases to check existing coverage Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location2/main.c | 13 + regression/cbmc-cover/location2/main.json | 197 ++++++ regression/cbmc-cover/location2/test.desc | 8 + regression/cbmc-cover/location3/main.c | 13 + regression/cbmc-cover/location3/main.json | 187 ++++++ regression/cbmc-cover/location3/test.desc | 9 + regression/cbmc-cover/location4/main.c | 41 ++ regression/cbmc-cover/location4/main.json | 633 ++++++++++++++++++ .../cbmc-cover/location4/single-linked-list.c | 51 ++ .../cbmc-cover/location4/single-linked-list.h | 14 + regression/cbmc-cover/location4/test.desc | 8 + 11 files changed, 1174 insertions(+) create mode 100644 regression/cbmc-cover/location2/main.c create mode 100644 regression/cbmc-cover/location2/main.json create mode 100644 regression/cbmc-cover/location2/test.desc create mode 100644 regression/cbmc-cover/location3/main.c create mode 100644 regression/cbmc-cover/location3/main.json create mode 100644 regression/cbmc-cover/location3/test.desc create mode 100644 regression/cbmc-cover/location4/main.c create mode 100644 regression/cbmc-cover/location4/main.json create mode 100644 regression/cbmc-cover/location4/single-linked-list.c create mode 100644 regression/cbmc-cover/location4/single-linked-list.h create mode 100644 regression/cbmc-cover/location4/test.desc diff --git a/regression/cbmc-cover/location2/main.c b/regression/cbmc-cover/location2/main.c new file mode 100644 index 00000000000..9a0b65d37f6 --- /dev/null +++ b/regression/cbmc-cover/location2/main.c @@ -0,0 +1,13 @@ +int main() +{ + int i, j; + + i = 1; + + if(j > 0) + j += i; + else + j = 0; + + assert(i != j); +} diff --git a/regression/cbmc-cover/location2/main.json b/regression/cbmc-cover/location2/main.json new file mode 100644 index 00000000000..57c35d49321 --- /dev/null +++ b/regression/cbmc-cover/location2/main.json @@ -0,0 +1,197 @@ +[ +{ + "program": "CBMC 5.5" +}, +{ + "messageText": "CBMC version 5.5 64-bit x86_64 linux", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Parsing main.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Converting", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking main", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "function `assert' is not declared", + "messageType": "WARNING" +}, +{ + "messageText": "Generating GOTO Program", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Adding CPROVER library (x86_64)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Removal of function pointers and virtual functions", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Partial Inlining", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generic Property Instrumentation", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Instrumenting coverage goals", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Starting Bounded Model Checking", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "size of program expression: 45 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 4 VCC(s), 4 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 4 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "265 variables, 522 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "265 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.001s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "main.coverage.1", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "3" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "main.coverage.2", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "main.coverage.3", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "main.coverage.4", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "12" + }, + "status": "satisfied" + } + ], + "goalsCovered": 4, + "tests": [ + { + "coveredGoals": [ "main.coverage.1", "main.coverage.3", "main.coverage.4" ], + "inputs": [ ] + }, + { + "coveredGoals": [ "main.coverage.2" ], + "inputs": [ ] + } + ], + "totalGoals": 4 +}, +{ + "messageText": "** 4 of 4 covered (100.0%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 2 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location2/test.desc b/regression/cbmc-cover/location2/test.desc new file mode 100644 index 00000000000..010956452e1 --- /dev/null +++ b/regression/cbmc-cover/location2/test.desc @@ -0,0 +1,8 @@ +CORE +main.c +--cover location --existing-coverage main.json +^EXIT=0$ +^SIGNAL=0$ +^\*\* 0 of 0 covered (100.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location3/main.c b/regression/cbmc-cover/location3/main.c new file mode 100644 index 00000000000..9a0b65d37f6 --- /dev/null +++ b/regression/cbmc-cover/location3/main.c @@ -0,0 +1,13 @@ +int main() +{ + int i, j; + + i = 1; + + if(j > 0) + j += i; + else + j = 0; + + assert(i != j); +} diff --git a/regression/cbmc-cover/location3/main.json b/regression/cbmc-cover/location3/main.json new file mode 100644 index 00000000000..f0721a496e7 --- /dev/null +++ b/regression/cbmc-cover/location3/main.json @@ -0,0 +1,187 @@ +[ +{ + "program": "CBMC 5.5" +}, +{ + "messageText": "CBMC version 5.5 64-bit x86_64 linux", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Parsing main.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Converting", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking main", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "function `assert' is not declared", + "messageType": "WARNING" +}, +{ + "messageText": "Generating GOTO Program", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Adding CPROVER library (x86_64)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Removal of function pointers and virtual functions", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Partial Inlining", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generic Property Instrumentation", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Instrumenting coverage goals", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Starting Bounded Model Checking", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "size of program expression: 45 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 4 VCC(s), 4 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 4 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "265 variables, 522 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "265 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.001s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "main.coverage.1", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "3" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "main.coverage.2", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "main.coverage.4", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "12" + }, + "status": "satisfied" + } + ], + "goalsCovered": 4, + "tests": [ + { + "coveredGoals": [ "main.coverage.1", "main.coverage.3", "main.coverage.4" ], + "inputs": [ ] + }, + { + "coveredGoals": [ "main.coverage.2" ], + "inputs": [ ] + } + ], + "totalGoals": 4 +}, +{ + "messageText": "** 4 of 4 covered (100.0%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 2 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location3/test.desc b/regression/cbmc-cover/location3/test.desc new file mode 100644 index 00000000000..a621fc0f941 --- /dev/null +++ b/regression/cbmc-cover/location3/test.desc @@ -0,0 +1,9 @@ +CORE +main.c +--cover location --existing-coverage main.json +^EXIT=0$ +^SIGNAL=0$ +^\[main.coverage.1\] file main.c line 10 function main block 3: SATISFIED$ +^\*\* 1 of 1 covered (100.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location4/main.c b/regression/cbmc-cover/location4/main.c new file mode 100644 index 00000000000..ca92d1abc09 --- /dev/null +++ b/regression/cbmc-cover/location4/main.c @@ -0,0 +1,41 @@ +#include +#include +#include "single-linked-list.h" + +int main(void) +{ + + int i; + mlist *mylist, *temp; + + insert_list(mylist,2); + insert_list(mylist,5); + insert_list(mylist,1); + insert_list(mylist,3); + + mylist = head; + + printf("list all elements: "); + while(mylist) + { + printf("%d ", mylist->key); + mylist = mylist->next; + } + printf("\n"); + + temp = search_list(mylist,2); + printf("search for element 2: %s\n", temp->key == 2 ? "found" : "not found"); + assert(temp->key == 2); + + delete_list(temp); + + mylist = head; + + printf("list all elements except 2: "); + while(mylist) + { + printf("%d ", mylist->key); + mylist = mylist->next; + } + printf("\n"); +} diff --git a/regression/cbmc-cover/location4/main.json b/regression/cbmc-cover/location4/main.json new file mode 100644 index 00000000000..114e0638022 --- /dev/null +++ b/regression/cbmc-cover/location4/main.json @@ -0,0 +1,633 @@ +[ +{ + "program": "CBMC 5.5" +}, +{ + "messageText": "CBMC version 5.5 64-bit x86_64 linux", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Parsing main.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Parsing single-linked-list.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Converting", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking main", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking single-linked-list", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generating GOTO Program", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Adding CPROVER library (x86_64)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Removal of function pointers and virtual functions", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Partial Inlining", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generic Property Instrumentation", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Instrumenting coverage goals", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Starting Bounded Model Checking", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop main.0 iteration 1 (2 max) file main.c line 19 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop main.0 iteration 2 (2 max) file main.c line 19 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop search_list.0 iteration 1 (2 max) file single-linked-list.c line 10 function search_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop search_list.0 iteration 2 (2 max) file single-linked-list.c line 10 function search_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop delete_list.0 iteration 1 (2 max) file single-linked-list.c line 23 function delete_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop delete_list.0 iteration 2 (2 max) file single-linked-list.c line 23 function delete_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop main.1 iteration 1 (2 max) file main.c line 35 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop main.1 iteration 2 (2 max) file main.c line 35 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "size of program expression: 358 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 57 VCC(s), 57 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 40 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "3368 variables, 1698 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "3368 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.007s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "free called for new[] object", + "goal": "", + "sourceLocation": { + "file": "", + "function": "free", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "main.coverage.1", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "main.coverage.2", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "12" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "main.coverage.3", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "13" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "main.coverage.4", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "14" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "main.coverage.5", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "16" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "main.coverage.6", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "19" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "main.coverage.7", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "main.coverage.8", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "main.coverage.9", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "main.coverage.10", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 11", + "goal": "main.coverage.11", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "32" + }, + "status": "failed" + }, + { + "description": "block 12", + "goal": "main.coverage.12", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "35" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "main.coverage.13", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "37" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "main.coverage.14", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "40" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "search_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "9" + }, + "status": "failed" + }, + { + "description": "block 2", + "goal": "search_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 3", + "goal": "search_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 4", + "goal": "search_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 5", + "goal": "search_list.coverage.5", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 6", + "goal": "search_list.coverage.6", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 7", + "goal": "search_list.coverage.7", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "15" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "delete_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "19" + }, + "status": "failed" + }, + { + "description": "block 2", + "goal": "delete_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 3", + "goal": "delete_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 4", + "goal": "delete_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 5", + "goal": "delete_list.coverage.5", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "29" + }, + "status": "failed" + }, + { + "description": "block 6", + "goal": "delete_list.coverage.6", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 7", + "goal": "delete_list.coverage.7", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 8", + "goal": "delete_list.coverage.8", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "delete_list.coverage.9", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "delete_list.coverage.10", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 11", + "goal": "delete_list.coverage.11", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 12", + "goal": "delete_list.coverage.12", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "delete_list.coverage.13", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "delete_list.coverage.14", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "insert_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "37" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "insert_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "40" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "insert_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "45" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "insert_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "48" + }, + "status": "satisfied" + } + ], + "goalsCovered": 11, + "tests": [ + { + "coveredGoals": [ "main.coverage.1", "main.coverage.2", "main.coverage.3", "main.coverage.4", "main.coverage.5", "main.coverage.6", "main.coverage.7", "insert_list.coverage.1", "insert_list.coverage.2", "insert_list.coverage.3", "insert_list.coverage.4" ], + "inputs": [ ] + } + ], + "totalGoals": 40 +}, +{ + "messageText": "** 11 of 40 covered (27.5%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 2 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location4/single-linked-list.c b/regression/cbmc-cover/location4/single-linked-list.c new file mode 100644 index 00000000000..30fe7a0ced0 --- /dev/null +++ b/regression/cbmc-cover/location4/single-linked-list.c @@ -0,0 +1,51 @@ +#include +#include +#include + +#include "single-linked-list.h" + +mlist* search_list(mlist *l, int k) +{ + l = head; + while(l!=NULL && l->key!=k) + { + l = l->next; + } + return l; +} + +int delete_list(mlist *l) +{ + mlist *tmp; + tmp = head; + if (head != l) + { + while(tmp->next!=l) + tmp = tmp->next; + tmp->next = l->next; + } + else + { + head = l->next; + } + free(l); + return 0; +} + +int insert_list(mlist *l, int k) +{ + l = (mlist*)malloc(sizeof(mlist)); + if (head==NULL) + { + l->key = k; + l->next = NULL; + } + else + { + l->key = k; + l->next = head; + } + head = l; + return 0; +} + diff --git a/regression/cbmc-cover/location4/single-linked-list.h b/regression/cbmc-cover/location4/single-linked-list.h new file mode 100644 index 00000000000..4d274a6a1e2 --- /dev/null +++ b/regression/cbmc-cover/location4/single-linked-list.h @@ -0,0 +1,14 @@ +#ifndef SINGLE_LINKED_LIST_H_ +#define SINGLE_LINKED_LIST_H_ + +typedef struct list { + int key; + struct list *next; +} mlist; + +mlist *head; +mlist* search_list(mlist *l, int k); +int delete_list(mlist *l); +int insert_list(mlist *l, int k); + +#endif /* SINGLE_LINKED_LIST_H_ */ diff --git a/regression/cbmc-cover/location4/test.desc b/regression/cbmc-cover/location4/test.desc new file mode 100644 index 00000000000..d9eaa8195c0 --- /dev/null +++ b/regression/cbmc-cover/location4/test.desc @@ -0,0 +1,8 @@ +CORE +main.c +single-linked-list.c --cover location --existing-coverage main.json --unwind 2 +^EXIT=0$ +^SIGNAL=0$ +^\*\* 0 of 1 covered (0.0%) +-- +^warning: ignoring From a338c82fd772814068baacf739c7f28d96662137 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 13:14:51 +0100 Subject: [PATCH 28/71] add more test cases to check existing coverage Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location5/main.c | 41 ++ regression/cbmc-cover/location5/main.json | 623 ++++++++++++++++++ .../cbmc-cover/location5/single-linked-list.c | 51 ++ .../cbmc-cover/location5/single-linked-list.h | 14 + regression/cbmc-cover/location5/test.desc | 9 + .../cbmc-cover/location6/if_expr1.class | Bin 0 -> 758 bytes regression/cbmc-cover/location6/if_expr1.java | 12 + regression/cbmc-cover/location6/if_expr1.json | 485 ++++++++++++++ regression/cbmc-cover/location6/test.desc | 8 + src/goto-instrument/cover.cpp | 2 +- src/goto-instrument/cover.h | 2 +- 11 files changed, 1245 insertions(+), 2 deletions(-) create mode 100644 regression/cbmc-cover/location5/main.c create mode 100644 regression/cbmc-cover/location5/main.json create mode 100644 regression/cbmc-cover/location5/single-linked-list.c create mode 100644 regression/cbmc-cover/location5/single-linked-list.h create mode 100644 regression/cbmc-cover/location5/test.desc create mode 100644 regression/cbmc-cover/location6/if_expr1.class create mode 100644 regression/cbmc-cover/location6/if_expr1.java create mode 100644 regression/cbmc-cover/location6/if_expr1.json create mode 100644 regression/cbmc-cover/location6/test.desc diff --git a/regression/cbmc-cover/location5/main.c b/regression/cbmc-cover/location5/main.c new file mode 100644 index 00000000000..ca92d1abc09 --- /dev/null +++ b/regression/cbmc-cover/location5/main.c @@ -0,0 +1,41 @@ +#include +#include +#include "single-linked-list.h" + +int main(void) +{ + + int i; + mlist *mylist, *temp; + + insert_list(mylist,2); + insert_list(mylist,5); + insert_list(mylist,1); + insert_list(mylist,3); + + mylist = head; + + printf("list all elements: "); + while(mylist) + { + printf("%d ", mylist->key); + mylist = mylist->next; + } + printf("\n"); + + temp = search_list(mylist,2); + printf("search for element 2: %s\n", temp->key == 2 ? "found" : "not found"); + assert(temp->key == 2); + + delete_list(temp); + + mylist = head; + + printf("list all elements except 2: "); + while(mylist) + { + printf("%d ", mylist->key); + mylist = mylist->next; + } + printf("\n"); +} diff --git a/regression/cbmc-cover/location5/main.json b/regression/cbmc-cover/location5/main.json new file mode 100644 index 00000000000..486ba8033d4 --- /dev/null +++ b/regression/cbmc-cover/location5/main.json @@ -0,0 +1,623 @@ +[ +{ + "program": "CBMC 5.5" +}, +{ + "messageText": "CBMC version 5.5 64-bit x86_64 linux", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Parsing main.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Parsing single-linked-list.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Converting", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking main", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking single-linked-list", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generating GOTO Program", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Adding CPROVER library (x86_64)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Removal of function pointers and virtual functions", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Partial Inlining", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generic Property Instrumentation", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Instrumenting coverage goals", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Starting Bounded Model Checking", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop main.0 iteration 1 (2 max) file main.c line 19 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop main.0 iteration 2 (2 max) file main.c line 19 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop search_list.0 iteration 1 (2 max) file single-linked-list.c line 10 function search_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop search_list.0 iteration 2 (2 max) file single-linked-list.c line 10 function search_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop delete_list.0 iteration 1 (2 max) file single-linked-list.c line 23 function delete_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop delete_list.0 iteration 2 (2 max) file single-linked-list.c line 23 function delete_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop main.1 iteration 1 (2 max) file main.c line 35 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop main.1 iteration 2 (2 max) file main.c line 35 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "size of program expression: 358 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 57 VCC(s), 57 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 40 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "3368 variables, 1698 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "3368 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.007s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "free called for new[] object", + "goal": "", + "sourceLocation": { + "file": "", + "function": "free", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "main.coverage.1", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "main.coverage.2", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "12" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "main.coverage.3", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "13" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "main.coverage.5", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "16" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "main.coverage.6", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "19" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "main.coverage.7", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "main.coverage.8", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "main.coverage.9", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "main.coverage.10", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 11", + "goal": "main.coverage.11", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "32" + }, + "status": "failed" + }, + { + "description": "block 12", + "goal": "main.coverage.12", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "35" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "main.coverage.13", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "37" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "main.coverage.14", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "40" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "search_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "9" + }, + "status": "failed" + }, + { + "description": "block 2", + "goal": "search_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 3", + "goal": "search_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 4", + "goal": "search_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 5", + "goal": "search_list.coverage.5", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 6", + "goal": "search_list.coverage.6", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 7", + "goal": "search_list.coverage.7", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "15" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "delete_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "19" + }, + "status": "failed" + }, + { + "description": "block 2", + "goal": "delete_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 3", + "goal": "delete_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 4", + "goal": "delete_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 5", + "goal": "delete_list.coverage.5", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "29" + }, + "status": "failed" + }, + { + "description": "block 6", + "goal": "delete_list.coverage.6", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 7", + "goal": "delete_list.coverage.7", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 8", + "goal": "delete_list.coverage.8", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "delete_list.coverage.9", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "delete_list.coverage.10", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 11", + "goal": "delete_list.coverage.11", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 12", + "goal": "delete_list.coverage.12", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "delete_list.coverage.13", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "delete_list.coverage.14", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "insert_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "37" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "insert_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "40" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "insert_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "45" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "insert_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "48" + }, + "status": "satisfied" + } + ], + "goalsCovered": 11, + "tests": [ + { + "coveredGoals": [ "main.coverage.1", "main.coverage.2", "main.coverage.3", "main.coverage.4", "main.coverage.5", "main.coverage.6", "main.coverage.7", "insert_list.coverage.1", "insert_list.coverage.2", "insert_list.coverage.3", "insert_list.coverage.4" ], + "inputs": [ ] + } + ], + "totalGoals": 40 +}, +{ + "messageText": "** 11 of 40 covered (27.5%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 2 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location5/single-linked-list.c b/regression/cbmc-cover/location5/single-linked-list.c new file mode 100644 index 00000000000..30fe7a0ced0 --- /dev/null +++ b/regression/cbmc-cover/location5/single-linked-list.c @@ -0,0 +1,51 @@ +#include +#include +#include + +#include "single-linked-list.h" + +mlist* search_list(mlist *l, int k) +{ + l = head; + while(l!=NULL && l->key!=k) + { + l = l->next; + } + return l; +} + +int delete_list(mlist *l) +{ + mlist *tmp; + tmp = head; + if (head != l) + { + while(tmp->next!=l) + tmp = tmp->next; + tmp->next = l->next; + } + else + { + head = l->next; + } + free(l); + return 0; +} + +int insert_list(mlist *l, int k) +{ + l = (mlist*)malloc(sizeof(mlist)); + if (head==NULL) + { + l->key = k; + l->next = NULL; + } + else + { + l->key = k; + l->next = head; + } + head = l; + return 0; +} + diff --git a/regression/cbmc-cover/location5/single-linked-list.h b/regression/cbmc-cover/location5/single-linked-list.h new file mode 100644 index 00000000000..4d274a6a1e2 --- /dev/null +++ b/regression/cbmc-cover/location5/single-linked-list.h @@ -0,0 +1,14 @@ +#ifndef SINGLE_LINKED_LIST_H_ +#define SINGLE_LINKED_LIST_H_ + +typedef struct list { + int key; + struct list *next; +} mlist; + +mlist *head; +mlist* search_list(mlist *l, int k); +int delete_list(mlist *l); +int insert_list(mlist *l, int k); + +#endif /* SINGLE_LINKED_LIST_H_ */ diff --git a/regression/cbmc-cover/location5/test.desc b/regression/cbmc-cover/location5/test.desc new file mode 100644 index 00000000000..16c53355a24 --- /dev/null +++ b/regression/cbmc-cover/location5/test.desc @@ -0,0 +1,9 @@ +CORE +main.c +single-linked-list.c --cover location --existing-coverage main.json --unwind 2 +^EXIT=0$ +^SIGNAL=0$ +^\[main.coverage.1\] file main.c line 14 function main block 4: SATISFIED$ +^\*\* 1 of 2 covered (50.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location6/if_expr1.class b/regression/cbmc-cover/location6/if_expr1.class new file mode 100644 index 0000000000000000000000000000000000000000..80db60b2bb12be71e852c51b64c3619a4a3ef71f GIT binary patch literal 758 zcmY*WO-~b16g_V`)7P0!b=q2}Z4pt>f**|uJF1ZsOh^zGH74M~Os7xsu$^gUrUuvk z3pTi8Ehdm?qI-W6G2S=QjxOHUz31L@&w0OofBOMo6^|^KsG7KmnuR(VCOGCeZdou; z<(Ri{8w(tF7|M%o6p1jFfgf$i$n6b8pMmW&WZTl0@iT@@bNMxc-U<4G;rh1p#m;!x z6X7cbro_;dKEq7&&Gw=D!EFs(|De^4L+Kx^slq}xcD?s6-O&}^+C1{aC?Vvy%aCh( zgDWPh8;nCwypXDILB4w{jz-~=$EvLj8wHL<8%wyyaoJM2W4lOVn5y vWeVvu+zo:()V", + "messageType": "WARNING" +}, +{ + "messageText": "size of program expression: 110 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 19 VCC(s), 19 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 20 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 2976 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 10", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 11", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 14", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 39 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 22 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 2 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.014s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "coverage.1", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.2", + "sourceLocation": { + "file": "if_expr1.java", + "line": "5" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.3", + "sourceLocation": { + "file": "if_expr1.java", + "line": "5" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.4", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.5", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.6", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "coverage.7", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "coverage.8", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "coverage.9", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "coverage.10", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "coverage.11", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 11", + "goal": "coverage.12", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 12", + "goal": "coverage.13", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "coverage.14", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "coverage.15", + "sourceLocation": { + "file": "if_expr1.java", + "line": "11" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.16", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.17", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.18", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.19", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.20", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + } + ], + "goalsCovered": 15, + "tests": [ + { + "coveredGoals": [ "coverage.2", "coverage.3", "coverage.5", "coverage.6", "coverage.11", "coverage.12", "coverage.15", "coverage.16", "coverage.17", "coverage.19", "coverage.20" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.18" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.4", "coverage.7" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.8" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + } + ], + "totalGoals": 20 +}, +{ + "messageText": "** 15 of 20 covered (75.0%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 5 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location6/test.desc b/regression/cbmc-cover/location6/test.desc new file mode 100644 index 00000000000..f9fe6010e6b --- /dev/null +++ b/regression/cbmc-cover/location6/test.desc @@ -0,0 +1,8 @@ +CORE +if_expr1.class +--cover location --existing-coverage if_expr1.json +^EXIT=0$ +^SIGNAL=0$ +^\*\* 0 of 0 covered (100.0%) +-- +^warning: ignoring diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 04d3097531c..acfcdf06ae0 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -95,7 +95,7 @@ Function: coverage_goals::get_goals \*******************************************************************/ -const bool coverage_goals::get_goals(const char* goal) +bool coverage_goals::get_goals(const char* goal) { std::vector::iterator it; it = find (existing_goals.begin(), existing_goals.end(), goal); diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index 3cd41f06bc0..f00659de1b8 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -17,7 +17,7 @@ class coverage_goals { public: void set_goals(std::string goal); - const bool get_goals(const char* goal); + bool get_goals(const char* goal); private: std::vector existing_goals; From 77669dfdf9409eea0aa37d3692542717d9b1e9d3 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 13:58:51 +0100 Subject: [PATCH 29/71] add more test cases to check existing coverage Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location6/if_expr1.json | 2 +- regression/cbmc-cover/location6/test.desc | 2 +- .../cbmc-cover/location7/if_expr1.class | Bin 0 -> 758 bytes regression/cbmc-cover/location7/if_expr1.java | 12 + regression/cbmc-cover/location7/if_expr1.json | 476 ++++++++++ regression/cbmc-cover/location7/test.desc | 9 + regression/cbmc-cover/location8/A.class | Bin 0 -> 183 bytes regression/cbmc-cover/location8/B.class | Bin 0 -> 183 bytes .../cbmc-cover/location8/if_acmp1.class | Bin 0 -> 1044 bytes regression/cbmc-cover/location8/if_acmp1.java | 36 + regression/cbmc-cover/location8/if_acmp1.json | 882 ++++++++++++++++++ regression/cbmc-cover/location8/test.desc | 8 + regression/cbmc-cover/location9/A.class | Bin 0 -> 183 bytes regression/cbmc-cover/location9/B.class | Bin 0 -> 183 bytes .../cbmc-cover/location9/if_acmp1.class | Bin 0 -> 1044 bytes regression/cbmc-cover/location9/if_acmp1.java | 36 + regression/cbmc-cover/location9/if_acmp1.json | 855 +++++++++++++++++ regression/cbmc-cover/location9/test.desc | 11 + src/cbmc/cbmc_parse_options.cpp | 2 +- 19 files changed, 2328 insertions(+), 3 deletions(-) create mode 100644 regression/cbmc-cover/location7/if_expr1.class create mode 100644 regression/cbmc-cover/location7/if_expr1.java create mode 100644 regression/cbmc-cover/location7/if_expr1.json create mode 100644 regression/cbmc-cover/location7/test.desc create mode 100644 regression/cbmc-cover/location8/A.class create mode 100644 regression/cbmc-cover/location8/B.class create mode 100644 regression/cbmc-cover/location8/if_acmp1.class create mode 100644 regression/cbmc-cover/location8/if_acmp1.java create mode 100644 regression/cbmc-cover/location8/if_acmp1.json create mode 100644 regression/cbmc-cover/location8/test.desc create mode 100644 regression/cbmc-cover/location9/A.class create mode 100644 regression/cbmc-cover/location9/B.class create mode 100644 regression/cbmc-cover/location9/if_acmp1.class create mode 100644 regression/cbmc-cover/location9/if_acmp1.java create mode 100644 regression/cbmc-cover/location9/if_acmp1.json create mode 100644 regression/cbmc-cover/location9/test.desc diff --git a/regression/cbmc-cover/location6/if_expr1.json b/regression/cbmc-cover/location6/if_expr1.json index 41521afe690..9415f24f359 100644 --- a/regression/cbmc-cover/location6/if_expr1.json +++ b/regression/cbmc-cover/location6/if_expr1.json @@ -235,7 +235,7 @@ "messageType": "STATUS-MESSAGE" }, { - "messageText": "Runtime decision procedure: 0.014s", + "messageText": "Runtime decision procedure: 0.011s", "messageType": "STATUS-MESSAGE" }, { diff --git a/regression/cbmc-cover/location6/test.desc b/regression/cbmc-cover/location6/test.desc index f9fe6010e6b..b47c983d68a 100644 --- a/regression/cbmc-cover/location6/test.desc +++ b/regression/cbmc-cover/location6/test.desc @@ -3,6 +3,6 @@ if_expr1.class --cover location --existing-coverage if_expr1.json ^EXIT=0$ ^SIGNAL=0$ -^\*\* 0 of 0 covered (100.0%) +^\*\* 0 of 0 covered (100.0%)$ -- ^warning: ignoring diff --git a/regression/cbmc-cover/location7/if_expr1.class b/regression/cbmc-cover/location7/if_expr1.class new file mode 100644 index 0000000000000000000000000000000000000000..80db60b2bb12be71e852c51b64c3619a4a3ef71f GIT binary patch literal 758 zcmY*WO-~b16g_V`)7P0!b=q2}Z4pt>f**|uJF1ZsOh^zGH74M~Os7xsu$^gUrUuvk z3pTi8Ehdm?qI-W6G2S=QjxOHUz31L@&w0OofBOMo6^|^KsG7KmnuR(VCOGCeZdou; z<(Ri{8w(tF7|M%o6p1jFfgf$i$n6b8pMmW&WZTl0@iT@@bNMxc-U<4G;rh1p#m;!x z6X7cbro_;dKEq7&&Gw=D!EFs(|De^4L+Kx^slq}xcD?s6-O&}^+C1{aC?Vvy%aCh( zgDWPh8;nCwypXDILB4w{jz-~=$EvLj8wHL<8%wyyaoJM2W4lOVn5y vWeVvu+zo:()V", + "messageType": "WARNING" +}, +{ + "messageText": "size of program expression: 110 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 19 VCC(s), 19 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 20 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 2976 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 10", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 11", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 14", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 39 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 22 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 2 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.011s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "coverage.1", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.2", + "sourceLocation": { + "file": "if_expr1.java", + "line": "5" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.3", + "sourceLocation": { + "file": "if_expr1.java", + "line": "5" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.4", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.5", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.6", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "coverage.7", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "coverage.8", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "coverage.9", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "coverage.10", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "coverage.11", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 11", + "goal": "coverage.12", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 12", + "goal": "coverage.13", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "coverage.14", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.16", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.17", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.18", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.19", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.20", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + } + ], + "goalsCovered": 15, + "tests": [ + { + "coveredGoals": [ "coverage.2", "coverage.3", "coverage.5", "coverage.6", "coverage.11", "coverage.12", "coverage.15", "coverage.16", "coverage.17", "coverage.19", "coverage.20" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.18" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.4", "coverage.7" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.8" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + } + ], + "totalGoals": 20 +}, +{ + "messageText": "** 15 of 20 covered (75.0%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 5 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location7/test.desc b/regression/cbmc-cover/location7/test.desc new file mode 100644 index 00000000000..ea38fff1940 --- /dev/null +++ b/regression/cbmc-cover/location7/test.desc @@ -0,0 +1,9 @@ +CORE +if_expr1.class +--cover location --existing-coverage if_expr1.json +^EXIT=0$ +^SIGNAL=0$ +^\[coverage.1\] file if_expr1.java line 11 block 14: SATISFIED$ +^\*\* 1 of 1 covered (100.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location8/A.class b/regression/cbmc-cover/location8/A.class new file mode 100644 index 0000000000000000000000000000000000000000..6ee0b76170fb10d3eb70f55956456784e60b583d GIT binary patch literal 183 zcmX^0Z`VEs1_l!bUM>b^1}=66ZgvJ9Mg}&U%)HDJJ4Oa(4b3n{1{UZ1lvG9rexJ;| zRKL>Pq|~C2#H1Xc2v=}^X;E^jTPBFZo0%4$n4DW+sF#&kmdL}v!obSN!05=xAOPa) z=OpH(>-#5Vr6!j!C@?Sqtpfo@AOb^1}=66ZgvJ9Mg}&U%)HDJJ4Oa(4b3n{1{UZ1lvG9rexJ;| zRKL>Pq|~C2#H1Xc2v=}^X;E^jTPBFZo0%4$n4DW+sF#&kmdL}v!obSN!05!tAOPa) z=OpH(>-#5Vr6!j!C@?Sqtpfo@AOag1pQ2s^Gp zLMjLi6C9HoI8qw@OmSS$FpY~GX@>Ze)o9qR=hSPB8&1R8s@P=)w!xq*I5o$+#?Y6Z zS!a-z>t&lEQgmweYO}g!yZ1yegS>5fn@eQVGsUHO3anaAjbR}Dptxf_wq`3Hbe=a?a;MA~PgE|e;*uG(6?>6YwUj_46~9&TEt>h9%BqNI)p zqC}FKvPB(XoMT9Kdo8vHy6L)gS4SKP2DM#*BcmgW97D95a%XGDE_tNJe>l_3-N5Av z$wkAJ?S|vpwA#QJsjSmVSTrff(Mh70ID;WZrxCJ@teiOjdrb!hgT9In za!Mw~bQYo0v`P`G9U^f50DZSJuR8H!&E$cK5Q6B(z)23v:()V", + "messageType": "WARNING" +}, +{ + "messageText": "size of program expression: 223 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 42 VCC(s), 42 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 61 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 191 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 10", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 14", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 18", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 22", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 26", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 30", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 34", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 38", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 42", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 46", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 47", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 51", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 25 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 11", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 15", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 19", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 23", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 27", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 31", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 35", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 39", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 43", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 48", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 25 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.011s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "coverage.1", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "4" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.2", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.3", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.4", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.5", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.6", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "15" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.7", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "15" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.8", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "16" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.9", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "17" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.10", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "18" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "coverage.11", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "19" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "coverage.12", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "coverage.13", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "coverage.14", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "coverage.15", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 11", + "goal": "coverage.16", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 12", + "goal": "coverage.17", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "coverage.18", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "coverage.19", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "satisfied" + }, + { + "description": "block 15", + "goal": "coverage.20", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "satisfied" + }, + { + "description": "block 16", + "goal": "coverage.21", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 17", + "goal": "coverage.22", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 18", + "goal": "coverage.23", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "satisfied" + }, + { + "description": "block 19", + "goal": "coverage.24", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "satisfied" + }, + { + "description": "block 20", + "goal": "coverage.25", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 21", + "goal": "coverage.26", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 22", + "goal": "coverage.27", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "satisfied" + }, + { + "description": "block 23", + "goal": "coverage.28", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "satisfied" + }, + { + "description": "block 24", + "goal": "coverage.29", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 25", + "goal": "coverage.30", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 26", + "goal": "coverage.31", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "satisfied" + }, + { + "description": "block 27", + "goal": "coverage.32", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "satisfied" + }, + { + "description": "block 28", + "goal": "coverage.33", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 29", + "goal": "coverage.34", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 30", + "goal": "coverage.35", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "satisfied" + }, + { + "description": "block 31", + "goal": "coverage.36", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "satisfied" + }, + { + "description": "block 32", + "goal": "coverage.37", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 33", + "goal": "coverage.38", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 34", + "goal": "coverage.39", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "satisfied" + }, + { + "description": "block 35", + "goal": "coverage.40", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "satisfied" + }, + { + "description": "block 36", + "goal": "coverage.41", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "failed" + }, + { + "description": "block 37", + "goal": "coverage.42", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "failed" + }, + { + "description": "block 38", + "goal": "coverage.43", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "satisfied" + }, + { + "description": "block 39", + "goal": "coverage.44", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "satisfied" + }, + { + "description": "block 40", + "goal": "coverage.45", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "failed" + }, + { + "description": "block 41", + "goal": "coverage.46", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "failed" + }, + { + "description": "block 42", + "goal": "coverage.47", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "29" + }, + "status": "satisfied" + }, + { + "description": "block 43", + "goal": "coverage.48", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "satisfied" + }, + { + "description": "block 44", + "goal": "coverage.49", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 45", + "goal": "coverage.50", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 46", + "goal": "coverage.51", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "31" + }, + "status": "satisfied" + }, + { + "description": "block 47", + "goal": "coverage.52", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "31" + }, + "status": "satisfied" + }, + { + "description": "block 48", + "goal": "coverage.53", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "satisfied" + }, + { + "description": "block 49", + "goal": "coverage.54", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "failed" + }, + { + "description": "block 50", + "goal": "coverage.55", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "failed" + }, + { + "description": "block 51", + "goal": "coverage.56", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "35" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.57", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.58", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.59", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.60", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.61", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + } + ], + "goalsCovered": 38, + "tests": [ + { + "coveredGoals": [ "coverage.1", "coverage.2", "coverage.3", "coverage.4", "coverage.6", "coverage.7", "coverage.8", "coverage.9", "coverage.10", "coverage.11", "coverage.15", "coverage.19", "coverage.23", "coverage.27", "coverage.31", "coverage.35", "coverage.39", "coverage.43", "coverage.47", "coverage.51", "coverage.52", "coverage.56", "coverage.57", "coverage.58", "coverage.59", "coverage.61" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.12", "coverage.16", "coverage.20", "coverage.24", "coverage.28", "coverage.32", "coverage.36", "coverage.40", "coverage.44", "coverage.48", "coverage.53", "coverage.60" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + } + ], + "totalGoals": 61 +}, +{ + "messageText": "** 38 of 61 covered (62.3%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 3 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location8/test.desc b/regression/cbmc-cover/location8/test.desc new file mode 100644 index 00000000000..bb29eb24d60 --- /dev/null +++ b/regression/cbmc-cover/location8/test.desc @@ -0,0 +1,8 @@ +CORE +if_acmp1.class +--cover location --existing-coverage if_acmp1.json +^EXIT=0$ +^SIGNAL=0$ +^\*\* 0 of 0 covered (100.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location9/A.class b/regression/cbmc-cover/location9/A.class new file mode 100644 index 0000000000000000000000000000000000000000..6ee0b76170fb10d3eb70f55956456784e60b583d GIT binary patch literal 183 zcmX^0Z`VEs1_l!bUM>b^1}=66ZgvJ9Mg}&U%)HDJJ4Oa(4b3n{1{UZ1lvG9rexJ;| zRKL>Pq|~C2#H1Xc2v=}^X;E^jTPBFZo0%4$n4DW+sF#&kmdL}v!obSN!05=xAOPa) z=OpH(>-#5Vr6!j!C@?Sqtpfo@AOb^1}=66ZgvJ9Mg}&U%)HDJJ4Oa(4b3n{1{UZ1lvG9rexJ;| zRKL>Pq|~C2#H1Xc2v=}^X;E^jTPBFZo0%4$n4DW+sF#&kmdL}v!obSN!05!tAOPa) z=OpH(>-#5Vr6!j!C@?Sqtpfo@AOag1pQ2s^Gp zLMjLi6C9HoI8qw@OmSS$FpY~GX@>Ze)o9qR=hSPB8&1R8s@P=)w!xq*I5o$+#?Y6Z zS!a-z>t&lEQgmweYO}g!yZ1yegS>5fn@eQVGsUHO3anaAjbR}Dptxf_wq`3Hbe=a?a;MA~PgE|e;*uG(6?>6YwUj_46~9&TEt>h9%BqNI)p zqC}FKvPB(XoMT9Kdo8vHy6L)gS4SKP2DM#*BcmgW97D95a%XGDE_tNJe>l_3-N5Av z$wkAJ?S|vpwA#QJsjSmVSTrff(Mh70ID;WZrxCJ@teiOjdrb!hgT9In za!Mw~bQYo0v`P`G9U^f50DZSJuR8H!&E$cK5Q6B(z)23v:()V", + "messageType": "WARNING" +}, +{ + "messageText": "size of program expression: 223 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 42 VCC(s), 42 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 61 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 191 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 10", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 14", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 18", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 22", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 26", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 30", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 34", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 38", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 42", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 46", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 47", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 51", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 25 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 11", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 15", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 19", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 23", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 27", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 31", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 35", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 39", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 43", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 48", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 25 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.011s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "coverage.1", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "4" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.2", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.3", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.4", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.5", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.6", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "15" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.7", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "15" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.9", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "17" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "coverage.12", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "coverage.13", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "coverage.14", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "coverage.15", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 11", + "goal": "coverage.16", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 12", + "goal": "coverage.17", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "coverage.18", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "coverage.19", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "satisfied" + }, + { + "description": "block 15", + "goal": "coverage.20", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "satisfied" + }, + { + "description": "block 16", + "goal": "coverage.21", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 17", + "goal": "coverage.22", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 18", + "goal": "coverage.23", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "satisfied" + }, + { + "description": "block 19", + "goal": "coverage.24", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "satisfied" + }, + { + "description": "block 20", + "goal": "coverage.25", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 21", + "goal": "coverage.26", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 22", + "goal": "coverage.27", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "satisfied" + }, + { + "description": "block 23", + "goal": "coverage.28", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "satisfied" + }, + { + "description": "block 24", + "goal": "coverage.29", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 25", + "goal": "coverage.30", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 26", + "goal": "coverage.31", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "satisfied" + }, + { + "description": "block 27", + "goal": "coverage.32", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "satisfied" + }, + { + "description": "block 28", + "goal": "coverage.33", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 29", + "goal": "coverage.34", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 30", + "goal": "coverage.35", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "satisfied" + }, + { + "description": "block 31", + "goal": "coverage.36", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "satisfied" + }, + { + "description": "block 32", + "goal": "coverage.37", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 33", + "goal": "coverage.38", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 34", + "goal": "coverage.39", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "satisfied" + }, + { + "description": "block 35", + "goal": "coverage.40", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "satisfied" + }, + { + "description": "block 36", + "goal": "coverage.41", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "failed" + }, + { + "description": "block 37", + "goal": "coverage.42", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "failed" + }, + { + "description": "block 38", + "goal": "coverage.43", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "satisfied" + }, + { + "description": "block 39", + "goal": "coverage.44", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "satisfied" + }, + { + "description": "block 40", + "goal": "coverage.45", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "failed" + }, + { + "description": "block 41", + "goal": "coverage.46", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "failed" + }, + { + "description": "block 42", + "goal": "coverage.47", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "29" + }, + "status": "satisfied" + }, + { + "description": "block 43", + "goal": "coverage.48", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "satisfied" + }, + { + "description": "block 44", + "goal": "coverage.49", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 45", + "goal": "coverage.50", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 46", + "goal": "coverage.51", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "31" + }, + "status": "satisfied" + }, + { + "description": "block 47", + "goal": "coverage.52", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "31" + }, + "status": "satisfied" + }, + { + "description": "block 48", + "goal": "coverage.53", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "satisfied" + }, + { + "description": "block 49", + "goal": "coverage.54", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "failed" + }, + { + "description": "block 50", + "goal": "coverage.55", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "failed" + }, + { + "description": "block 51", + "goal": "coverage.56", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "35" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.57", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.58", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.59", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.60", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.61", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + } + ], + "goalsCovered": 38, + "tests": [ + { + "coveredGoals": [ "coverage.1", "coverage.2", "coverage.3", "coverage.4", "coverage.6", "coverage.7", "coverage.8", "coverage.9", "coverage.10", "coverage.11", "coverage.15", "coverage.19", "coverage.23", "coverage.27", "coverage.31", "coverage.35", "coverage.39", "coverage.43", "coverage.47", "coverage.51", "coverage.52", "coverage.56", "coverage.57", "coverage.58", "coverage.59", "coverage.61" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.12", "coverage.16", "coverage.20", "coverage.24", "coverage.28", "coverage.32", "coverage.36", "coverage.40", "coverage.44", "coverage.48", "coverage.53", "coverage.60" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + } + ], + "totalGoals": 61 +}, +{ + "messageText": "** 38 of 61 covered (62.3%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 3 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location9/test.desc b/regression/cbmc-cover/location9/test.desc new file mode 100644 index 00000000000..b80a98c1894 --- /dev/null +++ b/regression/cbmc-cover/location9/test.desc @@ -0,0 +1,11 @@ +CORE +if_acmp1.class +--cover location --existing-coverage if_acmp1.json +^EXIT=0$ +^SIGNAL=0$ +^\[coverage.1\] file if_acmp1.java line 16 block 3: SATISFIED$ +^\[coverage.2\] file if_acmp1.java line 18 block 5: SATISFIED$ +^\[coverage.3\] file if_acmp1.java line 19 block 6: SATISFIED$ +^\*\* 3 of 3 covered (100.0%) +-- +^warning: ignoring diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 2e63d065786..9e3332f41d8 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -1024,7 +1024,7 @@ bool cbmc_parse_optionst::process_goto_program( itg!=(*it)["goals"].array.end(); itg++) { - //get the line of each goal + //get the line of each existing goal const std::string line=(*itg)["sourceLocation"]["line"].value; goals.set_goals(line); } From ab727a254592188b4ca9df448bc4180cd5688209 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 14:12:09 +0100 Subject: [PATCH 30/71] remove whitespace Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index acfcdf06ae0..0b7dd223686 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -103,7 +103,7 @@ bool coverage_goals::get_goals(const char* goal) if(it == existing_goals.end()) return true; else - return false; + return false; } From 3cb0e28494b3af46387754e651f469c5fb6cb619 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 14:15:38 +0100 Subject: [PATCH 31/71] code refactoring to check existing goals Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 4 ++-- src/goto-instrument/cover.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 0b7dd223686..95d3fd6e076 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -95,7 +95,7 @@ Function: coverage_goals::get_goals \*******************************************************************/ -bool coverage_goals::get_goals(const char* goal) +bool coverage_goals::is_existing_goal(const char* goal) { std::vector::iterator it; it = find (existing_goals.begin(), existing_goals.end(), goal); @@ -1163,7 +1163,7 @@ void instrument_cover_goals( basic_blocks.source_location_map[block_nr]; //check whether the current goal already exists - if(goals.get_goals(source_location.get_line().c_str()) && + if(goals.is_existing_goal(source_location.get_line().c_str()) && !source_location.get_file().empty() && source_location.get_file()[0]!='<') { diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index f00659de1b8..ad28c042282 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -16,11 +16,11 @@ Date: May 2016 class coverage_goals { public: - void set_goals(std::string goal); - bool get_goals(const char* goal); + void set_goals(std::string goal); + bool is_existing_goal(const char* goal); private: - std::vector existing_goals; + std::vector existing_goals; }; enum class coverage_criteriont { From 7eb566d0bfc8d32b35247c3e18b12494f9d2a05f Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 09:59:59 +0100 Subject: [PATCH 32/71] replace coverage_goals by coverage_goalst Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 2 +- src/goto-instrument/cover.cpp | 12 ++++++------ src/goto-instrument/cover.h | 6 +++--- src/symex/symex_parse_options.cpp | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 9e3332f41d8..3bb2620616f 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -983,7 +983,7 @@ bool cbmc_parse_optionst::process_goto_program( } // check existing test goals - coverage_goals goals; + coverage_goalst goals; if(cmdline.isset("existing-coverage")) { status() << "Check existing coverage goals" << eom; diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 95d3fd6e076..a6eaf1664e4 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -68,7 +68,7 @@ class basic_blockst /*******************************************************************\ -Function: coverage_goals::set_goals +Function: coverage_goalst::set_goals Inputs: @@ -78,14 +78,14 @@ Function: coverage_goals::set_goals \*******************************************************************/ -void coverage_goals::set_goals(std::string goal) +void coverage_goalst::set_goals(std::string goal) { existing_goals.push_back(goal); } /*******************************************************************\ -Function: coverage_goals::get_goals +Function: coverage_goalst::is_existing_goal Inputs: @@ -95,7 +95,7 @@ Function: coverage_goals::get_goals \*******************************************************************/ -bool coverage_goals::is_existing_goal(const char* goal) +bool coverage_goalst::is_existing_goal(const char* goal) { std::vector::iterator it; it = find (existing_goals.begin(), existing_goals.end(), goal); @@ -1100,7 +1100,7 @@ void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, coverage_criteriont criterion, - coverage_goals &goals) + coverage_goalst &goals) { const namespacet ns(symbol_table); basic_blockst basic_blocks(goto_program); @@ -1399,7 +1399,7 @@ void instrument_cover_goals( const symbol_tablet &symbol_table, goto_functionst &goto_functions, coverage_criteriont criterion, - coverage_goals &goals) + coverage_goalst &goals) { Forall_goto_functions(f_it, goto_functions) { diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index ad28c042282..5fe22d5a992 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -13,7 +13,7 @@ Date: May 2016 #include -class coverage_goals +class coverage_goalst { public: void set_goals(std::string goal); @@ -31,12 +31,12 @@ void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, coverage_criteriont, - coverage_goals &goals); + coverage_goalst &goals); void instrument_cover_goals( const symbol_tablet &symbol_table, goto_functionst &goto_functions, coverage_criteriont, - coverage_goals &goals); + coverage_goalst &goals); #endif diff --git a/src/symex/symex_parse_options.cpp b/src/symex/symex_parse_options.cpp index 5ac7fb001d8..433a32f73f3 100644 --- a/src/symex/symex_parse_options.cpp +++ b/src/symex/symex_parse_options.cpp @@ -442,7 +442,7 @@ bool symex_parse_optionst::process_goto_program(const optionst &options) } status() << "Instrumenting coverge goals" << eom; - coverage_goals goals; + coverage_goalst goals; instrument_cover_goals(symbol_table, goto_model.goto_functions, c, goals); goto_model.goto_functions.update(); } From c2b634475f7e15e98613a061cc72ef4449f291ec Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 10:11:28 +0100 Subject: [PATCH 33/71] default variant of instrument_cover_goals that uses an empty set of existing goals Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 30 ++++++++++++++++++++++++++++++ src/goto-instrument/cover.h | 5 +++++ src/symex/symex_parse_options.cpp | 3 +-- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index a6eaf1664e4..f0e54168a91 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -1411,3 +1411,33 @@ void instrument_cover_goals( criterion, goals); } } + +/*******************************************************************\ + +Function: instrument_cover_goals + + Inputs: + + Outputs: + + Purpose: + +\*******************************************************************/ + +void instrument_cover_goals( + const symbol_tablet &symbol_table, + goto_functionst &goto_functions, + coverage_criteriont criterion) +{ + Forall_goto_functions(f_it, goto_functions) + { + if(f_it->first==ID__start || + f_it->first=="__CPROVER_initialize") + continue; + + //empty set of existing goals + coverage_goalst goals; + instrument_cover_goals(symbol_table, f_it->second.body, + criterion, goals); + } +} diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index 5fe22d5a992..a1e917edf83 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -39,4 +39,9 @@ void instrument_cover_goals( coverage_criteriont, coverage_goalst &goals); +void instrument_cover_goals( + const symbol_tablet &symbol_table, + goto_functionst &goto_functions, + coverage_criteriont); + #endif diff --git a/src/symex/symex_parse_options.cpp b/src/symex/symex_parse_options.cpp index 433a32f73f3..2fbee65e2ad 100644 --- a/src/symex/symex_parse_options.cpp +++ b/src/symex/symex_parse_options.cpp @@ -442,8 +442,7 @@ bool symex_parse_optionst::process_goto_program(const optionst &options) } status() << "Instrumenting coverge goals" << eom; - coverage_goalst goals; - instrument_cover_goals(symbol_table, goto_model.goto_functions, c, goals); + instrument_cover_goals(symbol_table, goto_model.goto_functions, c); goto_model.goto_functions.update(); } From 1100815324794c0bd6f4fa806c73441745ee7960 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 10:19:04 +0100 Subject: [PATCH 34/71] a goal should be identified by a source_locationt Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 7 ++++--- src/goto-instrument/cover.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index f0e54168a91..18003786328 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -95,10 +95,11 @@ Function: coverage_goalst::is_existing_goal \*******************************************************************/ -bool coverage_goalst::is_existing_goal(const char* goal) +bool coverage_goalst::is_existing_goal(source_locationt source_location) { std::vector::iterator it; - it = find (existing_goals.begin(), existing_goals.end(), goal); + it = find (existing_goals.begin(), existing_goals.end(), + source_location.get_line().c_str()); if(it == existing_goals.end()) return true; @@ -1163,7 +1164,7 @@ void instrument_cover_goals( basic_blocks.source_location_map[block_nr]; //check whether the current goal already exists - if(goals.is_existing_goal(source_location.get_line().c_str()) && + if(goals.is_existing_goal(source_location) && !source_location.get_file().empty() && source_location.get_file()[0]!='<') { diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index a1e917edf83..b1a4e50b8ca 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -17,7 +17,7 @@ class coverage_goalst { public: void set_goals(std::string goal); - bool is_existing_goal(const char* goal); + bool is_existing_goal(source_locationt source_location); private: std::vector existing_goals; From 100d6c8d2211c213ad04537680969dcc312807f5 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 14:28:24 +0100 Subject: [PATCH 35/71] implement get_coverage method Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 43 ++---------------------- src/goto-instrument/Makefile | 1 + src/goto-instrument/cover.cpp | 58 +++++++++++++++++++++++++++++++++ src/goto-instrument/cover.h | 2 ++ src/symex/Makefile | 1 + 5 files changed, 64 insertions(+), 41 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 3bb2620616f..fc7ed8853ad 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -50,8 +50,6 @@ Author: Daniel Kroening, kroening@kroening.com #include -#include - #include "cbmc_solvers.h" #include "cbmc_parse_options.h" #include "bmc.h" @@ -990,47 +988,10 @@ bool cbmc_parse_optionst::process_goto_program( //get file with covered test goals const std::string coverage=cmdline.get_value("existing-coverage"); + goals.get_coverage(coverage,get_message_handler()); - jsont json; - - //check coverage file - if(parse_json(coverage, get_message_handler(), json)) - { - messaget message(get_message_handler()); - message.error() << coverage << " file is not a valid json file" - << messaget::eom; - return true; - } - - //make sure that we have an array of elements - if(!json.is_array()) - { - messaget message(get_message_handler()); - message.error() << "expecting an array in the " << coverage << " file, but got " - << json << messaget::eom; - return true; - } - - for(jsont::arrayt::const_iterator - it=json.array.begin(); - it!=json.array.end(); - it++) - { - //get the goals array - if ((*it)["goals"].is_array()) - { - for(jsont::arrayt::const_iterator - itg=(*it)["goals"].array.begin(); - itg!=(*it)["goals"].array.end(); - itg++) - { - //get the line of each existing goal - const std::string line=(*itg)["sourceLocation"]["line"].value; - goals.set_goals(line); - } - } - } } + status() << "Instrumenting coverage goals" << eom; instrument_cover_goals(symbol_table, goto_functions, c, goals); goto_functions.update(); diff --git a/src/goto-instrument/Makefile b/src/goto-instrument/Makefile index fd44907bb11..fddf70a5d51 100644 --- a/src/goto-instrument/Makefile +++ b/src/goto-instrument/Makefile @@ -37,6 +37,7 @@ OBJ += ../ansi-c/ansi-c$(LIBEXT) \ ../langapi/langapi$(LIBEXT) \ ../xmllang/xmllang$(LIBEXT) \ ../util/util$(LIBEXT) \ + ../json/json$(LIBEXT) \ ../solvers/solvers$(LIBEXT) INCLUDES= -I .. diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 18003786328..427346eecb4 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -15,6 +15,8 @@ Date: May 2016 #include #include +#include + #include "cover.h" class basic_blockst @@ -68,6 +70,62 @@ class basic_blockst /*******************************************************************\ +Function: coverage_goalst::get_coverage + + Inputs: + + Outputs: + + Purpose: + +\*******************************************************************/ + +void coverage_goalst::get_coverage(const std::string &coverage, + message_handlert &message_handler) +{ + jsont json; + + //check coverage file + if(parse_json(coverage, message_handler, json)) + { + messaget message(message_handler); + message.error() << coverage << " file is not a valid json file" + << messaget::eom; + exit(0); + } + + //make sure that we have an array of elements + if(!json.is_array()) + { + messaget message(message_handler); + message.error() << "expecting an array in the " << coverage << " file, but got " + << json << messaget::eom; + exit(0); + } + + for(jsont::arrayt::const_iterator + it=json.array.begin(); + it!=json.array.end(); + it++) + { + //get the goals array + if ((*it)["goals"].is_array()) + { + for(jsont::arrayt::const_iterator + itg=(*it)["goals"].array.begin(); + itg!=(*it)["goals"].array.end(); + itg++) + { + //get the line of each existing goal + const std::string line=(*itg)["sourceLocation"]["line"].value; + set_goals(line); + } + } + } +} + +/*******************************************************************\ + Function: coverage_goalst::set_goals Inputs: diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index b1a4e50b8ca..37398f3251e 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -16,6 +16,8 @@ Date: May 2016 class coverage_goalst { public: + void get_coverage(const std::string &coverage, + message_handlert &message_handler); void set_goals(std::string goal); bool is_existing_goal(source_locationt source_location); diff --git a/src/symex/Makefile b/src/symex/Makefile index 1f8e27ce063..42632b58d7b 100644 --- a/src/symex/Makefile +++ b/src/symex/Makefile @@ -16,6 +16,7 @@ OBJ += ../ansi-c/ansi-c$(LIBEXT) \ ../goto-symex/rewrite_union$(OBJEXT) \ ../pointer-analysis/dereference$(OBJEXT) \ ../goto-instrument/cover$(OBJEXT) \ + ../json/json$(LIBEXT) \ ../path-symex/path-symex$(LIBEXT) INCLUDES= -I .. From a75871039368f899d246d385a83b72c951c6af34 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 15:15:52 +0100 Subject: [PATCH 36/71] a goal should be identified by a source_locationt Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 22 +++++++++++++++------- src/goto-instrument/cover.h | 4 ++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 427346eecb4..70dc25acb91 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -8,6 +8,8 @@ Date: May 2016 \*******************************************************************/ +#include + #include #include @@ -84,6 +86,7 @@ void coverage_goalst::get_coverage(const std::string &coverage, message_handlert &message_handler) { jsont json; + source_locationt source_location; //check coverage file if(parse_json(coverage, message_handler, json)) @@ -103,6 +106,7 @@ void coverage_goalst::get_coverage(const std::string &coverage, exit(0); } + irep_idt line_number; for(jsont::arrayt::const_iterator it=json.array.begin(); it!=json.array.end(); @@ -117,8 +121,9 @@ void coverage_goalst::get_coverage(const std::string &coverage, itg++) { //get the line of each existing goal - const std::string line=(*itg)["sourceLocation"]["line"].value; - set_goals(line); + line_number=(*itg)["sourceLocation"]["line"].value; + source_location.set_line(line_number); + set_goals(source_location); } } } @@ -136,7 +141,7 @@ Function: coverage_goalst::set_goals \*******************************************************************/ -void coverage_goalst::set_goals(std::string goal) +void coverage_goalst::set_goals(source_locationt goal) { existing_goals.push_back(goal); } @@ -155,10 +160,13 @@ Function: coverage_goalst::is_existing_goal bool coverage_goalst::is_existing_goal(source_locationt source_location) { - std::vector::iterator it; - it = find (existing_goals.begin(), existing_goals.end(), - source_location.get_line().c_str()); - + std::vector::iterator it = existing_goals.begin(); + while (it!=existing_goals.end()) + { + if (!source_location.get_line().compare(it->get_line())) + break; + ++it; + } if(it == existing_goals.end()) return true; else diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index 37398f3251e..ba086d58154 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -18,11 +18,11 @@ class coverage_goalst public: void get_coverage(const std::string &coverage, message_handlert &message_handler); - void set_goals(std::string goal); + void set_goals(source_locationt goal); bool is_existing_goal(source_locationt source_location); private: - std::vector existing_goals; + std::vector existing_goals; }; enum class coverage_criteriont { From 50caf55d8665800e2e3f76840533179dbe8ba6bd Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 15:44:05 +0100 Subject: [PATCH 37/71] method to construct a coverage_goalst object Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 6 +++--- src/goto-instrument/cover.cpp | 6 ++++-- src/goto-instrument/cover.h | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index fc7ed8853ad..05286737664 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -980,16 +980,16 @@ bool cbmc_parse_optionst::process_goto_program( return true; } + // check existing test goals coverage_goalst goals; if(cmdline.isset("existing-coverage")) { status() << "Check existing coverage goals" << eom; - //get file with covered test goals const std::string coverage=cmdline.get_value("existing-coverage"); - goals.get_coverage(coverage,get_message_handler()); - + //get a coverage_goalst object + goals = coverage_goalst::get_coverage_goals(coverage,get_message_handler());; } status() << "Instrumenting coverage goals" << eom; diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 70dc25acb91..9d1480d301c 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -82,10 +82,11 @@ Function: coverage_goalst::get_coverage \*******************************************************************/ -void coverage_goalst::get_coverage(const std::string &coverage, +coverage_goalst coverage_goalst::get_coverage_goals(const std::string &coverage, message_handlert &message_handler) { jsont json; + coverage_goalst goals; source_locationt source_location; //check coverage file @@ -123,10 +124,11 @@ void coverage_goalst::get_coverage(const std::string &coverage, //get the line of each existing goal line_number=(*itg)["sourceLocation"]["line"].value; source_location.set_line(line_number); - set_goals(source_location); + goals.set_goals(source_location); } } } + return goals; } /*******************************************************************\ diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index ba086d58154..9eb85b3c7d2 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -16,8 +16,8 @@ Date: May 2016 class coverage_goalst { public: - void get_coverage(const std::string &coverage, - message_handlert &message_handler); + static coverage_goalst get_coverage_goals(const std::string &coverage, + message_handlert &message_handler); void set_goals(source_locationt goal); bool is_existing_goal(source_locationt source_location); From e2e8a803378477ce73c2f791e96d3ad688d54b0c Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 16:01:15 +0100 Subject: [PATCH 38/71] remove iostream Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 9d1480d301c..20c34102908 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -8,8 +8,6 @@ Date: May 2016 \*******************************************************************/ -#include - #include #include From ec445c928241c47b46c1f2b3508b6b590f15c6e5 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Thu, 8 Sep 2016 15:19:19 +0100 Subject: [PATCH 39/71] use json file suggested at github issue #187 Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 20c34102908..44b7345552a 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -8,6 +8,8 @@ Date: May 2016 \*******************************************************************/ +#include + #include #include @@ -105,24 +107,34 @@ coverage_goalst coverage_goalst::get_coverage_goals(const std::string &coverage, exit(0); } - irep_idt line_number; + irep_idt file, function, line; for(jsont::arrayt::const_iterator it=json.array.begin(); it!=json.array.end(); it++) { - //get the goals array - if ((*it)["goals"].is_array()) + + //get the file of each existing goal + file=(*it)["file"].value; + source_location.set_file(file); + + //get the function of each existing goal + function=(*it)["function"].value; + source_location.set_function(function); + + //get the lines array + if ((*it)["lines"].is_array()) { for(jsont::arrayt::const_iterator - itg=(*it)["goals"].array.begin(); - itg!=(*it)["goals"].array.end(); + itg=(*it)["lines"].array.begin(); + itg!=(*it)["lines"].array.end(); itg++) { //get the line of each existing goal - line_number=(*itg)["sourceLocation"]["line"].value; - source_location.set_line(line_number); + line=(*itg)["number"].value; + source_location.set_line(line); goals.set_goals(source_location); + } } } @@ -163,7 +175,9 @@ bool coverage_goalst::is_existing_goal(source_locationt source_location) std::vector::iterator it = existing_goals.begin(); while (it!=existing_goals.end()) { - if (!source_location.get_line().compare(it->get_line())) + if (!source_location.get_file().compare(it->get_file()) && + !source_location.get_function().compare(it->get_function()) && + !source_location.get_line().compare(it->get_line())) break; ++it; } From d22e9c5aae3a7ad5c03a4a6016725ac1b2eb00cf Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Thu, 8 Sep 2016 15:20:24 +0100 Subject: [PATCH 40/71] use json file as suggested at github issue #187 Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location2/main.json | 197 +--- regression/cbmc-cover/location3/main.json | 187 +--- regression/cbmc-cover/location4/main.json | 638 +------------ regression/cbmc-cover/location5/main.json | 628 +------------ regression/cbmc-cover/location6/if_expr1.json | 486 +--------- regression/cbmc-cover/location7/if_expr1.json | 476 +--------- regression/cbmc-cover/location8/if_acmp1.json | 883 +----------------- regression/cbmc-cover/location9/if_acmp1.json | 856 +---------------- 8 files changed, 21 insertions(+), 4330 deletions(-) diff --git a/regression/cbmc-cover/location2/main.json b/regression/cbmc-cover/location2/main.json index 57c35d49321..1fd3d2cd7ba 100644 --- a/regression/cbmc-cover/location2/main.json +++ b/regression/cbmc-cover/location2/main.json @@ -1,197 +1,2 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing main.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking main", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "function `assert' is not declared", - "messageType": "WARNING" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "size of program expression: 45 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 4 VCC(s), 4 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 4 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "265 variables, 522 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "265 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.001s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "main.coverage.1", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "3" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "main.coverage.2", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "main.coverage.3", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "main.coverage.4", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "12" - }, - "status": "satisfied" - } - ], - "goalsCovered": 4, - "tests": [ - { - "coveredGoals": [ "main.coverage.1", "main.coverage.3", "main.coverage.4" ], - "inputs": [ ] - }, - { - "coveredGoals": [ "main.coverage.2" ], - "inputs": [ ] - } - ], - "totalGoals": 4 -}, -{ - "messageText": "** 4 of 4 covered (100.0%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 2 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "main.c", "function": "main", "lines": [ {"number": 3}, {"number": 8}, {"number": 10}, {"number": 12} ] } ] diff --git a/regression/cbmc-cover/location3/main.json b/regression/cbmc-cover/location3/main.json index f0721a496e7..dc7fb615202 100644 --- a/regression/cbmc-cover/location3/main.json +++ b/regression/cbmc-cover/location3/main.json @@ -1,187 +1,2 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing main.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking main", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "function `assert' is not declared", - "messageType": "WARNING" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "size of program expression: 45 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 4 VCC(s), 4 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 4 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "265 variables, 522 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "265 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.001s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "main.coverage.1", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "3" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "main.coverage.2", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "main.coverage.4", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "12" - }, - "status": "satisfied" - } - ], - "goalsCovered": 4, - "tests": [ - { - "coveredGoals": [ "main.coverage.1", "main.coverage.3", "main.coverage.4" ], - "inputs": [ ] - }, - { - "coveredGoals": [ "main.coverage.2" ], - "inputs": [ ] - } - ], - "totalGoals": 4 -}, -{ - "messageText": "** 4 of 4 covered (100.0%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 2 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "main.c", "function": "main", "lines": [ {"number": 3}, {"number": 8}, {"number": 12} ] } ] diff --git a/regression/cbmc-cover/location4/main.json b/regression/cbmc-cover/location4/main.json index 114e0638022..d5b80c03a30 100644 --- a/regression/cbmc-cover/location4/main.json +++ b/regression/cbmc-cover/location4/main.json @@ -1,633 +1,7 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing main.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Parsing single-linked-list.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking main", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking single-linked-list", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop main.0 iteration 1 (2 max) file main.c line 19 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop main.0 iteration 2 (2 max) file main.c line 19 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop search_list.0 iteration 1 (2 max) file single-linked-list.c line 10 function search_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop search_list.0 iteration 2 (2 max) file single-linked-list.c line 10 function search_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop delete_list.0 iteration 1 (2 max) file single-linked-list.c line 23 function delete_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop delete_list.0 iteration 2 (2 max) file single-linked-list.c line 23 function delete_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop main.1 iteration 1 (2 max) file main.c line 35 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop main.1 iteration 2 (2 max) file main.c line 35 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "size of program expression: 358 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 57 VCC(s), 57 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 40 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "3368 variables, 1698 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "3368 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.007s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "free called for new[] object", - "goal": "", - "sourceLocation": { - "file": "", - "function": "free", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "main.coverage.1", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "main.coverage.2", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "12" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "main.coverage.3", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "13" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "main.coverage.4", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "14" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "main.coverage.5", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "16" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "main.coverage.6", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "19" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "main.coverage.7", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "main.coverage.8", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "main.coverage.9", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "main.coverage.10", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 11", - "goal": "main.coverage.11", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "32" - }, - "status": "failed" - }, - { - "description": "block 12", - "goal": "main.coverage.12", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "35" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "main.coverage.13", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "37" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "main.coverage.14", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "40" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "search_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "9" - }, - "status": "failed" - }, - { - "description": "block 2", - "goal": "search_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 3", - "goal": "search_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 4", - "goal": "search_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 5", - "goal": "search_list.coverage.5", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 6", - "goal": "search_list.coverage.6", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 7", - "goal": "search_list.coverage.7", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "15" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "delete_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "19" - }, - "status": "failed" - }, - { - "description": "block 2", - "goal": "delete_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 3", - "goal": "delete_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 4", - "goal": "delete_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 5", - "goal": "delete_list.coverage.5", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "29" - }, - "status": "failed" - }, - { - "description": "block 6", - "goal": "delete_list.coverage.6", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 7", - "goal": "delete_list.coverage.7", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 8", - "goal": "delete_list.coverage.8", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "delete_list.coverage.9", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "delete_list.coverage.10", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 11", - "goal": "delete_list.coverage.11", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 12", - "goal": "delete_list.coverage.12", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "delete_list.coverage.13", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "delete_list.coverage.14", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "insert_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "37" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "insert_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "40" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "insert_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "45" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "insert_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "48" - }, - "status": "satisfied" - } - ], - "goalsCovered": 11, - "tests": [ - { - "coveredGoals": [ "main.coverage.1", "main.coverage.2", "main.coverage.3", "main.coverage.4", "main.coverage.5", "main.coverage.6", "main.coverage.7", "insert_list.coverage.1", "insert_list.coverage.2", "insert_list.coverage.3", "insert_list.coverage.4" ], - "inputs": [ ] - } - ], - "totalGoals": 40 -}, -{ - "messageText": "** 11 of 40 covered (27.5%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 2 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "", "function": "free", "lines": [ {"number": 22} ] }, +{ "file": "main.c", "function": "main", "lines": [ {"number": 8}, {"number": 12}, {"number": 13}, {"number": 14}, {"number": 16}, {"number": 19}, {"number": 21}, {"number": 24}, {"number": 26}, {"number": 30}, {"number": 32}, {"number": 35}, {"number": 37}, {"number": 40} ] }, +{"file": "single-linked-list.c", "function": "search_list", "lines": [ {"number": 9}, {"number": 10}, {"number": 15} ] }, +{"file": "single-linked-list.c", "function": "delete_list", "lines": [ {"number": 19}, {"number": 23}, {"number": 24}, {"number": 25}, {"number": 29}, {"number": 31}, {"number": 37}, {"number": 40}, {"number": 45}, {"number": 48} ] }, +{"file": "single-linked-list.c", "function": "insert_list", "lines": [ {"number": 37}, {"number": 40}, {"number": 45}, {"number": 48} ] } ] + diff --git a/regression/cbmc-cover/location5/main.json b/regression/cbmc-cover/location5/main.json index 486ba8033d4..86c5b8fd0ee 100644 --- a/regression/cbmc-cover/location5/main.json +++ b/regression/cbmc-cover/location5/main.json @@ -1,623 +1,7 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing main.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Parsing single-linked-list.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking main", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking single-linked-list", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop main.0 iteration 1 (2 max) file main.c line 19 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop main.0 iteration 2 (2 max) file main.c line 19 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop search_list.0 iteration 1 (2 max) file single-linked-list.c line 10 function search_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop search_list.0 iteration 2 (2 max) file single-linked-list.c line 10 function search_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop delete_list.0 iteration 1 (2 max) file single-linked-list.c line 23 function delete_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop delete_list.0 iteration 2 (2 max) file single-linked-list.c line 23 function delete_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop main.1 iteration 1 (2 max) file main.c line 35 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop main.1 iteration 2 (2 max) file main.c line 35 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "size of program expression: 358 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 57 VCC(s), 57 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 40 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "3368 variables, 1698 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "3368 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.007s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "free called for new[] object", - "goal": "", - "sourceLocation": { - "file": "", - "function": "free", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "main.coverage.1", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "main.coverage.2", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "12" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "main.coverage.3", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "13" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "main.coverage.5", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "16" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "main.coverage.6", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "19" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "main.coverage.7", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "main.coverage.8", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "main.coverage.9", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "main.coverage.10", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 11", - "goal": "main.coverage.11", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "32" - }, - "status": "failed" - }, - { - "description": "block 12", - "goal": "main.coverage.12", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "35" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "main.coverage.13", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "37" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "main.coverage.14", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "40" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "search_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "9" - }, - "status": "failed" - }, - { - "description": "block 2", - "goal": "search_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 3", - "goal": "search_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 4", - "goal": "search_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 5", - "goal": "search_list.coverage.5", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 6", - "goal": "search_list.coverage.6", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 7", - "goal": "search_list.coverage.7", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "15" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "delete_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "19" - }, - "status": "failed" - }, - { - "description": "block 2", - "goal": "delete_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 3", - "goal": "delete_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 4", - "goal": "delete_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 5", - "goal": "delete_list.coverage.5", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "29" - }, - "status": "failed" - }, - { - "description": "block 6", - "goal": "delete_list.coverage.6", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 7", - "goal": "delete_list.coverage.7", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 8", - "goal": "delete_list.coverage.8", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "delete_list.coverage.9", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "delete_list.coverage.10", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 11", - "goal": "delete_list.coverage.11", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 12", - "goal": "delete_list.coverage.12", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "delete_list.coverage.13", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "delete_list.coverage.14", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "insert_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "37" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "insert_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "40" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "insert_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "45" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "insert_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "48" - }, - "status": "satisfied" - } - ], - "goalsCovered": 11, - "tests": [ - { - "coveredGoals": [ "main.coverage.1", "main.coverage.2", "main.coverage.3", "main.coverage.4", "main.coverage.5", "main.coverage.6", "main.coverage.7", "insert_list.coverage.1", "insert_list.coverage.2", "insert_list.coverage.3", "insert_list.coverage.4" ], - "inputs": [ ] - } - ], - "totalGoals": 40 -}, -{ - "messageText": "** 11 of 40 covered (27.5%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 2 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "", "function": "free", "lines": [ {"number": 22} ] }, +{ "file": "main.c", "function": "main", "lines": [ {"number": 8}, {"number": 12}, {"number": 13}, {"number": 16}, {"number": 19}, {"number": 21}, {"number": 24}, {"number": 26}, {"number": 30}, {"number": 32}, {"number": 35}, {"number": 37}, {"number": 40} ] }, +{"file": "single-linked-list.c", "function": "search_list", "lines": [ {"number": 9}, {"number": 10}, {"number": 15} ] }, +{"file": "single-linked-list.c", "function": "delete_list", "lines": [ {"number": 19}, {"number": 23}, {"number": 24}, {"number": 25}, {"number": 29}, {"number": 31}, {"number": 37}, {"number": 40}, {"number": 45}, {"number": 48} ] }, +{"file": "single-linked-list.c", "function": "insert_list", "lines": [ {"number": 37}, {"number": 40}, {"number": 45}, {"number": 48} ] } ] + diff --git a/regression/cbmc-cover/location6/if_expr1.json b/regression/cbmc-cover/location6/if_expr1.json index 9415f24f359..09d4eaa4fca 100644 --- a/regression/cbmc-cover/location6/if_expr1.json +++ b/regression/cbmc-cover/location6/if_expr1.json @@ -1,485 +1,3 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing if_expr1.class", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Java main class: if_expr1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "failed to load class `java.lang.String'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.io.IOException'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Class'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.AssertionError'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.System'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.io.InputStream'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Object'", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Class.desiredAssertionStatus:()Z", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.io.InputStream.read:()I", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.AssertionError.:()V", - "messageType": "WARNING" -}, -{ - "messageText": "size of program expression: 110 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 19 VCC(s), 19 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 20 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 2976 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 10", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 11", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 14", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 39 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 22 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 2 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.011s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "coverage.1", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.2", - "sourceLocation": { - "file": "if_expr1.java", - "line": "5" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.3", - "sourceLocation": { - "file": "if_expr1.java", - "line": "5" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.4", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.5", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.6", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "coverage.7", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "coverage.8", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "coverage.9", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "coverage.10", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "coverage.11", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 11", - "goal": "coverage.12", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 12", - "goal": "coverage.13", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "coverage.14", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "coverage.15", - "sourceLocation": { - "file": "if_expr1.java", - "line": "11" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.16", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.17", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.18", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.19", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.20", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - } - ], - "goalsCovered": 15, - "tests": [ - { - "coveredGoals": [ "coverage.2", "coverage.3", "coverage.5", "coverage.6", "coverage.11", "coverage.12", "coverage.15", "coverage.16", "coverage.17", "coverage.19", "coverage.20" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.18" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.4", "coverage.7" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.8" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - } - ], - "totalGoals": 20 -}, -{ - "messageText": "** 15 of 20 covered (75.0%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 5 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "if_expr1.java", "lines": [ {"number": 1}, {"number": 5}, {"number": 6}, {"number": 8}, {"number": 10}, {"number": 11} ] } ] + diff --git a/regression/cbmc-cover/location7/if_expr1.json b/regression/cbmc-cover/location7/if_expr1.json index a0d320755f2..1d1bbb6f552 100644 --- a/regression/cbmc-cover/location7/if_expr1.json +++ b/regression/cbmc-cover/location7/if_expr1.json @@ -1,476 +1,2 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing if_expr1.class", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Java main class: if_expr1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "failed to load class `java.lang.String'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.io.IOException'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Class'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.AssertionError'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.System'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.io.InputStream'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Object'", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Class.desiredAssertionStatus:()Z", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.io.InputStream.read:()I", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.AssertionError.:()V", - "messageType": "WARNING" -}, -{ - "messageText": "size of program expression: 110 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 19 VCC(s), 19 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 20 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 2976 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 10", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 11", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 14", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 39 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 22 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 2 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.011s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "coverage.1", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.2", - "sourceLocation": { - "file": "if_expr1.java", - "line": "5" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.3", - "sourceLocation": { - "file": "if_expr1.java", - "line": "5" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.4", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.5", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.6", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "coverage.7", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "coverage.8", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "coverage.9", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "coverage.10", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "coverage.11", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 11", - "goal": "coverage.12", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 12", - "goal": "coverage.13", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "coverage.14", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.16", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.17", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.18", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.19", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.20", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - } - ], - "goalsCovered": 15, - "tests": [ - { - "coveredGoals": [ "coverage.2", "coverage.3", "coverage.5", "coverage.6", "coverage.11", "coverage.12", "coverage.15", "coverage.16", "coverage.17", "coverage.19", "coverage.20" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.18" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.4", "coverage.7" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.8" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - } - ], - "totalGoals": 20 -}, -{ - "messageText": "** 15 of 20 covered (75.0%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 5 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "if_expr1.java", "lines": [ {"number": 1}, {"number": 5}, {"number": 6}, {"number": 8}, {"number": 10} ] } ] diff --git a/regression/cbmc-cover/location8/if_acmp1.json b/regression/cbmc-cover/location8/if_acmp1.json index c1623228f3e..de4ebb6c29d 100644 --- a/regression/cbmc-cover/location8/if_acmp1.json +++ b/regression/cbmc-cover/location8/if_acmp1.json @@ -1,882 +1,3 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing if_acmp1.class", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Java main class: if_acmp1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "failed to load class `java.lang.String'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Class'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.AssertionError'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Object'", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Class.desiredAssertionStatus:()Z", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Object.:()V", - "messageType": "WARNING" -}, -{ - "messageText": "size of program expression: 223 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 42 VCC(s), 42 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 61 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 191 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 10", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 14", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 18", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 22", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 26", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 30", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 34", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 38", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 42", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 46", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 47", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 51", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 25 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 11", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 15", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 19", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 23", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 27", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 31", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 35", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 39", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 43", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 48", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 25 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.011s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "coverage.1", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "4" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.2", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.3", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.4", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.5", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.6", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "15" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.7", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "15" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.8", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "16" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.9", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "17" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.10", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "18" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "coverage.11", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "19" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "coverage.12", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "coverage.13", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "coverage.14", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "coverage.15", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 11", - "goal": "coverage.16", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 12", - "goal": "coverage.17", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "coverage.18", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "coverage.19", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "satisfied" - }, - { - "description": "block 15", - "goal": "coverage.20", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "satisfied" - }, - { - "description": "block 16", - "goal": "coverage.21", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 17", - "goal": "coverage.22", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 18", - "goal": "coverage.23", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "satisfied" - }, - { - "description": "block 19", - "goal": "coverage.24", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "satisfied" - }, - { - "description": "block 20", - "goal": "coverage.25", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 21", - "goal": "coverage.26", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 22", - "goal": "coverage.27", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "satisfied" - }, - { - "description": "block 23", - "goal": "coverage.28", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "satisfied" - }, - { - "description": "block 24", - "goal": "coverage.29", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 25", - "goal": "coverage.30", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 26", - "goal": "coverage.31", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "satisfied" - }, - { - "description": "block 27", - "goal": "coverage.32", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "satisfied" - }, - { - "description": "block 28", - "goal": "coverage.33", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 29", - "goal": "coverage.34", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 30", - "goal": "coverage.35", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "satisfied" - }, - { - "description": "block 31", - "goal": "coverage.36", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "satisfied" - }, - { - "description": "block 32", - "goal": "coverage.37", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 33", - "goal": "coverage.38", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 34", - "goal": "coverage.39", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "satisfied" - }, - { - "description": "block 35", - "goal": "coverage.40", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "satisfied" - }, - { - "description": "block 36", - "goal": "coverage.41", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "failed" - }, - { - "description": "block 37", - "goal": "coverage.42", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "failed" - }, - { - "description": "block 38", - "goal": "coverage.43", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "satisfied" - }, - { - "description": "block 39", - "goal": "coverage.44", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "satisfied" - }, - { - "description": "block 40", - "goal": "coverage.45", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "failed" - }, - { - "description": "block 41", - "goal": "coverage.46", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "failed" - }, - { - "description": "block 42", - "goal": "coverage.47", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "29" - }, - "status": "satisfied" - }, - { - "description": "block 43", - "goal": "coverage.48", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "satisfied" - }, - { - "description": "block 44", - "goal": "coverage.49", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 45", - "goal": "coverage.50", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 46", - "goal": "coverage.51", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "31" - }, - "status": "satisfied" - }, - { - "description": "block 47", - "goal": "coverage.52", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "31" - }, - "status": "satisfied" - }, - { - "description": "block 48", - "goal": "coverage.53", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "satisfied" - }, - { - "description": "block 49", - "goal": "coverage.54", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "failed" - }, - { - "description": "block 50", - "goal": "coverage.55", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "failed" - }, - { - "description": "block 51", - "goal": "coverage.56", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "35" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.57", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.58", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.59", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.60", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.61", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - } - ], - "goalsCovered": 38, - "tests": [ - { - "coveredGoals": [ "coverage.1", "coverage.2", "coverage.3", "coverage.4", "coverage.6", "coverage.7", "coverage.8", "coverage.9", "coverage.10", "coverage.11", "coverage.15", "coverage.19", "coverage.23", "coverage.27", "coverage.31", "coverage.35", "coverage.39", "coverage.43", "coverage.47", "coverage.51", "coverage.52", "coverage.56", "coverage.57", "coverage.58", "coverage.59", "coverage.61" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.12", "coverage.16", "coverage.20", "coverage.24", "coverage.28", "coverage.32", "coverage.36", "coverage.40", "coverage.44", "coverage.48", "coverage.53", "coverage.60" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - } - ], - "totalGoals": 61 -}, -{ - "messageText": "** 38 of 61 covered (62.3%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 3 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "if_acmp1.java", "lines": [ {"number": 4}, {"number": 1}, {"number": 10}, {"number": 7}, {"number": 15}, {"number": 16}, {"number": 17}, {"number": 18}, {"number": 19}, {"number": 20}, {"number": 21}, {"number": 22}, {"number": 23}, {"number": 24}, {"number": 25}, {"number": 26}, {"number": 27}, {"number": 28}, {"number": 29}, {"number": 30}, {"number": 31}, {"number": 34}, {"number": 35} ] } ] + diff --git a/regression/cbmc-cover/location9/if_acmp1.json b/regression/cbmc-cover/location9/if_acmp1.json index 9e7fdc9f456..8d48cb86fa0 100644 --- a/regression/cbmc-cover/location9/if_acmp1.json +++ b/regression/cbmc-cover/location9/if_acmp1.json @@ -1,855 +1,3 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing if_acmp1.class", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Java main class: if_acmp1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "failed to load class `java.lang.String'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Class'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.AssertionError'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Object'", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Class.desiredAssertionStatus:()Z", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Object.:()V", - "messageType": "WARNING" -}, -{ - "messageText": "size of program expression: 223 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 42 VCC(s), 42 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 61 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 191 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 10", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 14", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 18", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 22", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 26", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 30", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 34", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 38", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 42", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 46", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 47", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 51", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 25 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 11", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 15", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 19", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 23", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 27", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 31", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 35", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 39", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 43", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 48", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 25 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.011s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "coverage.1", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "4" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.2", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.3", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.4", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.5", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.6", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "15" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.7", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "15" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.9", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "17" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "coverage.12", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "coverage.13", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "coverage.14", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "coverage.15", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 11", - "goal": "coverage.16", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 12", - "goal": "coverage.17", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "coverage.18", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "coverage.19", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "satisfied" - }, - { - "description": "block 15", - "goal": "coverage.20", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "satisfied" - }, - { - "description": "block 16", - "goal": "coverage.21", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 17", - "goal": "coverage.22", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 18", - "goal": "coverage.23", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "satisfied" - }, - { - "description": "block 19", - "goal": "coverage.24", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "satisfied" - }, - { - "description": "block 20", - "goal": "coverage.25", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 21", - "goal": "coverage.26", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 22", - "goal": "coverage.27", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "satisfied" - }, - { - "description": "block 23", - "goal": "coverage.28", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "satisfied" - }, - { - "description": "block 24", - "goal": "coverage.29", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 25", - "goal": "coverage.30", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 26", - "goal": "coverage.31", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "satisfied" - }, - { - "description": "block 27", - "goal": "coverage.32", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "satisfied" - }, - { - "description": "block 28", - "goal": "coverage.33", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 29", - "goal": "coverage.34", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 30", - "goal": "coverage.35", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "satisfied" - }, - { - "description": "block 31", - "goal": "coverage.36", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "satisfied" - }, - { - "description": "block 32", - "goal": "coverage.37", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 33", - "goal": "coverage.38", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 34", - "goal": "coverage.39", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "satisfied" - }, - { - "description": "block 35", - "goal": "coverage.40", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "satisfied" - }, - { - "description": "block 36", - "goal": "coverage.41", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "failed" - }, - { - "description": "block 37", - "goal": "coverage.42", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "failed" - }, - { - "description": "block 38", - "goal": "coverage.43", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "satisfied" - }, - { - "description": "block 39", - "goal": "coverage.44", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "satisfied" - }, - { - "description": "block 40", - "goal": "coverage.45", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "failed" - }, - { - "description": "block 41", - "goal": "coverage.46", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "failed" - }, - { - "description": "block 42", - "goal": "coverage.47", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "29" - }, - "status": "satisfied" - }, - { - "description": "block 43", - "goal": "coverage.48", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "satisfied" - }, - { - "description": "block 44", - "goal": "coverage.49", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 45", - "goal": "coverage.50", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 46", - "goal": "coverage.51", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "31" - }, - "status": "satisfied" - }, - { - "description": "block 47", - "goal": "coverage.52", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "31" - }, - "status": "satisfied" - }, - { - "description": "block 48", - "goal": "coverage.53", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "satisfied" - }, - { - "description": "block 49", - "goal": "coverage.54", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "failed" - }, - { - "description": "block 50", - "goal": "coverage.55", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "failed" - }, - { - "description": "block 51", - "goal": "coverage.56", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "35" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.57", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.58", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.59", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.60", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.61", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - } - ], - "goalsCovered": 38, - "tests": [ - { - "coveredGoals": [ "coverage.1", "coverage.2", "coverage.3", "coverage.4", "coverage.6", "coverage.7", "coverage.8", "coverage.9", "coverage.10", "coverage.11", "coverage.15", "coverage.19", "coverage.23", "coverage.27", "coverage.31", "coverage.35", "coverage.39", "coverage.43", "coverage.47", "coverage.51", "coverage.52", "coverage.56", "coverage.57", "coverage.58", "coverage.59", "coverage.61" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.12", "coverage.16", "coverage.20", "coverage.24", "coverage.28", "coverage.32", "coverage.36", "coverage.40", "coverage.44", "coverage.48", "coverage.53", "coverage.60" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - } - ], - "totalGoals": 61 -}, -{ - "messageText": "** 38 of 61 covered (62.3%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 3 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "if_acmp1.java", "lines": [ {"number": 4}, {"number": 1}, {"number": 10}, {"number": 7}, {"number": 15}, {"number": 17}, {"number": 20}, {"number": 21}, {"number": 22}, {"number": 23}, {"number": 24}, {"number": 25}, {"number": 26}, {"number": 27}, {"number": 28}, {"number": 29}, {"number": 30}, {"number": 31}, {"number": 34}, {"number": 35} ] } ] + From 11b5fc14e9c3ac514aea9b9d699b883134e0ef37 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Thu, 8 Sep 2016 15:30:46 +0100 Subject: [PATCH 41/71] remove space Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 44b7345552a..0fe251bec04 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -131,10 +131,9 @@ coverage_goalst coverage_goalst::get_coverage_goals(const std::string &coverage, itg++) { //get the line of each existing goal - line=(*itg)["number"].value; - source_location.set_line(line); - goals.set_goals(source_location); - + line=(*itg)["number"].value; + source_location.set_line(line); + goals.set_goals(source_location); } } } From b7a0afb699c0dfebfd040df308bc58b5e5a68f18 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Wed, 21 Sep 2016 15:29:34 +0100 Subject: [PATCH 42/71] fix merge Signed-off-by: Lucas Cordeiro --- regression/cbmc-concurrency/deadlock1/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regression/cbmc-concurrency/deadlock1/main.c b/regression/cbmc-concurrency/deadlock1/main.c index 891fb419e7e..8bf26775d37 100644 --- a/regression/cbmc-concurrency/deadlock1/main.c +++ b/regression/cbmc-concurrency/deadlock1/main.c @@ -19,4 +19,4 @@ void main() { pthread_join(tid2, NULL); // deadlock in the threads; assertion should not be reachable assert(0); -} +} From d42ad2dd09ac34806dcba3967521f16e42619806 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Fri, 2 Sep 2016 10:22:38 +0100 Subject: [PATCH 43/71] add the option existing-coverage Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 1 + src/cbmc/cbmc_parse_options.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 3b0d7b5bc6a..44922b7918b 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -1140,6 +1140,7 @@ void cbmc_parse_optionst::help() " --no-assumptions ignore user assumptions\n" " --error-label label check that label is unreachable\n" " --cover CC create test-suite with coverage criterion CC\n" + " --existing-coverage file instrument non-covered test goals\n" " --mm MM memory consistency model for concurrent programs\n" "\n" "Java Bytecode frontend options:\n" diff --git a/src/cbmc/cbmc_parse_options.h b/src/cbmc/cbmc_parse_options.h index 33fe0ba5175..1882f57a738 100644 --- a/src/cbmc/cbmc_parse_options.h +++ b/src/cbmc/cbmc_parse_options.h @@ -54,6 +54,7 @@ class optionst; "(round-to-nearest)(round-to-plus-inf)(round-to-minus-inf)(round-to-zero)" \ "(graphml-cex):" \ "(localize-faults)(localize-faults-method):" \ + "(existing-coverage):" \ "(floatbv)(all-claims)(all-properties)" // legacy, and will eventually disappear class cbmc_parse_optionst: From a514fd29a016c5546075ebaa6953473f3b10fec7 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Fri, 2 Sep 2016 12:32:09 +0100 Subject: [PATCH 44/71] check whether the user has provided a valid json file for --existing-coverage Signed-off-by: Lucas Cordeiro --- src/cbmc/Makefile | 1 + src/cbmc/cbmc_parse_options.cpp | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/cbmc/Makefile b/src/cbmc/Makefile index 8440c92fa1b..8bd53417622 100644 --- a/src/cbmc/Makefile +++ b/src/cbmc/Makefile @@ -27,6 +27,7 @@ OBJ += ../ansi-c/ansi-c$(LIBEXT) \ ../xmllang/xmllang$(LIBEXT) \ ../assembler/assembler$(LIBEXT) \ ../solvers/solvers$(LIBEXT) \ + ../json/json$(LIBEXT) \ ../util/util$(LIBEXT) INCLUDES= -I .. diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 44922b7918b..8432683c510 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -50,6 +50,8 @@ Author: Daniel Kroening, kroening@kroening.com #include +#include + #include "cbmc_solvers.h" #include "cbmc_parse_options.h" #include "bmc.h" @@ -458,6 +460,10 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options) if(cmdline.isset("graphml-cex")) options.set_option("graphml-cex", cmdline.get_value("graphml-cex")); + + if(cmdline.isset("existing-coverage")) + options.set_option("existing-coverage", cmdline.get_value("existing-coverage")); + } /*******************************************************************\ @@ -945,7 +951,25 @@ bool cbmc_parse_optionst::process_goto_program( // add loop ids goto_functions.compute_loop_numbers(); - + + // instrument non-covered test goals + if(cmdline.isset("existing-coverage")) + { + //get file with covered test goals + const std::string coverage=cmdline.get_value("existing-coverage"); + + jsont json; + + //check coverage file + if(parse_json(coverage, get_message_handler(), json)) + { + messaget message(get_message_handler()); + message.error() << coverage << " file is not a valid json file" + << messaget::eom; + return true; + } + } + // instrument cover goals if(cmdline.isset("cover")) From 8ee2d057f13b8f21d10422005fc4c01307d5de6e Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Fri, 2 Sep 2016 15:31:16 +0100 Subject: [PATCH 45/71] get the line of each goal Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 8432683c510..d19e98f75a5 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -968,6 +968,34 @@ bool cbmc_parse_optionst::process_goto_program( << messaget::eom; return true; } + + //make sure that we have an array of elements + if(!json.is_array()) + { + messaget message(get_message_handler()); + message.error() << "expecting an array in the " << coverage << " file, but got " + << json << messaget::eom; + return true; + } + + for(jsont::arrayt::const_iterator + it=json.array.begin(); + it!=json.array.end(); + it++) + { + //get the goals array + if ((*it)["goals"].is_array()) + { + for(jsont::arrayt::const_iterator + itg=(*it)["goals"].array.begin(); + itg!=(*it)["goals"].array.end(); + itg++) + { + //get the line of each goal + const unsigned int line=std::stoi((*itg)["sourceLocation"]["line"].value); + } + } + } } // instrument cover goals From 5f7f28dd97d142d20a6a9f22f70a8d81037f95c4 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Fri, 2 Sep 2016 16:28:21 +0100 Subject: [PATCH 46/71] generate goals only if they do not exist in the json file Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 7 +++++-- src/goto-instrument/cover.cpp | 27 ++++++++++++++++++++++++++- src/goto-instrument/cover.h | 2 ++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index d19e98f75a5..8c02cf4df52 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -952,9 +952,11 @@ bool cbmc_parse_optionst::process_goto_program( // add loop ids goto_functions.compute_loop_numbers(); - // instrument non-covered test goals + // check existing test goals if(cmdline.isset("existing-coverage")) { + status() << "Check existing coverage goals" << eom; + //get file with covered test goals const std::string coverage=cmdline.get_value("existing-coverage"); @@ -992,7 +994,8 @@ bool cbmc_parse_optionst::process_goto_program( itg++) { //get the line of each goal - const unsigned int line=std::stoi((*itg)["sourceLocation"]["line"].value); + const std::string line=(*itg)["sourceLocation"]["line"].value; + set_existing_goals(line); } } } diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index bb6e70d443e..45d845950cb 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -17,6 +17,8 @@ Date: May 2016 #include "cover.h" +std::vector existing_goals; + class basic_blockst { public: @@ -68,6 +70,23 @@ class basic_blockst /*******************************************************************\ +Function: set_existing_goals + + Inputs: + + Outputs: + + Purpose: + +\*******************************************************************/ + +void set_existing_goals(std::string goal) +{ + existing_goals.push_back(goal); +} + +/*******************************************************************\ + Function: as_string Inputs: @@ -1120,7 +1139,13 @@ void instrument_cover_goals( source_locationt source_location= basic_blocks.source_location_map[block_nr]; - if(!source_location.get_file().empty() && + //check whether the current goal already exists + std::vector::iterator it; + it = find (existing_goals.begin(), existing_goals.end(), + source_location.get_line().c_str()); + + if(it == existing_goals.end() && + !source_location.get_file().empty() && source_location.get_file()[0]!='<') { std::string comment="block "+b; diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index cf51972f6e6..56f8cb7122e 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -17,6 +17,8 @@ enum class coverage_criteriont { LOCATION, BRANCH, DECISION, CONDITION, PATH, MCDC, ASSERTION, COVER }; +void set_existing_goals(std::string goal); + void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, From 4496ee7a413115b081ce7eb9dd9d66b42c6fd41d Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 12:03:22 +0100 Subject: [PATCH 47/71] refactor the code for checking existing coverage Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 102 +++++++++++++++--------------- src/goto-instrument/cover.cpp | 45 +++++++++---- src/goto-instrument/cover.h | 18 ++++-- src/symex/symex_parse_options.cpp | 3 +- 4 files changed, 100 insertions(+), 68 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 8c02cf4df52..2e63d065786 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -952,55 +952,6 @@ bool cbmc_parse_optionst::process_goto_program( // add loop ids goto_functions.compute_loop_numbers(); - // check existing test goals - if(cmdline.isset("existing-coverage")) - { - status() << "Check existing coverage goals" << eom; - - //get file with covered test goals - const std::string coverage=cmdline.get_value("existing-coverage"); - - jsont json; - - //check coverage file - if(parse_json(coverage, get_message_handler(), json)) - { - messaget message(get_message_handler()); - message.error() << coverage << " file is not a valid json file" - << messaget::eom; - return true; - } - - //make sure that we have an array of elements - if(!json.is_array()) - { - messaget message(get_message_handler()); - message.error() << "expecting an array in the " << coverage << " file, but got " - << json << messaget::eom; - return true; - } - - for(jsont::arrayt::const_iterator - it=json.array.begin(); - it!=json.array.end(); - it++) - { - //get the goals array - if ((*it)["goals"].is_array()) - { - for(jsont::arrayt::const_iterator - itg=(*it)["goals"].array.begin(); - itg!=(*it)["goals"].array.end(); - itg++) - { - //get the line of each goal - const std::string line=(*itg)["sourceLocation"]["line"].value; - set_existing_goals(line); - } - } - } - } - // instrument cover goals if(cmdline.isset("cover")) @@ -1030,9 +981,58 @@ bool cbmc_parse_optionst::process_goto_program( error() << "unknown coverage criterion" << eom; return true; } - + + // check existing test goals + coverage_goals goals; + if(cmdline.isset("existing-coverage")) + { + status() << "Check existing coverage goals" << eom; + + //get file with covered test goals + const std::string coverage=cmdline.get_value("existing-coverage"); + + jsont json; + + //check coverage file + if(parse_json(coverage, get_message_handler(), json)) + { + messaget message(get_message_handler()); + message.error() << coverage << " file is not a valid json file" + << messaget::eom; + return true; + } + + //make sure that we have an array of elements + if(!json.is_array()) + { + messaget message(get_message_handler()); + message.error() << "expecting an array in the " << coverage << " file, but got " + << json << messaget::eom; + return true; + } + + for(jsont::arrayt::const_iterator + it=json.array.begin(); + it!=json.array.end(); + it++) + { + //get the goals array + if ((*it)["goals"].is_array()) + { + for(jsont::arrayt::const_iterator + itg=(*it)["goals"].array.begin(); + itg!=(*it)["goals"].array.end(); + itg++) + { + //get the line of each goal + const std::string line=(*itg)["sourceLocation"]["line"].value; + goals.set_goals(line); + } + } + } + } status() << "Instrumenting coverage goals" << eom; - instrument_cover_goals(symbol_table, goto_functions, c); + instrument_cover_goals(symbol_table, goto_functions, c, goals); goto_functions.update(); } diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 45d845950cb..04d3097531c 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -17,8 +17,6 @@ Date: May 2016 #include "cover.h" -std::vector existing_goals; - class basic_blockst { public: @@ -70,7 +68,7 @@ class basic_blockst /*******************************************************************\ -Function: set_existing_goals +Function: coverage_goals::set_goals Inputs: @@ -80,11 +78,35 @@ Function: set_existing_goals \*******************************************************************/ -void set_existing_goals(std::string goal) +void coverage_goals::set_goals(std::string goal) { existing_goals.push_back(goal); } +/*******************************************************************\ + +Function: coverage_goals::get_goals + + Inputs: + + Outputs: + + Purpose: + +\*******************************************************************/ + +const bool coverage_goals::get_goals(const char* goal) +{ + std::vector::iterator it; + it = find (existing_goals.begin(), existing_goals.end(), goal); + + if(it == existing_goals.end()) + return true; + else + return false; +} + + /*******************************************************************\ Function: as_string @@ -1077,7 +1099,8 @@ Function: instrument_cover_goals void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, - coverage_criteriont criterion) + coverage_criteriont criterion, + coverage_goals &goals) { const namespacet ns(symbol_table); basic_blockst basic_blocks(goto_program); @@ -1140,11 +1163,7 @@ void instrument_cover_goals( basic_blocks.source_location_map[block_nr]; //check whether the current goal already exists - std::vector::iterator it; - it = find (existing_goals.begin(), existing_goals.end(), - source_location.get_line().c_str()); - - if(it == existing_goals.end() && + if(goals.get_goals(source_location.get_line().c_str()) && !source_location.get_file().empty() && source_location.get_file()[0]!='<') { @@ -1379,7 +1398,8 @@ Function: instrument_cover_goals void instrument_cover_goals( const symbol_tablet &symbol_table, goto_functionst &goto_functions, - coverage_criteriont criterion) + coverage_criteriont criterion, + coverage_goals &goals) { Forall_goto_functions(f_it, goto_functions) { @@ -1387,6 +1407,7 @@ void instrument_cover_goals( f_it->first=="__CPROVER_initialize") continue; - instrument_cover_goals(symbol_table, f_it->second.body, criterion); + instrument_cover_goals(symbol_table, f_it->second.body, + criterion, goals); } } diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index 56f8cb7122e..3cd41f06bc0 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -13,20 +13,30 @@ Date: May 2016 #include +class coverage_goals +{ +public: + void set_goals(std::string goal); + const bool get_goals(const char* goal); + +private: + std::vector existing_goals; +}; + enum class coverage_criteriont { LOCATION, BRANCH, DECISION, CONDITION, PATH, MCDC, ASSERTION, COVER }; -void set_existing_goals(std::string goal); - void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, - coverage_criteriont); + coverage_criteriont, + coverage_goals &goals); void instrument_cover_goals( const symbol_tablet &symbol_table, goto_functionst &goto_functions, - coverage_criteriont); + coverage_criteriont, + coverage_goals &goals); #endif diff --git a/src/symex/symex_parse_options.cpp b/src/symex/symex_parse_options.cpp index 2fbee65e2ad..5ac7fb001d8 100644 --- a/src/symex/symex_parse_options.cpp +++ b/src/symex/symex_parse_options.cpp @@ -442,7 +442,8 @@ bool symex_parse_optionst::process_goto_program(const optionst &options) } status() << "Instrumenting coverge goals" << eom; - instrument_cover_goals(symbol_table, goto_model.goto_functions, c); + coverage_goals goals; + instrument_cover_goals(symbol_table, goto_model.goto_functions, c, goals); goto_model.goto_functions.update(); } From 1db39f4f33ad13855e45521d70dc44773317b5a2 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 12:04:37 +0100 Subject: [PATCH 48/71] add test cases to check existing coverage Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location2/main.c | 13 + regression/cbmc-cover/location2/main.json | 197 ++++++ regression/cbmc-cover/location2/test.desc | 8 + regression/cbmc-cover/location3/main.c | 13 + regression/cbmc-cover/location3/main.json | 187 ++++++ regression/cbmc-cover/location3/test.desc | 9 + regression/cbmc-cover/location4/main.c | 41 ++ regression/cbmc-cover/location4/main.json | 633 ++++++++++++++++++ .../cbmc-cover/location4/single-linked-list.c | 51 ++ .../cbmc-cover/location4/single-linked-list.h | 14 + regression/cbmc-cover/location4/test.desc | 8 + 11 files changed, 1174 insertions(+) create mode 100644 regression/cbmc-cover/location2/main.c create mode 100644 regression/cbmc-cover/location2/main.json create mode 100644 regression/cbmc-cover/location2/test.desc create mode 100644 regression/cbmc-cover/location3/main.c create mode 100644 regression/cbmc-cover/location3/main.json create mode 100644 regression/cbmc-cover/location3/test.desc create mode 100644 regression/cbmc-cover/location4/main.c create mode 100644 regression/cbmc-cover/location4/main.json create mode 100644 regression/cbmc-cover/location4/single-linked-list.c create mode 100644 regression/cbmc-cover/location4/single-linked-list.h create mode 100644 regression/cbmc-cover/location4/test.desc diff --git a/regression/cbmc-cover/location2/main.c b/regression/cbmc-cover/location2/main.c new file mode 100644 index 00000000000..9a0b65d37f6 --- /dev/null +++ b/regression/cbmc-cover/location2/main.c @@ -0,0 +1,13 @@ +int main() +{ + int i, j; + + i = 1; + + if(j > 0) + j += i; + else + j = 0; + + assert(i != j); +} diff --git a/regression/cbmc-cover/location2/main.json b/regression/cbmc-cover/location2/main.json new file mode 100644 index 00000000000..57c35d49321 --- /dev/null +++ b/regression/cbmc-cover/location2/main.json @@ -0,0 +1,197 @@ +[ +{ + "program": "CBMC 5.5" +}, +{ + "messageText": "CBMC version 5.5 64-bit x86_64 linux", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Parsing main.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Converting", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking main", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "function `assert' is not declared", + "messageType": "WARNING" +}, +{ + "messageText": "Generating GOTO Program", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Adding CPROVER library (x86_64)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Removal of function pointers and virtual functions", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Partial Inlining", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generic Property Instrumentation", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Instrumenting coverage goals", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Starting Bounded Model Checking", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "size of program expression: 45 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 4 VCC(s), 4 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 4 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "265 variables, 522 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "265 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.001s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "main.coverage.1", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "3" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "main.coverage.2", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "main.coverage.3", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "main.coverage.4", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "12" + }, + "status": "satisfied" + } + ], + "goalsCovered": 4, + "tests": [ + { + "coveredGoals": [ "main.coverage.1", "main.coverage.3", "main.coverage.4" ], + "inputs": [ ] + }, + { + "coveredGoals": [ "main.coverage.2" ], + "inputs": [ ] + } + ], + "totalGoals": 4 +}, +{ + "messageText": "** 4 of 4 covered (100.0%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 2 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location2/test.desc b/regression/cbmc-cover/location2/test.desc new file mode 100644 index 00000000000..010956452e1 --- /dev/null +++ b/regression/cbmc-cover/location2/test.desc @@ -0,0 +1,8 @@ +CORE +main.c +--cover location --existing-coverage main.json +^EXIT=0$ +^SIGNAL=0$ +^\*\* 0 of 0 covered (100.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location3/main.c b/regression/cbmc-cover/location3/main.c new file mode 100644 index 00000000000..9a0b65d37f6 --- /dev/null +++ b/regression/cbmc-cover/location3/main.c @@ -0,0 +1,13 @@ +int main() +{ + int i, j; + + i = 1; + + if(j > 0) + j += i; + else + j = 0; + + assert(i != j); +} diff --git a/regression/cbmc-cover/location3/main.json b/regression/cbmc-cover/location3/main.json new file mode 100644 index 00000000000..f0721a496e7 --- /dev/null +++ b/regression/cbmc-cover/location3/main.json @@ -0,0 +1,187 @@ +[ +{ + "program": "CBMC 5.5" +}, +{ + "messageText": "CBMC version 5.5 64-bit x86_64 linux", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Parsing main.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Converting", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking main", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "function `assert' is not declared", + "messageType": "WARNING" +}, +{ + "messageText": "Generating GOTO Program", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Adding CPROVER library (x86_64)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Removal of function pointers and virtual functions", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Partial Inlining", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generic Property Instrumentation", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Instrumenting coverage goals", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Starting Bounded Model Checking", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "size of program expression: 45 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 4 VCC(s), 4 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 4 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "265 variables, 522 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "265 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.001s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "main.coverage.1", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "3" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "main.coverage.2", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "main.coverage.4", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "12" + }, + "status": "satisfied" + } + ], + "goalsCovered": 4, + "tests": [ + { + "coveredGoals": [ "main.coverage.1", "main.coverage.3", "main.coverage.4" ], + "inputs": [ ] + }, + { + "coveredGoals": [ "main.coverage.2" ], + "inputs": [ ] + } + ], + "totalGoals": 4 +}, +{ + "messageText": "** 4 of 4 covered (100.0%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 2 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location3/test.desc b/regression/cbmc-cover/location3/test.desc new file mode 100644 index 00000000000..a621fc0f941 --- /dev/null +++ b/regression/cbmc-cover/location3/test.desc @@ -0,0 +1,9 @@ +CORE +main.c +--cover location --existing-coverage main.json +^EXIT=0$ +^SIGNAL=0$ +^\[main.coverage.1\] file main.c line 10 function main block 3: SATISFIED$ +^\*\* 1 of 1 covered (100.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location4/main.c b/regression/cbmc-cover/location4/main.c new file mode 100644 index 00000000000..ca92d1abc09 --- /dev/null +++ b/regression/cbmc-cover/location4/main.c @@ -0,0 +1,41 @@ +#include +#include +#include "single-linked-list.h" + +int main(void) +{ + + int i; + mlist *mylist, *temp; + + insert_list(mylist,2); + insert_list(mylist,5); + insert_list(mylist,1); + insert_list(mylist,3); + + mylist = head; + + printf("list all elements: "); + while(mylist) + { + printf("%d ", mylist->key); + mylist = mylist->next; + } + printf("\n"); + + temp = search_list(mylist,2); + printf("search for element 2: %s\n", temp->key == 2 ? "found" : "not found"); + assert(temp->key == 2); + + delete_list(temp); + + mylist = head; + + printf("list all elements except 2: "); + while(mylist) + { + printf("%d ", mylist->key); + mylist = mylist->next; + } + printf("\n"); +} diff --git a/regression/cbmc-cover/location4/main.json b/regression/cbmc-cover/location4/main.json new file mode 100644 index 00000000000..114e0638022 --- /dev/null +++ b/regression/cbmc-cover/location4/main.json @@ -0,0 +1,633 @@ +[ +{ + "program": "CBMC 5.5" +}, +{ + "messageText": "CBMC version 5.5 64-bit x86_64 linux", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Parsing main.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Parsing single-linked-list.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Converting", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking main", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking single-linked-list", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generating GOTO Program", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Adding CPROVER library (x86_64)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Removal of function pointers and virtual functions", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Partial Inlining", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generic Property Instrumentation", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Instrumenting coverage goals", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Starting Bounded Model Checking", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop main.0 iteration 1 (2 max) file main.c line 19 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop main.0 iteration 2 (2 max) file main.c line 19 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop search_list.0 iteration 1 (2 max) file single-linked-list.c line 10 function search_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop search_list.0 iteration 2 (2 max) file single-linked-list.c line 10 function search_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop delete_list.0 iteration 1 (2 max) file single-linked-list.c line 23 function delete_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop delete_list.0 iteration 2 (2 max) file single-linked-list.c line 23 function delete_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop main.1 iteration 1 (2 max) file main.c line 35 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop main.1 iteration 2 (2 max) file main.c line 35 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "size of program expression: 358 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 57 VCC(s), 57 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 40 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "3368 variables, 1698 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "3368 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.007s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "free called for new[] object", + "goal": "", + "sourceLocation": { + "file": "", + "function": "free", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "main.coverage.1", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "main.coverage.2", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "12" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "main.coverage.3", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "13" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "main.coverage.4", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "14" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "main.coverage.5", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "16" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "main.coverage.6", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "19" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "main.coverage.7", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "main.coverage.8", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "main.coverage.9", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "main.coverage.10", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 11", + "goal": "main.coverage.11", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "32" + }, + "status": "failed" + }, + { + "description": "block 12", + "goal": "main.coverage.12", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "35" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "main.coverage.13", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "37" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "main.coverage.14", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "40" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "search_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "9" + }, + "status": "failed" + }, + { + "description": "block 2", + "goal": "search_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 3", + "goal": "search_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 4", + "goal": "search_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 5", + "goal": "search_list.coverage.5", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 6", + "goal": "search_list.coverage.6", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 7", + "goal": "search_list.coverage.7", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "15" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "delete_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "19" + }, + "status": "failed" + }, + { + "description": "block 2", + "goal": "delete_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 3", + "goal": "delete_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 4", + "goal": "delete_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 5", + "goal": "delete_list.coverage.5", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "29" + }, + "status": "failed" + }, + { + "description": "block 6", + "goal": "delete_list.coverage.6", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 7", + "goal": "delete_list.coverage.7", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 8", + "goal": "delete_list.coverage.8", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "delete_list.coverage.9", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "delete_list.coverage.10", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 11", + "goal": "delete_list.coverage.11", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 12", + "goal": "delete_list.coverage.12", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "delete_list.coverage.13", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "delete_list.coverage.14", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "insert_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "37" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "insert_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "40" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "insert_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "45" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "insert_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "48" + }, + "status": "satisfied" + } + ], + "goalsCovered": 11, + "tests": [ + { + "coveredGoals": [ "main.coverage.1", "main.coverage.2", "main.coverage.3", "main.coverage.4", "main.coverage.5", "main.coverage.6", "main.coverage.7", "insert_list.coverage.1", "insert_list.coverage.2", "insert_list.coverage.3", "insert_list.coverage.4" ], + "inputs": [ ] + } + ], + "totalGoals": 40 +}, +{ + "messageText": "** 11 of 40 covered (27.5%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 2 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location4/single-linked-list.c b/regression/cbmc-cover/location4/single-linked-list.c new file mode 100644 index 00000000000..30fe7a0ced0 --- /dev/null +++ b/regression/cbmc-cover/location4/single-linked-list.c @@ -0,0 +1,51 @@ +#include +#include +#include + +#include "single-linked-list.h" + +mlist* search_list(mlist *l, int k) +{ + l = head; + while(l!=NULL && l->key!=k) + { + l = l->next; + } + return l; +} + +int delete_list(mlist *l) +{ + mlist *tmp; + tmp = head; + if (head != l) + { + while(tmp->next!=l) + tmp = tmp->next; + tmp->next = l->next; + } + else + { + head = l->next; + } + free(l); + return 0; +} + +int insert_list(mlist *l, int k) +{ + l = (mlist*)malloc(sizeof(mlist)); + if (head==NULL) + { + l->key = k; + l->next = NULL; + } + else + { + l->key = k; + l->next = head; + } + head = l; + return 0; +} + diff --git a/regression/cbmc-cover/location4/single-linked-list.h b/regression/cbmc-cover/location4/single-linked-list.h new file mode 100644 index 00000000000..4d274a6a1e2 --- /dev/null +++ b/regression/cbmc-cover/location4/single-linked-list.h @@ -0,0 +1,14 @@ +#ifndef SINGLE_LINKED_LIST_H_ +#define SINGLE_LINKED_LIST_H_ + +typedef struct list { + int key; + struct list *next; +} mlist; + +mlist *head; +mlist* search_list(mlist *l, int k); +int delete_list(mlist *l); +int insert_list(mlist *l, int k); + +#endif /* SINGLE_LINKED_LIST_H_ */ diff --git a/regression/cbmc-cover/location4/test.desc b/regression/cbmc-cover/location4/test.desc new file mode 100644 index 00000000000..d9eaa8195c0 --- /dev/null +++ b/regression/cbmc-cover/location4/test.desc @@ -0,0 +1,8 @@ +CORE +main.c +single-linked-list.c --cover location --existing-coverage main.json --unwind 2 +^EXIT=0$ +^SIGNAL=0$ +^\*\* 0 of 1 covered (0.0%) +-- +^warning: ignoring From 8bd413af22028a2b7b9d38163e253c9f9cbf6563 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 13:14:51 +0100 Subject: [PATCH 49/71] add more test cases to check existing coverage Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location5/main.c | 41 ++ regression/cbmc-cover/location5/main.json | 623 ++++++++++++++++++ .../cbmc-cover/location5/single-linked-list.c | 51 ++ .../cbmc-cover/location5/single-linked-list.h | 14 + regression/cbmc-cover/location5/test.desc | 9 + .../cbmc-cover/location6/if_expr1.class | Bin 0 -> 758 bytes regression/cbmc-cover/location6/if_expr1.java | 12 + regression/cbmc-cover/location6/if_expr1.json | 485 ++++++++++++++ regression/cbmc-cover/location6/test.desc | 8 + src/goto-instrument/cover.cpp | 2 +- src/goto-instrument/cover.h | 2 +- 11 files changed, 1245 insertions(+), 2 deletions(-) create mode 100644 regression/cbmc-cover/location5/main.c create mode 100644 regression/cbmc-cover/location5/main.json create mode 100644 regression/cbmc-cover/location5/single-linked-list.c create mode 100644 regression/cbmc-cover/location5/single-linked-list.h create mode 100644 regression/cbmc-cover/location5/test.desc create mode 100644 regression/cbmc-cover/location6/if_expr1.class create mode 100644 regression/cbmc-cover/location6/if_expr1.java create mode 100644 regression/cbmc-cover/location6/if_expr1.json create mode 100644 regression/cbmc-cover/location6/test.desc diff --git a/regression/cbmc-cover/location5/main.c b/regression/cbmc-cover/location5/main.c new file mode 100644 index 00000000000..ca92d1abc09 --- /dev/null +++ b/regression/cbmc-cover/location5/main.c @@ -0,0 +1,41 @@ +#include +#include +#include "single-linked-list.h" + +int main(void) +{ + + int i; + mlist *mylist, *temp; + + insert_list(mylist,2); + insert_list(mylist,5); + insert_list(mylist,1); + insert_list(mylist,3); + + mylist = head; + + printf("list all elements: "); + while(mylist) + { + printf("%d ", mylist->key); + mylist = mylist->next; + } + printf("\n"); + + temp = search_list(mylist,2); + printf("search for element 2: %s\n", temp->key == 2 ? "found" : "not found"); + assert(temp->key == 2); + + delete_list(temp); + + mylist = head; + + printf("list all elements except 2: "); + while(mylist) + { + printf("%d ", mylist->key); + mylist = mylist->next; + } + printf("\n"); +} diff --git a/regression/cbmc-cover/location5/main.json b/regression/cbmc-cover/location5/main.json new file mode 100644 index 00000000000..486ba8033d4 --- /dev/null +++ b/regression/cbmc-cover/location5/main.json @@ -0,0 +1,623 @@ +[ +{ + "program": "CBMC 5.5" +}, +{ + "messageText": "CBMC version 5.5 64-bit x86_64 linux", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Parsing main.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Parsing single-linked-list.c", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Converting", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking main", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Type-checking single-linked-list", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generating GOTO Program", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Adding CPROVER library (x86_64)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", + "messageType": "WARNING" +}, +{ + "messageText": ": note: this is the location of the previous definition", + "messageType": "WARNING" +}, +{ + "messageText": "Removal of function pointers and virtual functions", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Partial Inlining", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generic Property Instrumentation", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Instrumenting coverage goals", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Starting Bounded Model Checking", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop main.0 iteration 1 (2 max) file main.c line 19 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop main.0 iteration 2 (2 max) file main.c line 19 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop search_list.0 iteration 1 (2 max) file single-linked-list.c line 10 function search_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop search_list.0 iteration 2 (2 max) file single-linked-list.c line 10 function search_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop delete_list.0 iteration 1 (2 max) file single-linked-list.c line 23 function delete_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop delete_list.0 iteration 2 (2 max) file single-linked-list.c line 23 function delete_list thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Unwinding loop main.1 iteration 1 (2 max) file main.c line 35 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Not unwinding loop main.1 iteration 2 (2 max) file main.c line 35 function main thread 0", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "size of program expression: 358 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 57 VCC(s), 57 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 40 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "3368 variables, 1698 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "3368 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.007s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "free called for new[] object", + "goal": "", + "sourceLocation": { + "file": "", + "function": "free", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "main.coverage.1", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "main.coverage.2", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "12" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "main.coverage.3", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "13" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "main.coverage.5", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "16" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "main.coverage.6", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "19" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "main.coverage.7", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "main.coverage.8", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "main.coverage.9", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "main.coverage.10", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 11", + "goal": "main.coverage.11", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "32" + }, + "status": "failed" + }, + { + "description": "block 12", + "goal": "main.coverage.12", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "35" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "main.coverage.13", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "37" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "main.coverage.14", + "sourceLocation": { + "file": "main.c", + "function": "main", + "line": "40" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "search_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "9" + }, + "status": "failed" + }, + { + "description": "block 2", + "goal": "search_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 3", + "goal": "search_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 4", + "goal": "search_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 5", + "goal": "search_list.coverage.5", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 6", + "goal": "search_list.coverage.6", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 7", + "goal": "search_list.coverage.7", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "search_list", + "line": "15" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "delete_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "19" + }, + "status": "failed" + }, + { + "description": "block 2", + "goal": "delete_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 3", + "goal": "delete_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 4", + "goal": "delete_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 5", + "goal": "delete_list.coverage.5", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "29" + }, + "status": "failed" + }, + { + "description": "block 6", + "goal": "delete_list.coverage.6", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 7", + "goal": "delete_list.coverage.7", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 8", + "goal": "delete_list.coverage.8", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "delete_list.coverage.9", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "delete_list.coverage.10", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 11", + "goal": "delete_list.coverage.11", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 12", + "goal": "delete_list.coverage.12", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "delete_list.coverage.13", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "delete_list.coverage.14", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "delete_list", + "line": "31" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "insert_list.coverage.1", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "37" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "insert_list.coverage.2", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "40" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "insert_list.coverage.3", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "45" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "insert_list.coverage.4", + "sourceLocation": { + "file": "single-linked-list.c", + "function": "insert_list", + "line": "48" + }, + "status": "satisfied" + } + ], + "goalsCovered": 11, + "tests": [ + { + "coveredGoals": [ "main.coverage.1", "main.coverage.2", "main.coverage.3", "main.coverage.4", "main.coverage.5", "main.coverage.6", "main.coverage.7", "insert_list.coverage.1", "insert_list.coverage.2", "insert_list.coverage.3", "insert_list.coverage.4" ], + "inputs": [ ] + } + ], + "totalGoals": 40 +}, +{ + "messageText": "** 11 of 40 covered (27.5%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 2 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location5/single-linked-list.c b/regression/cbmc-cover/location5/single-linked-list.c new file mode 100644 index 00000000000..30fe7a0ced0 --- /dev/null +++ b/regression/cbmc-cover/location5/single-linked-list.c @@ -0,0 +1,51 @@ +#include +#include +#include + +#include "single-linked-list.h" + +mlist* search_list(mlist *l, int k) +{ + l = head; + while(l!=NULL && l->key!=k) + { + l = l->next; + } + return l; +} + +int delete_list(mlist *l) +{ + mlist *tmp; + tmp = head; + if (head != l) + { + while(tmp->next!=l) + tmp = tmp->next; + tmp->next = l->next; + } + else + { + head = l->next; + } + free(l); + return 0; +} + +int insert_list(mlist *l, int k) +{ + l = (mlist*)malloc(sizeof(mlist)); + if (head==NULL) + { + l->key = k; + l->next = NULL; + } + else + { + l->key = k; + l->next = head; + } + head = l; + return 0; +} + diff --git a/regression/cbmc-cover/location5/single-linked-list.h b/regression/cbmc-cover/location5/single-linked-list.h new file mode 100644 index 00000000000..4d274a6a1e2 --- /dev/null +++ b/regression/cbmc-cover/location5/single-linked-list.h @@ -0,0 +1,14 @@ +#ifndef SINGLE_LINKED_LIST_H_ +#define SINGLE_LINKED_LIST_H_ + +typedef struct list { + int key; + struct list *next; +} mlist; + +mlist *head; +mlist* search_list(mlist *l, int k); +int delete_list(mlist *l); +int insert_list(mlist *l, int k); + +#endif /* SINGLE_LINKED_LIST_H_ */ diff --git a/regression/cbmc-cover/location5/test.desc b/regression/cbmc-cover/location5/test.desc new file mode 100644 index 00000000000..16c53355a24 --- /dev/null +++ b/regression/cbmc-cover/location5/test.desc @@ -0,0 +1,9 @@ +CORE +main.c +single-linked-list.c --cover location --existing-coverage main.json --unwind 2 +^EXIT=0$ +^SIGNAL=0$ +^\[main.coverage.1\] file main.c line 14 function main block 4: SATISFIED$ +^\*\* 1 of 2 covered (50.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location6/if_expr1.class b/regression/cbmc-cover/location6/if_expr1.class new file mode 100644 index 0000000000000000000000000000000000000000..80db60b2bb12be71e852c51b64c3619a4a3ef71f GIT binary patch literal 758 zcmY*WO-~b16g_V`)7P0!b=q2}Z4pt>f**|uJF1ZsOh^zGH74M~Os7xsu$^gUrUuvk z3pTi8Ehdm?qI-W6G2S=QjxOHUz31L@&w0OofBOMo6^|^KsG7KmnuR(VCOGCeZdou; z<(Ri{8w(tF7|M%o6p1jFfgf$i$n6b8pMmW&WZTl0@iT@@bNMxc-U<4G;rh1p#m;!x z6X7cbro_;dKEq7&&Gw=D!EFs(|De^4L+Kx^slq}xcD?s6-O&}^+C1{aC?Vvy%aCh( zgDWPh8;nCwypXDILB4w{jz-~=$EvLj8wHL<8%wyyaoJM2W4lOVn5y vWeVvu+zo:()V", + "messageType": "WARNING" +}, +{ + "messageText": "size of program expression: 110 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 19 VCC(s), 19 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 20 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 2976 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 10", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 11", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 14", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 39 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 22 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 2 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.014s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "coverage.1", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.2", + "sourceLocation": { + "file": "if_expr1.java", + "line": "5" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.3", + "sourceLocation": { + "file": "if_expr1.java", + "line": "5" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.4", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.5", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.6", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "coverage.7", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "coverage.8", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "coverage.9", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "coverage.10", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "coverage.11", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 11", + "goal": "coverage.12", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 12", + "goal": "coverage.13", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "coverage.14", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "coverage.15", + "sourceLocation": { + "file": "if_expr1.java", + "line": "11" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.16", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.17", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.18", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.19", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.20", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + } + ], + "goalsCovered": 15, + "tests": [ + { + "coveredGoals": [ "coverage.2", "coverage.3", "coverage.5", "coverage.6", "coverage.11", "coverage.12", "coverage.15", "coverage.16", "coverage.17", "coverage.19", "coverage.20" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.18" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.4", "coverage.7" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.8" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + } + ], + "totalGoals": 20 +}, +{ + "messageText": "** 15 of 20 covered (75.0%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 5 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location6/test.desc b/regression/cbmc-cover/location6/test.desc new file mode 100644 index 00000000000..f9fe6010e6b --- /dev/null +++ b/regression/cbmc-cover/location6/test.desc @@ -0,0 +1,8 @@ +CORE +if_expr1.class +--cover location --existing-coverage if_expr1.json +^EXIT=0$ +^SIGNAL=0$ +^\*\* 0 of 0 covered (100.0%) +-- +^warning: ignoring diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 04d3097531c..acfcdf06ae0 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -95,7 +95,7 @@ Function: coverage_goals::get_goals \*******************************************************************/ -const bool coverage_goals::get_goals(const char* goal) +bool coverage_goals::get_goals(const char* goal) { std::vector::iterator it; it = find (existing_goals.begin(), existing_goals.end(), goal); diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index 3cd41f06bc0..f00659de1b8 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -17,7 +17,7 @@ class coverage_goals { public: void set_goals(std::string goal); - const bool get_goals(const char* goal); + bool get_goals(const char* goal); private: std::vector existing_goals; From c4dbf20d8d79b1dd0d7174c14676dbe5966bdadd Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 13:58:51 +0100 Subject: [PATCH 50/71] add more test cases to check existing coverage Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location6/if_expr1.json | 2 +- regression/cbmc-cover/location6/test.desc | 2 +- .../cbmc-cover/location7/if_expr1.class | Bin 0 -> 758 bytes regression/cbmc-cover/location7/if_expr1.java | 12 + regression/cbmc-cover/location7/if_expr1.json | 476 ++++++++++ regression/cbmc-cover/location7/test.desc | 9 + regression/cbmc-cover/location8/A.class | Bin 0 -> 183 bytes regression/cbmc-cover/location8/B.class | Bin 0 -> 183 bytes .../cbmc-cover/location8/if_acmp1.class | Bin 0 -> 1044 bytes regression/cbmc-cover/location8/if_acmp1.java | 36 + regression/cbmc-cover/location8/if_acmp1.json | 882 ++++++++++++++++++ regression/cbmc-cover/location8/test.desc | 8 + regression/cbmc-cover/location9/A.class | Bin 0 -> 183 bytes regression/cbmc-cover/location9/B.class | Bin 0 -> 183 bytes .../cbmc-cover/location9/if_acmp1.class | Bin 0 -> 1044 bytes regression/cbmc-cover/location9/if_acmp1.java | 36 + regression/cbmc-cover/location9/if_acmp1.json | 855 +++++++++++++++++ regression/cbmc-cover/location9/test.desc | 11 + src/cbmc/cbmc_parse_options.cpp | 2 +- 19 files changed, 2328 insertions(+), 3 deletions(-) create mode 100644 regression/cbmc-cover/location7/if_expr1.class create mode 100644 regression/cbmc-cover/location7/if_expr1.java create mode 100644 regression/cbmc-cover/location7/if_expr1.json create mode 100644 regression/cbmc-cover/location7/test.desc create mode 100644 regression/cbmc-cover/location8/A.class create mode 100644 regression/cbmc-cover/location8/B.class create mode 100644 regression/cbmc-cover/location8/if_acmp1.class create mode 100644 regression/cbmc-cover/location8/if_acmp1.java create mode 100644 regression/cbmc-cover/location8/if_acmp1.json create mode 100644 regression/cbmc-cover/location8/test.desc create mode 100644 regression/cbmc-cover/location9/A.class create mode 100644 regression/cbmc-cover/location9/B.class create mode 100644 regression/cbmc-cover/location9/if_acmp1.class create mode 100644 regression/cbmc-cover/location9/if_acmp1.java create mode 100644 regression/cbmc-cover/location9/if_acmp1.json create mode 100644 regression/cbmc-cover/location9/test.desc diff --git a/regression/cbmc-cover/location6/if_expr1.json b/regression/cbmc-cover/location6/if_expr1.json index 41521afe690..9415f24f359 100644 --- a/regression/cbmc-cover/location6/if_expr1.json +++ b/regression/cbmc-cover/location6/if_expr1.json @@ -235,7 +235,7 @@ "messageType": "STATUS-MESSAGE" }, { - "messageText": "Runtime decision procedure: 0.014s", + "messageText": "Runtime decision procedure: 0.011s", "messageType": "STATUS-MESSAGE" }, { diff --git a/regression/cbmc-cover/location6/test.desc b/regression/cbmc-cover/location6/test.desc index f9fe6010e6b..b47c983d68a 100644 --- a/regression/cbmc-cover/location6/test.desc +++ b/regression/cbmc-cover/location6/test.desc @@ -3,6 +3,6 @@ if_expr1.class --cover location --existing-coverage if_expr1.json ^EXIT=0$ ^SIGNAL=0$ -^\*\* 0 of 0 covered (100.0%) +^\*\* 0 of 0 covered (100.0%)$ -- ^warning: ignoring diff --git a/regression/cbmc-cover/location7/if_expr1.class b/regression/cbmc-cover/location7/if_expr1.class new file mode 100644 index 0000000000000000000000000000000000000000..80db60b2bb12be71e852c51b64c3619a4a3ef71f GIT binary patch literal 758 zcmY*WO-~b16g_V`)7P0!b=q2}Z4pt>f**|uJF1ZsOh^zGH74M~Os7xsu$^gUrUuvk z3pTi8Ehdm?qI-W6G2S=QjxOHUz31L@&w0OofBOMo6^|^KsG7KmnuR(VCOGCeZdou; z<(Ri{8w(tF7|M%o6p1jFfgf$i$n6b8pMmW&WZTl0@iT@@bNMxc-U<4G;rh1p#m;!x z6X7cbro_;dKEq7&&Gw=D!EFs(|De^4L+Kx^slq}xcD?s6-O&}^+C1{aC?Vvy%aCh( zgDWPh8;nCwypXDILB4w{jz-~=$EvLj8wHL<8%wyyaoJM2W4lOVn5y vWeVvu+zo:()V", + "messageType": "WARNING" +}, +{ + "messageText": "size of program expression: 110 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 19 VCC(s), 19 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 20 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 2976 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 10", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 11", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 14", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 39 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 22 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 2 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1418 variables, 0 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.011s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "coverage.1", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.2", + "sourceLocation": { + "file": "if_expr1.java", + "line": "5" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.3", + "sourceLocation": { + "file": "if_expr1.java", + "line": "5" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.4", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.5", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.6", + "sourceLocation": { + "file": "if_expr1.java", + "line": "6" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "coverage.7", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "coverage.8", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "coverage.9", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "coverage.10", + "sourceLocation": { + "file": "if_expr1.java", + "line": "8" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "coverage.11", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 11", + "goal": "coverage.12", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 12", + "goal": "coverage.13", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "coverage.14", + "sourceLocation": { + "file": "if_expr1.java", + "line": "10" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.16", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.17", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.18", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.19", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.20", + "sourceLocation": { + "file": "if_expr1.java", + "line": "1" + }, + "status": "satisfied" + } + ], + "goalsCovered": 15, + "tests": [ + { + "coveredGoals": [ "coverage.2", "coverage.3", "coverage.5", "coverage.6", "coverage.11", "coverage.12", "coverage.15", "coverage.16", "coverage.17", "coverage.19", "coverage.20" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.18" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.4", "coverage.7" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.8" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + } + ], + "totalGoals": 20 +}, +{ + "messageText": "** 15 of 20 covered (75.0%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 5 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location7/test.desc b/regression/cbmc-cover/location7/test.desc new file mode 100644 index 00000000000..ea38fff1940 --- /dev/null +++ b/regression/cbmc-cover/location7/test.desc @@ -0,0 +1,9 @@ +CORE +if_expr1.class +--cover location --existing-coverage if_expr1.json +^EXIT=0$ +^SIGNAL=0$ +^\[coverage.1\] file if_expr1.java line 11 block 14: SATISFIED$ +^\*\* 1 of 1 covered (100.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location8/A.class b/regression/cbmc-cover/location8/A.class new file mode 100644 index 0000000000000000000000000000000000000000..6ee0b76170fb10d3eb70f55956456784e60b583d GIT binary patch literal 183 zcmX^0Z`VEs1_l!bUM>b^1}=66ZgvJ9Mg}&U%)HDJJ4Oa(4b3n{1{UZ1lvG9rexJ;| zRKL>Pq|~C2#H1Xc2v=}^X;E^jTPBFZo0%4$n4DW+sF#&kmdL}v!obSN!05=xAOPa) z=OpH(>-#5Vr6!j!C@?Sqtpfo@AOb^1}=66ZgvJ9Mg}&U%)HDJJ4Oa(4b3n{1{UZ1lvG9rexJ;| zRKL>Pq|~C2#H1Xc2v=}^X;E^jTPBFZo0%4$n4DW+sF#&kmdL}v!obSN!05!tAOPa) z=OpH(>-#5Vr6!j!C@?Sqtpfo@AOag1pQ2s^Gp zLMjLi6C9HoI8qw@OmSS$FpY~GX@>Ze)o9qR=hSPB8&1R8s@P=)w!xq*I5o$+#?Y6Z zS!a-z>t&lEQgmweYO}g!yZ1yegS>5fn@eQVGsUHO3anaAjbR}Dptxf_wq`3Hbe=a?a;MA~PgE|e;*uG(6?>6YwUj_46~9&TEt>h9%BqNI)p zqC}FKvPB(XoMT9Kdo8vHy6L)gS4SKP2DM#*BcmgW97D95a%XGDE_tNJe>l_3-N5Av z$wkAJ?S|vpwA#QJsjSmVSTrff(Mh70ID;WZrxCJ@teiOjdrb!hgT9In za!Mw~bQYo0v`P`G9U^f50DZSJuR8H!&E$cK5Q6B(z)23v:()V", + "messageType": "WARNING" +}, +{ + "messageText": "size of program expression: 223 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 42 VCC(s), 42 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 61 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 191 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 10", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 14", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 18", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 22", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 26", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 30", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 34", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 38", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 42", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 46", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 47", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 51", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 25 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 11", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 15", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 19", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 23", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 27", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 31", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 35", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 39", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 43", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 48", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 25 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.011s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "coverage.1", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "4" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.2", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.3", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.4", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.5", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.6", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "15" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.7", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "15" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.8", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "16" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.9", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "17" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.10", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "18" + }, + "status": "satisfied" + }, + { + "description": "block 6", + "goal": "coverage.11", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "19" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "coverage.12", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "coverage.13", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "coverage.14", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "coverage.15", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 11", + "goal": "coverage.16", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 12", + "goal": "coverage.17", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "coverage.18", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "coverage.19", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "satisfied" + }, + { + "description": "block 15", + "goal": "coverage.20", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "satisfied" + }, + { + "description": "block 16", + "goal": "coverage.21", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 17", + "goal": "coverage.22", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 18", + "goal": "coverage.23", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "satisfied" + }, + { + "description": "block 19", + "goal": "coverage.24", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "satisfied" + }, + { + "description": "block 20", + "goal": "coverage.25", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 21", + "goal": "coverage.26", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 22", + "goal": "coverage.27", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "satisfied" + }, + { + "description": "block 23", + "goal": "coverage.28", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "satisfied" + }, + { + "description": "block 24", + "goal": "coverage.29", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 25", + "goal": "coverage.30", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 26", + "goal": "coverage.31", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "satisfied" + }, + { + "description": "block 27", + "goal": "coverage.32", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "satisfied" + }, + { + "description": "block 28", + "goal": "coverage.33", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 29", + "goal": "coverage.34", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 30", + "goal": "coverage.35", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "satisfied" + }, + { + "description": "block 31", + "goal": "coverage.36", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "satisfied" + }, + { + "description": "block 32", + "goal": "coverage.37", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 33", + "goal": "coverage.38", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 34", + "goal": "coverage.39", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "satisfied" + }, + { + "description": "block 35", + "goal": "coverage.40", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "satisfied" + }, + { + "description": "block 36", + "goal": "coverage.41", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "failed" + }, + { + "description": "block 37", + "goal": "coverage.42", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "failed" + }, + { + "description": "block 38", + "goal": "coverage.43", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "satisfied" + }, + { + "description": "block 39", + "goal": "coverage.44", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "satisfied" + }, + { + "description": "block 40", + "goal": "coverage.45", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "failed" + }, + { + "description": "block 41", + "goal": "coverage.46", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "failed" + }, + { + "description": "block 42", + "goal": "coverage.47", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "29" + }, + "status": "satisfied" + }, + { + "description": "block 43", + "goal": "coverage.48", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "satisfied" + }, + { + "description": "block 44", + "goal": "coverage.49", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 45", + "goal": "coverage.50", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 46", + "goal": "coverage.51", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "31" + }, + "status": "satisfied" + }, + { + "description": "block 47", + "goal": "coverage.52", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "31" + }, + "status": "satisfied" + }, + { + "description": "block 48", + "goal": "coverage.53", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "satisfied" + }, + { + "description": "block 49", + "goal": "coverage.54", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "failed" + }, + { + "description": "block 50", + "goal": "coverage.55", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "failed" + }, + { + "description": "block 51", + "goal": "coverage.56", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "35" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.57", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.58", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.59", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.60", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.61", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + } + ], + "goalsCovered": 38, + "tests": [ + { + "coveredGoals": [ "coverage.1", "coverage.2", "coverage.3", "coverage.4", "coverage.6", "coverage.7", "coverage.8", "coverage.9", "coverage.10", "coverage.11", "coverage.15", "coverage.19", "coverage.23", "coverage.27", "coverage.31", "coverage.35", "coverage.39", "coverage.43", "coverage.47", "coverage.51", "coverage.52", "coverage.56", "coverage.57", "coverage.58", "coverage.59", "coverage.61" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.12", "coverage.16", "coverage.20", "coverage.24", "coverage.28", "coverage.32", "coverage.36", "coverage.40", "coverage.44", "coverage.48", "coverage.53", "coverage.60" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + } + ], + "totalGoals": 61 +}, +{ + "messageText": "** 38 of 61 covered (62.3%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 3 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location8/test.desc b/regression/cbmc-cover/location8/test.desc new file mode 100644 index 00000000000..bb29eb24d60 --- /dev/null +++ b/regression/cbmc-cover/location8/test.desc @@ -0,0 +1,8 @@ +CORE +if_acmp1.class +--cover location --existing-coverage if_acmp1.json +^EXIT=0$ +^SIGNAL=0$ +^\*\* 0 of 0 covered (100.0%) +-- +^warning: ignoring diff --git a/regression/cbmc-cover/location9/A.class b/regression/cbmc-cover/location9/A.class new file mode 100644 index 0000000000000000000000000000000000000000..6ee0b76170fb10d3eb70f55956456784e60b583d GIT binary patch literal 183 zcmX^0Z`VEs1_l!bUM>b^1}=66ZgvJ9Mg}&U%)HDJJ4Oa(4b3n{1{UZ1lvG9rexJ;| zRKL>Pq|~C2#H1Xc2v=}^X;E^jTPBFZo0%4$n4DW+sF#&kmdL}v!obSN!05=xAOPa) z=OpH(>-#5Vr6!j!C@?Sqtpfo@AOb^1}=66ZgvJ9Mg}&U%)HDJJ4Oa(4b3n{1{UZ1lvG9rexJ;| zRKL>Pq|~C2#H1Xc2v=}^X;E^jTPBFZo0%4$n4DW+sF#&kmdL}v!obSN!05!tAOPa) z=OpH(>-#5Vr6!j!C@?Sqtpfo@AOag1pQ2s^Gp zLMjLi6C9HoI8qw@OmSS$FpY~GX@>Ze)o9qR=hSPB8&1R8s@P=)w!xq*I5o$+#?Y6Z zS!a-z>t&lEQgmweYO}g!yZ1yegS>5fn@eQVGsUHO3anaAjbR}Dptxf_wq`3Hbe=a?a;MA~PgE|e;*uG(6?>6YwUj_46~9&TEt>h9%BqNI)p zqC}FKvPB(XoMT9Kdo8vHy6L)gS4SKP2DM#*BcmgW97D95a%XGDE_tNJe>l_3-N5Av z$wkAJ?S|vpwA#QJsjSmVSTrff(Mh70ID;WZrxCJ@teiOjdrb!hgT9In za!Mw~bQYo0v`P`G9U^f50DZSJuR8H!&E$cK5Q6B(z)23v:()V", + "messageType": "WARNING" +}, +{ + "messageText": "size of program expression: 223 steps", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Generated 42 VCC(s), 42 remaining after simplification", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Passing problem to propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "converting SSA", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Aiming to cover 61 goal(s)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Running propositional reduction", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Post-processing", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 191 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 6", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 10", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 14", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 18", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 22", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 26", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 30", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 34", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 38", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 42", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 46", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 47", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 51", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 1", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 2", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 3", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 5", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 25 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker: instance is SATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 7", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 11", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 15", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 19", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 23", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 27", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 31", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 35", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 39", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 43", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 48", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Covered block 4", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Solving with MiniSAT 2.2.1 with simplifier", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "1525 variables, 25 clauses", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "Runtime decision procedure: 0.011s", + "messageType": "STATUS-MESSAGE" +}, +{ + "goals": [ + { + "description": "block 1", + "goal": "coverage.1", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "4" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.2", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "1" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.3", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.4", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "10" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.5", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "failed" + }, + { + "description": "block 1", + "goal": "coverage.6", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "15" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.7", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "15" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.9", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "17" + }, + "status": "satisfied" + }, + { + "description": "block 7", + "goal": "coverage.12", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "satisfied" + }, + { + "description": "block 8", + "goal": "coverage.13", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "failed" + }, + { + "description": "block 9", + "goal": "coverage.14", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "20" + }, + "status": "failed" + }, + { + "description": "block 10", + "goal": "coverage.15", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 11", + "goal": "coverage.16", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "satisfied" + }, + { + "description": "block 12", + "goal": "coverage.17", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "failed" + }, + { + "description": "block 13", + "goal": "coverage.18", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "21" + }, + "status": "failed" + }, + { + "description": "block 14", + "goal": "coverage.19", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "satisfied" + }, + { + "description": "block 15", + "goal": "coverage.20", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "satisfied" + }, + { + "description": "block 16", + "goal": "coverage.21", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 17", + "goal": "coverage.22", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "22" + }, + "status": "failed" + }, + { + "description": "block 18", + "goal": "coverage.23", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "satisfied" + }, + { + "description": "block 19", + "goal": "coverage.24", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "satisfied" + }, + { + "description": "block 20", + "goal": "coverage.25", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 21", + "goal": "coverage.26", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "23" + }, + "status": "failed" + }, + { + "description": "block 22", + "goal": "coverage.27", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "satisfied" + }, + { + "description": "block 23", + "goal": "coverage.28", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "satisfied" + }, + { + "description": "block 24", + "goal": "coverage.29", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 25", + "goal": "coverage.30", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "24" + }, + "status": "failed" + }, + { + "description": "block 26", + "goal": "coverage.31", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "satisfied" + }, + { + "description": "block 27", + "goal": "coverage.32", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "satisfied" + }, + { + "description": "block 28", + "goal": "coverage.33", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 29", + "goal": "coverage.34", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "25" + }, + "status": "failed" + }, + { + "description": "block 30", + "goal": "coverage.35", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "satisfied" + }, + { + "description": "block 31", + "goal": "coverage.36", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "satisfied" + }, + { + "description": "block 32", + "goal": "coverage.37", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 33", + "goal": "coverage.38", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "26" + }, + "status": "failed" + }, + { + "description": "block 34", + "goal": "coverage.39", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "satisfied" + }, + { + "description": "block 35", + "goal": "coverage.40", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "satisfied" + }, + { + "description": "block 36", + "goal": "coverage.41", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "failed" + }, + { + "description": "block 37", + "goal": "coverage.42", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "27" + }, + "status": "failed" + }, + { + "description": "block 38", + "goal": "coverage.43", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "satisfied" + }, + { + "description": "block 39", + "goal": "coverage.44", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "satisfied" + }, + { + "description": "block 40", + "goal": "coverage.45", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "failed" + }, + { + "description": "block 41", + "goal": "coverage.46", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "28" + }, + "status": "failed" + }, + { + "description": "block 42", + "goal": "coverage.47", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "29" + }, + "status": "satisfied" + }, + { + "description": "block 43", + "goal": "coverage.48", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "satisfied" + }, + { + "description": "block 44", + "goal": "coverage.49", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 45", + "goal": "coverage.50", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "30" + }, + "status": "failed" + }, + { + "description": "block 46", + "goal": "coverage.51", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "31" + }, + "status": "satisfied" + }, + { + "description": "block 47", + "goal": "coverage.52", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "31" + }, + "status": "satisfied" + }, + { + "description": "block 48", + "goal": "coverage.53", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "satisfied" + }, + { + "description": "block 49", + "goal": "coverage.54", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "failed" + }, + { + "description": "block 50", + "goal": "coverage.55", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "34" + }, + "status": "failed" + }, + { + "description": "block 51", + "goal": "coverage.56", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "35" + }, + "status": "satisfied" + }, + { + "description": "block 1", + "goal": "coverage.57", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 2", + "goal": "coverage.58", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 3", + "goal": "coverage.59", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 4", + "goal": "coverage.60", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + }, + { + "description": "block 5", + "goal": "coverage.61", + "sourceLocation": { + "file": "if_acmp1.java", + "line": "7" + }, + "status": "satisfied" + } + ], + "goalsCovered": 38, + "tests": [ + { + "coveredGoals": [ "coverage.1", "coverage.2", "coverage.3", "coverage.4", "coverage.6", "coverage.7", "coverage.8", "coverage.9", "coverage.10", "coverage.11", "coverage.15", "coverage.19", "coverage.23", "coverage.27", "coverage.31", "coverage.35", "coverage.39", "coverage.43", "coverage.47", "coverage.51", "coverage.52", "coverage.56", "coverage.57", "coverage.58", "coverage.59", "coverage.61" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + }, + { + "coveredGoals": [ "coverage.12", "coverage.16", "coverage.20", "coverage.24", "coverage.28", "coverage.32", "coverage.36", "coverage.40", "coverage.44", "coverage.48", "coverage.53", "coverage.60" ], + "inputs": [ + { + "id": "arg0a", + "value": { + "binary": "0000001000000000000000000000000000000000000000000000000000000000", + "name": "pointer" + } + } + ] + } + ], + "totalGoals": 61 +}, +{ + "messageText": "** 38 of 61 covered (62.3%)", + "messageType": "STATUS-MESSAGE" +}, +{ + "messageText": "** Used 3 iterations", + "messageType": "STATUS-MESSAGE" +} +] diff --git a/regression/cbmc-cover/location9/test.desc b/regression/cbmc-cover/location9/test.desc new file mode 100644 index 00000000000..b80a98c1894 --- /dev/null +++ b/regression/cbmc-cover/location9/test.desc @@ -0,0 +1,11 @@ +CORE +if_acmp1.class +--cover location --existing-coverage if_acmp1.json +^EXIT=0$ +^SIGNAL=0$ +^\[coverage.1\] file if_acmp1.java line 16 block 3: SATISFIED$ +^\[coverage.2\] file if_acmp1.java line 18 block 5: SATISFIED$ +^\[coverage.3\] file if_acmp1.java line 19 block 6: SATISFIED$ +^\*\* 3 of 3 covered (100.0%) +-- +^warning: ignoring diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 2e63d065786..9e3332f41d8 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -1024,7 +1024,7 @@ bool cbmc_parse_optionst::process_goto_program( itg!=(*it)["goals"].array.end(); itg++) { - //get the line of each goal + //get the line of each existing goal const std::string line=(*itg)["sourceLocation"]["line"].value; goals.set_goals(line); } From 00f8f33fc1e18e40f04035c8753a9431fc112f10 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 14:12:09 +0100 Subject: [PATCH 51/71] remove whitespace Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index acfcdf06ae0..0b7dd223686 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -103,7 +103,7 @@ bool coverage_goals::get_goals(const char* goal) if(it == existing_goals.end()) return true; else - return false; + return false; } From e6dc38be19fc8e7af79c0091dfae5c9af2611632 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Mon, 5 Sep 2016 14:15:38 +0100 Subject: [PATCH 52/71] code refactoring to check existing goals Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 4 ++-- src/goto-instrument/cover.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 0b7dd223686..95d3fd6e076 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -95,7 +95,7 @@ Function: coverage_goals::get_goals \*******************************************************************/ -bool coverage_goals::get_goals(const char* goal) +bool coverage_goals::is_existing_goal(const char* goal) { std::vector::iterator it; it = find (existing_goals.begin(), existing_goals.end(), goal); @@ -1163,7 +1163,7 @@ void instrument_cover_goals( basic_blocks.source_location_map[block_nr]; //check whether the current goal already exists - if(goals.get_goals(source_location.get_line().c_str()) && + if(goals.is_existing_goal(source_location.get_line().c_str()) && !source_location.get_file().empty() && source_location.get_file()[0]!='<') { diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index f00659de1b8..ad28c042282 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -16,11 +16,11 @@ Date: May 2016 class coverage_goals { public: - void set_goals(std::string goal); - bool get_goals(const char* goal); + void set_goals(std::string goal); + bool is_existing_goal(const char* goal); private: - std::vector existing_goals; + std::vector existing_goals; }; enum class coverage_criteriont { From a15c500cd0a481782ba4b8856cade39d55d524c8 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 09:59:59 +0100 Subject: [PATCH 53/71] replace coverage_goals by coverage_goalst Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 2 +- src/goto-instrument/cover.cpp | 12 ++++++------ src/goto-instrument/cover.h | 6 +++--- src/symex/symex_parse_options.cpp | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 9e3332f41d8..3bb2620616f 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -983,7 +983,7 @@ bool cbmc_parse_optionst::process_goto_program( } // check existing test goals - coverage_goals goals; + coverage_goalst goals; if(cmdline.isset("existing-coverage")) { status() << "Check existing coverage goals" << eom; diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 95d3fd6e076..a6eaf1664e4 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -68,7 +68,7 @@ class basic_blockst /*******************************************************************\ -Function: coverage_goals::set_goals +Function: coverage_goalst::set_goals Inputs: @@ -78,14 +78,14 @@ Function: coverage_goals::set_goals \*******************************************************************/ -void coverage_goals::set_goals(std::string goal) +void coverage_goalst::set_goals(std::string goal) { existing_goals.push_back(goal); } /*******************************************************************\ -Function: coverage_goals::get_goals +Function: coverage_goalst::is_existing_goal Inputs: @@ -95,7 +95,7 @@ Function: coverage_goals::get_goals \*******************************************************************/ -bool coverage_goals::is_existing_goal(const char* goal) +bool coverage_goalst::is_existing_goal(const char* goal) { std::vector::iterator it; it = find (existing_goals.begin(), existing_goals.end(), goal); @@ -1100,7 +1100,7 @@ void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, coverage_criteriont criterion, - coverage_goals &goals) + coverage_goalst &goals) { const namespacet ns(symbol_table); basic_blockst basic_blocks(goto_program); @@ -1399,7 +1399,7 @@ void instrument_cover_goals( const symbol_tablet &symbol_table, goto_functionst &goto_functions, coverage_criteriont criterion, - coverage_goals &goals) + coverage_goalst &goals) { Forall_goto_functions(f_it, goto_functions) { diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index ad28c042282..5fe22d5a992 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -13,7 +13,7 @@ Date: May 2016 #include -class coverage_goals +class coverage_goalst { public: void set_goals(std::string goal); @@ -31,12 +31,12 @@ void instrument_cover_goals( const symbol_tablet &symbol_table, goto_programt &goto_program, coverage_criteriont, - coverage_goals &goals); + coverage_goalst &goals); void instrument_cover_goals( const symbol_tablet &symbol_table, goto_functionst &goto_functions, coverage_criteriont, - coverage_goals &goals); + coverage_goalst &goals); #endif diff --git a/src/symex/symex_parse_options.cpp b/src/symex/symex_parse_options.cpp index 5ac7fb001d8..433a32f73f3 100644 --- a/src/symex/symex_parse_options.cpp +++ b/src/symex/symex_parse_options.cpp @@ -442,7 +442,7 @@ bool symex_parse_optionst::process_goto_program(const optionst &options) } status() << "Instrumenting coverge goals" << eom; - coverage_goals goals; + coverage_goalst goals; instrument_cover_goals(symbol_table, goto_model.goto_functions, c, goals); goto_model.goto_functions.update(); } From cbc6e26022ba213bb19004823466d1172b849c3d Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 10:11:28 +0100 Subject: [PATCH 54/71] default variant of instrument_cover_goals that uses an empty set of existing goals Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 30 ++++++++++++++++++++++++++++++ src/goto-instrument/cover.h | 5 +++++ src/symex/symex_parse_options.cpp | 3 +-- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index a6eaf1664e4..f0e54168a91 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -1411,3 +1411,33 @@ void instrument_cover_goals( criterion, goals); } } + +/*******************************************************************\ + +Function: instrument_cover_goals + + Inputs: + + Outputs: + + Purpose: + +\*******************************************************************/ + +void instrument_cover_goals( + const symbol_tablet &symbol_table, + goto_functionst &goto_functions, + coverage_criteriont criterion) +{ + Forall_goto_functions(f_it, goto_functions) + { + if(f_it->first==ID__start || + f_it->first=="__CPROVER_initialize") + continue; + + //empty set of existing goals + coverage_goalst goals; + instrument_cover_goals(symbol_table, f_it->second.body, + criterion, goals); + } +} diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index 5fe22d5a992..a1e917edf83 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -39,4 +39,9 @@ void instrument_cover_goals( coverage_criteriont, coverage_goalst &goals); +void instrument_cover_goals( + const symbol_tablet &symbol_table, + goto_functionst &goto_functions, + coverage_criteriont); + #endif diff --git a/src/symex/symex_parse_options.cpp b/src/symex/symex_parse_options.cpp index 433a32f73f3..2fbee65e2ad 100644 --- a/src/symex/symex_parse_options.cpp +++ b/src/symex/symex_parse_options.cpp @@ -442,8 +442,7 @@ bool symex_parse_optionst::process_goto_program(const optionst &options) } status() << "Instrumenting coverge goals" << eom; - coverage_goalst goals; - instrument_cover_goals(symbol_table, goto_model.goto_functions, c, goals); + instrument_cover_goals(symbol_table, goto_model.goto_functions, c); goto_model.goto_functions.update(); } From 106f7bd3a5fed87624fc9ca537dc21c509bf085e Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 10:19:04 +0100 Subject: [PATCH 55/71] a goal should be identified by a source_locationt Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 7 ++++--- src/goto-instrument/cover.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index f0e54168a91..18003786328 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -95,10 +95,11 @@ Function: coverage_goalst::is_existing_goal \*******************************************************************/ -bool coverage_goalst::is_existing_goal(const char* goal) +bool coverage_goalst::is_existing_goal(source_locationt source_location) { std::vector::iterator it; - it = find (existing_goals.begin(), existing_goals.end(), goal); + it = find (existing_goals.begin(), existing_goals.end(), + source_location.get_line().c_str()); if(it == existing_goals.end()) return true; @@ -1163,7 +1164,7 @@ void instrument_cover_goals( basic_blocks.source_location_map[block_nr]; //check whether the current goal already exists - if(goals.is_existing_goal(source_location.get_line().c_str()) && + if(goals.is_existing_goal(source_location) && !source_location.get_file().empty() && source_location.get_file()[0]!='<') { diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index a1e917edf83..b1a4e50b8ca 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -17,7 +17,7 @@ class coverage_goalst { public: void set_goals(std::string goal); - bool is_existing_goal(const char* goal); + bool is_existing_goal(source_locationt source_location); private: std::vector existing_goals; From 5cf4a86fb4329ee315df08761e179aff827159e8 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 14:28:24 +0100 Subject: [PATCH 56/71] implement get_coverage method Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 43 ++---------------------- src/goto-instrument/Makefile | 1 + src/goto-instrument/cover.cpp | 58 +++++++++++++++++++++++++++++++++ src/goto-instrument/cover.h | 2 ++ src/symex/Makefile | 1 + 5 files changed, 64 insertions(+), 41 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index 3bb2620616f..fc7ed8853ad 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -50,8 +50,6 @@ Author: Daniel Kroening, kroening@kroening.com #include -#include - #include "cbmc_solvers.h" #include "cbmc_parse_options.h" #include "bmc.h" @@ -990,47 +988,10 @@ bool cbmc_parse_optionst::process_goto_program( //get file with covered test goals const std::string coverage=cmdline.get_value("existing-coverage"); + goals.get_coverage(coverage,get_message_handler()); - jsont json; - - //check coverage file - if(parse_json(coverage, get_message_handler(), json)) - { - messaget message(get_message_handler()); - message.error() << coverage << " file is not a valid json file" - << messaget::eom; - return true; - } - - //make sure that we have an array of elements - if(!json.is_array()) - { - messaget message(get_message_handler()); - message.error() << "expecting an array in the " << coverage << " file, but got " - << json << messaget::eom; - return true; - } - - for(jsont::arrayt::const_iterator - it=json.array.begin(); - it!=json.array.end(); - it++) - { - //get the goals array - if ((*it)["goals"].is_array()) - { - for(jsont::arrayt::const_iterator - itg=(*it)["goals"].array.begin(); - itg!=(*it)["goals"].array.end(); - itg++) - { - //get the line of each existing goal - const std::string line=(*itg)["sourceLocation"]["line"].value; - goals.set_goals(line); - } - } - } } + status() << "Instrumenting coverage goals" << eom; instrument_cover_goals(symbol_table, goto_functions, c, goals); goto_functions.update(); diff --git a/src/goto-instrument/Makefile b/src/goto-instrument/Makefile index fd44907bb11..fddf70a5d51 100644 --- a/src/goto-instrument/Makefile +++ b/src/goto-instrument/Makefile @@ -37,6 +37,7 @@ OBJ += ../ansi-c/ansi-c$(LIBEXT) \ ../langapi/langapi$(LIBEXT) \ ../xmllang/xmllang$(LIBEXT) \ ../util/util$(LIBEXT) \ + ../json/json$(LIBEXT) \ ../solvers/solvers$(LIBEXT) INCLUDES= -I .. diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 18003786328..427346eecb4 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -15,6 +15,8 @@ Date: May 2016 #include #include +#include + #include "cover.h" class basic_blockst @@ -68,6 +70,62 @@ class basic_blockst /*******************************************************************\ +Function: coverage_goalst::get_coverage + + Inputs: + + Outputs: + + Purpose: + +\*******************************************************************/ + +void coverage_goalst::get_coverage(const std::string &coverage, + message_handlert &message_handler) +{ + jsont json; + + //check coverage file + if(parse_json(coverage, message_handler, json)) + { + messaget message(message_handler); + message.error() << coverage << " file is not a valid json file" + << messaget::eom; + exit(0); + } + + //make sure that we have an array of elements + if(!json.is_array()) + { + messaget message(message_handler); + message.error() << "expecting an array in the " << coverage << " file, but got " + << json << messaget::eom; + exit(0); + } + + for(jsont::arrayt::const_iterator + it=json.array.begin(); + it!=json.array.end(); + it++) + { + //get the goals array + if ((*it)["goals"].is_array()) + { + for(jsont::arrayt::const_iterator + itg=(*it)["goals"].array.begin(); + itg!=(*it)["goals"].array.end(); + itg++) + { + //get the line of each existing goal + const std::string line=(*itg)["sourceLocation"]["line"].value; + set_goals(line); + } + } + } +} + +/*******************************************************************\ + Function: coverage_goalst::set_goals Inputs: diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index b1a4e50b8ca..37398f3251e 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -16,6 +16,8 @@ Date: May 2016 class coverage_goalst { public: + void get_coverage(const std::string &coverage, + message_handlert &message_handler); void set_goals(std::string goal); bool is_existing_goal(source_locationt source_location); diff --git a/src/symex/Makefile b/src/symex/Makefile index 1f8e27ce063..42632b58d7b 100644 --- a/src/symex/Makefile +++ b/src/symex/Makefile @@ -16,6 +16,7 @@ OBJ += ../ansi-c/ansi-c$(LIBEXT) \ ../goto-symex/rewrite_union$(OBJEXT) \ ../pointer-analysis/dereference$(OBJEXT) \ ../goto-instrument/cover$(OBJEXT) \ + ../json/json$(LIBEXT) \ ../path-symex/path-symex$(LIBEXT) INCLUDES= -I .. From 05896a6c40f6a73da2b5535c29c7c580a0e5aa9a Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 15:15:52 +0100 Subject: [PATCH 57/71] a goal should be identified by a source_locationt Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 22 +++++++++++++++------- src/goto-instrument/cover.h | 4 ++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 427346eecb4..70dc25acb91 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -8,6 +8,8 @@ Date: May 2016 \*******************************************************************/ +#include + #include #include @@ -84,6 +86,7 @@ void coverage_goalst::get_coverage(const std::string &coverage, message_handlert &message_handler) { jsont json; + source_locationt source_location; //check coverage file if(parse_json(coverage, message_handler, json)) @@ -103,6 +106,7 @@ void coverage_goalst::get_coverage(const std::string &coverage, exit(0); } + irep_idt line_number; for(jsont::arrayt::const_iterator it=json.array.begin(); it!=json.array.end(); @@ -117,8 +121,9 @@ void coverage_goalst::get_coverage(const std::string &coverage, itg++) { //get the line of each existing goal - const std::string line=(*itg)["sourceLocation"]["line"].value; - set_goals(line); + line_number=(*itg)["sourceLocation"]["line"].value; + source_location.set_line(line_number); + set_goals(source_location); } } } @@ -136,7 +141,7 @@ Function: coverage_goalst::set_goals \*******************************************************************/ -void coverage_goalst::set_goals(std::string goal) +void coverage_goalst::set_goals(source_locationt goal) { existing_goals.push_back(goal); } @@ -155,10 +160,13 @@ Function: coverage_goalst::is_existing_goal bool coverage_goalst::is_existing_goal(source_locationt source_location) { - std::vector::iterator it; - it = find (existing_goals.begin(), existing_goals.end(), - source_location.get_line().c_str()); - + std::vector::iterator it = existing_goals.begin(); + while (it!=existing_goals.end()) + { + if (!source_location.get_line().compare(it->get_line())) + break; + ++it; + } if(it == existing_goals.end()) return true; else diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index 37398f3251e..ba086d58154 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -18,11 +18,11 @@ class coverage_goalst public: void get_coverage(const std::string &coverage, message_handlert &message_handler); - void set_goals(std::string goal); + void set_goals(source_locationt goal); bool is_existing_goal(source_locationt source_location); private: - std::vector existing_goals; + std::vector existing_goals; }; enum class coverage_criteriont { From a66ed506d3b85a4b990eca74898643c17a30b262 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 15:44:05 +0100 Subject: [PATCH 58/71] method to construct a coverage_goalst object Signed-off-by: Lucas Cordeiro --- src/cbmc/cbmc_parse_options.cpp | 6 +++--- src/goto-instrument/cover.cpp | 6 ++++-- src/goto-instrument/cover.h | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/cbmc/cbmc_parse_options.cpp b/src/cbmc/cbmc_parse_options.cpp index fc7ed8853ad..05286737664 100644 --- a/src/cbmc/cbmc_parse_options.cpp +++ b/src/cbmc/cbmc_parse_options.cpp @@ -980,16 +980,16 @@ bool cbmc_parse_optionst::process_goto_program( return true; } + // check existing test goals coverage_goalst goals; if(cmdline.isset("existing-coverage")) { status() << "Check existing coverage goals" << eom; - //get file with covered test goals const std::string coverage=cmdline.get_value("existing-coverage"); - goals.get_coverage(coverage,get_message_handler()); - + //get a coverage_goalst object + goals = coverage_goalst::get_coverage_goals(coverage,get_message_handler());; } status() << "Instrumenting coverage goals" << eom; diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 70dc25acb91..9d1480d301c 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -82,10 +82,11 @@ Function: coverage_goalst::get_coverage \*******************************************************************/ -void coverage_goalst::get_coverage(const std::string &coverage, +coverage_goalst coverage_goalst::get_coverage_goals(const std::string &coverage, message_handlert &message_handler) { jsont json; + coverage_goalst goals; source_locationt source_location; //check coverage file @@ -123,10 +124,11 @@ void coverage_goalst::get_coverage(const std::string &coverage, //get the line of each existing goal line_number=(*itg)["sourceLocation"]["line"].value; source_location.set_line(line_number); - set_goals(source_location); + goals.set_goals(source_location); } } } + return goals; } /*******************************************************************\ diff --git a/src/goto-instrument/cover.h b/src/goto-instrument/cover.h index ba086d58154..9eb85b3c7d2 100644 --- a/src/goto-instrument/cover.h +++ b/src/goto-instrument/cover.h @@ -16,8 +16,8 @@ Date: May 2016 class coverage_goalst { public: - void get_coverage(const std::string &coverage, - message_handlert &message_handler); + static coverage_goalst get_coverage_goals(const std::string &coverage, + message_handlert &message_handler); void set_goals(source_locationt goal); bool is_existing_goal(source_locationt source_location); From 5958459c4270a5f02f44c27b330aaef0a8a3bee3 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Tue, 6 Sep 2016 16:01:15 +0100 Subject: [PATCH 59/71] remove iostream Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 9d1480d301c..20c34102908 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -8,8 +8,6 @@ Date: May 2016 \*******************************************************************/ -#include - #include #include From 19788f05527a87839feffcdba7228bca5694bc62 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Thu, 8 Sep 2016 15:19:19 +0100 Subject: [PATCH 60/71] use json file suggested at github issue #187 Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 20c34102908..44b7345552a 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -8,6 +8,8 @@ Date: May 2016 \*******************************************************************/ +#include + #include #include @@ -105,24 +107,34 @@ coverage_goalst coverage_goalst::get_coverage_goals(const std::string &coverage, exit(0); } - irep_idt line_number; + irep_idt file, function, line; for(jsont::arrayt::const_iterator it=json.array.begin(); it!=json.array.end(); it++) { - //get the goals array - if ((*it)["goals"].is_array()) + + //get the file of each existing goal + file=(*it)["file"].value; + source_location.set_file(file); + + //get the function of each existing goal + function=(*it)["function"].value; + source_location.set_function(function); + + //get the lines array + if ((*it)["lines"].is_array()) { for(jsont::arrayt::const_iterator - itg=(*it)["goals"].array.begin(); - itg!=(*it)["goals"].array.end(); + itg=(*it)["lines"].array.begin(); + itg!=(*it)["lines"].array.end(); itg++) { //get the line of each existing goal - line_number=(*itg)["sourceLocation"]["line"].value; - source_location.set_line(line_number); + line=(*itg)["number"].value; + source_location.set_line(line); goals.set_goals(source_location); + } } } @@ -163,7 +175,9 @@ bool coverage_goalst::is_existing_goal(source_locationt source_location) std::vector::iterator it = existing_goals.begin(); while (it!=existing_goals.end()) { - if (!source_location.get_line().compare(it->get_line())) + if (!source_location.get_file().compare(it->get_file()) && + !source_location.get_function().compare(it->get_function()) && + !source_location.get_line().compare(it->get_line())) break; ++it; } From 2a96477878a166eab38262c529ed35114bf036ab Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Thu, 8 Sep 2016 15:20:24 +0100 Subject: [PATCH 61/71] use json file as suggested at github issue #187 Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location2/main.json | 197 +--- regression/cbmc-cover/location3/main.json | 187 +--- regression/cbmc-cover/location4/main.json | 638 +------------ regression/cbmc-cover/location5/main.json | 628 +------------ regression/cbmc-cover/location6/if_expr1.json | 486 +--------- regression/cbmc-cover/location7/if_expr1.json | 476 +--------- regression/cbmc-cover/location8/if_acmp1.json | 883 +----------------- regression/cbmc-cover/location9/if_acmp1.json | 856 +---------------- 8 files changed, 21 insertions(+), 4330 deletions(-) diff --git a/regression/cbmc-cover/location2/main.json b/regression/cbmc-cover/location2/main.json index 57c35d49321..1fd3d2cd7ba 100644 --- a/regression/cbmc-cover/location2/main.json +++ b/regression/cbmc-cover/location2/main.json @@ -1,197 +1,2 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing main.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking main", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "function `assert' is not declared", - "messageType": "WARNING" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "size of program expression: 45 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 4 VCC(s), 4 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 4 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "265 variables, 522 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "265 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.001s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "main.coverage.1", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "3" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "main.coverage.2", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "main.coverage.3", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "main.coverage.4", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "12" - }, - "status": "satisfied" - } - ], - "goalsCovered": 4, - "tests": [ - { - "coveredGoals": [ "main.coverage.1", "main.coverage.3", "main.coverage.4" ], - "inputs": [ ] - }, - { - "coveredGoals": [ "main.coverage.2" ], - "inputs": [ ] - } - ], - "totalGoals": 4 -}, -{ - "messageText": "** 4 of 4 covered (100.0%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 2 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "main.c", "function": "main", "lines": [ {"number": 3}, {"number": 8}, {"number": 10}, {"number": 12} ] } ] diff --git a/regression/cbmc-cover/location3/main.json b/regression/cbmc-cover/location3/main.json index f0721a496e7..dc7fb615202 100644 --- a/regression/cbmc-cover/location3/main.json +++ b/regression/cbmc-cover/location3/main.json @@ -1,187 +1,2 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing main.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking main", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "function `assert' is not declared", - "messageType": "WARNING" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "size of program expression: 45 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 4 VCC(s), 4 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 4 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "265 variables, 522 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "265 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.001s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "main.coverage.1", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "3" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "main.coverage.2", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "main.coverage.4", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "12" - }, - "status": "satisfied" - } - ], - "goalsCovered": 4, - "tests": [ - { - "coveredGoals": [ "main.coverage.1", "main.coverage.3", "main.coverage.4" ], - "inputs": [ ] - }, - { - "coveredGoals": [ "main.coverage.2" ], - "inputs": [ ] - } - ], - "totalGoals": 4 -}, -{ - "messageText": "** 4 of 4 covered (100.0%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 2 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "main.c", "function": "main", "lines": [ {"number": 3}, {"number": 8}, {"number": 12} ] } ] diff --git a/regression/cbmc-cover/location4/main.json b/regression/cbmc-cover/location4/main.json index 114e0638022..d5b80c03a30 100644 --- a/regression/cbmc-cover/location4/main.json +++ b/regression/cbmc-cover/location4/main.json @@ -1,633 +1,7 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing main.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Parsing single-linked-list.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking main", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking single-linked-list", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop main.0 iteration 1 (2 max) file main.c line 19 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop main.0 iteration 2 (2 max) file main.c line 19 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop search_list.0 iteration 1 (2 max) file single-linked-list.c line 10 function search_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop search_list.0 iteration 2 (2 max) file single-linked-list.c line 10 function search_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop delete_list.0 iteration 1 (2 max) file single-linked-list.c line 23 function delete_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop delete_list.0 iteration 2 (2 max) file single-linked-list.c line 23 function delete_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop main.1 iteration 1 (2 max) file main.c line 35 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop main.1 iteration 2 (2 max) file main.c line 35 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "size of program expression: 358 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 57 VCC(s), 57 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 40 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "3368 variables, 1698 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "3368 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.007s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "free called for new[] object", - "goal": "", - "sourceLocation": { - "file": "", - "function": "free", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "main.coverage.1", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "main.coverage.2", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "12" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "main.coverage.3", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "13" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "main.coverage.4", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "14" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "main.coverage.5", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "16" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "main.coverage.6", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "19" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "main.coverage.7", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "main.coverage.8", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "main.coverage.9", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "main.coverage.10", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 11", - "goal": "main.coverage.11", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "32" - }, - "status": "failed" - }, - { - "description": "block 12", - "goal": "main.coverage.12", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "35" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "main.coverage.13", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "37" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "main.coverage.14", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "40" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "search_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "9" - }, - "status": "failed" - }, - { - "description": "block 2", - "goal": "search_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 3", - "goal": "search_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 4", - "goal": "search_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 5", - "goal": "search_list.coverage.5", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 6", - "goal": "search_list.coverage.6", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 7", - "goal": "search_list.coverage.7", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "15" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "delete_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "19" - }, - "status": "failed" - }, - { - "description": "block 2", - "goal": "delete_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 3", - "goal": "delete_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 4", - "goal": "delete_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 5", - "goal": "delete_list.coverage.5", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "29" - }, - "status": "failed" - }, - { - "description": "block 6", - "goal": "delete_list.coverage.6", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 7", - "goal": "delete_list.coverage.7", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 8", - "goal": "delete_list.coverage.8", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "delete_list.coverage.9", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "delete_list.coverage.10", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 11", - "goal": "delete_list.coverage.11", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 12", - "goal": "delete_list.coverage.12", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "delete_list.coverage.13", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "delete_list.coverage.14", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "insert_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "37" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "insert_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "40" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "insert_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "45" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "insert_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "48" - }, - "status": "satisfied" - } - ], - "goalsCovered": 11, - "tests": [ - { - "coveredGoals": [ "main.coverage.1", "main.coverage.2", "main.coverage.3", "main.coverage.4", "main.coverage.5", "main.coverage.6", "main.coverage.7", "insert_list.coverage.1", "insert_list.coverage.2", "insert_list.coverage.3", "insert_list.coverage.4" ], - "inputs": [ ] - } - ], - "totalGoals": 40 -}, -{ - "messageText": "** 11 of 40 covered (27.5%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 2 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "", "function": "free", "lines": [ {"number": 22} ] }, +{ "file": "main.c", "function": "main", "lines": [ {"number": 8}, {"number": 12}, {"number": 13}, {"number": 14}, {"number": 16}, {"number": 19}, {"number": 21}, {"number": 24}, {"number": 26}, {"number": 30}, {"number": 32}, {"number": 35}, {"number": 37}, {"number": 40} ] }, +{"file": "single-linked-list.c", "function": "search_list", "lines": [ {"number": 9}, {"number": 10}, {"number": 15} ] }, +{"file": "single-linked-list.c", "function": "delete_list", "lines": [ {"number": 19}, {"number": 23}, {"number": 24}, {"number": 25}, {"number": 29}, {"number": 31}, {"number": 37}, {"number": 40}, {"number": 45}, {"number": 48} ] }, +{"file": "single-linked-list.c", "function": "insert_list", "lines": [ {"number": 37}, {"number": 40}, {"number": 45}, {"number": 48} ] } ] + diff --git a/regression/cbmc-cover/location5/main.json b/regression/cbmc-cover/location5/main.json index 486ba8033d4..86c5b8fd0ee 100644 --- a/regression/cbmc-cover/location5/main.json +++ b/regression/cbmc-cover/location5/main.json @@ -1,623 +1,7 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing main.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Parsing single-linked-list.c", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking main", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Type-checking single-linked-list", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": ":0:0: warning: \"__STDC_VERSION__\" redefined", - "messageType": "WARNING" -}, -{ - "messageText": ": note: this is the location of the previous definition", - "messageType": "WARNING" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop main.0 iteration 1 (2 max) file main.c line 19 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop main.0 iteration 2 (2 max) file main.c line 19 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop search_list.0 iteration 1 (2 max) file single-linked-list.c line 10 function search_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop search_list.0 iteration 2 (2 max) file single-linked-list.c line 10 function search_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop delete_list.0 iteration 1 (2 max) file single-linked-list.c line 23 function delete_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop delete_list.0 iteration 2 (2 max) file single-linked-list.c line 23 function delete_list thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Unwinding loop main.1 iteration 1 (2 max) file main.c line 35 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Not unwinding loop main.1 iteration 2 (2 max) file main.c line 35 function main thread 0", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "size of program expression: 358 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 57 VCC(s), 57 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 40 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "3368 variables, 1698 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "3368 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.007s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "free called for new[] object", - "goal": "", - "sourceLocation": { - "file": "", - "function": "free", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "main.coverage.1", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "main.coverage.2", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "12" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "main.coverage.3", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "13" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "main.coverage.5", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "16" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "main.coverage.6", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "19" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "main.coverage.7", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "main.coverage.8", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "main.coverage.9", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "main.coverage.10", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 11", - "goal": "main.coverage.11", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "32" - }, - "status": "failed" - }, - { - "description": "block 12", - "goal": "main.coverage.12", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "35" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "main.coverage.13", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "37" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "main.coverage.14", - "sourceLocation": { - "file": "main.c", - "function": "main", - "line": "40" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "search_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "9" - }, - "status": "failed" - }, - { - "description": "block 2", - "goal": "search_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 3", - "goal": "search_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 4", - "goal": "search_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 5", - "goal": "search_list.coverage.5", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 6", - "goal": "search_list.coverage.6", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 7", - "goal": "search_list.coverage.7", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "search_list", - "line": "15" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "delete_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "19" - }, - "status": "failed" - }, - { - "description": "block 2", - "goal": "delete_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 3", - "goal": "delete_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 4", - "goal": "delete_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 5", - "goal": "delete_list.coverage.5", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "29" - }, - "status": "failed" - }, - { - "description": "block 6", - "goal": "delete_list.coverage.6", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 7", - "goal": "delete_list.coverage.7", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 8", - "goal": "delete_list.coverage.8", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "delete_list.coverage.9", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "delete_list.coverage.10", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 11", - "goal": "delete_list.coverage.11", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 12", - "goal": "delete_list.coverage.12", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "delete_list.coverage.13", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "delete_list.coverage.14", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "delete_list", - "line": "31" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "insert_list.coverage.1", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "37" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "insert_list.coverage.2", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "40" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "insert_list.coverage.3", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "45" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "insert_list.coverage.4", - "sourceLocation": { - "file": "single-linked-list.c", - "function": "insert_list", - "line": "48" - }, - "status": "satisfied" - } - ], - "goalsCovered": 11, - "tests": [ - { - "coveredGoals": [ "main.coverage.1", "main.coverage.2", "main.coverage.3", "main.coverage.4", "main.coverage.5", "main.coverage.6", "main.coverage.7", "insert_list.coverage.1", "insert_list.coverage.2", "insert_list.coverage.3", "insert_list.coverage.4" ], - "inputs": [ ] - } - ], - "totalGoals": 40 -}, -{ - "messageText": "** 11 of 40 covered (27.5%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 2 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "", "function": "free", "lines": [ {"number": 22} ] }, +{ "file": "main.c", "function": "main", "lines": [ {"number": 8}, {"number": 12}, {"number": 13}, {"number": 16}, {"number": 19}, {"number": 21}, {"number": 24}, {"number": 26}, {"number": 30}, {"number": 32}, {"number": 35}, {"number": 37}, {"number": 40} ] }, +{"file": "single-linked-list.c", "function": "search_list", "lines": [ {"number": 9}, {"number": 10}, {"number": 15} ] }, +{"file": "single-linked-list.c", "function": "delete_list", "lines": [ {"number": 19}, {"number": 23}, {"number": 24}, {"number": 25}, {"number": 29}, {"number": 31}, {"number": 37}, {"number": 40}, {"number": 45}, {"number": 48} ] }, +{"file": "single-linked-list.c", "function": "insert_list", "lines": [ {"number": 37}, {"number": 40}, {"number": 45}, {"number": 48} ] } ] + diff --git a/regression/cbmc-cover/location6/if_expr1.json b/regression/cbmc-cover/location6/if_expr1.json index 9415f24f359..09d4eaa4fca 100644 --- a/regression/cbmc-cover/location6/if_expr1.json +++ b/regression/cbmc-cover/location6/if_expr1.json @@ -1,485 +1,3 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing if_expr1.class", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Java main class: if_expr1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "failed to load class `java.lang.String'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.io.IOException'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Class'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.AssertionError'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.System'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.io.InputStream'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Object'", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Class.desiredAssertionStatus:()Z", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.io.InputStream.read:()I", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.AssertionError.:()V", - "messageType": "WARNING" -}, -{ - "messageText": "size of program expression: 110 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 19 VCC(s), 19 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 20 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 2976 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 10", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 11", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 14", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 39 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 22 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 2 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.011s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "coverage.1", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.2", - "sourceLocation": { - "file": "if_expr1.java", - "line": "5" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.3", - "sourceLocation": { - "file": "if_expr1.java", - "line": "5" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.4", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.5", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.6", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "coverage.7", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "coverage.8", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "coverage.9", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "coverage.10", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "coverage.11", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 11", - "goal": "coverage.12", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 12", - "goal": "coverage.13", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "coverage.14", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "coverage.15", - "sourceLocation": { - "file": "if_expr1.java", - "line": "11" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.16", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.17", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.18", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.19", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.20", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - } - ], - "goalsCovered": 15, - "tests": [ - { - "coveredGoals": [ "coverage.2", "coverage.3", "coverage.5", "coverage.6", "coverage.11", "coverage.12", "coverage.15", "coverage.16", "coverage.17", "coverage.19", "coverage.20" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.18" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.4", "coverage.7" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.8" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - } - ], - "totalGoals": 20 -}, -{ - "messageText": "** 15 of 20 covered (75.0%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 5 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "if_expr1.java", "lines": [ {"number": 1}, {"number": 5}, {"number": 6}, {"number": 8}, {"number": 10}, {"number": 11} ] } ] + diff --git a/regression/cbmc-cover/location7/if_expr1.json b/regression/cbmc-cover/location7/if_expr1.json index a0d320755f2..1d1bbb6f552 100644 --- a/regression/cbmc-cover/location7/if_expr1.json +++ b/regression/cbmc-cover/location7/if_expr1.json @@ -1,476 +1,2 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing if_expr1.class", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Java main class: if_expr1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "failed to load class `java.lang.String'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.io.IOException'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Class'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.AssertionError'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.System'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.io.InputStream'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Object'", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Class.desiredAssertionStatus:()Z", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.io.InputStream.read:()I", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.AssertionError.:()V", - "messageType": "WARNING" -}, -{ - "messageText": "size of program expression: 110 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 19 VCC(s), 19 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 20 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 2976 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 10", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 11", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 14", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 39 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 22 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 2 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1418 variables, 0 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.011s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "coverage.1", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.2", - "sourceLocation": { - "file": "if_expr1.java", - "line": "5" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.3", - "sourceLocation": { - "file": "if_expr1.java", - "line": "5" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.4", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.5", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.6", - "sourceLocation": { - "file": "if_expr1.java", - "line": "6" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "coverage.7", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "coverage.8", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "coverage.9", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "coverage.10", - "sourceLocation": { - "file": "if_expr1.java", - "line": "8" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "coverage.11", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 11", - "goal": "coverage.12", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 12", - "goal": "coverage.13", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "coverage.14", - "sourceLocation": { - "file": "if_expr1.java", - "line": "10" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.16", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.17", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.18", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.19", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.20", - "sourceLocation": { - "file": "if_expr1.java", - "line": "1" - }, - "status": "satisfied" - } - ], - "goalsCovered": 15, - "tests": [ - { - "coveredGoals": [ "coverage.2", "coverage.3", "coverage.5", "coverage.6", "coverage.11", "coverage.12", "coverage.15", "coverage.16", "coverage.17", "coverage.19", "coverage.20" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.18" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.4", "coverage.7" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.8" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - } - ], - "totalGoals": 20 -}, -{ - "messageText": "** 15 of 20 covered (75.0%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 5 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "if_expr1.java", "lines": [ {"number": 1}, {"number": 5}, {"number": 6}, {"number": 8}, {"number": 10} ] } ] diff --git a/regression/cbmc-cover/location8/if_acmp1.json b/regression/cbmc-cover/location8/if_acmp1.json index c1623228f3e..de4ebb6c29d 100644 --- a/regression/cbmc-cover/location8/if_acmp1.json +++ b/regression/cbmc-cover/location8/if_acmp1.json @@ -1,882 +1,3 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing if_acmp1.class", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Java main class: if_acmp1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "failed to load class `java.lang.String'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Class'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.AssertionError'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Object'", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Class.desiredAssertionStatus:()Z", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Object.:()V", - "messageType": "WARNING" -}, -{ - "messageText": "size of program expression: 223 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 42 VCC(s), 42 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 61 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 191 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 10", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 14", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 18", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 22", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 26", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 30", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 34", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 38", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 42", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 46", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 47", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 51", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 25 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 11", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 15", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 19", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 23", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 27", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 31", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 35", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 39", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 43", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 48", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 25 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.011s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "coverage.1", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "4" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.2", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.3", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.4", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.5", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.6", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "15" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.7", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "15" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.8", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "16" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.9", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "17" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.10", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "18" - }, - "status": "satisfied" - }, - { - "description": "block 6", - "goal": "coverage.11", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "19" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "coverage.12", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "coverage.13", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "coverage.14", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "coverage.15", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 11", - "goal": "coverage.16", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 12", - "goal": "coverage.17", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "coverage.18", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "coverage.19", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "satisfied" - }, - { - "description": "block 15", - "goal": "coverage.20", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "satisfied" - }, - { - "description": "block 16", - "goal": "coverage.21", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 17", - "goal": "coverage.22", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 18", - "goal": "coverage.23", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "satisfied" - }, - { - "description": "block 19", - "goal": "coverage.24", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "satisfied" - }, - { - "description": "block 20", - "goal": "coverage.25", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 21", - "goal": "coverage.26", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 22", - "goal": "coverage.27", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "satisfied" - }, - { - "description": "block 23", - "goal": "coverage.28", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "satisfied" - }, - { - "description": "block 24", - "goal": "coverage.29", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 25", - "goal": "coverage.30", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 26", - "goal": "coverage.31", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "satisfied" - }, - { - "description": "block 27", - "goal": "coverage.32", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "satisfied" - }, - { - "description": "block 28", - "goal": "coverage.33", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 29", - "goal": "coverage.34", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 30", - "goal": "coverage.35", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "satisfied" - }, - { - "description": "block 31", - "goal": "coverage.36", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "satisfied" - }, - { - "description": "block 32", - "goal": "coverage.37", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 33", - "goal": "coverage.38", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 34", - "goal": "coverage.39", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "satisfied" - }, - { - "description": "block 35", - "goal": "coverage.40", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "satisfied" - }, - { - "description": "block 36", - "goal": "coverage.41", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "failed" - }, - { - "description": "block 37", - "goal": "coverage.42", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "failed" - }, - { - "description": "block 38", - "goal": "coverage.43", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "satisfied" - }, - { - "description": "block 39", - "goal": "coverage.44", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "satisfied" - }, - { - "description": "block 40", - "goal": "coverage.45", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "failed" - }, - { - "description": "block 41", - "goal": "coverage.46", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "failed" - }, - { - "description": "block 42", - "goal": "coverage.47", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "29" - }, - "status": "satisfied" - }, - { - "description": "block 43", - "goal": "coverage.48", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "satisfied" - }, - { - "description": "block 44", - "goal": "coverage.49", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 45", - "goal": "coverage.50", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 46", - "goal": "coverage.51", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "31" - }, - "status": "satisfied" - }, - { - "description": "block 47", - "goal": "coverage.52", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "31" - }, - "status": "satisfied" - }, - { - "description": "block 48", - "goal": "coverage.53", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "satisfied" - }, - { - "description": "block 49", - "goal": "coverage.54", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "failed" - }, - { - "description": "block 50", - "goal": "coverage.55", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "failed" - }, - { - "description": "block 51", - "goal": "coverage.56", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "35" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.57", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.58", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.59", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.60", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.61", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - } - ], - "goalsCovered": 38, - "tests": [ - { - "coveredGoals": [ "coverage.1", "coverage.2", "coverage.3", "coverage.4", "coverage.6", "coverage.7", "coverage.8", "coverage.9", "coverage.10", "coverage.11", "coverage.15", "coverage.19", "coverage.23", "coverage.27", "coverage.31", "coverage.35", "coverage.39", "coverage.43", "coverage.47", "coverage.51", "coverage.52", "coverage.56", "coverage.57", "coverage.58", "coverage.59", "coverage.61" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.12", "coverage.16", "coverage.20", "coverage.24", "coverage.28", "coverage.32", "coverage.36", "coverage.40", "coverage.44", "coverage.48", "coverage.53", "coverage.60" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - } - ], - "totalGoals": 61 -}, -{ - "messageText": "** 38 of 61 covered (62.3%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 3 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "if_acmp1.java", "lines": [ {"number": 4}, {"number": 1}, {"number": 10}, {"number": 7}, {"number": 15}, {"number": 16}, {"number": 17}, {"number": 18}, {"number": 19}, {"number": 20}, {"number": 21}, {"number": 22}, {"number": 23}, {"number": 24}, {"number": 25}, {"number": 26}, {"number": 27}, {"number": 28}, {"number": 29}, {"number": 30}, {"number": 31}, {"number": 34}, {"number": 35} ] } ] + diff --git a/regression/cbmc-cover/location9/if_acmp1.json b/regression/cbmc-cover/location9/if_acmp1.json index 9e7fdc9f456..8d48cb86fa0 100644 --- a/regression/cbmc-cover/location9/if_acmp1.json +++ b/regression/cbmc-cover/location9/if_acmp1.json @@ -1,855 +1,3 @@ -[ -{ - "program": "CBMC 5.5" -}, -{ - "messageText": "CBMC version 5.5 64-bit x86_64 linux", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Parsing if_acmp1.class", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Java main class: if_acmp1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "failed to load class `java.lang.String'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Class'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.AssertionError'", - "messageType": "WARNING" -}, -{ - "messageText": "failed to load class `java.lang.Object'", - "messageType": "WARNING" -}, -{ - "messageText": "Converting", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generating GOTO Program", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Adding CPROVER library (x86_64)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Removal of function pointers and virtual functions", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Partial Inlining", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generic Property Instrumentation", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Instrumenting coverage goals", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Starting Bounded Model Checking", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Class.desiredAssertionStatus:()Z", - "messageType": "WARNING" -}, -{ - "messageText": "**** WARNING: no body for function java::java.lang.Object.:()V", - "messageType": "WARNING" -}, -{ - "messageText": "size of program expression: 223 steps", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Generated 42 VCC(s), 42 remaining after simplification", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Passing problem to propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "converting SSA", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Aiming to cover 61 goal(s)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Running propositional reduction", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Post-processing", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 191 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 6", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 10", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 14", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 18", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 22", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 26", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 30", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 34", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 38", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 42", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 46", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 47", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 51", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 1", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 2", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 3", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 5", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 25 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker: instance is SATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 7", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 11", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 15", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 19", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 23", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 27", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 31", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 35", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 39", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 43", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 48", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Covered block 4", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Solving with MiniSAT 2.2.1 with simplifier", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "1525 variables, 25 clauses", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "SAT checker inconsistent: instance is UNSATISFIABLE", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "Runtime decision procedure: 0.011s", - "messageType": "STATUS-MESSAGE" -}, -{ - "goals": [ - { - "description": "block 1", - "goal": "coverage.1", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "4" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.2", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "1" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.3", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.4", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "10" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.5", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "failed" - }, - { - "description": "block 1", - "goal": "coverage.6", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "15" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.7", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "15" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.9", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "17" - }, - "status": "satisfied" - }, - { - "description": "block 7", - "goal": "coverage.12", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "satisfied" - }, - { - "description": "block 8", - "goal": "coverage.13", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "failed" - }, - { - "description": "block 9", - "goal": "coverage.14", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "20" - }, - "status": "failed" - }, - { - "description": "block 10", - "goal": "coverage.15", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 11", - "goal": "coverage.16", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "satisfied" - }, - { - "description": "block 12", - "goal": "coverage.17", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "failed" - }, - { - "description": "block 13", - "goal": "coverage.18", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "21" - }, - "status": "failed" - }, - { - "description": "block 14", - "goal": "coverage.19", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "satisfied" - }, - { - "description": "block 15", - "goal": "coverage.20", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "satisfied" - }, - { - "description": "block 16", - "goal": "coverage.21", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 17", - "goal": "coverage.22", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "22" - }, - "status": "failed" - }, - { - "description": "block 18", - "goal": "coverage.23", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "satisfied" - }, - { - "description": "block 19", - "goal": "coverage.24", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "satisfied" - }, - { - "description": "block 20", - "goal": "coverage.25", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 21", - "goal": "coverage.26", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "23" - }, - "status": "failed" - }, - { - "description": "block 22", - "goal": "coverage.27", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "satisfied" - }, - { - "description": "block 23", - "goal": "coverage.28", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "satisfied" - }, - { - "description": "block 24", - "goal": "coverage.29", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 25", - "goal": "coverage.30", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "24" - }, - "status": "failed" - }, - { - "description": "block 26", - "goal": "coverage.31", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "satisfied" - }, - { - "description": "block 27", - "goal": "coverage.32", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "satisfied" - }, - { - "description": "block 28", - "goal": "coverage.33", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 29", - "goal": "coverage.34", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "25" - }, - "status": "failed" - }, - { - "description": "block 30", - "goal": "coverage.35", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "satisfied" - }, - { - "description": "block 31", - "goal": "coverage.36", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "satisfied" - }, - { - "description": "block 32", - "goal": "coverage.37", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 33", - "goal": "coverage.38", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "26" - }, - "status": "failed" - }, - { - "description": "block 34", - "goal": "coverage.39", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "satisfied" - }, - { - "description": "block 35", - "goal": "coverage.40", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "satisfied" - }, - { - "description": "block 36", - "goal": "coverage.41", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "failed" - }, - { - "description": "block 37", - "goal": "coverage.42", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "27" - }, - "status": "failed" - }, - { - "description": "block 38", - "goal": "coverage.43", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "satisfied" - }, - { - "description": "block 39", - "goal": "coverage.44", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "satisfied" - }, - { - "description": "block 40", - "goal": "coverage.45", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "failed" - }, - { - "description": "block 41", - "goal": "coverage.46", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "28" - }, - "status": "failed" - }, - { - "description": "block 42", - "goal": "coverage.47", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "29" - }, - "status": "satisfied" - }, - { - "description": "block 43", - "goal": "coverage.48", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "satisfied" - }, - { - "description": "block 44", - "goal": "coverage.49", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 45", - "goal": "coverage.50", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "30" - }, - "status": "failed" - }, - { - "description": "block 46", - "goal": "coverage.51", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "31" - }, - "status": "satisfied" - }, - { - "description": "block 47", - "goal": "coverage.52", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "31" - }, - "status": "satisfied" - }, - { - "description": "block 48", - "goal": "coverage.53", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "satisfied" - }, - { - "description": "block 49", - "goal": "coverage.54", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "failed" - }, - { - "description": "block 50", - "goal": "coverage.55", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "34" - }, - "status": "failed" - }, - { - "description": "block 51", - "goal": "coverage.56", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "35" - }, - "status": "satisfied" - }, - { - "description": "block 1", - "goal": "coverage.57", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 2", - "goal": "coverage.58", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 3", - "goal": "coverage.59", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 4", - "goal": "coverage.60", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - }, - { - "description": "block 5", - "goal": "coverage.61", - "sourceLocation": { - "file": "if_acmp1.java", - "line": "7" - }, - "status": "satisfied" - } - ], - "goalsCovered": 38, - "tests": [ - { - "coveredGoals": [ "coverage.1", "coverage.2", "coverage.3", "coverage.4", "coverage.6", "coverage.7", "coverage.8", "coverage.9", "coverage.10", "coverage.11", "coverage.15", "coverage.19", "coverage.23", "coverage.27", "coverage.31", "coverage.35", "coverage.39", "coverage.43", "coverage.47", "coverage.51", "coverage.52", "coverage.56", "coverage.57", "coverage.58", "coverage.59", "coverage.61" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - }, - { - "coveredGoals": [ "coverage.12", "coverage.16", "coverage.20", "coverage.24", "coverage.28", "coverage.32", "coverage.36", "coverage.40", "coverage.44", "coverage.48", "coverage.53", "coverage.60" ], - "inputs": [ - { - "id": "arg0a", - "value": { - "binary": "0000001000000000000000000000000000000000000000000000000000000000", - "name": "pointer" - } - } - ] - } - ], - "totalGoals": 61 -}, -{ - "messageText": "** 38 of 61 covered (62.3%)", - "messageType": "STATUS-MESSAGE" -}, -{ - "messageText": "** Used 3 iterations", - "messageType": "STATUS-MESSAGE" -} +[ { "file": "if_acmp1.java", "lines": [ {"number": 4}, {"number": 1}, {"number": 10}, {"number": 7}, {"number": 15}, {"number": 17}, {"number": 20}, {"number": 21}, {"number": 22}, {"number": 23}, {"number": 24}, {"number": 25}, {"number": 26}, {"number": 27}, {"number": 28}, {"number": 29}, {"number": 30}, {"number": 31}, {"number": 34}, {"number": 35} ] } ] + From 420f38b71d92fa1d61d9d767863b39b562262ebb Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Thu, 8 Sep 2016 15:30:46 +0100 Subject: [PATCH 62/71] remove space Signed-off-by: Lucas Cordeiro --- src/goto-instrument/cover.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/goto-instrument/cover.cpp b/src/goto-instrument/cover.cpp index 44b7345552a..0fe251bec04 100644 --- a/src/goto-instrument/cover.cpp +++ b/src/goto-instrument/cover.cpp @@ -131,10 +131,9 @@ coverage_goalst coverage_goalst::get_coverage_goals(const std::string &coverage, itg++) { //get the line of each existing goal - line=(*itg)["number"].value; - source_location.set_line(line); - goals.set_goals(source_location); - + line=(*itg)["number"].value; + source_location.set_line(line); + goals.set_goals(source_location); } } } From cc0187c3ed83d7cc0ad7d5c02d420d0dbef6ccfc Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Wed, 19 Oct 2016 13:46:20 +0100 Subject: [PATCH 63/71] fix merge Signed-off-by: Lucas Cordeiro --- regression/cbmc-concurrency/deadlock1/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regression/cbmc-concurrency/deadlock1/main.c b/regression/cbmc-concurrency/deadlock1/main.c index 891fb419e7e..8bf26775d37 100644 --- a/regression/cbmc-concurrency/deadlock1/main.c +++ b/regression/cbmc-concurrency/deadlock1/main.c @@ -19,4 +19,4 @@ void main() { pthread_join(tid2, NULL); // deadlock in the threads; assertion should not be reachable assert(0); -} +} From a7cf0f80fbab5afd175edb612072901e1384803c Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Fri, 21 Oct 2016 11:47:16 +0100 Subject: [PATCH 64/71] add test case location10 to check --cover in the presence of unreachable functions and assumes Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location10/main.c | 23 ++++++++++++++++++++++ regression/cbmc-cover/location10/test.desc | 20 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 regression/cbmc-cover/location10/main.c create mode 100644 regression/cbmc-cover/location10/test.desc diff --git a/regression/cbmc-cover/location10/main.c b/regression/cbmc-cover/location10/main.c new file mode 100644 index 00000000000..c06b43a470e --- /dev/null +++ b/regression/cbmc-cover/location10/main.c @@ -0,0 +1,23 @@ +#include + +int myfunc(int x, int y) +{ + int z = x + y; + return z; +} + +int main(void) +{ + _Bool x=0, y; + if (x) + assert(myfunc(2,3)==5); + else + y=1; + + if (y) + assert(myfunc(4,3)==7); + else + assume(0); + + assert(y==1); +} diff --git a/regression/cbmc-cover/location10/test.desc b/regression/cbmc-cover/location10/test.desc new file mode 100644 index 00000000000..4ade078f961 --- /dev/null +++ b/regression/cbmc-cover/location10/test.desc @@ -0,0 +1,20 @@ +CORE +main.c +--cover location +^EXIT=0$ +^SIGNAL=0$ +^\[main.coverage.1\] file main.c line 11 function main block 1: SATISFIED$ +^\[main.coverage.2\] file main.c line 13 function main block 2: FAILED$ +^\[main.coverage.3\] file main.c line 13 function main block 3: FAILED$ +^\[main.coverage.4\] file main.c line 15 function main block 5: SATISFIED$ +^\[main.coverage.5\] file main.c line 17 function main block 6: SATISFIED$ +^\[main.coverage.6\] file main.c line 18 function main block 7: SATISFIED$ +^\[main.coverage.7\] file main.c line 18 function main block 8: SATISFIED$ +^\[main.coverage.8\] file main.c line 20 function main block 10: FAILED$ +^\[main.coverage.9\] file main.c line 22 function main block 11: SATISFIED$ +^\[main.coverage.10\] file main.c line 23 function main block 12: SATISFIED$ +^\[myfunc.coverage.1\] file main.c line 5 function myfunc block 1: SATISFIED$ +^\[myfunc.coverage.2\] file main.c line 7 function myfunc block 2: SATISFIED$ +^\*\* 9 of 12 covered (75.0%) +-- +^warning: ignoring From e51488f549815768363a25c01740b6ed2012e8ab Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Fri, 21 Oct 2016 11:51:59 +0100 Subject: [PATCH 65/71] add test case location11 to check --cover in the presence of unreachable functions and assumes Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location11/main.c | 23 ++++++++++++++++++++++ regression/cbmc-cover/location11/test.desc | 19 ++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 regression/cbmc-cover/location11/main.c create mode 100644 regression/cbmc-cover/location11/test.desc diff --git a/regression/cbmc-cover/location11/main.c b/regression/cbmc-cover/location11/main.c new file mode 100644 index 00000000000..65e72f245f1 --- /dev/null +++ b/regression/cbmc-cover/location11/main.c @@ -0,0 +1,23 @@ +#include + +int myfunc(int x, int y) +{ + int z = x + y; + return z; +} + +int main(void) +{ + _Bool x=0, y; + if (x) + assert(myfunc(2,3)==5); + else + y=1; + + if (y) + y=0; + else + assume(0); + + assert(y==1); +} diff --git a/regression/cbmc-cover/location11/test.desc b/regression/cbmc-cover/location11/test.desc new file mode 100644 index 00000000000..398e9b8b36f --- /dev/null +++ b/regression/cbmc-cover/location11/test.desc @@ -0,0 +1,19 @@ +CORE +main.c +--cover location +^EXIT=0$ +^SIGNAL=0$ +^\[main.coverage.1\] file main.c line 11 function main block 1: SATISFIED$ +^\[main.coverage.2\] file main.c line 13 function main block 2: FAILED$ +^\[main.coverage.3\] file main.c line 13 function main block 3: FAILED$ +^\[main.coverage.4\] file main.c line 15 function main block 5: SATISFIED$ +^\[main.coverage.5\] file main.c line 17 function main block 6: SATISFIED$ +^\[main.coverage.6\] file main.c line 18 function main block 7: SATISFIED$ +^\[main.coverage.7\] file main.c line 20 function main block 8: FAILED$ +^\[main.coverage.8\] file main.c line 22 function main block 9: SATISFIED$ +^\[main.coverage.9\] file main.c line 23 function main block 10: SATISFIED$ +^\[myfunc.coverage.1\] file main.c line 5 function myfunc block 1: FAILED$ +^\[myfunc.coverage.2\] file main.c line 7 function myfunc block 2: FAILED$ +^\*\* 6 of 11 covered (54.5%) +-- +^warning: ignoring From af26c6de19ce62ffbdb382b630fd1ba6774fd9f0 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Wed, 26 Oct 2016 09:39:20 +0100 Subject: [PATCH 66/71] added test case to check the behaviour of --cover in the presence of unreachable assumes Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location12/main.c | 12 ++++++++++++ regression/cbmc-cover/location12/test.desc | 15 +++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 regression/cbmc-cover/location12/main.c create mode 100644 regression/cbmc-cover/location12/test.desc diff --git a/regression/cbmc-cover/location12/main.c b/regression/cbmc-cover/location12/main.c new file mode 100644 index 00000000000..09fc6d0307a --- /dev/null +++ b/regression/cbmc-cover/location12/main.c @@ -0,0 +1,12 @@ +#include + +int foo (int iX, int iY) +{ + return iX + iY; + assume(0); +} + +int main(void) +{ + assert(foo(5,3)==8); +} diff --git a/regression/cbmc-cover/location12/test.desc b/regression/cbmc-cover/location12/test.desc new file mode 100644 index 00000000000..8b46af0784d --- /dev/null +++ b/regression/cbmc-cover/location12/test.desc @@ -0,0 +1,15 @@ +CORE +main.c +--cover location +^EXIT=0$ +^SIGNAL=0$ +^\[main.coverage.1\] file main.c line 11 function main block 1: SATISFIED$ +^\[main.coverage.2\] file main.c line 11 function main block 2: SATISFIED$ +^\[main.coverage.3\] file main.c line 12 function main block 3: SATISFIED$ +^\[foo.coverage.1\] file main.c line 5 function foo block 1: SATISFIED$ +^\[foo.coverage.2\] file main.c line 6 function foo block 2: FAILED$ +^\[foo.coverage.3\] file main.c line 7 function foo block 3: FAILED$ +^\[foo.coverage.4\] file main.c line 7 function foo block 4: SATISFIED$ +^\*\* 5 of 7 covered (71.4%) +-- +^warning: ignoring From a5868ae9f3aa52566fc7dfe822cbc46033d02c59 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Wed, 26 Oct 2016 09:43:12 +0100 Subject: [PATCH 67/71] added test case to check the behaviour of --cover in the presence of unreachable assumes Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location13/main.c | 17 +++++++++++++++++ regression/cbmc-cover/location13/test.desc | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 regression/cbmc-cover/location13/main.c create mode 100644 regression/cbmc-cover/location13/test.desc diff --git a/regression/cbmc-cover/location13/main.c b/regression/cbmc-cover/location13/main.c new file mode 100644 index 00000000000..f8d18141ca9 --- /dev/null +++ b/regression/cbmc-cover/location13/main.c @@ -0,0 +1,17 @@ +#include + +int myfunc(int a, int b) +{ + return a+b; +} + +int foo (int iX, int iY) +{ + return iX + iY; + assert(myfunc(iX,iY)==8); +} + +int main(void) +{ + assert(foo(5,3)==8); +} diff --git a/regression/cbmc-cover/location13/test.desc b/regression/cbmc-cover/location13/test.desc new file mode 100644 index 00000000000..543be77b095 --- /dev/null +++ b/regression/cbmc-cover/location13/test.desc @@ -0,0 +1,18 @@ +CORE +main.c +--cover location +^EXIT=0$ +^SIGNAL=0$ +^\[main.coverage.1\] file main.c line 16 function main block 1: SATISFIED$ +^\[main.coverage.2\] file main.c line 16 function main block 2: SATISFIED$ +^\[main.coverage.3\] file main.c line 17 function main block 3: SATISFIED$ +^\[myfunc.coverage.1\] file main.c line 5 function myfunc block 1: FAILED$ +^\[myfunc.coverage.2\] file main.c line 6 function myfunc block 2: FAILED$ +^\[foo.coverage.1\] file main.c line 10 function foo block 1: SATISFIED$ +^\[foo.coverage.2\] file main.c line 11 function foo block 2: FAILED$ +^\[foo.coverage.3\] file main.c line 11 function foo block 3: FAILED$ +^\[foo.coverage.4\] file main.c line 12 function foo block 4: FAILED$ +^\[foo.coverage.5\] file main.c line 12 function foo block 5: SATISFIED$ +^\*\* 5 of 10 covered (50.0%) +-- +^warning: ignoring From fe52c6dc726a17141de46e57a5947424efff0ca6 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Wed, 26 Oct 2016 10:05:05 +0100 Subject: [PATCH 68/71] added location14 to check the behaviour of --cover in the presence of unreachable function Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location14/main.c | 13 +++++++++++++ regression/cbmc-cover/location14/test.desc | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 regression/cbmc-cover/location14/main.c create mode 100644 regression/cbmc-cover/location14/test.desc diff --git a/regression/cbmc-cover/location14/main.c b/regression/cbmc-cover/location14/main.c new file mode 100644 index 00000000000..5fbf0c498e7 --- /dev/null +++ b/regression/cbmc-cover/location14/main.c @@ -0,0 +1,13 @@ +#include + +int foo (int iX, int iY) +{ + return iX + iY; +} + +int main(void) +{ + int iN = 2 + 1; + if (iN == 4) + assert(foo(5,3)==8); +} diff --git a/regression/cbmc-cover/location14/test.desc b/regression/cbmc-cover/location14/test.desc new file mode 100644 index 00000000000..f3cb25573da --- /dev/null +++ b/regression/cbmc-cover/location14/test.desc @@ -0,0 +1,14 @@ +CORE +main.c +--cover location +^EXIT=0$ +^SIGNAL=0$ +^\[main.coverage.1\] file main.c line 10 function main block 1: SATISFIED$ +^\[main.coverage.2\] file main.c line 12 function main block 2: FAILED$ +^\[main.coverage.3\] file main.c line 12 function main block 3: FAILED$ +^\[main.coverage.4\] file main.c line 13 function main block 4: SATISFIED$ +^\[foo.coverage.1\] file main.c line 5 function foo block 1: FAILED$ +^\[foo.coverage.2\] file main.c line 6 function foo block 2: FAILED$ +^\*\* 2 of 6 covered (33.3%) +-- +^warning: ignoring From 43dc052597ae6e34fcc0051c77f542ec727291a1 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Wed, 26 Oct 2016 10:12:55 +0100 Subject: [PATCH 69/71] fix test cases location11 and location12 Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location11/main.c | 2 +- regression/cbmc-cover/location12/main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/regression/cbmc-cover/location11/main.c b/regression/cbmc-cover/location11/main.c index 65e72f245f1..cf22990b042 100644 --- a/regression/cbmc-cover/location11/main.c +++ b/regression/cbmc-cover/location11/main.c @@ -17,7 +17,7 @@ int main(void) if (y) y=0; else - assume(0); + __CPROVER_assume(0); assert(y==1); } diff --git a/regression/cbmc-cover/location12/main.c b/regression/cbmc-cover/location12/main.c index 09fc6d0307a..118401511b6 100644 --- a/regression/cbmc-cover/location12/main.c +++ b/regression/cbmc-cover/location12/main.c @@ -3,7 +3,7 @@ int foo (int iX, int iY) { return iX + iY; - assume(0); + __CPROVER_assume(0); } int main(void) From 8efb139377ad811065b48f46fb1fd8dde24ba01f Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Wed, 26 Oct 2016 10:13:19 +0100 Subject: [PATCH 70/71] added location15 to check the behaviour of --cover in the presence of unreachable function and assume Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location15/main.c | 17 +++++++++++++++++ regression/cbmc-cover/location15/test.desc | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 regression/cbmc-cover/location15/main.c create mode 100644 regression/cbmc-cover/location15/test.desc diff --git a/regression/cbmc-cover/location15/main.c b/regression/cbmc-cover/location15/main.c new file mode 100644 index 00000000000..799293db22c --- /dev/null +++ b/regression/cbmc-cover/location15/main.c @@ -0,0 +1,17 @@ +#include +#include + +int foo (int iX, int iY) +{ + return iX + iY; +} + +int main(void) +{ + double dX = sqrt(2); + if (dX > 5) + { + __CPROVER_assume(0); + assert(foo(5,3)==1); + } +} diff --git a/regression/cbmc-cover/location15/test.desc b/regression/cbmc-cover/location15/test.desc new file mode 100644 index 00000000000..3fb10c3066b --- /dev/null +++ b/regression/cbmc-cover/location15/test.desc @@ -0,0 +1,17 @@ +CORE +main.c +--cover location +^EXIT=0$ +^SIGNAL=0$ +^\[main.coverage.1\] file main.c line 11 function main block 1: SATISFIED$ +^\[main.coverage.2\] file main.c line 11 function main block 2: SATISFIED$ +^\[main.coverage.3\] file main.c line 14 function main block 3: FAILED$ +^\[main.coverage.4\] file main.c line 15 function main block 4: FAILED$ +^\[main.coverage.5\] file main.c line 15 function main block 5: FAILED$ +^\[main.coverage.6\] file main.c line 16 function main block 6: FAILED$ +^\[main.coverage.7\] file main.c line 17 function main block 7: SATISFIED$ +^\[foo.coverage.1\] file main.c line 6 function foo block 1: FAILED$ +^\[foo.coverage.2\] file main.c line 7 function foo block 2: FAILED$ +^\*\* 3 of 9 covered (33.3%) +-- +^warning: ignoring From 3181b2f0198ab4ca0e16178dcca7f7f331173b31 Mon Sep 17 00:00:00 2001 From: Lucas Cordeiro Date: Wed, 26 Oct 2016 10:25:20 +0100 Subject: [PATCH 71/71] added location16 to check the behaviour of --cover in the presence of unreachable function Signed-off-by: Lucas Cordeiro --- regression/cbmc-cover/location16/main.c | 21 +++++++++++++++++++++ regression/cbmc-cover/location16/test.desc | 17 +++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 regression/cbmc-cover/location16/main.c create mode 100644 regression/cbmc-cover/location16/test.desc diff --git a/regression/cbmc-cover/location16/main.c b/regression/cbmc-cover/location16/main.c new file mode 100644 index 00000000000..6334e4c8e88 --- /dev/null +++ b/regression/cbmc-cover/location16/main.c @@ -0,0 +1,21 @@ +#include + +int func(int a) +{ + int b = a*2; + return b; + + if (b < 10) + { + b += 10; + } + + assert(0); + + return b; +} + +int main(void) +{ + func(2); +} diff --git a/regression/cbmc-cover/location16/test.desc b/regression/cbmc-cover/location16/test.desc new file mode 100644 index 00000000000..bb81dddf43c --- /dev/null +++ b/regression/cbmc-cover/location16/test.desc @@ -0,0 +1,17 @@ +CORE +main.c +--cover location +^EXIT=0$ +^SIGNAL=0$ +^\[main.coverage.1\] file main.c line 20 function main block 1: SATISFIED$ +^\[main.coverage.2\] file main.c line 21 function main block 2: SATISFIED$ +^\[func.coverage.1\] file main.c line 5 function func block 1: SATISFIED$ +^\[func.coverage.2\] file main.c line 8 function func block 2: FAILED$ +^\[func.coverage.3\] file main.c line 10 function func block 3: FAILED$ +^\[func.coverage.4\] file main.c line 13 function func block 4: FAILED$ +^\[func.coverage.5\] file main.c line 13 function func block 5: FAILED$ +^\[func.coverage.6\] file main.c line 15 function func block 6: FAILED$ +^\[func.coverage.7\] file main.c line 16 function func block 7: SATISFIED$ +^\*\* 4 of 9 covered (44.4%) +-- +^warning: ignoring