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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr41395-1.c] - Blame information for rev 715

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

Line No. Rev Author Line
1 688 jeremybenn
struct VEC_char_base
2
{
3
  unsigned num;
4
  unsigned alloc;
5
  short vec[1];
6
};
7
 
8
short __attribute__((noinline))
9
foo (struct VEC_char_base *p, int i)
10
{
11
  short *q;
12
  p->vec[i] = 0;
13
  q = &p->vec[8];
14
  *q = 1;
15
  return p->vec[i];
16
}
17
 
18
extern void abort (void);
19
extern void *malloc (__SIZE_TYPE__);
20
 
21
int
22
main()
23
{
24
  struct VEC_char_base *p = malloc (sizeof (struct VEC_char_base) + 256);
25
  if (foo (p, 8) != 1)
26
    abort ();
27
  return 0;
28
}

powered by: WebSVN 2.1.0

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