summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-eqxor-2.c
blob: 02eef39487723b77a4f7480fabcc6c17ba801787 (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
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-original" } */

int test1(int a, int b)
{
  return (a ^ b) == a;
}

int test2(int c, int d)
{
  return (c ^ d) != c;
}

int test3(int e, int f)
{
  return (e ^ f) == f;
}

int test4(int g, int h)
{
  return (g ^ h) != h;
}

/* { dg-final { scan-tree-dump-times "b == 0" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "d != 0" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "e == 0" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "g != 0" 1 "original" } } */