AVR: target/84211 - Add a post reload register optimization pass.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr112639.c
blob9450d88baeafd340f93273f54dceb173f4415318
1 /* PR middle-end/112639 */
2 /* { dg-do run } */
4 unsigned long long b = 0;
6 int
7 foo (void)
9 return __builtin_clzg (b++, __SIZEOF_LONG_LONG__ * __CHAR_BIT__);
12 int
13 bar (void)
15 return __builtin_ctzg (b++, __SIZEOF_LONG_LONG__ * __CHAR_BIT__);
18 int
19 main ()
21 if (foo () != __SIZEOF_LONG_LONG__ * __CHAR_BIT__ || b != 1)
22 __builtin_abort ();
23 if (foo () != __SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 1 || b != 2)
24 __builtin_abort ();
25 if (foo () != __SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 2 || b != 3)
26 __builtin_abort ();
27 b = 0;
28 if (bar () != __SIZEOF_LONG_LONG__ * __CHAR_BIT__ || b != 1)
29 __builtin_abort ();
30 if (bar () != 0 || b != 2)
31 __builtin_abort ();
32 if (bar () != 1 || b != 3)
33 __builtin_abort ();