Changeset 1f81d61 for src/tests/builtins/sync.c
- Timestamp:
- May 28, 2018, 3:26:49 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 533540a, db4d8e3
- Parents:
- 91cfa34
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/builtins/sync.c
r91cfa34 r1f81d61 8 8 volatile int * vp4 = 0; int * rp4 = 0; int v4 = 0; 9 9 volatile long long int * vp8 = 0; long long int * rp8 = 0; long long int v8 = 0; 10 #if defined(__SIZEOF_INT128__) 10 11 volatile __int128 * vp16 = 0; __int128 * rp16 = 0; __int128 v16 = 0; 12 #endif 11 13 12 14 { char ret; ret = __sync_fetch_and_add(vp1, v1); } … … 18 20 { long long int ret; ret = __sync_fetch_and_add(vp8, v8); } 19 21 { long long int ret; ret = __sync_fetch_and_add_8(vp8, v8); } 22 #if defined(__SIZEOF_INT128__) 20 23 { __int128 ret; ret = __sync_fetch_and_add(vp16, v16); } 21 24 { __int128 ret; ret = __sync_fetch_and_add_16(vp16, v16); } 25 #endif 22 26 23 27 { char ret; ret = __sync_fetch_and_sub(vp1, v1); } … … 29 33 { long long int ret; ret = __sync_fetch_and_sub(vp8, v8); } 30 34 { long long int ret; ret = __sync_fetch_and_sub_8(vp8, v8); } 35 #if defined(__SIZEOF_INT128__) 31 36 { __int128 ret; ret = __sync_fetch_and_sub(vp16, v16); } 32 37 { __int128 ret; ret = __sync_fetch_and_sub_16(vp16, v16); } 38 #endif 33 39 34 40 { char ret; ret = __sync_fetch_and_or(vp1, v1); } … … 40 46 { long long int ret; ret = __sync_fetch_and_or(vp8, v8); } 41 47 { long long int ret; ret = __sync_fetch_and_or_8(vp8, v8); } 48 #if defined(__SIZEOF_INT128__) 42 49 { __int128 ret; ret = __sync_fetch_and_or(vp16, v16); } 43 50 { __int128 ret; ret = __sync_fetch_and_or_16(vp16, v16); } 51 #endif 44 52 45 53 { char ret; ret = __sync_fetch_and_and(vp1, v1); } … … 51 59 { long long int ret; ret = __sync_fetch_and_and(vp8, v8); } 52 60 { long long int ret; ret = __sync_fetch_and_and_8(vp8, v8); } 61 #if defined(__SIZEOF_INT128__) 53 62 { __int128 ret; ret = __sync_fetch_and_and(vp16, v16); } 54 63 { __int128 ret; ret = __sync_fetch_and_and_16(vp16, v16); } 64 #endif 55 65 56 66 { char ret; ret = __sync_fetch_and_xor(vp1, v1); } … … 62 72 { long long int ret; ret = __sync_fetch_and_xor(vp8, v8); } 63 73 { long long int ret; ret = __sync_fetch_and_xor_8(vp8, v8); } 74 #if defined(__SIZEOF_INT128__) 64 75 { __int128 ret; ret = __sync_fetch_and_xor(vp16, v16); } 65 76 { __int128 ret; ret = __sync_fetch_and_xor_16(vp16, v16); } 77 #endif 66 78 67 79 { char ret; ret = __sync_fetch_and_nand(vp1, v1); } … … 73 85 { long long int ret; ret = __sync_fetch_and_nand(vp8, v8); } 74 86 { long long int ret; ret = __sync_fetch_and_nand_8(vp8, v8); } 87 #if defined(__SIZEOF_INT128__) 75 88 { __int128 ret; ret = __sync_fetch_and_nand(vp16, v16); } 76 89 { __int128 ret; ret = __sync_fetch_and_nand_16(vp16, v16); } 90 #endif 77 91 78 92 { char ret; ret = __sync_add_and_fetch(vp1, v1); } … … 84 98 { long long int ret; ret = __sync_add_and_fetch(vp8, v8); } 85 99 { long long int ret; ret = __sync_add_and_fetch_8(vp8, v8); } 100 #if defined(__SIZEOF_INT128__) 86 101 { __int128 ret; ret = __sync_add_and_fetch(vp16, v16); } 87 102 { __int128 ret; ret = __sync_add_and_fetch_16(vp16, v16); } 103 #endif 88 104 89 105 { char ret; ret = __sync_sub_and_fetch(vp1, v1); } … … 95 111 { long long int ret; ret = __sync_sub_and_fetch(vp8, v8); } 96 112 { long long int ret; ret = __sync_sub_and_fetch_8(vp8, v8); } 113 #if defined(__SIZEOF_INT128__) 97 114 { __int128 ret; ret = __sync_sub_and_fetch(vp16, v16); } 98 115 { __int128 ret; ret = __sync_sub_and_fetch_16(vp16, v16); } 116 #endif 99 117 100 118 { char ret; ret = __sync_or_and_fetch(vp1, v1); } … … 106 124 { long long int ret; ret = __sync_or_and_fetch(vp8, v8); } 107 125 { long long int ret; ret = __sync_or_and_fetch_8(vp8, v8); } 126 #if defined(__SIZEOF_INT128__) 108 127 { __int128 ret; ret = __sync_or_and_fetch(vp16, v16); } 109 128 { __int128 ret; ret = __sync_or_and_fetch_16(vp16, v16); } 129 #endif 110 130 111 131 { char ret; ret = __sync_and_and_fetch(vp1, v1); } … … 117 137 { long long int ret; ret = __sync_and_and_fetch(vp8, v8); } 118 138 { long long int ret; ret = __sync_and_and_fetch_8(vp8, v8); } 139 #if defined(__SIZEOF_INT128__) 119 140 { __int128 ret; ret = __sync_and_and_fetch(vp16, v16); } 120 141 { __int128 ret; ret = __sync_and_and_fetch_16(vp16, v16); } 142 #endif 121 143 122 144 { char ret; ret = __sync_xor_and_fetch(vp1, v1); } … … 128 150 { long long int ret; ret = __sync_xor_and_fetch(vp8, v8); } 129 151 { long long int ret; ret = __sync_xor_and_fetch_8(vp8, v8); } 152 #if defined(__SIZEOF_INT128__) 130 153 { __int128 ret; ret = __sync_xor_and_fetch(vp16, v16); } 131 154 { __int128 ret; ret = __sync_xor_and_fetch_16(vp16, v16); } 155 #endif 132 156 133 157 { char ret; ret = __sync_nand_and_fetch(vp1, v1); } … … 139 163 { long long int ret; ret = __sync_nand_and_fetch(vp8, v8); } 140 164 { long long int ret; ret = __sync_nand_and_fetch_8(vp8, v8); } 165 #if defined(__SIZEOF_INT128__) 141 166 { __int128 ret; ret = __sync_nand_and_fetch(vp16, v16); } 142 167 { __int128 ret; ret = __sync_nand_and_fetch_16(vp16, v16); } 168 #endif 143 169 144 170 { _Bool ret; ret = __sync_bool_compare_and_swap(vp1, v1, v1); } … … 150 176 { _Bool ret; ret = __sync_bool_compare_and_swap(vp8, v8, v8); } 151 177 { _Bool ret; ret = __sync_bool_compare_and_swap_8(vp8, v8, v8); } 178 #if defined(__SIZEOF_INT128__) 152 179 { _Bool ret; ret = __sync_bool_compare_and_swap(vp16, v16, v16); } 153 180 { _Bool ret; ret = __sync_bool_compare_and_swap_16(vp16, v16,v16); } 181 #endif 154 182 155 183 { char ret; ret = __sync_val_compare_and_swap(vp1, v1, v1); } … … 161 189 { long long int ret; ret = __sync_val_compare_and_swap(vp8, v8, v8); } 162 190 { long long int ret; ret = __sync_val_compare_and_swap_8(vp8, v8, v8); } 191 #if defined(__SIZEOF_INT128__) 163 192 { __int128 ret; ret = __sync_val_compare_and_swap(vp16, v16, v16); } 164 193 { __int128 ret; ret = __sync_val_compare_and_swap_16(vp16, v16,v16); } 194 #endif 165 195 166 196 { char ret; ret = __sync_lock_test_and_set(vp1, v1); } … … 172 202 { long long int ret; ret = __sync_lock_test_and_set(vp8, v8); } 173 203 { long long int ret; ret = __sync_lock_test_and_set_8(vp8, v8); } 204 #if defined(__SIZEOF_INT128__) 174 205 { __int128 ret; ret = __sync_lock_test_and_set(vp16, v16); } 175 206 { __int128 ret; ret = __sync_lock_test_and_set_16(vp16, v16); } 207 #endif 176 208 177 209 { __sync_lock_release(vp1); } … … 183 215 { __sync_lock_release(vp8); } 184 216 { __sync_lock_release_8(vp8); } 217 #if defined(__SIZEOF_INT128__) 185 218 { __sync_lock_release(vp16); } 186 219 { __sync_lock_release_16(vp16); } 220 #endif 187 221 188 222 { __sync_synchronize(); } … … 208 242 { long long int ret; ret = __atomic_exchange_8(vp8, v8, __ATOMIC_SEQ_CST); } 209 243 { long long int ret; __atomic_exchange(vp8, &v8, &ret, __ATOMIC_SEQ_CST); } 244 #if defined(__SIZEOF_INT128__) 210 245 { __int128 ret; ret = __atomic_exchange_n(vp16, &v16, __ATOMIC_SEQ_CST); } 211 246 { __int128 ret; ret = __atomic_exchange_16(vp16, v16, __ATOMIC_SEQ_CST); } 212 247 { __int128 ret; __atomic_exchange(vp16, &v16, &ret, __ATOMIC_SEQ_CST); } 248 #endif 213 249 214 250 { char ret; ret = __atomic_load_n(vp1, __ATOMIC_SEQ_CST); } … … 224 260 { long long int ret; ret = __atomic_load_8(vp8, __ATOMIC_SEQ_CST); } 225 261 { long long int ret; __atomic_load(vp8, &ret, __ATOMIC_SEQ_CST); } 262 #if defined(__SIZEOF_INT128__) 226 263 { __int128 ret; ret = __atomic_load_n(vp16, __ATOMIC_SEQ_CST); } 227 264 { __int128 ret; ret = __atomic_load_16(vp16, __ATOMIC_SEQ_CST); } 228 265 { __int128 ret; __atomic_load(vp16, &ret, __ATOMIC_SEQ_CST); } 266 #endif 229 267 230 268 { _Bool ret; ret = __atomic_compare_exchange_n(vp1, rp1, v1, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } … … 240 278 { _Bool ret; ret = __atomic_compare_exchange_8(vp8, rp8, v8, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 241 279 { _Bool ret; ret = __atomic_compare_exchange(vp8, rp8, &v8, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 280 #if defined(__SIZEOF_INT128__) 242 281 { _Bool ret; ret = __atomic_compare_exchange_n(vp16, rp16, v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 243 282 { _Bool ret; ret = __atomic_compare_exchange_16(vp16, rp16, v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 244 283 { _Bool ret; ret = __atomic_compare_exchange(vp16, rp16, &v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 284 #endif 245 285 246 286 { __atomic_store_n(vp1, v1, __ATOMIC_SEQ_CST); } … … 256 296 { __atomic_store_8(vp8, v8, __ATOMIC_SEQ_CST); } 257 297 { __atomic_store(vp8, &v8, __ATOMIC_SEQ_CST); } 298 #if defined(__SIZEOF_INT128__) 258 299 { __atomic_store_n(vp16, v16, __ATOMIC_SEQ_CST); } 259 300 { __atomic_store_16(vp16, v16, __ATOMIC_SEQ_CST); } 260 301 { __atomic_store(vp16, &v16, __ATOMIC_SEQ_CST); } 302 #endif 261 303 262 304 { char ret; ret = __atomic_add_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 268 310 { long long int ret; ret = __atomic_add_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 269 311 { long long int ret; ret = __atomic_add_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 312 #if defined(__SIZEOF_INT128__) 270 313 { __int128 ret; ret = __atomic_add_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 271 314 { __int128 ret; ret = __atomic_add_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 315 #endif 272 316 273 317 { char ret; ret = __atomic_sub_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 279 323 { long long int ret; ret = __atomic_sub_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 280 324 { long long int ret; ret = __atomic_sub_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 325 #if defined(__SIZEOF_INT128__) 281 326 { __int128 ret; ret = __atomic_sub_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 282 327 { __int128 ret; ret = __atomic_sub_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 328 #endif 283 329 284 330 { char ret; ret = __atomic_and_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 290 336 { long long int ret; ret = __atomic_and_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 291 337 { long long int ret; ret = __atomic_and_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 338 #if defined(__SIZEOF_INT128__) 292 339 { __int128 ret; ret = __atomic_and_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 293 340 { __int128 ret; ret = __atomic_and_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 341 #endif 294 342 295 343 { char ret; ret = __atomic_nand_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 301 349 { long long int ret; ret = __atomic_nand_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 302 350 { long long int ret; ret = __atomic_nand_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 351 #if defined(__SIZEOF_INT128__) 303 352 { __int128 ret; ret = __atomic_nand_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 304 353 { __int128 ret; ret = __atomic_nand_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 354 #endif 305 355 306 356 { char ret; ret = __atomic_xor_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 312 362 { long long int ret; ret = __atomic_xor_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 313 363 { long long int ret; ret = __atomic_xor_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 364 #if defined(__SIZEOF_INT128__) 314 365 { __int128 ret; ret = __atomic_xor_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 315 366 { __int128 ret; ret = __atomic_xor_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 367 #endif 316 368 317 369 { char ret; ret = __atomic_or_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 323 375 { long long int ret; ret = __atomic_or_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 324 376 { long long int ret; ret = __atomic_or_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 377 #if defined(__SIZEOF_INT128__) 325 378 { __int128 ret; ret = __atomic_or_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 326 379 { __int128 ret; ret = __atomic_or_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 380 #endif 327 381 328 382 { char ret; ret = __atomic_fetch_add(vp1, v1, __ATOMIC_SEQ_CST); } … … 334 388 { long long int ret; ret = __atomic_fetch_add(vp8, v8, __ATOMIC_SEQ_CST); } 335 389 { long long int ret; ret = __atomic_fetch_add_8(vp8, v8, __ATOMIC_SEQ_CST); } 390 #if defined(__SIZEOF_INT128__) 336 391 { __int128 ret; ret = __atomic_fetch_add(vp16, v16, __ATOMIC_SEQ_CST); } 337 392 { __int128 ret; ret = __atomic_fetch_add_16(vp16, v16, __ATOMIC_SEQ_CST); } 393 #endif 338 394 339 395 { char ret; ret = __atomic_fetch_sub(vp1, v1, __ATOMIC_SEQ_CST); } … … 345 401 { long long int ret; ret = __atomic_fetch_sub(vp8, v8, __ATOMIC_SEQ_CST); } 346 402 { long long int ret; ret = __atomic_fetch_sub_8(vp8, v8, __ATOMIC_SEQ_CST); } 403 #if defined(__SIZEOF_INT128__) 347 404 { __int128 ret; ret = __atomic_fetch_sub(vp16, v16, __ATOMIC_SEQ_CST); } 348 405 { __int128 ret; ret = __atomic_fetch_sub_16(vp16, v16, __ATOMIC_SEQ_CST); } 406 #endif 349 407 350 408 { char ret; ret = __atomic_fetch_and(vp1, v1, __ATOMIC_SEQ_CST); } … … 356 414 { long long int ret; ret = __atomic_fetch_and(vp8, v8, __ATOMIC_SEQ_CST); } 357 415 { long long int ret; ret = __atomic_fetch_and_8(vp8, v8, __ATOMIC_SEQ_CST); } 416 #if defined(__SIZEOF_INT128__) 358 417 { __int128 ret; ret = __atomic_fetch_and(vp16, v16, __ATOMIC_SEQ_CST); } 359 418 { __int128 ret; ret = __atomic_fetch_and_16(vp16, v16, __ATOMIC_SEQ_CST); } 419 #endif 360 420 361 421 { char ret; ret = __atomic_fetch_nand(vp1, v1, __ATOMIC_SEQ_CST); } … … 367 427 { long long int ret; ret = __atomic_fetch_nand(vp8, v8, __ATOMIC_SEQ_CST); } 368 428 { long long int ret; ret = __atomic_fetch_nand_8(vp8, v8, __ATOMIC_SEQ_CST); } 429 #if defined(__SIZEOF_INT128__) 369 430 { __int128 ret; ret = __atomic_fetch_nand(vp16, v16, __ATOMIC_SEQ_CST); } 370 431 { __int128 ret; ret = __atomic_fetch_nand_16(vp16, v16, __ATOMIC_SEQ_CST); } 432 #endif 371 433 372 434 { char ret; ret = __atomic_fetch_xor(vp1, v1, __ATOMIC_SEQ_CST); } … … 378 440 { long long int ret; ret = __atomic_fetch_xor(vp8, v8, __ATOMIC_SEQ_CST); } 379 441 { long long int ret; ret = __atomic_fetch_xor_8(vp8, v8, __ATOMIC_SEQ_CST); } 442 #if defined(__SIZEOF_INT128__) 380 443 { __int128 ret; ret = __atomic_fetch_xor(vp16, v16, __ATOMIC_SEQ_CST); } 381 444 { __int128 ret; ret = __atomic_fetch_xor_16(vp16, v16, __ATOMIC_SEQ_CST); } 445 #endif 382 446 383 447 { char ret; ret = __atomic_fetch_or(vp1, v1, __ATOMIC_SEQ_CST); } … … 389 453 { long long int ret; ret = __atomic_fetch_or(vp8, v8, __ATOMIC_SEQ_CST); } 390 454 { long long int ret; ret = __atomic_fetch_or_8(vp8, v8, __ATOMIC_SEQ_CST); } 455 #if defined(__SIZEOF_INT128__) 391 456 { __int128 ret; ret = __atomic_fetch_or(vp16, v16, __ATOMIC_SEQ_CST); } 392 457 { __int128 ret; ret = __atomic_fetch_or_16(vp16, v16, __ATOMIC_SEQ_CST); } 458 #endif 393 459 394 460 { _Bool ret; ret = __atomic_always_lock_free(sizeof(int), vp4); }
Note: See TracChangeset
for help on using the changeset viewer.