aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/pr101537.c
blob: c0c3cfc45cb41a8b587d4a197337080018b5bb61 (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
/* PR c/101537 */
/* { dg-do compile } */
/* { dg-options "-Wconversion" } */

int
foo ()
{
  int aaa = 1;
  unsigned char bbb = 0;
  bbb |= aaa ? 1 : 0;
  return bbb;
}

int
bar (unsigned char x, int f)
{
  x |= f ? 1 : 0;
  return x;
}

int
baz (unsigned char x, int f)
{
  x = x | f ? 1 : 0;
  return x;
}