Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/builtins/sync.c

    r1f81d61 r13073be  
    88        volatile int * vp4 = 0; int * rp4 = 0; int v4 = 0;
    99        volatile long long int * vp8 = 0; long long int * rp8 = 0; long long int v8 = 0;
    10         #if defined(__SIZEOF_INT128__)
    1110        volatile __int128 * vp16 = 0; __int128 * rp16 = 0; __int128 v16 = 0;
    12         #endif
    1311
    1412        { char ret; ret = __sync_fetch_and_add(vp1, v1); }
     
    2018        { long long int ret; ret = __sync_fetch_and_add(vp8, v8); }
    2119        { long long int ret; ret = __sync_fetch_and_add_8(vp8, v8); }
    22         #if defined(__SIZEOF_INT128__)
    2320        { __int128 ret; ret = __sync_fetch_and_add(vp16, v16); }
    2421        { __int128 ret; ret = __sync_fetch_and_add_16(vp16, v16); }
    25         #endif
    2622
    2723        { char ret; ret = __sync_fetch_and_sub(vp1, v1); }
     
    3329        { long long int ret; ret = __sync_fetch_and_sub(vp8, v8); }
    3430        { long long int ret; ret = __sync_fetch_and_sub_8(vp8, v8); }
    35         #if defined(__SIZEOF_INT128__)
    3631        { __int128 ret; ret = __sync_fetch_and_sub(vp16, v16); }
    3732        { __int128 ret; ret = __sync_fetch_and_sub_16(vp16, v16); }
    38         #endif
    3933
    4034        { char ret; ret = __sync_fetch_and_or(vp1, v1); }
     
    4640        { long long int ret; ret = __sync_fetch_and_or(vp8, v8); }
    4741        { long long int ret; ret = __sync_fetch_and_or_8(vp8, v8); }
    48         #if defined(__SIZEOF_INT128__)
    4942        { __int128 ret; ret = __sync_fetch_and_or(vp16, v16); }
    5043        { __int128 ret; ret = __sync_fetch_and_or_16(vp16, v16); }
    51         #endif
    5244
    5345        { char ret; ret = __sync_fetch_and_and(vp1, v1); }
     
    5951        { long long int ret; ret = __sync_fetch_and_and(vp8, v8); }
    6052        { long long int ret; ret = __sync_fetch_and_and_8(vp8, v8); }
    61         #if defined(__SIZEOF_INT128__)
    6253        { __int128 ret; ret = __sync_fetch_and_and(vp16, v16); }
    6354        { __int128 ret; ret = __sync_fetch_and_and_16(vp16, v16); }
    64         #endif
    6555
    6656        { char ret; ret = __sync_fetch_and_xor(vp1, v1); }
     
    7262        { long long int ret; ret = __sync_fetch_and_xor(vp8, v8); }
    7363        { long long int ret; ret = __sync_fetch_and_xor_8(vp8, v8); }
    74         #if defined(__SIZEOF_INT128__)
    7564        { __int128 ret; ret = __sync_fetch_and_xor(vp16, v16); }
    7665        { __int128 ret; ret = __sync_fetch_and_xor_16(vp16, v16); }
    77         #endif
    7866
    7967        { char ret; ret = __sync_fetch_and_nand(vp1, v1); }
     
    8573        { long long int ret; ret = __sync_fetch_and_nand(vp8, v8); }
    8674        { long long int ret; ret = __sync_fetch_and_nand_8(vp8, v8); }
    87         #if defined(__SIZEOF_INT128__)
    8875        { __int128 ret; ret = __sync_fetch_and_nand(vp16, v16); }
    8976        { __int128 ret; ret = __sync_fetch_and_nand_16(vp16, v16); }
    90         #endif
    9177
    9278        { char ret; ret = __sync_add_and_fetch(vp1, v1); }
     
    9884        { long long int ret; ret = __sync_add_and_fetch(vp8, v8); }
    9985        { long long int ret; ret = __sync_add_and_fetch_8(vp8, v8); }
    100         #if defined(__SIZEOF_INT128__)
    10186        { __int128 ret; ret = __sync_add_and_fetch(vp16, v16); }
    10287        { __int128 ret; ret = __sync_add_and_fetch_16(vp16, v16); }
    103         #endif
    10488
    10589        { char ret; ret = __sync_sub_and_fetch(vp1, v1); }
     
    11195        { long long int ret; ret = __sync_sub_and_fetch(vp8, v8); }
    11296        { long long int ret; ret = __sync_sub_and_fetch_8(vp8, v8); }
    113         #if defined(__SIZEOF_INT128__)
    11497        { __int128 ret; ret = __sync_sub_and_fetch(vp16, v16); }
    11598        { __int128 ret; ret = __sync_sub_and_fetch_16(vp16, v16); }
    116         #endif
    11799
    118100        { char ret; ret = __sync_or_and_fetch(vp1, v1); }
     
    124106        { long long int ret; ret = __sync_or_and_fetch(vp8, v8); }
    125107        { long long int ret; ret = __sync_or_and_fetch_8(vp8, v8); }
    126         #if defined(__SIZEOF_INT128__)
    127108        { __int128 ret; ret = __sync_or_and_fetch(vp16, v16); }
    128109        { __int128 ret; ret = __sync_or_and_fetch_16(vp16, v16); }
    129         #endif
    130110
    131111        { char ret; ret = __sync_and_and_fetch(vp1, v1); }
     
    137117        { long long int ret; ret = __sync_and_and_fetch(vp8, v8); }
    138118        { long long int ret; ret = __sync_and_and_fetch_8(vp8, v8); }
    139         #if defined(__SIZEOF_INT128__)
    140119        { __int128 ret; ret = __sync_and_and_fetch(vp16, v16); }
    141120        { __int128 ret; ret = __sync_and_and_fetch_16(vp16, v16); }
    142         #endif
    143121
    144122        { char ret; ret = __sync_xor_and_fetch(vp1, v1); }
     
    150128        { long long int ret; ret = __sync_xor_and_fetch(vp8, v8); }
    151129        { long long int ret; ret = __sync_xor_and_fetch_8(vp8, v8); }
    152         #if defined(__SIZEOF_INT128__)
    153130        { __int128 ret; ret = __sync_xor_and_fetch(vp16, v16); }
    154131        { __int128 ret; ret = __sync_xor_and_fetch_16(vp16, v16); }
    155         #endif
    156132
    157133        { char ret; ret = __sync_nand_and_fetch(vp1, v1); }
     
    163139        { long long int ret; ret = __sync_nand_and_fetch(vp8, v8); }
    164140        { long long int ret; ret = __sync_nand_and_fetch_8(vp8, v8); }
    165         #if defined(__SIZEOF_INT128__)
    166141        { __int128 ret; ret = __sync_nand_and_fetch(vp16, v16); }
    167142        { __int128 ret; ret = __sync_nand_and_fetch_16(vp16, v16); }
    168         #endif
    169143
    170144        { _Bool ret; ret = __sync_bool_compare_and_swap(vp1, v1, v1); }
     
    176150        { _Bool ret; ret = __sync_bool_compare_and_swap(vp8, v8, v8); }
    177151        { _Bool ret; ret = __sync_bool_compare_and_swap_8(vp8, v8, v8); }
    178         #if defined(__SIZEOF_INT128__)
    179152        { _Bool ret; ret = __sync_bool_compare_and_swap(vp16, v16, v16); }
    180153        { _Bool ret; ret = __sync_bool_compare_and_swap_16(vp16, v16,v16); }
    181         #endif
    182154
    183155        { char ret; ret = __sync_val_compare_and_swap(vp1, v1, v1); }
     
    189161        { long long int ret; ret = __sync_val_compare_and_swap(vp8, v8, v8); }
    190162        { long long int ret; ret = __sync_val_compare_and_swap_8(vp8, v8, v8); }
    191         #if defined(__SIZEOF_INT128__)
    192163        { __int128 ret; ret = __sync_val_compare_and_swap(vp16, v16, v16); }
    193164        { __int128 ret; ret = __sync_val_compare_and_swap_16(vp16, v16,v16); }
    194         #endif
    195165
    196166        { char ret; ret = __sync_lock_test_and_set(vp1, v1); }
     
    202172        { long long int ret; ret = __sync_lock_test_and_set(vp8, v8); }
    203173        { long long int ret; ret = __sync_lock_test_and_set_8(vp8, v8); }
    204         #if defined(__SIZEOF_INT128__)
    205174        { __int128 ret; ret = __sync_lock_test_and_set(vp16, v16); }
    206175        { __int128 ret; ret = __sync_lock_test_and_set_16(vp16, v16); }
    207         #endif
    208176
    209177        { __sync_lock_release(vp1); }
     
    215183        { __sync_lock_release(vp8); }
    216184        { __sync_lock_release_8(vp8); }
    217         #if defined(__SIZEOF_INT128__)
    218185        { __sync_lock_release(vp16); }
    219186        { __sync_lock_release_16(vp16); }
    220         #endif
    221187
    222188        { __sync_synchronize(); }
     
    242208        { long long int ret; ret = __atomic_exchange_8(vp8, v8, __ATOMIC_SEQ_CST); }
    243209        { long long int ret; __atomic_exchange(vp8, &v8, &ret, __ATOMIC_SEQ_CST); }
    244         #if defined(__SIZEOF_INT128__)
    245210        { __int128 ret; ret = __atomic_exchange_n(vp16, &v16, __ATOMIC_SEQ_CST); }
    246211        { __int128 ret; ret = __atomic_exchange_16(vp16, v16, __ATOMIC_SEQ_CST); }
    247212        { __int128 ret; __atomic_exchange(vp16, &v16, &ret, __ATOMIC_SEQ_CST); }
    248         #endif
    249213
    250214        { char ret; ret = __atomic_load_n(vp1, __ATOMIC_SEQ_CST); }
     
    260224        { long long int ret; ret = __atomic_load_8(vp8, __ATOMIC_SEQ_CST); }
    261225        { long long int ret; __atomic_load(vp8, &ret, __ATOMIC_SEQ_CST); }
    262         #if defined(__SIZEOF_INT128__)
    263226        { __int128 ret; ret = __atomic_load_n(vp16, __ATOMIC_SEQ_CST); }
    264227        { __int128 ret; ret = __atomic_load_16(vp16, __ATOMIC_SEQ_CST); }
    265228        { __int128 ret; __atomic_load(vp16, &ret, __ATOMIC_SEQ_CST); }
    266         #endif
    267229
    268230        { _Bool ret; ret = __atomic_compare_exchange_n(vp1, rp1, v1, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }
     
    278240        { _Bool ret; ret = __atomic_compare_exchange_8(vp8, rp8, v8, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }
    279241        { _Bool ret; ret = __atomic_compare_exchange(vp8, rp8, &v8, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }
    280         #if defined(__SIZEOF_INT128__)
    281242        { _Bool ret; ret = __atomic_compare_exchange_n(vp16, rp16, v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }
    282243        { _Bool ret; ret = __atomic_compare_exchange_16(vp16, rp16, v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }
    283244        { _Bool ret; ret = __atomic_compare_exchange(vp16, rp16, &v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }
    284         #endif
    285245
    286246        { __atomic_store_n(vp1, v1, __ATOMIC_SEQ_CST); }
     
    296256        { __atomic_store_8(vp8, v8, __ATOMIC_SEQ_CST); }
    297257        { __atomic_store(vp8, &v8, __ATOMIC_SEQ_CST); }
    298         #if defined(__SIZEOF_INT128__)
    299258        { __atomic_store_n(vp16, v16, __ATOMIC_SEQ_CST); }
    300259        { __atomic_store_16(vp16, v16, __ATOMIC_SEQ_CST); }
    301260        { __atomic_store(vp16, &v16, __ATOMIC_SEQ_CST); }
    302         #endif
    303261
    304262        { char ret; ret = __atomic_add_fetch(vp1, v1, __ATOMIC_SEQ_CST); }
     
    310268        { long long int ret; ret = __atomic_add_fetch(vp8, v8, __ATOMIC_SEQ_CST); }
    311269        { long long int ret; ret = __atomic_add_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); }
    312         #if defined(__SIZEOF_INT128__)
    313270        { __int128 ret; ret = __atomic_add_fetch(vp16, v16, __ATOMIC_SEQ_CST); }
    314271        { __int128 ret; ret = __atomic_add_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); }
    315         #endif
    316272
    317273        { char ret; ret = __atomic_sub_fetch(vp1, v1, __ATOMIC_SEQ_CST); }
     
    323279        { long long int ret; ret = __atomic_sub_fetch(vp8, v8, __ATOMIC_SEQ_CST); }
    324280        { long long int ret; ret = __atomic_sub_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); }
    325         #if defined(__SIZEOF_INT128__)
    326281        { __int128 ret; ret = __atomic_sub_fetch(vp16, v16, __ATOMIC_SEQ_CST); }
    327282        { __int128 ret; ret = __atomic_sub_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); }
    328         #endif
    329283
    330284        { char ret; ret = __atomic_and_fetch(vp1, v1, __ATOMIC_SEQ_CST); }
     
    336290        { long long int ret; ret = __atomic_and_fetch(vp8, v8, __ATOMIC_SEQ_CST); }
    337291        { long long int ret; ret = __atomic_and_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); }
    338         #if defined(__SIZEOF_INT128__)
    339292        { __int128 ret; ret = __atomic_and_fetch(vp16, v16, __ATOMIC_SEQ_CST); }
    340293        { __int128 ret; ret = __atomic_and_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); }
    341         #endif
    342294
    343295        { char ret; ret = __atomic_nand_fetch(vp1, v1, __ATOMIC_SEQ_CST); }
     
    349301        { long long int ret; ret = __atomic_nand_fetch(vp8, v8, __ATOMIC_SEQ_CST); }
    350302        { long long int ret; ret = __atomic_nand_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); }
    351         #if defined(__SIZEOF_INT128__)
    352303        { __int128 ret; ret = __atomic_nand_fetch(vp16, v16, __ATOMIC_SEQ_CST); }
    353304        { __int128 ret; ret = __atomic_nand_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); }
    354         #endif
    355305
    356306        { char ret; ret = __atomic_xor_fetch(vp1, v1, __ATOMIC_SEQ_CST); }
     
    362312        { long long int ret; ret = __atomic_xor_fetch(vp8, v8, __ATOMIC_SEQ_CST); }
    363313        { long long int ret; ret = __atomic_xor_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); }
    364         #if defined(__SIZEOF_INT128__)
    365314        { __int128 ret; ret = __atomic_xor_fetch(vp16, v16, __ATOMIC_SEQ_CST); }
    366315        { __int128 ret; ret = __atomic_xor_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); }
    367         #endif
    368316
    369317        { char ret; ret = __atomic_or_fetch(vp1, v1, __ATOMIC_SEQ_CST); }
     
    375323        { long long int ret; ret = __atomic_or_fetch(vp8, v8, __ATOMIC_SEQ_CST); }
    376324        { long long int ret; ret = __atomic_or_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); }
    377         #if defined(__SIZEOF_INT128__)
    378325        { __int128 ret; ret = __atomic_or_fetch(vp16, v16, __ATOMIC_SEQ_CST); }
    379326        { __int128 ret; ret = __atomic_or_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); }
    380         #endif
    381327
    382328        { char ret; ret = __atomic_fetch_add(vp1, v1, __ATOMIC_SEQ_CST); }
     
    388334        { long long int ret; ret = __atomic_fetch_add(vp8, v8, __ATOMIC_SEQ_CST); }
    389335        { long long int ret; ret = __atomic_fetch_add_8(vp8, v8, __ATOMIC_SEQ_CST); }
    390         #if defined(__SIZEOF_INT128__)
    391336        { __int128 ret; ret = __atomic_fetch_add(vp16, v16, __ATOMIC_SEQ_CST); }
    392337        { __int128 ret; ret = __atomic_fetch_add_16(vp16, v16, __ATOMIC_SEQ_CST); }
    393         #endif
    394338
    395339        { char ret; ret = __atomic_fetch_sub(vp1, v1, __ATOMIC_SEQ_CST); }
     
    401345        { long long int ret; ret = __atomic_fetch_sub(vp8, v8, __ATOMIC_SEQ_CST); }
    402346        { long long int ret; ret = __atomic_fetch_sub_8(vp8, v8, __ATOMIC_SEQ_CST); }
    403         #if defined(__SIZEOF_INT128__)
    404347        { __int128 ret; ret = __atomic_fetch_sub(vp16, v16, __ATOMIC_SEQ_CST); }
    405348        { __int128 ret; ret = __atomic_fetch_sub_16(vp16, v16, __ATOMIC_SEQ_CST); }
    406         #endif
    407349
    408350        { char ret; ret = __atomic_fetch_and(vp1, v1, __ATOMIC_SEQ_CST); }
     
    414356        { long long int ret; ret = __atomic_fetch_and(vp8, v8, __ATOMIC_SEQ_CST); }
    415357        { long long int ret; ret = __atomic_fetch_and_8(vp8, v8, __ATOMIC_SEQ_CST); }
    416         #if defined(__SIZEOF_INT128__)
    417358        { __int128 ret; ret = __atomic_fetch_and(vp16, v16, __ATOMIC_SEQ_CST); }
    418359        { __int128 ret; ret = __atomic_fetch_and_16(vp16, v16, __ATOMIC_SEQ_CST); }
    419         #endif
    420360
    421361        { char ret; ret = __atomic_fetch_nand(vp1, v1, __ATOMIC_SEQ_CST); }
     
    427367        { long long int ret; ret = __atomic_fetch_nand(vp8, v8, __ATOMIC_SEQ_CST); }
    428368        { long long int ret; ret = __atomic_fetch_nand_8(vp8, v8, __ATOMIC_SEQ_CST); }
    429         #if defined(__SIZEOF_INT128__)
    430369        { __int128 ret; ret = __atomic_fetch_nand(vp16, v16, __ATOMIC_SEQ_CST); }
    431370        { __int128 ret; ret = __atomic_fetch_nand_16(vp16, v16, __ATOMIC_SEQ_CST); }
    432         #endif
    433371
    434372        { char ret; ret = __atomic_fetch_xor(vp1, v1, __ATOMIC_SEQ_CST); }
     
    440378        { long long int ret; ret = __atomic_fetch_xor(vp8, v8, __ATOMIC_SEQ_CST); }
    441379        { long long int ret; ret = __atomic_fetch_xor_8(vp8, v8, __ATOMIC_SEQ_CST); }
    442         #if defined(__SIZEOF_INT128__)
    443380        { __int128 ret; ret = __atomic_fetch_xor(vp16, v16, __ATOMIC_SEQ_CST); }
    444381        { __int128 ret; ret = __atomic_fetch_xor_16(vp16, v16, __ATOMIC_SEQ_CST); }
    445         #endif
    446382
    447383        { char ret; ret = __atomic_fetch_or(vp1, v1, __ATOMIC_SEQ_CST); }
     
    453389        { long long int ret; ret = __atomic_fetch_or(vp8, v8, __ATOMIC_SEQ_CST); }
    454390        { long long int ret; ret = __atomic_fetch_or_8(vp8, v8, __ATOMIC_SEQ_CST); }
    455         #if defined(__SIZEOF_INT128__)
    456391        { __int128 ret; ret = __atomic_fetch_or(vp16, v16, __ATOMIC_SEQ_CST); }
    457392        { __int128 ret; ret = __atomic_fetch_or_16(vp16, v16, __ATOMIC_SEQ_CST); }
    458         #endif
    459393
    460394        { _Bool ret; ret = __atomic_always_lock_free(sizeof(int), vp4); }
Note: See TracChangeset for help on using the changeset viewer.