summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/binop-notand4a.c
blob: 1178cf78826a3ce550a08b1fa03b7c534d92a2ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */

int
foo (unsigned char a, _Bool b)
{
  return (!a & a) | (b & !b);
}

/* As long as comparisons aren't boolified and casts from boolean-types
   aren't preserved, the folding of  X & !X to zero fails.  */
/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */