source: CIVL/mods/dev.civl.com/examples/pthread/esbmc/bigshot_p_false-unreach-call.c@ cb4d4f4

1.23 2.0 main test-branch
Last change on this file since cb4d4f4 was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

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

  • Property mode set to 100644
File size: 544 bytes
Line 
1extern void __VERIFIER_error();
2
3#include <stdlib.h>
4#include <pthread.h>
5#include <string.h>
6
7void __VERIFIER_assert(int expression) { if (!expression) { ERROR: __VERIFIER_error();}; return; }
8
9char *v;
10
11void *thread1(void * arg)
12{
13 v = malloc(sizeof(char) * 8);
14}
15
16void *thread2(void *arg)
17{
18 if (v) strcpy(v, "Bigshot");
19}
20
21
22int main()
23{
24 pthread_t t1, t2;
25
26 pthread_create(&t1, 0, thread1, 0);
27 pthread_create(&t2, 0, thread2, 0);
28 pthread_join(t1, 0);
29 pthread_join(t2, 0);
30
31 __VERIFIER_assert(!v || v[0] == 'B');
32
33 return 0;
34}
35
36
Note: See TracBrowser for help on using the repository browser.