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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [pr49094.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 "-O" } */
3
 
4
struct in_addr {
5
        unsigned int s_addr;
6
};
7
 
8
struct ip {
9
        unsigned char ip_p;
10
        unsigned short ip_sum;
11
        struct  in_addr ip_src,ip_dst;
12
} __attribute__ ((aligned(1), packed));
13
 
14
struct ip ip_fw_fwd_addr;
15
 
16
int test_alignment( char *m )
17
{
18
  struct ip *ip = (struct ip *) m;
19
  struct in_addr pkt_dst;
20
  pkt_dst = ip->ip_dst ;
21
  if( pkt_dst.s_addr == 0 )
22
    return 1;
23
  else
24
    return 0;
25
}
26
 
27
int __attribute__ ((noinline, noclone))
28
intermediary (char *p)
29
{
30
  return test_alignment (p);
31
}
32
 
33
int
34
main (int argc, char *argv[])
35
{
36
  ip_fw_fwd_addr.ip_dst.s_addr = 1;
37
  return intermediary ((void *) &ip_fw_fwd_addr);
38
}

powered by: WebSVN 2.1.0

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