X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=chase-lev-deque-bugfix%2Ftestcase8.c;fp=chase-lev-deque-bugfix%2Ftestcase8.c;h=d954138db7fb3d70755ebcfe4b81b535a11da7fe;hb=cd0af72755f006449a7a3dbbdcf7416054e83b0f;hp=0000000000000000000000000000000000000000;hpb=206cda9ceeb0ac1d5efe9aecc8102b35d8bb3db7;p=model-checker-benchmarks.git diff --git a/chase-lev-deque-bugfix/testcase8.c b/chase-lev-deque-bugfix/testcase8.c new file mode 100644 index 0000000..d954138 --- /dev/null +++ b/chase-lev-deque-bugfix/testcase8.c @@ -0,0 +1,52 @@ +#include +#include +#include +#include +#include + +#include "model-assert.h" + +#include "deque.h" + +Deque *q; +int a; +int b; +int c; + +static void task(void * param) { + b=steal(q); + //c=steal(q); +} + +int user_main(int argc, char **argv) +{ + thrd_t t1, t2; + q=create(); + + push(q, 1); + thrd_create(&t1, task, 0); + thrd_create(&t2, task, 0); + a=take(q); + push(q, 2); + c=take(q); + push(q, 3); + thrd_join(t1); + thrd_join(t2); + +/* + bool correct=true; + if (a!=1 && a!=2 && a!=4 && a!= EMPTY) + correct=false; + if (b!=1 && b!=2 && b!=4 && b!= EMPTY) + correct=false; + if (c!=1 && c!=2 && c!=4 && a!= EMPTY) + correct=false; + if (a!=EMPTY && b!=EMPTY && c!=EMPTY && (a+b+c)!=7) + correct=false; + //if (!correct) + printf("a=%d b=%d c=%d\n",a,b,c); + MODEL_ASSERT(correct); + */ + + return 0; +}