aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-convlshift-1.c
blob: b6f57f81e72b6f15beb128c89ec57f32864c03cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */

unsigned int foo(unsigned int i)
{
  int t1 = i;
  int t2 = t1 << 8;
  return t2;
}

int bar(int i)
{
  unsigned int t1 = i;
  unsigned int t2 = t1 << 8;
  return t2;
}

/* { dg-final { scan-tree-dump-not "\\(int\\)" "optimized" } } */
/* { dg-final { scan-tree-dump-not "\\(unsigned int\\)" "optimized" } } */