1.23
2.0
acw/focus-triggers
main
test-branch
| 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 |
|
|---|
| 15 | int i=1, j=1;
|
|---|
| 16 |
|
|---|
| 17 | #define NUM 5
|
|---|
| 18 |
|
|---|
| 19 | void *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 |
|
|---|
| 29 | void *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 |
|
|---|
| 39 | int 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.