aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr96681.c
blob: 6d72a1a3d7d83483f1761558952a3e58d434f9c6 (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
35
/* PR tree-optimization/96681 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-final { scan-tree-dump-times " \\^ " 5 "optimized" } } */
/* { dg-final { scan-tree-dump-times " (?:<|>=) 0" 5 "optimized" } } */

int
foo (int x, int y)
{
  return (x < 0) ^ (y < 0);
}

int
bar (int x, int y)
{
  return (x > -1) ^ (y > -1);
}

int
baz (int x, int y)
{
  return (x ^ y) < 0;
}

int
qux (int x, int y)
{
  return (x ^ y) >= 0;
}

int
corge (int x, int y)
{
  return (x >= 0) ^ (y < 0);
}