File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
regression/cbmc-concurrency/norace_array2 Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+ #include <pthread.h>
3+ #include <stdlib.h>
4+
5+ unsigned long data [2 ];
6+
7+ void * thread0 (void * arg )
8+ {
9+ data [0 ] = 1 ;
10+ return NULL ;
11+ }
12+
13+ void * thread1 (void * arg )
14+ {
15+ data [1 ] = 1 ;
16+ return NULL ;
17+ }
18+
19+ int main (int argc , char * argv [])
20+ {
21+ pthread_t t0 ;
22+ pthread_t t1 ;
23+
24+ pthread_create (& t0 , NULL , thread0 , NULL );
25+ pthread_create (& t1 , NULL , thread1 , NULL );
26+ pthread_join (t0 , NULL );
27+ pthread_join (t1 , NULL );
28+
29+ assert (data [0 ] == 1 );
30+ assert (data [1 ] == 1 );
31+
32+ return 0 ;
33+ }
Original file line number Diff line number Diff line change 1+ KNOWNBUG
2+ main.c
3+
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ ^VERIFICATION SUCCESSFUL$
7+ --
8+ ^warning: ignoring
You can’t perform that action at this time.
0 commit comments