source: CIVL/examples/pthread/fib_bench_false.cvl@ 310401a

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since 310401a was 9f23e8b, checked in by John Edenhofner <johneden@…>, 12 years ago

Added bug fix programs and some documentation

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@996 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 918 bytes
Line 
1/*****************************************************************************
2* SOURCE: This is a translation of a Pthread program from
3* the Pthread benchmarks of SV-COMP 2014.
4* https://svn.sosy-lab.org/software/sv-benchmarks/tags/svcomp14/
5* FILE: fib_bench_false.cvl
6* DESCRIPTION:
7*
8* Command line execution:
9* civl verify fib_bench_false.cvl
10******************************************************************************/
11
12#include <civlc.h>
13#include <pthread.cvh>
14
15int i=1, j=1;
16
17#define NUM 5
18
19void *t1(void* arg)
20{
21 int k = 0;
22
23 for (k = 0; k < NUM; k++)
24 i+=j;
25
26 pthread_exit(NULL);
27}
28
29void *t2(void* arg)
30{
31 int k = 0;
32
33 for (k = 0; k < NUM; k++)
34 j+=i;
35
36 pthread_exit(NULL);
37}
38
39int main(int argc, char **argv)
40{
41 pthread_t id1, id2;
42
43 pthread_create(&id1, NULL, t1, NULL);
44 pthread_create(&id2, NULL, t2, NULL);
45
46 if (i >= 144 || j >= 144) {
47 ERROR:
48 goto ERROR;
49 }
50
51 return 0;
52}
Note: See TracBrowser for help on using the repository browser.