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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
|
[kernel] Parsing ghost_cv_valid_use.i (no preprocessing)
/* Generated by Frama-C */
typedef int int_array[10];
struct Type {
int field ;
};
void instr(void)
{
/*@ ghost int x; */
/*@ ghost int \ghost *p; */
/*@ ghost int arr[10]; */
/*@ ghost x = 1; */
/*@ ghost *p = 1; */
/*@ ghost arr[0] = 1; */
return;
}
void named(void)
{
/*@ ghost int_array a; */
/*@ ghost a[0] = 42; */
return;
}
void field_access(void)
{
struct Type ng_var;
/*@ ghost struct Type g_var; */
ng_var.field = 42;
/*@ ghost g_var.field = 42; */
return;
}
void nested(void)
{
/*@ ghost int **ptrp; */
/*@ ghost int * \ghost *ptrpg; */
/*@ ghost int \ghost * \ghost *ptrpgg; */
/*@ ghost int \ghost arra[10][10]; */
/*@ ghost int *arrp[10]; */
/*@ ghost int \ghost *arrpg[10]; */
/*@ ghost int (*ptra)[10]; */
/*@ ghost int \ghost (*ptrag)[10]; */
/*@ ghost ptrp = (int **)0; */
/*@ ghost ptrpg = (int * \ghost *)0; */
/*@ ghost *ptrpg = (int *)0; */
/*@ ghost ptrpgg = (int \ghost * \ghost *)0; */
/*@ ghost *ptrpgg = (int \ghost *)0; */
/*@ ghost *(*ptrpgg) = 1; */
/*@ ghost arra[0][0] = 1; */
/*@ ghost arrp[0] = (int *)0; */
/*@ ghost arrpg[0] = (int \ghost *)0; */
/*@ ghost *(arrpg[0]) = 1; */
/*@ ghost ptra = (int (*)[10])0; */
/*@ ghost ptrag = (int \ghost (*)[10])0; */
/*@ ghost (*ptrag)[0] = 1; */
return;
}
void assigns_clause(void)
{
/*@ ghost int *p; */
{
int i = 0;
/*@ loop assigns p, i; */
while (i < 10) i ++;
}
/*@ ghost
{
int i_0 = 0;
/@ loop assigns p, i_0; @/
while (i_0 < 10) i_0 ++;
}
*/
return;
}
/*@ ghost /@ assigns *p; @/
void g_decl_star(int \ghost *p); */
/*@ ghost /@ assigns *p; @/
void g_def_star(int \ghost *p)
{
return;
}
*/
/*@ assigns *p; */
void ng_decl_star(void) /*@ ghost (int \ghost *p) */;
/*@ assigns *p; */
void ng_def_star(void) /*@ ghost (int \ghost *p) */
{
return;
}
/*@ assigns *p; */
void ng_decl_star_ng(void) /*@ ghost (int *p) */;
/*@ assigns *p; */
void ng_def_star_ng(void) /*@ ghost (int *p) */
{
return;
}
void assigns_loop_star(void)
{
/*@ ghost int \ghost *p; */
{
int i = 0;
/*@ loop assigns *p, i; */
while (i < 10) i ++;
}
/*@ ghost
{
int i_0 = 0;
/@ loop assigns *p, i_0; @/
while (i_0 < 10) i_0 ++;
}
*/
return;
}
/*@ ghost
/@ assigns *(p + (0 .. max)); @/
void g_decl_set(int \ghost *p, int max); */
/*@ ghost
/@ assigns *(p + (0 .. max)); @/
void g_def_set(int \ghost *p, int max)
{
return;
}
*/
/*@ assigns *(p + (0 .. max)); */
void ng_decl_set(int max) /*@ ghost (int \ghost *p) */;
/*@ assigns *(p + (0 .. max)); */
void ng_def_set(int max) /*@ ghost (int \ghost *p) */
{
return;
}
/*@ assigns *(p + (0 .. max)); */
void ng_decl_set_ng(int max) /*@ ghost (int \ghost *p) */;
/*@ assigns *(p + (0 .. max)); */
void ng_def_set_ng(int max) /*@ ghost (int \ghost *p) */
{
return;
}
void assigns_loop_set(void)
{
/*@ ghost int \ghost *p; */
int max = 42;
{
int i = 0;
/*@ loop assigns *(p + (0 .. max)), i; */
while (i < 10) i ++;
}
/*@ ghost
{
int i_0 = 0;
/@ loop assigns *(p + (0 .. max)), i_0; @/
while (i_0 < 10) i_0 ++;
}
*/
return;
}
/*@ ghost /@ assigns \nothing; @/
void ghost_decl_nothing(int *a); */
/*@ ghost /@ assigns *a; @/
void ghost_decl_valid_a(int \ghost *a); */
/*@ ghost void ghost_def_nothing(int *a)
{
int x = *a;
return;
}
*/
/*@ ghost void ghost_def_valid_a(int \ghost *a)
{
*a = 42;
return;
}
*/
void assigns_nothing_or_correct(void)
{
int ng;
/*@ ghost int g; */
/*@ ghost ghost_decl_nothing(& ng); */
/*@ ghost ghost_def_nothing(& ng); */
/*@ ghost ghost_decl_valid_a(& g); */
/*@ ghost ghost_def_valid_a(& g); */
return;
}
|