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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gdb/] [gdb-6.8/] [gdb-6.8.openrisc-2.1/] [gdb/] [testsuite/] [gdb.base/] [gcore.c] - Diff between revs 24 and 33

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

Rev 24 Rev 33
/* Copyright 2002, 2004, 2007, 2008 Free Software Foundation, Inc.
/* Copyright 2002, 2004, 2007, 2008 Free Software Foundation, Inc.
 
 
   This file is part of GDB.
   This file is part of GDB.
 
 
   This program is free software; you can redistribute it and/or modify
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.
   (at your option) any later version.
 
 
   This program is distributed in the hope that it will be useful,
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   GNU General Public License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
/*
/*
 * Test GDB's ability to save and reload a corefile.
 * Test GDB's ability to save and reload a corefile.
 */
 */
 
 
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
 
 
int extern_array[4] = {1, 2, 3, 4};
int extern_array[4] = {1, 2, 3, 4};
static int static_array[4] = {5, 6, 7, 8};
static int static_array[4] = {5, 6, 7, 8};
static int un_initialized_array[4];
static int un_initialized_array[4];
static char *heap_string;
static char *heap_string;
 
 
void
void
terminal_func ()
terminal_func ()
{
{
  return;
  return;
}
}
 
 
void
void
array_func ()
array_func ()
{
{
  int local_array[4];
  int local_array[4];
  int i;
  int i;
 
 
  heap_string = (char *) malloc (80);
  heap_string = (char *) malloc (80);
  strcpy (heap_string, "I'm a little teapot, short and stout...");
  strcpy (heap_string, "I'm a little teapot, short and stout...");
  for (i = 0; i < 4; i++)
  for (i = 0; i < 4; i++)
    {
    {
      un_initialized_array[i] = extern_array[i] + 8;
      un_initialized_array[i] = extern_array[i] + 8;
      local_array[i] = extern_array[i] + 12;
      local_array[i] = extern_array[i] + 12;
    }
    }
  terminal_func ();
  terminal_func ();
}
}
 
 
#ifdef PROTOTYPES
#ifdef PROTOTYPES
int factorial_func (int value)
int factorial_func (int value)
#else
#else
int factorial_func (value)
int factorial_func (value)
     int value;
     int value;
#endif
#endif
{
{
  if (value > 1) {
  if (value > 1) {
    value *= factorial_func (value - 1);
    value *= factorial_func (value - 1);
  }
  }
  array_func ();
  array_func ();
  return (value);
  return (value);
}
}
 
 
main()
main()
{
{
  factorial_func (6);
  factorial_func (6);
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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