summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-plusnot-1.c
blob: 81ddf46d6d0e66470f1a4ea29099b89d4bfb19ca (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 middle-end/30322 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-original" } */

int test1(int a)
{
  return a + ~a;
}

int test2(int b)
{
  return ~b + b;
}

unsigned int test3(unsigned int c)
{
  return c + ~c;
}

unsigned int test4(unsigned int d)
{
  return ~d + d;
}

/* { dg-final { scan-tree-dump-times "\\+ a" 0 "original" } } */
/* { dg-final { scan-tree-dump-times "\\+ b" 0 "original" } } */
/* { dg-final { scan-tree-dump-times "\\+ c" 0 "original" } } */
/* { dg-final { scan-tree-dump-times "\\+ d" 0 "original" } } */
/* { dg-final { cleanup-tree-dump "original" } } */