aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr96392.c
blob: 662bacb62bc006486f1b4fc9b419f065b58ec4be (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
29
30
31
32
33
/* 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 mult0(int x)
{
  return 0.0 * x;
}

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" } } */
/* { dg-final { scan-tree-dump-not " \\* " "optimized" } } */