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/] [941014-2.c] - Blame information for rev 297

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
#include <stdio.h>
2
#include <stdlib.h>
3
 
4
typedef struct {
5
  unsigned short a;
6
  unsigned short b;
7
} foo_t;
8
 
9
void a1 (unsigned long offset) {}
10
 
11
volatile foo_t *
12
f ()
13
{
14
  volatile foo_t *foo_p = (volatile foo_t *)malloc (sizeof (foo_t));
15
 
16
  a1((unsigned long)foo_p-30);
17
  if (foo_p->a & 0xf000)
18
    printf("%d\n", foo_p->a);
19
  foo_p->b = 0x0100;
20
  a1 ((unsigned long)foo_p + 2);
21
  a1 ((unsigned long)foo_p - 30);
22
  return foo_p;
23
}
24
 
25
main ()
26
{
27
  volatile foo_t *foo_p;
28
 
29
  foo_p = f ();
30
  if (foo_p->b != 0x0100)
31
    abort ();
32
  exit (0);
33
}

powered by: WebSVN 2.1.0

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