File tree 1 file changed +3
-27
lines changed
regression/goto-instrument/assembly_call_graph_test 1 file changed +3
-27
lines changed Original file line number Diff line number Diff line change 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" );
19
3
}
20
4
21
5
void * thr2 (void * arg ) {
22
- flag2 = 1 ;
23
- turn = 0 ;
24
6
__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 ;
31
7
}
32
8
33
9
int main ()
34
10
{
35
- __CPROVER_ASYNC_1 : thr1 (0 );
11
+ thr1 (0 );
36
12
thr2 (0 );
37
13
}
You can’t perform that action at this time.
0 commit comments