OSDN Git Service

Index: gcc/ChangeLog
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / ultrasp4.c
1 /* Simplified from PR target/5309.  */
2 /* { dg-do compile } */
3 /* { dg-options "-O2" } */
4 /* { dg-options "-O2 -mcpu=ultrasparc" { target sparc64-*-* sparcv9-*-* } } */
5
6 #if __INT_MAX__ > 32767
7 #define PTR_TYPE long
8 #else
9 /* For 16-bit ports a long is a 32-bit quantity.  So you cannot
10    cast a 32-bit long integer into a pointer which will only be
11    16-bits long.  */
12 #define PTR_TYPE int
13 #endif
14
15 extern PTR_TYPE bar (unsigned int);
16
17 PTR_TYPE
18 foo (PTR_TYPE x, unsigned int y)
19 {
20   return *(((PTR_TYPE *) (bar (y) - 1)) + 1 + (x >> 2) % 359);
21 }