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 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544
|
/* { dg-require-effective-target int128 } */
/* { dg-require-effective-target sync_char_short } */
/* { dg-require-effective-target sync_int_long_stack } */
/* { dg-require-effective-target sync_int_long } */
#include <stdint.h>
#include "analyzer-decls.h"
/* __atomic_exchange. */
void test__atomic_exchange_on_int8 (int8_t i, int8_t j)
{
int8_t orig_i = i;
int8_t orig_j = j;
int8_t ret;
__atomic_exchange (&i, &j, &ret, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
void test__atomic_exchange_on_int16 (int16_t i, int16_t j)
{
int16_t orig_i = i;
int16_t orig_j = j;
int16_t ret;
__atomic_exchange (&i, &j, &ret, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
void test__atomic_exchange_on_int32 (int32_t i, int32_t j)
{
int32_t orig_i = i;
int32_t orig_j = j;
int32_t ret;
__atomic_exchange (&i, &j, &ret, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
void test__atomic_exchange_on_int64 (int64_t i, int64_t j)
{
int64_t orig_i = i;
int64_t orig_j = j;
int64_t ret;
__atomic_exchange (&i, &j, &ret, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
void test__atomic_exchange_on_int128 (__int128 i, __int128 j)
{
__int128 orig_i = i;
__int128 orig_j = j;
__int128 ret;
__atomic_exchange (&i, &j, &ret, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
/* __atomic_exchange_n. */
void test__atomic_exchange_n_on_int8 (int8_t i, int8_t j)
{
int8_t orig_i = i;
int8_t orig_j = j;
int8_t ret;
ret = __atomic_exchange_n (&i, j, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
void test__atomic_exchange_n_on_int16 (int16_t i, int16_t j)
{
int16_t orig_i = i;
int16_t orig_j = j;
int16_t ret;
ret = __atomic_exchange_n (&i, j, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
void test__atomic_exchange_n_on_int32 (int32_t i, int32_t j)
{
int32_t orig_i = i;
int32_t orig_j = j;
int32_t ret;
ret = __atomic_exchange_n (&i, j, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
void test__atomic_exchange_n_on_int64 (int64_t i, int64_t j)
{
int64_t orig_i = i;
int64_t orig_j = j;
int64_t ret;
ret = __atomic_exchange_n (&i, j, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
void test__atomic_exchange_n_on_int128 (__int128 i, __int128 j)
{
__int128 orig_i = i;
__int128 orig_j = j;
__int128 ret;
ret = __atomic_exchange_n (&i, j, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
/* __atomic_exchange_1 through __atomic_exchange_16. */
void test__atomic_exchange_1 (int8_t i, int8_t j)
{
int8_t orig_i = i;
int8_t orig_j = j;
int8_t ret;
ret = __atomic_exchange_1 (&i, j, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
void test__atomic_exchange_2 (int16_t i, int16_t j)
{
int16_t orig_i = i;
int16_t orig_j = j;
int16_t ret;
ret = __atomic_exchange_2 (&i, j, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
void test__atomic_exchange_4 (int32_t i, int32_t j)
{
int32_t orig_i = i;
int32_t orig_j = j;
int32_t ret;
ret = __atomic_exchange_4 (&i, j, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
void test__atomic_exchange_8 (int64_t i, int64_t j)
{
int64_t orig_i = i;
int64_t orig_j = j;
int64_t ret;
ret = __atomic_exchange_8 (&i, j, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
void test__atomic_exchange_16 (__int128 i, __int128 j)
{
__int128 orig_i = i;
__int128 orig_j = j;
__int128 ret;
ret = __atomic_exchange_16 (&i, j, 0);
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (i == orig_j); /* { dg-warning "TRUE" } */
}
/* __atomic_load. */
void test__atomic_load_from_int8 (int8_t i)
{
int8_t orig_i = i;
int8_t ret;
__atomic_load (&i, &ret, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_load_from_int16 (int16_t i)
{
int16_t orig_i = i;
int16_t ret;
__atomic_load (&i, &ret, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_load_from_int32 (int32_t i)
{
int32_t orig_i = i;
int32_t ret;
__atomic_load (&i, &ret, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_load_from_int64 (int64_t i)
{
int64_t orig_i = i;
int64_t ret;
__atomic_load (&i, &ret, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_load_from_int1288 (__int128 i)
{
__int128 orig_i = i;
__int128 ret;
__atomic_load (&i, &ret, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
/* __atomic_load_n. */
void test__atomic_load_n_from_int8 (int8_t i)
{
int8_t orig_i = i;
int8_t ret;
ret = __atomic_load_n (&i, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_load_n_from_int16 (int16_t i)
{
int16_t orig_i = i;
int16_t ret;
ret = __atomic_load_n (&i, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_load_n_from_int32 (int32_t i)
{
int32_t orig_i = i;
int32_t ret;
ret = __atomic_load_n (&i, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_load_n_from_int64 (int64_t i)
{
int64_t orig_i = i;
int64_t ret;
ret = __atomic_load_n (&i, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_load_n_from_int128 (__int128 i)
{
__int128 orig_i = i;
__int128 ret;
ret = __atomic_load_n (&i, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
/* __atomic_load_1 through __atomic_load_16. */
void test__atomic_load_1 (int8_t i)
{
int8_t orig_i = i;
int8_t ret;
ret = __atomic_load_1 (&i, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_load_2 (int16_t i)
{
int16_t orig_i = i;
int16_t ret;
ret = __atomic_load_2 (&i, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_load_4 (int32_t i)
{
int32_t orig_i = i;
int32_t ret;
ret = __atomic_load_4 (&i, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_load_8 (int64_t i)
{
int64_t orig_i = i;
int64_t ret;
ret = __atomic_load_8 (&i, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_load_16 (__int128 i)
{
__int128 orig_i = i;
__int128 ret;
ret = __atomic_load_16 (&i, 0);
__analyzer_eval (i == orig_i); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_store_n_on_uint8 (uint8_t i)
{
uint8_t tmp;
__atomic_store_n (&tmp, i, 0);
__analyzer_eval (tmp == i); /* { dg-warning "TRUE" } */
}
void test__atomic_store_n_on_uint16 (uint16_t i)
{
uint16_t tmp;
__atomic_store_n (&tmp, i, 0);
__analyzer_eval (tmp == i); /* { dg-warning "TRUE" } */
}
void test__atomic_store_n_on_uint32 (uint32_t i)
{
uint32_t tmp;
__atomic_store_n (&tmp, i, 0);
__analyzer_eval (tmp == i); /* { dg-warning "TRUE" } */
}
void test__atomic_store_n_on_uint64 (uint64_t i)
{
uint64_t tmp;
__atomic_store_n (&tmp, i, 0);
__analyzer_eval (tmp == i); /* { dg-warning "TRUE" } */
}
void test__atomic_store_n_on_int128 (__int128 i)
{
__int128 tmp;
__atomic_store_n (&tmp, i, 0);
__analyzer_eval (tmp == i); /* { dg-warning "TRUE" } */
}
/* __atomic_OP_fetch built-ins. */
/* __atomic_add_fetch. */
void test__atomic_add_fetch_on_uint32_t (uint32_t i, uint32_t j)
{
uint32_t orig_i = i;
uint32_t ret;
ret = __atomic_add_fetch (&i, j, 0);
__analyzer_eval (i == (orig_i + j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == i); /* { dg-warning "TRUE" } */
}
void test__atomic_add_fetch_on_uint64_t (uint64_t i, uint64_t j)
{
uint64_t orig_i = i;
uint64_t ret;
ret = __atomic_add_fetch (&i, j, 0);
__analyzer_eval (i == (orig_i + j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == i); /* { dg-warning "TRUE" } */
}
/* __atomic_sub_fetch. */
void test__atomic_sub_fetch_on_uint32_t (uint32_t i, uint32_t j)
{
uint32_t orig_i = i;
uint32_t ret;
ret = __atomic_sub_fetch (&i, j, 0);
__analyzer_eval (i == (orig_i - j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == i); /* { dg-warning "TRUE" } */
}
void test__atomic_sub_fetch_on_uint64_t (uint64_t i, uint64_t j)
{
uint64_t orig_i = i;
uint64_t ret;
ret = __atomic_sub_fetch (&i, j, 0);
__analyzer_eval (i == (orig_i - j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == i); /* { dg-warning "TRUE" } */
}
/* __atomic_and_fetch. */
void test__atomic_and_fetch_on_uint32_t (uint32_t i, uint32_t j)
{
uint32_t orig_i = i;
uint32_t ret;
ret = __atomic_and_fetch (&i, j, 0);
__analyzer_eval (i == (orig_i & j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == i); /* { dg-warning "TRUE" } */
}
void test__atomic_and_fetch_on_uint64_t (uint64_t i, uint64_t j)
{
uint64_t orig_i = i;
uint64_t ret;
ret = __atomic_and_fetch (&i, j, 0);
__analyzer_eval (i == (orig_i & j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == i); /* { dg-warning "TRUE" } */
}
/* __atomic_xor_fetch. */
void test__atomic_xor_fetch_on_uint32_t (uint32_t i, uint32_t j)
{
uint32_t orig_i = i;
uint32_t ret;
ret = __atomic_xor_fetch (&i, j, 0);
__analyzer_eval (i == (orig_i ^ j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == i); /* { dg-warning "TRUE" } */
}
void test__atomic_xor_fetch_on_uint64_t (uint64_t i, uint64_t j)
{
uint64_t orig_i = i;
uint64_t ret;
ret = __atomic_xor_fetch (&i, j, 0);
__analyzer_eval (i == (orig_i ^ j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == i); /* { dg-warning "TRUE" } */
}
/* __atomic_or_fetch. */
void test__atomic_or_fetch_on_uint32_t (uint32_t i, uint32_t j)
{
uint32_t orig_i = i;
uint32_t ret;
ret = __atomic_or_fetch (&i, j, 0);
__analyzer_eval (i == (orig_i | j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == i); /* { dg-warning "TRUE" } */
}
void test__atomic_or_fetch_on_uint64_t (uint64_t i, uint64_t j)
{
uint64_t orig_i = i;
uint64_t ret;
ret = __atomic_or_fetch (&i, j, 0);
__analyzer_eval (i == (orig_i | j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == i); /* { dg-warning "TRUE" } */
}
/* __atomic_fetch_OP built-ins. */
/* __atomic_fetch_add. */
void test__atomic_fetch_add_on_uint32_t (uint32_t i, uint32_t j)
{
uint32_t orig_i = i;
uint32_t ret;
ret = __atomic_fetch_add (&i, j, 0);
__analyzer_eval (i == (orig_i + j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_fetch_add_on_uint64_t (uint64_t i, uint64_t j)
{
uint64_t orig_i = i;
uint64_t ret;
ret = __atomic_fetch_add (&i, j, 0);
__analyzer_eval (i == (orig_i + j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
/* __atomic_fetch_sub. */
void test__atomic_fetch_sub_on_uint32_t (uint32_t i, uint32_t j)
{
uint32_t orig_i = i;
uint32_t ret;
ret = __atomic_fetch_sub (&i, j, 0);
__analyzer_eval (i == (orig_i - j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_fetch_sub_on_uint64_t (uint64_t i, uint64_t j)
{
uint64_t orig_i = i;
uint64_t ret;
ret = __atomic_fetch_sub (&i, j, 0);
__analyzer_eval (i == (orig_i - j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
/* __atomic_fetch_and. */
void test__atomic_fetch_and_on_uint32_t (uint32_t i, uint32_t j)
{
uint32_t orig_i = i;
uint32_t ret;
ret = __atomic_fetch_and (&i, j, 0);
__analyzer_eval (i == (orig_i & j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_fetch_and_on_uint64_t (uint64_t i, uint64_t j)
{
uint64_t orig_i = i;
uint64_t ret;
ret = __atomic_fetch_and (&i, j, 0);
__analyzer_eval (i == (orig_i & j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
/* __atomic_fetch_xor. */
void test__atomic_fetch_xor_on_uint32_t (uint32_t i, uint32_t j)
{
uint32_t orig_i = i;
uint32_t ret;
ret = __atomic_fetch_xor (&i, j, 0);
__analyzer_eval (i == (orig_i ^ j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_fetch_xor_on_uint64_t (uint64_t i, uint64_t j)
{
uint64_t orig_i = i;
uint64_t ret;
ret = __atomic_fetch_xor (&i, j, 0);
__analyzer_eval (i == (orig_i ^ j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
/* __atomic_fetch_or. */
void test__atomic_fetch_or_on_uint32_t (uint32_t i, uint32_t j)
{
uint32_t orig_i = i;
uint32_t ret;
ret = __atomic_fetch_or (&i, j, 0);
__analyzer_eval (i == (orig_i | j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
void test__atomic_fetch_or_on_uint64_t (uint64_t i, uint64_t j)
{
uint64_t orig_i = i;
uint64_t ret;
ret = __atomic_fetch_or (&i, j, 0);
__analyzer_eval (i == (orig_i | j)); /* { dg-warning "TRUE" } */
__analyzer_eval (ret == orig_i); /* { dg-warning "TRUE" } */
}
|