Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / c-c++-common / rotate-10.c
blob683d2cbc96bf2b585746bfb6f472880151583383
1 /* PR tree-optimization/108440 */
2 /* { dg-do compile { target { { ilp32 || lp64 } || llp64 } } } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 /* { dg-final { scan-tree-dump-times " r<< " 5 "optimized" } } */
5 /* { dg-final { scan-tree-dump-times " \\\& 7;" 4 "optimized" } } */
7 unsigned char
8 foo (unsigned char x, unsigned int y)
10 if (y > __CHAR_BIT__)
11 __builtin_unreachable ();
12 return (x << y) | (x >> ((-y) & (__CHAR_BIT__ - 1)));
15 unsigned char
16 bar (unsigned char x, unsigned int y)
18 if (y >= __CHAR_BIT__)
19 __builtin_unreachable ();
20 return (x << y) | (x >> ((-y) & (__CHAR_BIT__ - 1)));
23 unsigned char
24 baz (unsigned char x, unsigned int y)
26 if (y > __CHAR_BIT__ && y != 2 * __CHAR_BIT__)
27 __builtin_unreachable ();
28 return (x << y) | (x >> ((-y) & (__CHAR_BIT__ - 1)));
31 unsigned char
32 qux (unsigned char x, unsigned int y)
34 if (y > __CHAR_BIT__ && y != 2 * __CHAR_BIT__ && y != __CHAR_BIT__ + 2)
35 __builtin_unreachable ();
36 return (x << y) | (x >> ((-y) & (__CHAR_BIT__ - 1)));
39 unsigned char
40 quux (unsigned char x, unsigned int y)
42 if (y > __CHAR_BIT__)
43 __builtin_unreachable ();
44 return (x << y) | (x >> (__CHAR_BIT__ - y));
47 unsigned char
48 corge (unsigned char x, unsigned int y)
50 if (y >= __CHAR_BIT__)
51 __builtin_unreachable ();
52 return (x << y) | (x >> (__CHAR_BIT__ - y));