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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr43008.c] - Blame information for rev 297

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
int i;
2
struct X {
3
  int *p;
4
};
5
struct X * __attribute__((malloc))
6
my_alloc (void)
7
{
8
  struct X *p = __builtin_malloc (sizeof (struct X));
9
  p->p = &i;
10
  return p;
11
}
12
extern void abort (void);
13
int main()
14
{
15
  struct X *p, *q;
16
  p = my_alloc ();
17
  q = my_alloc ();
18
  *(p->p) = 1;
19
  *(q->p) = 0;
20
  if (*(p->p) != 0)
21
    abort ();
22
  return 0;
23
}

powered by: WebSVN 2.1.0

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