diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/cris/pr93372-34.c')
-rw-r--r-- | gcc/testsuite/gcc.target/cris/pr93372-34.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/cris/pr93372-34.c b/gcc/testsuite/gcc.target/cris/pr93372-34.c new file mode 100644 index 0000000..8bd3b44 --- /dev/null +++ b/gcc/testsuite/gcc.target/cris/pr93372-34.c @@ -0,0 +1,45 @@ +/* Check that btst/btstq other than a field starting at bit 0, is used. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-final { scan-assembler-not "\tand" } } */ +/* { dg-final { scan-assembler-not "\tcmp|\ttest" } } */ +/* { dg-final { scan-assembler-times "\tbtstq" 3 } } */ +/* { dg-final { scan-assembler-times "\tbtst " 3 } } */ + +void foo(void); + +void f(int *a) +{ + if ((*a & 32) != 0) + foo(); +} + +void g(short int *a) +{ + if ((*a & 128) == 0) + foo(); +} + +void h(char *a) +{ + if ((*a & 64) != 0) + foo(); +} + +void i(int *a, unsigned int n) +{ + if ((*a & (1 << n)) != 0) + foo(); +} + +void j(short int *a, unsigned int n) +{ + if ((*a & (1 << n)) == 0) + foo(); +} + +void k(char *a, unsigned int n) +{ + if ((*a & (1 << n)) != 0) + foo(); +} |