aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-37.c
blob: f1ff472aaff68e91d8b726a1f689386a61881df2 (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
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-phiopt1" } */

unsigned abs_with_convert0 (int x)
{
    unsigned int y = x;

    if (x < 0)
        y = -y;

  return y;
}
unsigned abs_with_convert1 (unsigned x)
{
    int y = x;

    if (y < 0)
        x = -x;

  return x;
}

/* { dg-final { scan-tree-dump-times "ABSU_EXPR <"  2  "phiopt1" } } */
/* { dg-final { scan-tree-dump-not   "if "        "phiopt1" } } */