Added "check -assert"
authorClifford Wolf <clifford@clifford.at>
Sun, 22 Feb 2015 12:00:41 +0000 (13:00 +0100)
committerClifford Wolf <clifford@clifford.at>
Sun, 22 Feb 2015 12:00:41 +0000 (13:00 +0100)
passes/cmds/check.cc

index 824131a7a60ce742a24bf1ee0192d1a9529aa2b0..17b15caa0689e9d96d5b84bfdb8003de5fd50950 100644 (file)
@@ -49,6 +49,7 @@ struct CheckPass : public Pass {
        {
                int counter = 0;
                bool noinit = false;
+               bool assert_mode = false;
 
                size_t argidx;
                for (argidx = 1; argidx < args.size(); argidx++) {
@@ -56,6 +57,10 @@ struct CheckPass : public Pass {
                                noinit = true;
                                continue;
                        }
+                       if (args[argidx] == "-assert") {
+                               assert_mode = true;
+                               continue;
+                       }
                        break;
                }
                extra_args(args, argidx, design);
@@ -137,6 +142,9 @@ struct CheckPass : public Pass {
                }
 
                log("found and reported %d problems.\n", counter);
+
+               if (assert_mode)
+                       log_error("Found %d problems in 'check -assert'.\n", counter);
        }
 } CheckPass;