OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pr36227.c] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { 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;
9
#else
10
#error Add target support here
11
#endif
12
 
13
volatile unsigned long *
14
sat_add(volatile unsigned long *ptr, unsigned long i, volatile unsigned long *end)
15
{
16
  if ((ptrcast)ptr + i * sizeof(*ptr) > (ptrcast)ptr) /* { dg-bogus "pointer wraparound" } */
17
    return ptr + i;
18
  else
19
    return end;
20
}
21
 
22
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.