summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr39855.c
blob: 6d75c38a907a7f2b5941bade58b988ea1b2f101f (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
/* PR c/39855 */
/* { dg-do run { target { int32plus } } } */

extern void abort (void);

int i, j, k;

int
foo (void)
{
  return ++i;
}

int
main ()
{
  if (__CHAR_BIT__ != 8 || sizeof (int) != 4)
    return 0;
  j = foo () << 30 << 2;
  k = (unsigned) foo () >> 16 >> 16;
  if (i != 2 || j != 0 || k != 0)
    abort ();
  return 0;
}