source: CIVL/examples/pthread/svcomp/scull_true-unreach-call.i@ 1aaefd4

main test-branch
Last change on this file since 1aaefd4 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

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

  • Property mode set to 100644
File size: 31.9 KB
Line 
1extern void __VERIFIER_error() __attribute__ ((__noreturn__));
2
3extern int __VERIFIER_nondet_int();
4typedef unsigned char __u_char;
5typedef unsigned short int __u_short;
6typedef unsigned int __u_int;
7typedef unsigned long int __u_long;
8typedef signed char __int8_t;
9typedef unsigned char __uint8_t;
10typedef signed short int __int16_t;
11typedef unsigned short int __uint16_t;
12typedef signed int __int32_t;
13typedef unsigned int __uint32_t;
14typedef signed long int __int64_t;
15typedef unsigned long int __uint64_t;
16typedef long int __quad_t;
17typedef unsigned long int __u_quad_t;
18typedef unsigned long int __dev_t;
19typedef unsigned int __uid_t;
20typedef unsigned int __gid_t;
21typedef unsigned long int __ino_t;
22typedef unsigned long int __ino64_t;
23typedef unsigned int __mode_t;
24typedef unsigned long int __nlink_t;
25typedef long int __off_t;
26typedef long int __off64_t;
27typedef int __pid_t;
28typedef struct { int __val[2]; } __fsid_t;
29typedef long int __clock_t;
30typedef unsigned long int __rlim_t;
31typedef unsigned long int __rlim64_t;
32typedef unsigned int __id_t;
33typedef long int __time_t;
34typedef unsigned int __useconds_t;
35typedef long int __suseconds_t;
36typedef int __daddr_t;
37typedef long int __swblk_t;
38typedef int __key_t;
39typedef int __clockid_t;
40typedef void * __timer_t;
41typedef long int __blksize_t;
42typedef long int __blkcnt_t;
43typedef long int __blkcnt64_t;
44typedef unsigned long int __fsblkcnt_t;
45typedef unsigned long int __fsblkcnt64_t;
46typedef unsigned long int __fsfilcnt_t;
47typedef unsigned long int __fsfilcnt64_t;
48typedef long int __ssize_t;
49typedef __off64_t __loff_t;
50typedef __quad_t *__qaddr_t;
51typedef char *__caddr_t;
52typedef long int __intptr_t;
53typedef unsigned int __socklen_t;
54typedef long unsigned int size_t;
55
56typedef __time_t time_t;
57
58
59struct timespec
60 {
61 __time_t tv_sec;
62 long int tv_nsec;
63 };
64typedef __pid_t pid_t;
65struct sched_param
66 {
67 int __sched_priority;
68 };
69
70
71struct __sched_param
72 {
73 int __sched_priority;
74 };
75typedef unsigned long int __cpu_mask;
76typedef struct
77{
78 __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
79} cpu_set_t;
80
81extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
82 __attribute__ ((__nothrow__ , __leaf__));
83extern cpu_set_t *__sched_cpualloc (size_t __count) __attribute__ ((__nothrow__ , __leaf__)) ;
84extern void __sched_cpufree (cpu_set_t *__set) __attribute__ ((__nothrow__ , __leaf__));
85
86
87extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
88 __attribute__ ((__nothrow__ , __leaf__));
89extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__));
90extern int sched_setscheduler (__pid_t __pid, int __policy,
91 __const struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__));
92extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
93extern int sched_yield (void) __attribute__ ((__nothrow__ , __leaf__));
94extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__ , __leaf__));
95extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__ , __leaf__));
96extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__ , __leaf__));
97
98
99
100typedef __clock_t clock_t;
101
102
103typedef __clockid_t clockid_t;
104
105
106typedef __timer_t timer_t;
107
108struct tm
109{
110 int tm_sec;
111 int tm_min;
112 int tm_hour;
113 int tm_mday;
114 int tm_mon;
115 int tm_year;
116 int tm_wday;
117 int tm_yday;
118 int tm_isdst;
119 long int tm_gmtoff;
120 __const char *tm_zone;
121};
122
123
124struct itimerspec
125 {
126 struct timespec it_interval;
127 struct timespec it_value;
128 };
129struct sigevent;
130
131extern clock_t clock (void) __attribute__ ((__nothrow__ , __leaf__));
132extern time_t time (time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
133extern double difftime (time_t __time1, time_t __time0)
134 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
135extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
136extern size_t strftime (char *__restrict __s, size_t __maxsize,
137 __const char *__restrict __format,
138 __const struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
139
140typedef struct __locale_struct
141{
142 struct __locale_data *__locales[13];
143 const unsigned short int *__ctype_b;
144 const int *__ctype_tolower;
145 const int *__ctype_toupper;
146 const char *__names[13];
147} *__locale_t;
148typedef __locale_t locale_t;
149extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
150 __const char *__restrict __format,
151 __const struct tm *__restrict __tp,
152 __locale_t __loc) __attribute__ ((__nothrow__ , __leaf__));
153
154extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
155extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
156
157extern struct tm *gmtime_r (__const time_t *__restrict __timer,
158 struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
159extern struct tm *localtime_r (__const time_t *__restrict __timer,
160 struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
161
162extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
163extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
164
165extern char *asctime_r (__const struct tm *__restrict __tp,
166 char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
167extern char *ctime_r (__const time_t *__restrict __timer,
168 char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
169extern char *__tzname[2];
170extern int __daylight;
171extern long int __timezone;
172extern char *tzname[2];
173extern void tzset (void) __attribute__ ((__nothrow__ , __leaf__));
174extern int daylight;
175extern long int timezone;
176extern int stime (__const time_t *__when) __attribute__ ((__nothrow__ , __leaf__));
177extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
178extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
179extern int dysize (int __year) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
180extern int nanosleep (__const struct timespec *__requested_time,
181 struct timespec *__remaining);
182extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__ , __leaf__));
183extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__ , __leaf__));
184extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
185 __attribute__ ((__nothrow__ , __leaf__));
186extern int clock_nanosleep (clockid_t __clock_id, int __flags,
187 __const struct timespec *__req,
188 struct timespec *__rem);
189extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__ , __leaf__));
190extern int timer_create (clockid_t __clock_id,
191 struct sigevent *__restrict __evp,
192 timer_t *__restrict __timerid) __attribute__ ((__nothrow__ , __leaf__));
193extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__));
194extern int timer_settime (timer_t __timerid, int __flags,
195 __const struct itimerspec *__restrict __value,
196 struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__ , __leaf__));
197extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
198 __attribute__ ((__nothrow__ , __leaf__));
199extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__));
200
201typedef unsigned long int pthread_t;
202typedef union
203{
204 char __size[56];
205 long int __align;
206} pthread_attr_t;
207typedef struct __pthread_internal_list
208{
209 struct __pthread_internal_list *__prev;
210 struct __pthread_internal_list *__next;
211} __pthread_list_t;
212typedef union
213{
214 struct __pthread_mutex_s
215 {
216 int __lock;
217 unsigned int __count;
218 int __owner;
219 unsigned int __nusers;
220 int __kind;
221 int __spins;
222 __pthread_list_t __list;
223 } __data;
224 char __size[40];
225 long int __align;
226} pthread_mutex_t;
227typedef union
228{
229 char __size[4];
230 int __align;
231} pthread_mutexattr_t;
232typedef union
233{
234 struct
235 {
236 int __lock;
237 unsigned int __futex;
238 __extension__ unsigned long long int __total_seq;
239 __extension__ unsigned long long int __wakeup_seq;
240 __extension__ unsigned long long int __woken_seq;
241 void *__mutex;
242 unsigned int __nwaiters;
243 unsigned int __broadcast_seq;
244 } __data;
245 char __size[48];
246 __extension__ long long int __align;
247} pthread_cond_t;
248typedef union
249{
250 char __size[4];
251 int __align;
252} pthread_condattr_t;
253typedef unsigned int pthread_key_t;
254typedef int pthread_once_t;
255typedef union
256{
257 struct
258 {
259 int __lock;
260 unsigned int __nr_readers;
261 unsigned int __readers_wakeup;
262 unsigned int __writer_wakeup;
263 unsigned int __nr_readers_queued;
264 unsigned int __nr_writers_queued;
265 int __writer;
266 int __shared;
267 unsigned long int __pad1;
268 unsigned long int __pad2;
269 unsigned int __flags;
270 } __data;
271 char __size[56];
272 long int __align;
273} pthread_rwlock_t;
274typedef union
275{
276 char __size[8];
277 long int __align;
278} pthread_rwlockattr_t;
279typedef volatile int pthread_spinlock_t;
280typedef union
281{
282 char __size[32];
283 long int __align;
284} pthread_barrier_t;
285typedef union
286{
287 char __size[4];
288 int __align;
289} pthread_barrierattr_t;
290typedef long int __jmp_buf[8];
291enum
292{
293 PTHREAD_CREATE_JOINABLE,
294 PTHREAD_CREATE_DETACHED
295};
296enum
297{
298 PTHREAD_MUTEX_TIMED_NP,
299 PTHREAD_MUTEX_RECURSIVE_NP,
300 PTHREAD_MUTEX_ERRORCHECK_NP,
301 PTHREAD_MUTEX_ADAPTIVE_NP
302 ,
303 PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
304 PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
305 PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
306 PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
307};
308enum
309{
310 PTHREAD_MUTEX_STALLED,
311 PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
312 PTHREAD_MUTEX_ROBUST,
313 PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
314};
315enum
316{
317 PTHREAD_RWLOCK_PREFER_READER_NP,
318 PTHREAD_RWLOCK_PREFER_WRITER_NP,
319 PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
320 PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
321};
322enum
323{
324 PTHREAD_INHERIT_SCHED,
325 PTHREAD_EXPLICIT_SCHED
326};
327enum
328{
329 PTHREAD_SCOPE_SYSTEM,
330 PTHREAD_SCOPE_PROCESS
331};
332enum
333{
334 PTHREAD_PROCESS_PRIVATE,
335 PTHREAD_PROCESS_SHARED
336};
337struct _pthread_cleanup_buffer
338{
339 void (*__routine) (void *);
340 void *__arg;
341 int __canceltype;
342 struct _pthread_cleanup_buffer *__prev;
343};
344enum
345{
346 PTHREAD_CANCEL_ENABLE,
347 PTHREAD_CANCEL_DISABLE
348};
349enum
350{
351 PTHREAD_CANCEL_DEFERRED,
352 PTHREAD_CANCEL_ASYNCHRONOUS
353};
354
355extern int pthread_create (pthread_t *__restrict __newthread,
356 __const pthread_attr_t *__restrict __attr,
357 void *(*__start_routine) (void *),
358 void *__restrict __arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));
359extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
360extern int pthread_join (pthread_t __th, void **__thread_return);
361extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__ , __leaf__));
362extern pthread_t pthread_self (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
363extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __attribute__ ((__nothrow__ , __leaf__));
364extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
365extern int pthread_attr_destroy (pthread_attr_t *__attr)
366 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
367extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
368 int *__detachstate)
369 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
370extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
371 int __detachstate)
372 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
373extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr,
374 size_t *__guardsize)
375 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
376extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
377 size_t __guardsize)
378 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
379extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
380 __attr,
381 struct sched_param *__restrict __param)
382 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
383extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
384 __const struct sched_param *__restrict
385 __param) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
386extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
387 __attr, int *__restrict __policy)
388 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
389extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
390 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
391extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
392 __attr, int *__restrict __inherit)
393 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
394extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
395 int __inherit)
396 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
397extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
398 int *__restrict __scope)
399 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
400extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
401 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
402extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
403 __attr, void **__restrict __stackaddr)
404 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__));
405extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
406 void *__stackaddr)
407 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__));
408extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
409 __attr, size_t *__restrict __stacksize)
410 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
411extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
412 size_t __stacksize)
413 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
414extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
415 void **__restrict __stackaddr,
416 size_t *__restrict __stacksize)
417 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3)));
418extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
419 size_t __stacksize) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
420extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
421 __const struct sched_param *__param)
422 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
423extern int pthread_getschedparam (pthread_t __target_thread,
424 int *__restrict __policy,
425 struct sched_param *__restrict __param)
426 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
427extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
428 __attribute__ ((__nothrow__ , __leaf__));
429extern int pthread_once (pthread_once_t *__once_control,
430 void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2)));
431extern int pthread_setcancelstate (int __state, int *__oldstate);
432extern int pthread_setcanceltype (int __type, int *__oldtype);
433extern int pthread_cancel (pthread_t __th);
434extern void pthread_testcancel (void);
435typedef struct
436{
437 struct
438 {
439 __jmp_buf __cancel_jmp_buf;
440 int __mask_was_saved;
441 } __cancel_jmp_buf[1];
442 void *__pad[4];
443} __pthread_unwind_buf_t __attribute__ ((__aligned__));
444struct __pthread_cleanup_frame
445{
446 void (*__cancel_routine) (void *);
447 void *__cancel_arg;
448 int __do_it;
449 int __cancel_type;
450};
451extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
452 ;
453extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
454 ;
455extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
456 __attribute__ ((__noreturn__))
457 __attribute__ ((__weak__))
458 ;
459struct __jmp_buf_tag;
460extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__ , __leaf__));
461extern int pthread_mutex_init (pthread_mutex_t *__mutex,
462 __const pthread_mutexattr_t *__mutexattr)
463 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
464extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
465 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
466extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
467 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
468extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
469 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
470extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
471 __const struct timespec *__restrict
472 __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
473extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
474 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
475extern int pthread_mutex_getprioceiling (__const pthread_mutex_t *
476 __restrict __mutex,
477 int *__restrict __prioceiling)
478 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
479extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
480 int __prioceiling,
481 int *__restrict __old_ceiling)
482 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
483extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
484 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
485extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
486 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
487extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
488 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
489extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
490 __restrict __attr,
491 int *__restrict __pshared)
492 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
493extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
494 int __pshared)
495 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
496extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
497 __attr, int *__restrict __kind)
498 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
499extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
500 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
501extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t *
502 __restrict __attr,
503 int *__restrict __protocol)
504 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
505extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
506 int __protocol)
507 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
508extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t *
509 __restrict __attr,
510 int *__restrict __prioceiling)
511 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
512extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
513 int __prioceiling)
514 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
515extern int pthread_mutexattr_getrobust (__const pthread_mutexattr_t *__attr,
516 int *__robustness)
517 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
518extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
519 int __robustness)
520 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
521extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
522 __const pthread_rwlockattr_t *__restrict
523 __attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
524extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
525 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
526extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
527 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
528extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
529 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
530extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
531 __const struct timespec *__restrict
532 __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
533extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
534 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
535extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
536 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
537extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
538 __const struct timespec *__restrict
539 __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
540extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
541 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
542extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
543 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
544extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
545 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
546extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
547 __restrict __attr,
548 int *__restrict __pshared)
549 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
550extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
551 int __pshared)
552 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
553extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *
554 __restrict __attr,
555 int *__restrict __pref)
556 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
557extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
558 int __pref) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
559extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
560 __const pthread_condattr_t *__restrict
561 __cond_attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
562extern int pthread_cond_destroy (pthread_cond_t *__cond)
563 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
564extern int pthread_cond_signal (pthread_cond_t *__cond)
565 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
566extern int pthread_cond_broadcast (pthread_cond_t *__cond)
567 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
568extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
569 pthread_mutex_t *__restrict __mutex)
570 __attribute__ ((__nonnull__ (1, 2)));
571extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
572 pthread_mutex_t *__restrict __mutex,
573 __const struct timespec *__restrict
574 __abstime) __attribute__ ((__nonnull__ (1, 2, 3)));
575extern int pthread_condattr_init (pthread_condattr_t *__attr)
576 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
577extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
578 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
579extern int pthread_condattr_getpshared (__const pthread_condattr_t *
580 __restrict __attr,
581 int *__restrict __pshared)
582 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
583extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
584 int __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
585extern int pthread_condattr_getclock (__const pthread_condattr_t *
586 __restrict __attr,
587 __clockid_t *__restrict __clock_id)
588 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
589extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
590 __clockid_t __clock_id)
591 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
592extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
593 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
594extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
595 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
596extern int pthread_spin_lock (pthread_spinlock_t *__lock)
597 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
598extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
599 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
600extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
601 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
602extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
603 __const pthread_barrierattr_t *__restrict
604 __attr, unsigned int __count)
605 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
606extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
607 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
608extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
609 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
610extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
611 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
612extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
613 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
614extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
615 __restrict __attr,
616 int *__restrict __pshared)
617 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
618extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
619 int __pshared)
620 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
621extern int pthread_key_create (pthread_key_t *__key,
622 void (*__destr_function) (void *))
623 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
624extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__));
625extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__));
626extern int pthread_setspecific (pthread_key_t __key,
627 __const void *__pointer) __attribute__ ((__nothrow__ , __leaf__)) ;
628extern int pthread_getcpuclockid (pthread_t __thread_id,
629 __clockid_t *__clock_id)
630 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
631extern int pthread_atfork (void (*__prepare) (void),
632 void (*__parent) (void),
633 void (*__child) (void)) __attribute__ ((__nothrow__ , __leaf__));
634
635int i;
636pthread_mutex_t lock;
637inline int down_interruptible() {
638 pthread_mutex_lock(&lock);
639 return 0;
640}
641inline void up() {
642 pthread_mutex_unlock(&lock);
643 return;
644}
645inline int copy_to_user(int to, int from, int n) {
646 to = from;
647 return __VERIFIER_nondet_int();
648}
649inline int copy_from_user(int to, int from, int n) {
650 to = from;
651 return __VERIFIER_nondet_int();
652}
653inline int __get_user(int size, int ptr)
654{
655 return __VERIFIER_nondet_int();
656}
657inline int __put_user(int size, int ptr)
658{
659 return __VERIFIER_nondet_int();
660}
661int scull_quantum = 4000;
662int scull_qset = 1000;
663int dev_data;
664int dev_quantum;
665int dev_qset;
666int dev_size;
667int __X__;
668int scull_trim(int dev)
669{
670 int qset = dev_qset;
671 dev_size = 0;
672 dev_quantum = scull_quantum;
673 dev_qset = scull_qset;
674 dev_data = 0;
675 return 0;
676}
677inline int scull_open(int tid, int i, int filp)
678{
679 int dev;
680 dev = i;
681 filp = dev;
682 if (down_interruptible())
683 return -512;
684 __X__ = 2;
685 scull_trim(dev);
686 if (!(__X__ >= 2)) ERROR: __VERIFIER_error();
687 up();
688 return 0;
689}
690inline int scull_follow(int dev, int n) {
691 return __VERIFIER_nondet_int();
692}
693inline int scull_read(int tid, int filp, int buf, int count,
694 int f_pos)
695{
696 int dev = filp;
697 int dptr;
698 int quantum = dev_quantum, qset = dev_qset;
699 int itemsize = quantum * qset;
700 int item, s_pos, q_pos, rest;
701 int retval = 0;
702 if (down_interruptible())
703 return -512;
704 __X__ = 0;
705 if (f_pos >= dev_size)
706 goto out;
707 if (f_pos+count >= dev_size)
708 count = dev_size - f_pos;
709 item = f_pos / itemsize;
710 rest = f_pos;
711 s_pos = rest / quantum; q_pos = rest;
712 dptr = scull_follow(dev, item);
713 if (count > quantum - q_pos)
714 count = quantum - q_pos;
715 if (copy_to_user(buf, dev_data + s_pos + q_pos, count)) {
716 retval = -2;
717 goto out;
718 }
719 f_pos += count;
720 retval = count;
721 if (!(__X__ <= 0)) ERROR: __VERIFIER_error();
722 out:
723 up();
724 return retval;
725}
726inline int scull_write(int tid, int filp, int buf, int count,
727 int f_pos)
728{
729 int dev = filp;
730 int dptr;
731 int quantum = dev_quantum, qset = dev_qset;
732 int itemsize = quantum * qset;
733 int item, s_pos, q_pos, rest;
734 int retval = -4;
735 if (down_interruptible())
736 return -512;
737 item = f_pos / itemsize;
738 rest = f_pos;
739 s_pos = rest / quantum; q_pos = rest;
740 dptr = scull_follow(dev, item);
741 if (dptr == 0)
742 goto out;
743 if (count > quantum - q_pos)
744 count = quantum - q_pos;
745 __X__ = 1;
746 if (copy_from_user(dev_data+s_pos+q_pos, buf, count)) {
747 retval = -2;
748 goto out;
749 }
750 f_pos += count;
751 retval = count;
752 if (dev_size < f_pos)
753 dev_size = f_pos;
754 if (!(__X__ == 1)) ERROR: __VERIFIER_error();
755 out:
756 up();
757 return retval;
758}
759inline int scull_ioctl(int i, int filp,
760 int cmd, int arg)
761{
762 int err = 0, tmp;
763 int retval = 0;
764 switch(cmd) {
765 case 0:
766 scull_quantum = 4000;
767 scull_qset = 1000;
768 break;
769 case 1:
770 retval = __get_user(scull_quantum, arg);
771 break;
772 case 3:
773 scull_quantum = arg;
774 break;
775 case 5:
776 retval = __put_user(scull_quantum, arg);
777 break;
778 case 7:
779 return scull_quantum;
780 case 9:
781 tmp = scull_quantum;
782 retval = __get_user(scull_quantum, arg);
783 if (retval == 0)
784 retval = __put_user(tmp, arg);
785 break;
786 case 11:
787 tmp = scull_quantum;
788 scull_quantum = arg;
789 return tmp;
790 case 2:
791 retval = __get_user(scull_qset, arg);
792 break;
793 case 4:
794 scull_qset = arg;
795 break;
796 case 6:
797 retval = __put_user(scull_qset, arg);
798 break;
799 case 8:
800 return scull_qset;
801 case 10:
802 tmp = scull_qset;
803 retval = __get_user(scull_qset, arg);
804 if (retval == 0)
805 retval = __put_user(tmp, arg);
806 break;
807 case 12:
808 tmp = scull_qset;
809 scull_qset = arg;
810 return tmp;
811 default:
812 return -25;
813 }
814 return retval;
815}
816inline int scull_llseek(int filp, int off, int whence, int f_pos)
817{
818 int dev = filp;
819 int newpos;
820 switch(whence) {
821 case 0:
822 newpos = off;
823 break;
824 case 1:
825 newpos = filp + f_pos + off;
826 break;
827 case 2:
828 newpos = dev_size + off;
829 break;
830 default:
831 return -28;
832 }
833 if (newpos < 0) return -28;
834 filp = newpos;
835 return newpos;
836}
837inline void scull_cleanup_module(void)
838{
839 int dev=__VERIFIER_nondet_int();
840 scull_trim(dev);
841}
842inline int scull_init_module()
843{
844 int result = 0;
845 return 0;
846 fail:
847 scull_cleanup_module();
848 return result;
849}
850void *loader(void *arg) {
851 scull_init_module();
852 scull_cleanup_module();
853}
854void *thread1(void *arg) {
855 int filp=__VERIFIER_nondet_int();
856 int buf=__VERIFIER_nondet_int();
857 int count = 10;
858 int off = 0;
859 scull_open(1, i, filp);
860 scull_read(1, filp, buf, count, off);
861 0;
862}
863void *thread2(void *arg) {
864 int filp=__VERIFIER_nondet_int();
865 int buf=__VERIFIER_nondet_int();
866 int count = 10;
867 int off = 0;
868 scull_open(2, i, filp);
869 scull_write(2, filp, buf, count, off);
870 0;
871}
872int main() {
873 pthread_t t1, t2, t3;
874 pthread_mutex_init(&lock, 0);
875 pthread_create(&t1, 0, loader, 0);
876 pthread_create(&t2, 0, thread1, 0);
877 pthread_create(&t3, 0, thread2, 0);
878 pthread_join(t1, 0);
879 pthread_join(t2, 0);
880 pthread_join(t3, 0);
881 pthread_mutex_destroy(&lock);
882 return 0;
883}
Note: See TracBrowser for help on using the repository browser.