1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Wstrict-overflow=3" } */
3 #if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__)
4 typedef unsigned long long ptrcast
;
5 #elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__)
6 typedef unsigned long ptrcast
;
7 #elif (__SIZEOF_INT__ == __SIZEOF_POINTER__)
8 typedef unsigned int ptrcast
;
10 #error Add target support here
13 volatile unsigned long *
14 sat_add(volatile unsigned long *ptr
, unsigned long i
, volatile unsigned long *end
)
16 if ((ptrcast
)ptr
+ i
* sizeof(*ptr
) > (ptrcast
)ptr
) /* { dg-bogus "pointer wraparound" } */