X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=main.cc;h=590a41d27f33c07118592912fc73f582a4624050;hp=5396823334df9a0b47f3077f3c352cc6774e7e1b;hb=ef0269b70d29a256e1ed2123d8fe115d051a5215;hpb=651e9182baf50ef1e235ad7a587730b989bb44c7 diff --git a/main.cc b/main.cc index 53968233..590a41d2 100644 --- a/main.cc +++ b/main.cc @@ -23,6 +23,7 @@ void param_defaults(struct model_params *params) params->uninitvalue = 0; params->maxexecutions = 10; params->nofork = false; + params->threadsnocleanup = false; } static void print_usage(const char *program_name, struct model_params *params) @@ -56,6 +57,9 @@ static void print_usage(const char *program_name, struct model_params *params) " Default: %u\n" " -o help for a list of options\n" "-n No fork\n" +#ifdef TLS + "-d Don't allow threads to cleanup\n" +#endif " -- Program arguments follow.\n\n", program_name, params->verbose, @@ -86,7 +90,7 @@ bool install_plugin(char * name) { static void parse_options(struct model_params *params, int argc, char **argv) { - const char *shortopts = "hnt:o:u:x:v::"; + const char *shortopts = "hdnt:o:u:x:v::"; const struct option longopts[] = { {"help", no_argument, NULL, 'h'}, {"verbose", optional_argument, NULL, 'v'}, @@ -103,6 +107,9 @@ static void parse_options(struct model_params *params, int argc, char **argv) case 'h': print_usage(argv[0], params); break; + case 'd': + params->threadsnocleanup = true; + break; case 'n': params->nofork = true; break; @@ -182,8 +189,6 @@ int main(int argc, char **argv) "Distributed under the GPLv2\n" "Written by Weiyu Luo, Brian Norris, and Brian Demsky\n\n"); - /* Configure output redirection for the model-checker */ - redirect_output(); //Initialize snapshotting library and model checker object if (!model) { @@ -192,6 +197,9 @@ int main(int argc, char **argv) model->startChecker(); } + /* Configure output redirection for the model-checker */ + redirect_output(); + register_plugins(); //Parse command line options