OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [packed-array.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2 -fno-inline" } */
3
 
4
struct usb_interface_descriptor {
5
 unsigned short wMaxPacketSize;
6
  char e;
7
} __attribute__ ((packed));
8
 
9
struct usb_device {
10
 int devnum;
11
 struct usb_interface_descriptor if_desc[2];
12
};
13
 
14
extern int printf (const char *, ...);
15
 
16
void foo (unsigned short a)
17
{
18
  printf ("%d\n", a);
19
}
20
 
21
struct usb_device ndev;
22
 
23
void usb_set_maxpacket(int n)
24
{
25
  int i;
26
 
27
  for(i=0; i<n;i++)
28
    foo((&ndev)->if_desc[i].wMaxPacketSize);
29
}
30
 
31
int
32
main()
33
{
34
  usb_set_maxpacket(2);
35
  return 0;
36
}
37
 
38
 
39
 
40
 

powered by: WebSVN 2.1.0

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