summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-hoist-1.c
blob: dec64165eb1436dfe3fd2f8f52b9e22b3cfcec36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre" } */

unsigned short f(unsigned short a)
{
  if (a & 0x8000)
    a <<= 1, a = a ^ 0x1021;
  else
    a <<= 1;

  return a;
}

/* We should hoist and CSE the shift.  */

/* { dg-final { scan-tree-dump-times " << 1;" 1 "pre" } } */