Commit d9484c5b by Christian Bruel Committed by Christian Bruel

test case for alignment bug in packed structs for STRICT_ALIGNMENT targets

From-SVN: r132415
parent 0e93e1b4
2008-02-19 Christian Bruel <christian.bruel@st.com>
* gcc.dg/packed-array.c: New testcase.
2008-02-19 Uros Bizjak <ubizjak@gmail.com> 2008-02-19 Uros Bizjak <ubizjak@gmail.com>
PR target/33555 PR target/33555
/* { dg-do run } */
/* { dg-options "-O2 -fno-inline" } */
struct usb_interface_descriptor {
unsigned short wMaxPacketSize;
char e;
} __attribute__ ((packed));
struct usb_device {
int devnum;
struct usb_interface_descriptor if_desc[2];
};
extern int printf (const char *, ...);
void foo (unsigned short a)
{
printf ("%d\n", a);
}
struct usb_device ndev;
void usb_set_maxpacket(int n)
{
int i;
for(i=0; i<n;i++)
foo((&ndev)->if_desc[i].wMaxPacketSize);
}
int
main()
{
usb_set_maxpacket(2);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment