Debian Codegraph @

gcc/testsuite/gcc.c-torture/compile/bf.c

raw
1 typedef unsigned long uint32;
2 typedef signed long sint32;
3 int clr (int, int, int);
4 int atoi (const char *);
5
6 uint32
7 ext (sint32 src, unsigned o5, unsigned w5)
8 {
9 return (w5 == 0) ? src >> o5 : (src << (( - o5 - w5) & 31)) >> (32 - w5);
10 }
11
12 uint32
13 extu (uint32 src, unsigned o5, unsigned w5)
14 {
15 return (w5 == 0) ? src >> o5 : (src << (( - o5 - w5) & 31)) >> (32 - w5);
16 }
17
18 uint32
19 mak (uint32 src, unsigned o5, unsigned w5)
20 {
21 return (w5 == 0) ? src << o5 : (src << (32 - w5)) >> (( - o5 - w5) & 31);
22 }
23
24 uint32
25 rot (uint32 src, unsigned o5)
26 {
27 return (src >> o5) | (src << (( - o5) & 31));
28 }
29
30 int
31 main (int argc, char **argv)
32 {
33 __builtin_printf ("%x\n", clr (0xffffffff, atoi (argv[2]), atoi (argv[1])));
34 }