1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fno-strict-aliasing -fdump-tree-optimized" } */
3 
4 typedef unsigned u32;
5 typedef unsigned short u16;
6 typedef unsigned char u8;
7 struct biosregs {
8  union {
9   struct {
10    u32 edi;
11    u32 esi;
12    u32 ebp;
13    u32 _esp;
14    u32 ebx;
15    u32 edx;
16    u32 ecx;
17    u32 eax;
18    u32 _fsgs;
19    u32 _dses;
20    u32 eflags;
21   };
22   struct {
23    u16 di, hdi;
24    u16 si, hsi;
25    u16 bp, hbp;
26    u16 _sp, _hsp;
27    u16 bx, hbx;
28    u16 dx, hdx;
29    u16 cx, hcx;
30    u16 ax, hax;
31    u16 gs, fs;
32    u16 es, ds;
33    u16 flags, hflags;
34   };
35   struct {
36    u8 dil, dih, edi2, edi3;
37    u8 sil, sih, esi2, esi3;
38    u8 bpl, bph, ebp2, ebp3;
39    u8 _spl, _sph, _esp2, _esp3;
40    u8 bl, bh, ebx2, ebx3;
41    u8 dl, dh, edx2, edx3;
42    u8 cl, ch, ecx2, ecx3;
43    u8 al, ah, eax2, eax3;
44   };
45  };
46 };
47 void initregs(struct biosregs *regs);
48 void intcall(u8 int_no, const struct biosregs *ireg, struct biosregs *oreg);
49 static u32 *const gp = (u32*) 0x32;
keyboard_set_repeat(void)50 void keyboard_set_repeat(void)
51 {
52  struct biosregs ireg;
53  *gp = 10;
54  initregs(&ireg);
55  ireg.ax = 0x0305;
56  intcall(0x16, &ireg, ((void *)0));
57 }
58 
59 /* { dg-final { scan-tree-dump-times "ireg.*ax" 1 "optimized"} } */
60 
61