URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 107 |
Rev 1765 |
/* Trivial code used to test watchpoints in recursive code and
|
/* Trivial code used to test watchpoints in recursive code and
|
auto-deletion of watchpoints as they go out of scope. */
|
auto-deletion of watchpoints as they go out of scope. */
|
|
|
#ifdef PROTOTYPES
|
#ifdef PROTOTYPES
|
static int
|
static int
|
recurse (int a)
|
recurse (int a)
|
#else
|
#else
|
static int
|
static int
|
recurse (a)
|
recurse (a)
|
int a;
|
int a;
|
#endif
|
#endif
|
{
|
{
|
int b = 0;
|
int b = 0;
|
|
|
if (a == 1)
|
if (a == 1)
|
return 1;
|
return 1;
|
|
|
b = a;
|
b = a;
|
b *= recurse (a - 1);
|
b *= recurse (a - 1);
|
return b;
|
return b;
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
#ifdef usestubs
|
#ifdef usestubs
|
set_debug_traps();
|
set_debug_traps();
|
breakpoint();
|
breakpoint();
|
#endif
|
#endif
|
recurse (10);
|
recurse (10);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.