aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr96094.c
blob: fe9163dda3e4bf5f5857a19a47cc3c2303247313 (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
34
/* PR tree-optimization/96094 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-final { scan-tree-dump-times "return 34;" 2 "optimized" } } */
/* { dg-final { scan-tree-dump-times "return y_\[0-9]*\\\(D\\\);" 2 "optimized" } } */
/* { dg-final { scan-tree-dump-times "return \[^\n\r;]*;" 4 "optimized" } } */

int
foo (int x)
{
  if (x >= 2U)
    return 34;
  return 34 / x;
}

int
bar (int x, int y)
{
  if (x >= 2U)
    return y;
  return y / x;
}

int
baz (_Bool x)
{
  return 34 / x;
}

int
qux (_Bool x, int y)
{
  return y / x;
}