aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-convlshift-2.c
blob: f21358c458430e0c6ea5122db13f75ac227590a7 (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 char c)
{
  int t1 = c;
  int t2 = t1 << 8;
  return t2;
}

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

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