summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr105338.c
blob: a7b879444f4d121d12d737b95622f91eeb749e03 (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 target/105338 */
/* { dg-do compile } */
/* { dg-options "-O2 -fno-ipa-icf -masm=att" } */
/* { dg-final { scan-assembler-times "\tnegl\t" 3 } } */
/* { dg-final { scan-assembler-times "\tsbbl\t" 3 } } */
/* { dg-final { scan-assembler-times "\tandl\t" 3 } } */

int
foo (int i)
{
  return i ? 5 : 0;
}

int
bar (int b)
{
  return !!b * 5;
}

int
baz (int b)
{
  if (!b)
    return 0;
  return 5;
}