1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-optimized" } */
4 #define INT_BITS (sizeof (int) * __CHAR_BIT__)
5 #define ROL(x, y) ((x) << (y) | (x) >> (INT_BITS - (y)))
6 #define ROR(x, y) ((x) >> (y) | (x) << (INT_BITS - (y)))
9 rol (unsigned a
, unsigned b
)
15 ror (unsigned a
, unsigned b
)
21 rol_conv1 (int a
, unsigned b
)
23 return ~(int)ROL((unsigned)~a
, b
);
27 rol_conv2 (int a
, unsigned b
)
29 return ~ROL((unsigned)~a
, b
);
33 rol_conv3 (unsigned a
, unsigned b
)
35 return ~(int)ROL(~a
, b
);
38 #define LONG_BITS (sizeof (long) * __CHAR_BIT__)
39 #define ROLL(x, y) ((x) << (y) | (x) >> (LONG_BITS - (y)))
40 #define RORL(x, y) ((x) >> (y) | (x) << (LONG_BITS - (y)))
43 roll (unsigned long a
, unsigned long b
)
49 rorl (unsigned long a
, unsigned long b
)
54 /* { dg-final { scan-tree-dump-not "~" "optimized" } } */