| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O2 --save-temps -fno-inline" } */ |
| 3 |
|
| 4 |
extern void abort (void); |
| 5 |
|
| 6 |
int |
| 7 |
bics_si_test1 (int a, int b, int c) |
| 8 |
{ |
| 9 |
if ((a | b) == a) |
| 10 |
return a; |
| 11 |
else |
| 12 |
return c; |
| 13 |
} |
| 14 |
|
| 15 |
int |
| 16 |
bics_si_test2 (int a, int b, int c) |
| 17 |
{ |
| 18 |
if ((a | b) == b) |
| 19 |
return b; |
| 20 |
else |
| 21 |
return c; |
| 22 |
} |
| 23 |
|
| 24 |
typedef long long s64; |
| 25 |
|
| 26 |
s64 |
| 27 |
bics_di_test1 (s64 a, s64 b, s64 c) |
| 28 |
{ |
| 29 |
if ((a | b) == a) |
| 30 |
return a; |
| 31 |
else |
| 32 |
return c; |
| 33 |
} |
| 34 |
|
| 35 |
s64 |
| 36 |
bics_di_test2 (s64 a, s64 b, s64 c) |
| 37 |
{ |
| 38 |
if ((a | b) == b) |
| 39 |
return b; |
| 40 |
else |
| 41 |
return c; |
| 42 |
} |
| 43 |
|
| 44 |
int |
| 45 |
main () |
| 46 |
{ |
| 47 |
int x; |
| 48 |
s64 y; |
| 49 |
|
| 50 |
x = bics_si_test1 (0xf00d, 0xf11f, 0); |
| 51 |
if (x != 0) |
| 52 |
abort (); |
| 53 |
|
| 54 |
x = bics_si_test1 (0xf11f, 0xf00d, 0); |
| 55 |
if (x != 0xf11f) |
| 56 |
abort (); |
| 57 |
|
| 58 |
x = bics_si_test2 (0xf00d, 0xf11f, 0); |
| 59 |
if (x != 0xf11f) |
| 60 |
abort (); |
| 61 |
|
| 62 |
x = bics_si_test2 (0xf11f, 0xf00d, 0); |
| 63 |
if (x != 0) |
| 64 |
abort (); |
| 65 |
|
| 66 |
y = bics_di_test1 (0x10001000f00dll, 0x12341000f00dll, 0ll); |
| 67 |
if (y != 0) |
| 68 |
abort (); |
| 69 |
|
| 70 |
y = bics_di_test1 (0x12341000f00dll, 0x10001000f00dll, 0ll); |
| 71 |
if (y != 0x12341000f00dll) |
| 72 |
abort (); |
| 73 |
|
| 74 |
y = bics_di_test2 (0x10001000f00dll, 0x12341000f00dll, 0ll); |
| 75 |
if (y != 0x12341000f00dll) |
| 76 |
abort (); |
| 77 |
|
| 78 |
y = bics_di_test2 (0x12341000f00dll, 0x10001000f00dll, 0ll); |
| 79 |
if (y != 0) |
| 80 |
abort (); |
| 81 |
|
| 82 |
return 0; |
| 83 |
} |
| 84 |
|
| 85 |
/* { dg-final { scan-assembler-times "bics\twzr, w\[0-9\]+, w\[0-9\]+" 2 } } */ |
| 86 |
/* { dg-final { scan-assembler-times "bics\txzr, x\[0-9\]+, x\[0-9\]+" 2 } } */ |