summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/ultrasp4.c
blob: 1c72d0659d4fa0b3c31a2902235266ba73ba3b0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Simplified from PR target/5309.  */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-options "-O2 -mcpu=ultrasparc" { target sparc64-*-* sparcv9-*-* } } */

#if __INT_MAX__ > 32767
#define PTR_TYPE long
#else
/* For 16-bit ports a long is a 32-bit quantity.  So you cannot
   cast a 32-bit long integer into a pointer which will only be
   16-bits long.  */
#define PTR_TYPE int
#endif

extern PTR_TYPE bar (unsigned int);

PTR_TYPE
foo (PTR_TYPE x, unsigned int y)
{
  return *(((PTR_TYPE *) (bar (y) - 1)) + 1 + (x >> 2) % 359);
}
OpenPOWER on IntegriCloud