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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [testsuite/] [gdb.base/] [coremaker2.c] - Diff between revs 107 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 107 Rev 1765
/* Simple little program that just generates a core dump from inside some
/* Simple little program that just generates a core dump from inside some
   nested function calls.  Keep this as self contained as possible, I.E.
   nested function calls.  Keep this as self contained as possible, I.E.
   use no environment resources other than possibly abort(). */
   use no environment resources other than possibly abort(). */
 
 
#ifndef __STDC__
#ifndef __STDC__
#define const   /**/
#define const   /**/
#endif
#endif
 
 
#ifndef HAVE_ABORT
#ifndef HAVE_ABORT
#define HAVE_ABORT 1
#define HAVE_ABORT 1
#endif
#endif
 
 
#if HAVE_ABORT
#if HAVE_ABORT
#define ABORT abort()
#define ABORT abort()
#else
#else
#define ABORT {char *invalid = 0; *invalid = 0xFF;}
#define ABORT {char *invalid = 0; *invalid = 0xFF;}
#endif
#endif
 
 
/* Don't make these automatic vars or we will have to walk back up the
/* Don't make these automatic vars or we will have to walk back up the
   stack to access them. */
   stack to access them. */
 
 
char *buf1;
char *buf1;
char *buf2;
char *buf2;
 
 
int coremaker_data = 1; /* In Data section */
int coremaker_data = 1; /* In Data section */
int coremaker_bss;      /* In BSS section */
int coremaker_bss;      /* In BSS section */
 
 
const int coremaker_ro = 201;   /* In Read-Only Data section */
const int coremaker_ro = 201;   /* In Read-Only Data section */
 
 
void
void
func2 (int x)
func2 (int x)
{
{
  int coremaker_local[5];
  int coremaker_local[5];
  int i;
  int i;
  static int y;
  static int y;
 
 
  /* Make sure that coremaker_local doesn't get optimized away. */
  /* Make sure that coremaker_local doesn't get optimized away. */
  for (i = 0; i < 5; i++)
  for (i = 0; i < 5; i++)
    coremaker_local[i] = i;
    coremaker_local[i] = i;
  coremaker_bss = 0;
  coremaker_bss = 0;
  for (i = 0; i < 5; i++)
  for (i = 0; i < 5; i++)
    coremaker_bss += coremaker_local[i];
    coremaker_bss += coremaker_local[i];
  coremaker_data = coremaker_ro + 1;
  coremaker_data = coremaker_ro + 1;
  y = 10 * x;
  y = 10 * x;
  ABORT;
  ABORT;
}
}
 
 
void
void
func1 (int x)
func1 (int x)
{
{
  func2 (x * 2);
  func2 (x * 2);
}
}
 
 
int main ()
int main ()
{
{
  func1 (10);
  func1 (10);
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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