-
Notifications
You must be signed in to change notification settings - Fork 273
/
Copy pathcprover.h
75 lines (58 loc) · 2.89 KB
/
cprover.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*******************************************************************\
Module: C library check
Author: Daniel Kroening, [email protected]
\*******************************************************************/
#ifndef CPROVER_ANSI_C_LIBRARY_CPROVER_H
#define CPROVER_ANSI_C_LIBRARY_CPROVER_H
/// \file
/// CPROVER built-in declarations to perform library checks. This file is only
/// used by library_check.sh.
// NOLINTNEXTLINE(readability/identifiers)
typedef __typeof__(sizeof(int)) __CPROVER_size_t;
// NOLINTNEXTLINE(readability/identifiers)
typedef signed long long __CPROVER_ssize_t;
void *__CPROVER_allocate(__CPROVER_size_t size, __CPROVER_bool zero);
void __CPROVER_deallocate(void *);
extern const void *__CPROVER_deallocated;
extern const void *__CPROVER_memory_leak;
extern int __CPROVER_malloc_failure_mode;
extern __CPROVER_bool __CPROVER_malloc_may_fail;
// The maximum size of an object that we can handle under the object:offset
// pointer encoding. Marked thread-local as it is a per-analysis constant that
// can safely be constant-propagated even in concurrent execution.
extern __CPROVER_thread_local __CPROVER_size_t __CPROVER_max_malloc_size;
// malloc failure modes
extern int __CPROVER_malloc_failure_mode_return_null;
extern int __CPROVER_malloc_failure_mode_assert_then_assume;
struct __CPROVER_pipet {
_Bool widowed;
char data[4];
short next_avail;
short next_unread;
};
// __CPROVER_equal expects two arguments of the same type -- any type is
// permitted, unsigned long long is just used for the benefit of running syntax
// checks using system compilers
__CPROVER_bool __CPROVER_equal(unsigned long long, unsigned long long);
// The following built-ins are type checked by our C front-end and do not
// require declarations. They work with any types as described below. unsigned
// long long is just used to enable checks using system compilers.
// detect overflow
// the following expect two numeric arguments
__CPROVER_bool __CPROVER_overflow_minus(unsigned long long, unsigned long long);
__CPROVER_bool __CPROVER_overflow_mult(unsigned long long, unsigned long long);
__CPROVER_bool __CPROVER_overflow_plus(unsigned long long, unsigned long long);
__CPROVER_bool __CPROVER_overflow_shl(unsigned long long, unsigned long long);
// expects one numeric argument
__CPROVER_bool __CPROVER_overflow_unary_minus(unsigned long long);
// enumerations
// expects one enum-typed argument
__CPROVER_bool __CPROVER_enum_is_in_range(unsigned long long);
// The following have an optional second parameter (the width), and are
// polymorphic in the first parameter: if the second argument is omitted, then
// the width of the subtype of the pointer-typed first argument is used.
__CPROVER_bool __CPROVER_r_ok(const void *, ...);
__CPROVER_bool __CPROVER_w_ok(const void *, ...);
__CPROVER_bool __CPROVER_rw_ok(const void *, ...);
#include "../cprover_builtin_headers.h"
#endif // CPROVER_ANSI_C_LIBRARY_CPROVER_H