/* functest.c. Function parameter test for Or1ksim
|
/* functest.c. Function parameter test for Or1ksim
|
|
|
Copyright (C) 1999-2006 OpenCores
|
Copyright (C) 1999-2006 OpenCores
|
Copyright (C) 2010 Embecosm Limited
|
Copyright (C) 2010 Embecosm Limited
|
|
|
Contributors various OpenCores participants
|
Contributors various OpenCores participants
|
Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
|
Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
|
|
|
This file is part of OpenRISC 1000 Architectural Simulator.
|
This file is part of OpenRISC 1000 Architectural Simulator.
|
|
|
This program is free software; you can redistribute it and/or modify it
|
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 the Free
|
under the terms of the GNU General Public License as published by the Free
|
Software Foundation; either version 3 of the License, or (at your option)
|
Software Foundation; either version 3 of the License, or (at your option)
|
any later version.
|
any later version.
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
more details.
|
more details.
|
|
|
You should have received a copy of the GNU General Public License along
|
You should have received a copy of the GNU General Public License along
|
with this program. If not, see <http: www.gnu.org/licenses/>. */
|
with this program. If not, see <http: www.gnu.org/licenses/>. */
|
|
|
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
This code is commented throughout for use with Doxygen.
|
This code is commented throughout for use with Doxygen.
|
--------------------------------------------------------------------------*/
|
--------------------------------------------------------------------------*/
|
|
|
/* Simple test, that test function parameters */
|
/* Simple test, that test function parameters */
|
#include "support.h"
|
#include "support.h"
|
|
|
int gk = 0;
|
int gk = 0;
|
int c = 0;
|
int c = 0;
|
int fun1 (int a, int b, int c, int d, int e, int f, int g)
|
int fun1 (int a, int b, int c, int d, int e, int f, int g)
|
{
|
{
|
int j = 0;
|
int j = 0;
|
|
|
while(j < 2) {
|
while(j < 2) {
|
a++;
|
a++;
|
j++;
|
j++;
|
}
|
}
|
|
|
return a;
|
return a;
|
}
|
}
|
|
|
int main(void)
|
int main(void)
|
{
|
{
|
int i, j, k;
|
int i, j, k;
|
i = j = k = 0;
|
i = j = k = 0;
|
|
|
while (c++ < 10) {
|
while (c++ < 10) {
|
j = fun1(gk, k + 1, k + 2, k + 3, k + 4, k + 5, k + 6);
|
j = fun1(gk, k + 1, k + 2, k + 3, k + 4, k + 5, k + 6);
|
printf ("%i\n", gk);
|
printf ("%i\n", gk);
|
if(j > 40)
|
if(j > 40)
|
gk = j - 20;
|
gk = j - 20;
|
else
|
else
|
gk = j;
|
gk = j;
|
}
|
}
|
report (gk);
|
report (gk);
|
if (gk == 20)
|
if (gk == 20)
|
report(0xdeaddead);
|
report(0xdeaddead);
|
return (gk != 20);
|
return (gk != 20);
|
}
|
}
|
|
|