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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 688 jeremybenn
/* PR rtl-optimization/45912 */
2
 
3
extern void abort (void);
4
 
5
static void* __attribute__((noinline,noclone))
6
get_addr_base_and_unit_offset (void *base, long long *i)
7
{
8
  *i = 0;
9
  return base;
10
}
11
 
12
static void* __attribute__((noinline,noclone))
13
build_int_cst (void *base, long long offset)
14
{
15
  if (offset != 4)
16
    abort ();
17
 
18
  return base;
19
}
20
 
21
static void* __attribute__((noinline,noclone))
22
build_ref_for_offset (void *base, long long offset)
23
{
24
  long long base_offset;
25
  base = get_addr_base_and_unit_offset (base, &base_offset);
26
  return build_int_cst (base, base_offset + offset / 8);
27
}
28
 
29
int
30
main (void)
31
{
32
  void *ret = build_ref_for_offset ((void *)0, 32);
33
  if (ret != (void *)0)
34
    abort ();
35
  return 0;
36
}

powered by: WebSVN 2.1.0

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