summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-eqxor-3.c
blob: a087375aee932cdbebe7be5f352f62720a6dc045 (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 ^ 2) == 2;
}

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

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

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

/* { dg-final { scan-tree-dump-times "a == 0" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "c != 0" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "e == 4" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "g != 2" 1 "original" } } */
/* { dg-final { cleanup-tree-dump "original" } } */