Skip to content

Commit 206dddf

Browse files
author
Daniel Kroening
committed
add --validate-goto-model to goto-cc
This enables tests of the validation without CBMC.
1 parent a869788 commit 206dddf

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/goto-cc/compile.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,11 @@ bool compilet::write_bin_object_file(
542542
const std::string &file_name,
543543
const goto_modelt &src_goto_model)
544544
{
545+
status() << "Validating goto model" << eom;
546+
547+
if(validate_goto_model)
548+
src_goto_model.validate(validation_modet::INVARIANT);
549+
545550
statistics() << "Writing binary format object `"
546551
<< file_name << "'" << eom;
547552

src/goto-cc/compile.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class compilet : public messaget
3434
bool echo_file_name;
3535
std::string working_directory;
3636
std::string override_language;
37+
bool validate_goto_model = false;
3738

3839
enum { PREPROCESS_ONLY, // gcc -E
3940
COMPILE_ONLY, // gcc -c

src/goto-cc/gcc_cmdline.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const char *goto_cc_options_without_argument[]=
4949
"--big-endian",
5050
"--no-arch",
5151
"--partial-inlining",
52+
"--validate-goto-model",
5253
"-?",
5354
nullptr
5455
};

0 commit comments

Comments
 (0)