libgcc: Fix a warning/error in libgcc2.c [PR117624]
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr57829.c
blobb5c3d185d0a939e5623913c0fd0224bb2a084c13
1 /* PR rtl-optimization/57829 */
3 __attribute__((noinline, noclone))
4 int
5 f1 (int k)
7 return 2 | ((k - 1) >> ((int) sizeof (int) * __CHAR_BIT__ - 1));
10 __attribute__((noinline, noclone))
11 long int
12 f2 (long int k)
14 return 2L | ((k - 1L) >> ((int) sizeof (long int) * __CHAR_BIT__ - 1));
17 __attribute__((noinline, noclone))
18 int
19 f3 (int k)
21 k &= 63;
22 return 4 | ((k + 2) >> 5);
25 int
26 main ()
28 if (f1 (1) != 2 || f2 (1L) != 2L || f3 (63) != 6 || f3 (1) != 4)
29 __builtin_abort ();
30 return 0;