gcc/testsuite/gcc.target/visium/bit_test.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2" } */ |
| 3 | |
| 4 | extern void bar (void); |
| 5 | |
| 6 | void foo1 (unsigned int i) |
| 7 | { |
| 8 | if (i & 4) |
| 9 | bar (); |
| 10 | } |
| 11 | |
| 12 | void foo2 (unsigned int i) |
| 13 | { |
| 14 | if (i & 0x80000000) |
| 15 | bar (); |
| 16 | } |
| 17 | |
| 18 | void foo3 (unsigned char c) |
| 19 | { |
| 20 | if (c & 4) |
| 21 | bar (); |
| 22 | } |
| 23 | |
| 24 | void foo4 (unsigned char c) |
| 25 | { |
| 26 | if (c & 0x80) |
| 27 | bar (); |
| 28 | } |
| 29 | |
| 30 | /* { dg-final { scan-assembler-times "lsr" 2 } } */ |
| 31 | /* { dg-final { scan-assembler-times "cmp" 2 } } */ |