OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [20051215-1.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* ARM's load-and-call patterns used to allow automodified addresses.
2
   This was wrong, because if the modified register were spilled,
3
   the call would need an output reload.  */
4
/* { dg-do run { target arm*-*-* } } */
5
/* { dg-options "-O2 -fno-omit-frame-pointer" } */
6
extern void abort (void);
7
typedef void (*callback) (void);
8
 
9
static void
10
foo (callback *first, callback *p)
11
{
12
  while (p > first)
13
    {
14
      (*--p) ();
15
#ifndef __thumb__
16
      asm ("" : "=r" (p) : "0" (p)
17
           : "r4", "r5", "r6", "r7", "r8", "r9", "r10");
18
#endif
19
    }
20
}
21
 
22
static void
23
dummy (void)
24
{
25
  static int count;
26
  if (count++ == 1)
27
    abort ();
28
}
29
 
30
int
31
main (void)
32
{
33
  callback list[1] = { dummy };
34
  foo (&list[0], &list[1]);
35
  return 0;
36
}

powered by: WebSVN 2.1.0

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