OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [packed-array.c] - Rev 298

Compare with Previous | Blame | View Log

/* { 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;
}
 
 
 
 
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.