Merge branch 'new-bench' of ssh://demsky.eecs.uci.edu/home/git/model-checker-benchmar...
[model-checker-benchmarks.git] / chase-lev-deque-bugfix / testcase5.c
1 #include <stdlib.h>
2 #include <assert.h>
3 #include <stdio.h>
4 #include <threads.h>
5 #include <stdatomic.h>
6
7 #include "model-assert.h"
8
9 #include "deque.h"
10
11 Deque *q;
12 int a;
13 int b;
14 int c;
15
16 /** Make w14 release, try to run with the following:
17         time ./run.sh chase-lev-deque-bugfix/testcase5_wildcard -m2 -y -u3 -tSCFENCE
18                 -o fchase-lev-deque-bugfix/result4.txt -o weaken -x5000
19 */
20
21 static void task(void * param) {
22         b=steal(q);
23         //c=steal(q);
24 }
25
26 int user_main(int argc, char **argv)
27 {
28         thrd_t t1, t2;
29         q=create();
30
31         push(q, 1);
32         //push(q, 2);
33         //push(q, 3);
34         thrd_create(&t1, task, 0);
35         //thrd_create(&t2, task, 0);
36         a=take(q);
37         //c=take(q);
38         thrd_join(t1);
39         //thrd_join(t2);
40
41 /*
42         bool correct=true;
43         if (a!=1 && a!=2 && a!=4 && a!= EMPTY)
44                 correct=false;
45         if (b!=1 && b!=2 && b!=4 && b!= EMPTY)
46                 correct=false;
47         if (c!=1 && c!=2 && c!=4 && a!= EMPTY)
48                 correct=false;
49         if (a!=EMPTY && b!=EMPTY && c!=EMPTY && (a+b+c)!=7)
50                 correct=false;
51         //if (!correct)
52                 printf("a=%d b=%d c=%d\n",a,b,c);
53         MODEL_ASSERT(correct);
54         */
55
56         return 0;
57 }