2014-04-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / packed-array.c
blobb57f3ac035356e20cb59180d37d935f1f6b704a7
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fno-inline" } */
4 struct usb_interface_descriptor {
5 unsigned short wMaxPacketSize;
6 char e;
7 } __attribute__ ((packed));
9 struct usb_device {
10 int devnum;
11 struct usb_interface_descriptor if_desc[2];
14 extern int printf (const char *, ...);
16 void foo (unsigned short a)
18 printf ("%d\n", a);
21 struct usb_device ndev;
23 void usb_set_maxpacket(int n)
25 int i;
27 for(i=0; i<n;i++)
28 foo((&ndev)->if_desc[i].wMaxPacketSize);
31 int
32 main()
34 usb_set_maxpacket(2);
35 return 0;