Skip to content

Commit 6fa41f9

Browse files
committed
minimise test
1 parent 9e8d973 commit 6fa41f9

File tree

1 file changed

+3
-27
lines changed
  • regression/goto-instrument/assembly_call_graph_test

1 file changed

+3
-27
lines changed
Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,13 @@
1-
#ifdef SATABS
2-
#define assert(e) __CPROVER_assert(e,"error")
3-
#endif
4-
5-
volatile int turn; // integer variable to hold the ID of the thread whose turn is it
6-
int x; // variable to test mutual exclusion
7-
volatile int flag1 = 0, flag2 = 0; // boolean flags
8-
9-
void* thr1(void * arg) { // frontend produces 12 transitions from this thread. It would be better if it would produce only 8!
10-
flag1 = 1;
11-
turn = 1;
12-
__asm__ __volatile__ ("mfence": : :"memory");
13-
__CPROVER_assume(! (flag2==1 && turn==1) );
14-
// begin: critical section
15-
x = 0;
16-
assert(x<=0);
17-
// end: critical section
18-
flag1 = 0;
1+
void* thr1(void * arg) {
2+
__asm__ __volatile__ ("mfence": : :"memory");
193
}
204

215
void* thr2(void * arg) {
22-
flag2 = 1;
23-
turn = 0;
246
__asm__ __volatile__ ("mfence": : :"memory");
25-
__CPROVER_assume(! (flag1==1 && turn==0) );
26-
// begin: critical section
27-
x = 1;
28-
assert (x>=1);
29-
// end: critical section
30-
flag2 = 0;
317
}
328

339
int main()
3410
{
35-
__CPROVER_ASYNC_1: thr1(0);
11+
thr1(0);
3612
thr2(0);
3713
}

0 commit comments

Comments
 (0)