summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/ultrasp10.c
blob: ffa3229fa4f26f4c00115095c37e51d4807870e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* PR target/11965 */
/* Originator: <jk@tools.de> */
/* { dg-do run { target sparc*-*-* } } */
/* { dg-options "-O -mcpu=ultrasparc" } */

/* This used to fail on 32-bit Ultrasparc because GCC emitted
   an invalid shift instruction.  */


static inline unsigned int shift(int n, unsigned int value)
{
  return value << n;
}

unsigned int val = 1;

int main(void)
{
  int i;

  for (i = 0; i < 4; i++)
    val = shift(32, val);

  return 0;
}
OpenPOWER on IntegriCloud