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/] [libmudflap/] [testsuite/] [libmudflap.c/] [pass22-frag.c] - Blame information for rev 275

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 275 jeremybenn
#include <stdio.h>
2
#include <stdlib.h>
3
#include <string.h>
4
int main ()
5
{
6
struct foo {
7
  unsigned base:8;
8
  unsigned flag1:1;
9
  unsigned flag2:3;
10
  unsigned flag3:4;
11
  char nothing[0];
12
};
13
 
14
#define offsetof(TYPE, MEMBER)  ((size_t) &((TYPE *) 0)->MEMBER)
15
 
16
struct foo* f = (struct foo *) malloc (offsetof (struct foo, nothing));
17
f->base = 1;
18
f->flag1 = 1;
19
free (f);
20
 
21
 
22
return 0;
23
}

powered by: WebSVN 2.1.0

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