summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/pr17581-1.c
blob: b63517c8403ff60d6ef61775989ebe254f8622f4 (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
26
27
28
29
30
/* PR rtl-optimization/17581 */
/* { dg-do run } */
/* { dg-options "-O2" } */

void abort (void);

int foo(int x)
{
  unsigned long long tmp = 0;

  switch(x) {
    case 21:
      tmp |= 1;
      tmp |= 2;
      tmp |= 8;
      break;
    default:
      break;
  }
  
  return (int)tmp;
}

int main()
{
  if (foo(21) != 11)
    abort ();
  return 0;
}

OpenPOWER on IntegriCloud