Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / pr33923.c
blobd71e5578a8a054ce6fa5d38578ff6d0c0de24a5c
1 /* PR target/33923 */
2 /* Testcase by Martin Michlmayr <tbm@cyrius.com> */
4 /* { dg-do compile } */
5 /* { dg-options "-O3 --param max-partial-antic-length=0" } */
7 static int pendingCommand;
8 static int currentModifiers;
9 typedef struct
11 int (*updateKeys) (int *keyPressed);
13 ProtocolOperations;
14 static const ProtocolOperations *protocol;
15 brl_readCommand (void)
17 unsigned long int keys;
18 int command;
19 int keyPressed;
20 unsigned char routingKeys[200];
21 int routingKeyCount;
22 signed char rightVerticalSensor;
23 if (pendingCommand != (-1))
25 return command;
27 if (!protocol->updateKeys (&keyPressed))
29 if (rightVerticalSensor >= 0)
30 keys |= 1;
31 if ((routingKeyCount == 0) && keys)
33 if (currentModifiers)
35 doChord:switch (keys);
37 else
39 doCharacter:
40 command = 0X2200;
41 if (keys & 0X01UL)
42 command |= 0001;
43 if (keys & 0X02UL)
44 command |= 0002;
45 if (keys & 0X04UL)
46 command |= 0004;
47 if (keys & 0X08UL)
48 command |= 0010;
49 if (keys & 0X10UL)
50 command |= 0020;
51 if (keys & 0X20UL)
52 command |= 0040;
53 if (currentModifiers & (0X0010 | 0X0200))
54 command |= 0100;
55 if (currentModifiers & 0X0040)
56 command |= 0200;
57 if (currentModifiers & 0X0100)
58 command |= 0X020000;
59 if (currentModifiers & 0X0400)
60 command |= 0X080000;
61 if (currentModifiers & 0X0800)
62 command |= 0X040000;
64 unsigned char key1 = routingKeys[0];
65 if (key1 == 0)
67 } else if (key1 == 1)
68 if (keys)
70 currentModifiers |= 0X0010;
71 goto doCharacter;
75 return command;