X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=common.cc;fp=common.cc;h=20102b0bba76ecee78f3491302b5768967c482a2;hb=d596a0e422232c82e01fe266ca2099d0eff5de0f;hp=b274989f48bc4d885f6976b596139b1e5bde42ed;hpb=1a6c97a90dcb078ef64ca95d058837a575b34239;p=c11tester.git diff --git a/common.cc b/common.cc index b274989f..20102b0b 100644 --- a/common.cc +++ b/common.cc @@ -2,6 +2,8 @@ #include #include +#include + #include "common.h" #include "model.h" #include "stacktrace.h" @@ -40,3 +42,12 @@ void assert_hook(void) { printf("Add breakpoint to line %u in file %s.\n",__LINE__,__FILE__); } + +void model_assert(bool expr, const char *file, int line) +{ + if (!expr) { + printf(" [BUG] Program has hit assertion in file %s at line %d\n", + file, line); + model->set_assert(); + } +}