aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr96688.c
blob: acaa0f691c2b908a091337478ec43fec351720b6 (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 tree-optimization/96688 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-final { scan-tree-dump-times " = -124 >> " 2 "optimized" } } */
/* { dg-final { scan-tree-dump-times " >> " 3 "optimized" } } */
/* { dg-final { scan-tree-dump-times " = ~" 1 "optimized" } } */

int
foo (int x)
{
  return ~(123 >> x);
}

unsigned
bar (int x)
{
  return ~(123U >> x);
}

unsigned
baz (int x)
{
  return ~(~123U >> x);
}