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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [920810-1.c] - Blame information for rev 841

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
#include <stdio.h>
2
#include <string.h>
3
#include <stdlib.h>
4
 
5
typedef struct{void*super;int name;int size;}t;
6
t*f(t*clas,int size)
7
{
8
  t*child=(t*)malloc(size);
9
  memcpy(child,clas,clas->size);
10
  child->super=clas;
11
  child->name=0;
12
  child->size=size;
13
  return child;
14
}
15
main()
16
{
17
  t foo,*bar;
18
  memset(&foo,37,sizeof(t));
19
  foo.size=sizeof(t);
20
  bar=f(&foo,sizeof(t));
21
  if(bar->super!=&foo||bar->name!=0||bar->size!=sizeof(t))abort();
22
  exit(0);
23
}

powered by: WebSVN 2.1.0

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