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

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

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

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

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

/* { dg-final { scan-tree-dump-times "a == b" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "c != d" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "e == f" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "g != h" 1 "original" } } */
/* { dg-final { cleanup-tree-dump "original" } } */