964d25e9fb76e756470f168744e61497201b62ad
[model-checker-benchmarks.git] / chase-lev-deque-bugfix / testcase2.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 static void task(void * param) {
17         b=steal(q);
18         c=steal(q);
19 }
20
21 int user_main(int argc, char **argv)
22 {
23         thrd_t t1, t2;
24         q=create_size(4);
25         push(q, 1);
26         push(q, 2);
27         push(q, 3);
28         thrd_create(&t1, task, 0);
29         //thrd_create(&t2, task, 0);
30         a=take(q);
31         //c=take(q);
32         thrd_join(t1);
33         //thrd_join(t2);
34
35 /*
36         bool correct=true;
37         if (a!=1 && a!=2 && a!=4 && a!= EMPTY)
38                 correct=false;
39         if (b!=1 && b!=2 && b!=4 && b!= EMPTY)
40                 correct=false;
41         if (c!=1 && c!=2 && c!=4 && a!= EMPTY)
42                 correct=false;
43         if (a!=EMPTY && b!=EMPTY && c!=EMPTY && (a+b+c)!=7)
44                 correct=false;
45         //if (!correct)
46                 printf("a=%d b=%d c=%d\n",a,b,c);
47         MODEL_ASSERT(correct);
48         */
49
50         return 0;
51 }