PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / shift_mask.c
blob29c84bd1dffe741bf7bcc30c31d416d348d4c710
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
4 int test_sal (int a, int c)
6 return a << (c & 0x1f);
9 int test_sar (int a, int c)
11 return a >> (c & 0x1f);
14 unsigned int test_shr (unsigned int a, int c)
16 return a >> (c & 0x1f);
19 unsigned int test_rol (unsigned int a, int c)
21 int z = c & 0x1f;
22 return (a << z) | (a >> (32 - z));
25 unsigned int test_ror (unsigned int a, int c)
27 int z = c & 0x1f;
28 return (a >> z) | (a << (32 - z));
31 /* { dg-final { scan-assembler-not "and" } } */