Run tabbing pass
[c11tester.git] / main.cc
diff --git a/main.cc b/main.cc
index 12fc3e17c717cdc04c300bb19d111bb8a3627f7e..590a41d27f33c07118592912fc73f582a4624050 100644 (file)
--- 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
@@ -199,10 +207,8 @@ int main(int argc, char **argv)
        parse_options(params, main_argc, main_argv);
 
 
-       snapshot_stack_init();
        install_trace_analyses(model->get_execution());
 
-       snapshot_record(0);
        model->startMainThread();
        DEBUG("Exiting\n");
 }