changes to the spec of deque
[cdsspec-compiler.git] / benchmark / chase-lev-deque-bugfix / main.c
index 7fb831f3d55d08568ba8db5a986146f173e1de21..fd67b60ec7a02ebf39244821030f541699260737 100644 (file)
@@ -14,10 +14,18 @@ int b;
 int c;
 
 static void task(void * param) {
-       // FIXME: Add the following take() will expose an Uninitialzied Load bug...
-       //a=take(q);
-
        a=steal(q);
+       if (a == ABORT) {
+               printf("Steal NULL\n");
+       } else {
+               printf("Steal %d\n", a);
+       }
+       int x=steal(q);
+       if (x == ABORT) {
+               printf("Steal NULL\n");
+       } else {
+               printf("Steal %d\n", x);
+       }
 }
 
 int user_main(int argc, char **argv)
@@ -31,12 +39,25 @@ int user_main(int argc, char **argv)
        q=create();
        thrd_create(&t, task, 0);
        push(q, 1);
+       printf("Push 1\n");
        push(q, 2);
+       printf("Push 2\n");
        push(q, 4);
+       printf("Push 4\n");
        b=take(q);
+       if (b == EMPTY) {
+               printf("Take NULL\n");
+       } else {
+               printf("Take %d\n", b);
+       }
        c=take(q);
+       if (c == EMPTY) {
+               printf("Take NULL\n");
+       } else {
+               printf("Take %d\n", c);
+       }
        thrd_join(t);
-
+/*
        bool correct=true;
        if (a!=1 && a!=2 && a!=4 && a!= EMPTY)
                correct=false;
@@ -48,7 +69,8 @@ int user_main(int argc, char **argv)
                correct=false;
        if (!correct)
                printf("a=%d b=%d c=%d\n",a,b,c);
-       MODEL_ASSERT(correct);
+               */
+       //MODEL_ASSERT(correct);
 
        return 0;
 }