1 /* { dg-do run { target { stdint_types } } } */
6 void f(uint64_t *a
, uint64_t aa
) __attribute__((noinline
));
7 void f(uint64_t *a
, uint64_t aa
)
9 uint64_t new_value
= aa
;
10 uint64_t old_value
= *a
;
12 uint64_t mask
= (uint64_t)(unsigned)(-1);
13 uint64_t tmp
= old_value
& mask
;
15 /* On overflow we need to add 1 in the upper bits */
17 new_value
+= 1ull<<bit_size
;
18 /* Add in the upper bits from the old value */
19 new_value
+= old_value
& ~mask
;
24 uint64_t value
, new_value
, old_value
;
27 new_value
= (value
+1)&(uint64_t)(unsigned)(-1);
29 if (value
!= old_value
+1)