URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 107 |
Rev 1765 |
#include <stdlib.h>
|
#include <stdlib.h>
|
#include <string.h>
|
#include <string.h>
|
|
|
/* Test various kinds of stepping.
|
/* Test various kinds of stepping.
|
*/
|
*/
|
int myglob = 0;
|
int myglob = 0;
|
|
|
int callee() {
|
int callee() {
|
myglob++; return 0;
|
myglob++; return 0;
|
}
|
}
|
|
|
/* A structure which, we hope, will need to be passed using memcpy. */
|
/* A structure which, we hope, will need to be passed using memcpy. */
|
struct rhomboidal {
|
struct rhomboidal {
|
int rather_large[100];
|
int rather_large[100];
|
};
|
};
|
|
|
void
|
void
|
large_struct_by_value (struct rhomboidal r)
|
large_struct_by_value (struct rhomboidal r)
|
{
|
{
|
myglob += r.rather_large[42]; /* step-test.exp: arrive here 1 */
|
myglob += r.rather_large[42]; /* step-test.exp: arrive here 1 */
|
}
|
}
|
|
|
int main () {
|
int main () {
|
int w,x,y,z;
|
int w,x,y,z;
|
int a[10], b[10];
|
int a[10], b[10];
|
|
|
/* Test "next" and "step" */
|
/* Test "next" and "step" */
|
w = 0;
|
w = 0;
|
x = 1;
|
x = 1;
|
y = 2;
|
y = 2;
|
z = 3;
|
z = 3;
|
w = w + 2;
|
w = w + 2;
|
x = x + 3;
|
x = x + 3;
|
y = y + 4;
|
y = y + 4;
|
z = z + 5;
|
z = z + 5;
|
|
|
/* Test that "next" goes over a call */
|
/* Test that "next" goes over a call */
|
callee(); /* OVER */
|
callee(); /* OVER */
|
|
|
/* Test that "step" doesn't */
|
/* Test that "step" doesn't */
|
callee(); /* INTO */
|
callee(); /* INTO */
|
|
|
/* Test "stepi" */
|
/* Test "stepi" */
|
a[5] = a[3] - a[4];
|
a[5] = a[3] - a[4];
|
callee(); /* STEPI */
|
callee(); /* STEPI */
|
|
|
/* Test "nexti" */
|
/* Test "nexti" */
|
callee(); /* NEXTI */
|
callee(); /* NEXTI */
|
|
|
y = w + z;
|
y = w + z;
|
|
|
{
|
{
|
struct rhomboidal r;
|
struct rhomboidal r;
|
memset (r.rather_large, 0, sizeof (r.rather_large));
|
memset (r.rather_large, 0, sizeof (r.rather_large));
|
r.rather_large[42] = 10;
|
r.rather_large[42] = 10;
|
large_struct_by_value (r); /* step-test.exp: large struct by value */
|
large_struct_by_value (r); /* step-test.exp: large struct by value */
|
}
|
}
|
|
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.