| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O" } */ |
| 3 |
|
| 4 |
extern void foo(void); |
| 5 |
|
| 6 |
void BNONE_test(int a, int b) |
| 7 |
{ |
| 8 |
if (a & b) |
| 9 |
foo(); |
| 10 |
} |
| 11 |
|
| 12 |
void BANY_test(int a, int b) |
| 13 |
{ |
| 14 |
if (!(a & b)) |
| 15 |
foo(); |
| 16 |
} |
| 17 |
|
| 18 |
void BALL_test(int a, int b) |
| 19 |
{ |
| 20 |
if (~a & b) |
| 21 |
foo(); |
| 22 |
} |
| 23 |
|
| 24 |
void BNALL_test(int a, int b) |
| 25 |
{ |
| 26 |
if (!(~a & b)) |
| 27 |
foo(); |
| 28 |
} |
| 29 |
|
| 30 |
/* { dg-final { scan-assembler-times "bnone" 1 } } */ |
| 31 |
/* { dg-final { scan-assembler-times "bany" 1 } } */ |
| 32 |
/* { dg-final { scan-assembler-times "ball" 1 } } */ |
| 33 |
/* { dg-final { scan-assembler-times "bnall" 1 } } */ |