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 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
|
[kernel] Parsing share/libc/__fc_builtin_for_normalization.i (no preprocessing)
[kernel] Parsing tests/syntax/gcc_builtins.c (with preprocessing)
/* Generated by Frama-C */
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned int uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
/* compiler builtin:
short __sync_add_and_fetch_int16_t(short *ptr, short value , ...); */
/* compiler builtin:
int __sync_add_and_fetch_int32_t(int *ptr, int value , ...); */
/* compiler builtin:
long long __sync_add_and_fetch_int64_t(long long *ptr, long long value
, ...); */
/* compiler builtin:
int __sync_bool_compare_and_swap_uint16_t(unsigned short *ptr,
unsigned short oldval,
unsigned short newval , ...); */
/* compiler builtin:
int __sync_bool_compare_and_swap_uint32_t(unsigned int *ptr,
unsigned int oldval,
unsigned int newval , ...); */
/* compiler builtin:
int __sync_bool_compare_and_swap_uint64_t(unsigned long long *ptr,
unsigned long long oldval,
unsigned long long newval , ...); */
/* compiler builtin:
short __sync_fetch_and_add_int16_t(short *ptr, short value , ...); */
/* compiler builtin:
int __sync_fetch_and_add_int32_t(int *ptr, int value , ...); */
/* compiler builtin:
long long __sync_fetch_and_add_int64_t(long long *ptr, long long value
, ...); */
/* compiler builtin:
short __sync_fetch_and_sub_int16_t(short *ptr, short value , ...); */
/* compiler builtin:
int __sync_fetch_and_sub_int32_t(int *ptr, int value , ...); */
/* compiler builtin:
long long __sync_fetch_and_sub_int64_t(long long *ptr, long long value
, ...); */
/* compiler builtin:
short __sync_sub_and_fetch_int16_t(short *ptr, short value , ...); */
/* compiler builtin:
int __sync_sub_and_fetch_int32_t(int *ptr, int value , ...); */
/* compiler builtin:
long long __sync_sub_and_fetch_int64_t(long long *ptr, long long value
, ...); */
short __sync_fetch_and_add_int16_t(short *ptr, short value , ...)
{
int16_t tmp;
tmp = *ptr;
*ptr = (short)((int)*ptr + (int)value);
return tmp;
}
short __sync_fetch_and_sub_int16_t(short *ptr, short value , ...)
{
int16_t tmp;
tmp = *ptr;
*ptr = (short)((int)*ptr - (int)value);
return tmp;
}
int __sync_fetch_and_add_int32_t(int *ptr, int value , ...)
{
int32_t tmp;
tmp = *ptr;
*ptr += value;
return tmp;
}
int __sync_fetch_and_sub_int32_t(int *ptr, int value , ...)
{
int32_t tmp;
tmp = *ptr;
*ptr -= value;
return tmp;
}
long long __sync_fetch_and_add_int64_t(long long *ptr, long long value , ...)
{
int64_t tmp;
tmp = *ptr;
*ptr += value;
return tmp;
}
long long __sync_fetch_and_sub_int64_t(long long *ptr, long long value , ...)
{
int64_t tmp;
tmp = *ptr;
*ptr -= value;
return tmp;
}
short __sync_add_and_fetch_int16_t(short *ptr, short value , ...)
{
short __retres;
*ptr = (short)((int)*ptr + (int)value);
__retres = *ptr;
return __retres;
}
short __sync_sub_and_fetch_int16_t(short *ptr, short value , ...)
{
short __retres;
*ptr = (short)((int)*ptr - (int)value);
__retres = *ptr;
return __retres;
}
int __sync_add_and_fetch_int32_t(int *ptr, int value , ...)
{
int __retres;
*ptr += value;
__retres = *ptr;
return __retres;
}
int __sync_sub_and_fetch_int32_t(int *ptr, int value , ...)
{
int __retres;
*ptr -= value;
__retres = *ptr;
return __retres;
}
long long __sync_add_and_fetch_int64_t(long long *ptr, long long value , ...)
{
long long __retres;
*ptr += value;
__retres = *ptr;
return __retres;
}
long long __sync_sub_and_fetch_int64_t(long long *ptr, long long value , ...)
{
long long __retres;
*ptr -= value;
__retres = *ptr;
return __retres;
}
int __sync_bool_compare_and_swap_uint16_t(unsigned short *ptr,
unsigned short oldval,
unsigned short newval , ...)
{
int __retres;
if ((int)*ptr == (int)oldval) {
*ptr = newval;
__retres = 1;
goto return_label;
}
else {
__retres = 0;
goto return_label;
}
return_label: return __retres;
}
int __sync_bool_compare_and_swap_uint32_t(unsigned int *ptr,
unsigned int oldval,
unsigned int newval , ...)
{
int __retres;
if (*ptr == oldval) {
*ptr = newval;
__retres = 1;
goto return_label;
}
else {
__retres = 0;
goto return_label;
}
return_label: return __retres;
}
int __sync_bool_compare_and_swap_uint64_t(unsigned long long *ptr,
unsigned long long oldval,
unsigned long long newval , ...)
{
int __retres;
if (*ptr == oldval) {
*ptr = newval;
__retres = 1;
goto return_label;
}
else {
__retres = 0;
goto return_label;
}
return_label: return __retres;
}
void main(void)
{
int x_1;
int tmp;
{
int16_t content;
int16_t *ptr;
int16_t value;
int16_t result;
content = (short)100;
ptr = & content;
value = (short)33;
result = __sync_fetch_and_add_int16_t(ptr,value);
/*@ assert result ≡ 100 ∧ content ≡ 133; */ ;
result = __sync_fetch_and_add_int16_t(ptr,(short)(-11));
/*@ assert result ≡ 133 ∧ content ≡ 122; */ ;
result = __sync_fetch_and_sub_int16_t(ptr,value);
/*@ assert result ≡ 122 ∧ content ≡ 89; */ ;
result = __sync_fetch_and_sub_int16_t(ptr,(short)(-11));
/*@ assert result ≡ 89 ∧ content ≡ 100; */ ;
}
{
int32_t content_0;
int32_t *ptr_0;
int32_t value_0;
int32_t result_0;
content_0 = 100;
ptr_0 = & content_0;
value_0 = 33;
result_0 = __sync_fetch_and_add_int32_t(ptr_0,value_0);
/*@ assert result_0 ≡ 100 ∧ content_0 ≡ 133; */ ;
result_0 = __sync_fetch_and_add_int32_t(ptr_0,-11);
/*@ assert result_0 ≡ 133 ∧ content_0 ≡ 122; */ ;
result_0 = __sync_fetch_and_sub_int32_t(ptr_0,value_0);
/*@ assert result_0 ≡ 122 ∧ content_0 ≡ 89; */ ;
result_0 = __sync_fetch_and_sub_int32_t(ptr_0,-11);
/*@ assert result_0 ≡ 89 ∧ content_0 ≡ 100; */ ;
}
{
int64_t content_1;
int64_t *ptr_1;
int64_t value_1;
int64_t result_1;
content_1 = (long long)100;
ptr_1 = & content_1;
value_1 = (long long)33;
result_1 = __sync_fetch_and_add_int64_t(ptr_1,value_1);
/*@ assert result_1 ≡ 100 ∧ content_1 ≡ 133; */ ;
result_1 = __sync_fetch_and_add_int64_t(ptr_1,(long long)(-11));
/*@ assert result_1 ≡ 133 ∧ content_1 ≡ 122; */ ;
result_1 = __sync_fetch_and_sub_int64_t(ptr_1,value_1);
/*@ assert result_1 ≡ 122 ∧ content_1 ≡ 89; */ ;
result_1 = __sync_fetch_and_sub_int64_t(ptr_1,(long long)(-11));
/*@ assert result_1 ≡ 89 ∧ content_1 ≡ 100; */ ;
}
{
uint16_t content_2;
uint16_t *ptr_2;
uint16_t oldval;
uint16_t newval;
int result_2;
content_2 = (unsigned short)100;
ptr_2 = & content_2;
oldval = (unsigned short)100;
newval = (unsigned short)133;
result_2 = __sync_bool_compare_and_swap_uint16_t(ptr_2,oldval,newval);
/*@ assert result_2 ≡ 1 ∧ *ptr_2 ≡ newval; */ ;
}
{
uint32_t content_3;
uint32_t *ptr_3;
uint32_t oldval_0;
uint32_t newval_0;
int result_3;
content_3 = (unsigned int)100;
ptr_3 = & content_3;
oldval_0 = (unsigned int)100;
newval_0 = (unsigned int)133;
result_3 = __sync_bool_compare_and_swap_uint32_t(ptr_3,oldval_0,newval_0);
/*@ assert result_3 ≡ 1 ∧ *ptr_3 ≡ newval_0; */ ;
}
{
uint64_t content_4;
uint64_t *ptr_4;
uint64_t oldval_1;
uint64_t newval_1;
int result_4;
content_4 = (unsigned long long)100;
ptr_4 = & content_4;
oldval_1 = (unsigned long long)100;
newval_1 = (unsigned long long)133;
result_4 = __sync_bool_compare_and_swap_uint64_t(ptr_4,oldval_1,newval_1);
/*@ assert result_4 ≡ 1 ∧ *ptr_4 ≡ newval_1; */ ;
}
if ((long)(4 == 4)) {
int x;
x = 1;
}
if ((long)(3 == 4)) {
int x_0;
x_0 = 0;
}
x_1 = 2;
{ /* sequence */
;
tmp = x_1;
x_1 ++;
;
}
if ((long)tmp) {
int y;
y = x_1;
}
return;
}
|