| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O2 --save-temps -fno-inline" } */ |
| 3 |
/* { dg-require-effective-target arm32 } */ |
| 4 |
|
| 5 |
extern void abort (void); |
| 6 |
|
| 7 |
int |
| 8 |
bics_si_test1 (int a, int b, int c) |
| 9 |
{ |
| 10 |
int d = a & ~b; |
| 11 |
|
| 12 |
/* { dg-final { scan-assembler-times "bics\tr\[0-9\]+, r\[0-9\]+, r\[0-9\]+" 2 } } */ |
| 13 |
if (d == 0) |
| 14 |
return a + c; |
| 15 |
else |
| 16 |
return b + d + c; |
| 17 |
} |
| 18 |
|
| 19 |
int |
| 20 |
bics_si_test2 (int a, int b, int c) |
| 21 |
{ |
| 22 |
int d = a & ~(b << 3); |
| 23 |
|
| 24 |
/* { dg-final { scan-assembler-times "bics\tr\[0-9\]+, r\[0-9\]+, r\[0-9\]+, .sl \#3" 1 } } */ |
| 25 |
if (d == 0) |
| 26 |
return a + c; |
| 27 |
else |
| 28 |
return b + d + c; |
| 29 |
} |
| 30 |
|
| 31 |
int |
| 32 |
main () |
| 33 |
{ |
| 34 |
int x; |
| 35 |
|
| 36 |
x = bics_si_test1 (29, ~4, 5); |
| 37 |
if (x != ((29 & 4) + ~4 + 5)) |
| 38 |
abort (); |
| 39 |
|
| 40 |
x = bics_si_test1 (5, ~2, 20); |
| 41 |
if (x != 25) |
| 42 |
abort (); |
| 43 |
|
| 44 |
x = bics_si_test2 (35, ~4, 5); |
| 45 |
if (x != ((35 & ~(~4 << 3)) + ~4 + 5)) |
| 46 |
abort (); |
| 47 |
|
| 48 |
x = bics_si_test2 (96, ~2, 20); |
| 49 |
if (x != 116) |
| 50 |
abort (); |
| 51 |
|
| 52 |
return 0; |
| 53 |
} |