aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr96392.c
blob: fb7de217f966b7152656e3ab2a6c65c783835ca6 (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
/* PR tree-optimization/96392 */
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-optimized" } */

double plus0(int x)
{
  return x + 0.0;
}

double sub0(int x)
{
  return x - 0.0;
}

double negate(int x)
{
  return 0.0 - x;
}

double subtract(int x)
{
  return (double)x - (double)x;
}

/* { dg-final { scan-tree-dump-not " \\+ " "optimized" } } */
/* { dg-final { scan-tree-dump-not " \\- " "optimized" } } */