Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr33922.c
blob7429eb161e6bf8c0796b9f4726a2552d6e944b78
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -ftree-pre" } */
4 typedef enum
6 ST_TiemanStyle,
8 BrailleDisplay;
9 static int pendingCommand;
10 static int currentModifiers;
11 typedef struct
13 int (*updateKeys) (BrailleDisplay * brl, int *keyPressed);
15 ProtocolOperations;
16 static const ProtocolOperations *protocol;
17 brl_readCommand (BrailleDisplay * brl)
19 unsigned long int keys;
20 int command;
21 int keyPressed;
22 unsigned char routingKeys[200];
23 int routingKeyCount;
24 signed char rightVerticalSensor;
25 if (pendingCommand != (-1))
27 return command;
29 if (!protocol->updateKeys (brl, &keyPressed))
31 if (rightVerticalSensor >= 0)
32 keys |= 1;
33 if ((routingKeyCount == 0) && keys)
35 if (currentModifiers)
37 doChord:switch (keys);
39 else
41 doCharacter:
42 command = 0X2200;
43 if (keys & 0X01UL)
44 command |= 0001;
45 if (keys & 0X02UL)
46 command |= 0002;
47 if (keys & 0X04UL)
48 command |= 0004;
49 if (keys & 0X08UL)
50 command |= 0010;
51 if (keys & 0X10UL)
52 command |= 0020;
53 if (keys & 0X20UL)
54 command |= 0040;
55 if (currentModifiers & (0X0010 | 0X0200))
56 command |= 0100;
57 if (currentModifiers & 0X0040)
58 command |= 0200;
59 if (currentModifiers & 0X0100)
60 command |= 0X020000;
61 if (currentModifiers & 0X0400)
62 command |= 0X080000;
63 if (currentModifiers & 0X0800)
64 command |= 0X040000;
66 unsigned char key1 = routingKeys[0];
67 if (key1 == 0)
70 if (key1 == 1)
71 if (keys)
73 currentModifiers |= 0X0010;
74 goto doCharacter;
78 return command;