summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-compare-4.c
blob: d4bb64ad2bdfb5a3dad0ceb7b001790299c6fabf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */
/* { dg-options "-fdump-tree-original" } */

int test1 (int a, int b)
{
  return a - b == a;
}
int test2 (int a, int b)
{
  return a + b == a;
}
int test3 (int a)
{
  return a + 5 == a;
}
int test4 (int a)
{
  return a - 5 == a;
}

/* { dg-final { scan-tree-dump-times "b == 0" 2 "original" } } */
/* { dg-final { scan-tree-dump-times "return 0" 2 "original" } } */
/* { dg-final { cleanup-tree-dump "original" } } */