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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [testsuite/] [test-code-or1k/] [functest/] [functest.c] - Blame information for rev 143

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 90 jeremybenn
/* functest.c. Function parameter test for Or1ksim
2
 
3
   Copyright (C) 1999-2006 OpenCores
4
   Copyright (C) 2010 Embecosm Limited
5
 
6
   Contributors various OpenCores participants
7
   Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
8
 
9
   This file is part of OpenRISC 1000 Architectural Simulator.
10
 
11
   This program is free software; you can redistribute it and/or modify it
12
   under the terms of the GNU General Public License as published by the Free
13
   Software Foundation; either version 3 of the License, or (at your option)
14
   any later version.
15
 
16
   This program is distributed in the hope that it will be useful, but WITHOUT
17
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
19
   more details.
20
 
21
   You should have received a copy of the GNU General Public License along
22
   with this program.  If not, see <http:  www.gnu.org/licenses/>.  */
23
 
24
/* ----------------------------------------------------------------------------
25
   This code is commented throughout for use with Doxygen.
26
   --------------------------------------------------------------------------*/
27
 
28
/* Simple test, that test function parameters */
29
#include "support.h"
30
 
31
int gk = 0;
32
int c = 0;
33
int fun1 (int a, int b, int c, int d, int e, int f, int g)
34
{
35
  int j = 0;
36
 
37
  while(j < 2) {
38
    a++;
39
    j++;
40
  }
41
 
42
  return a;
43
}
44
 
45
int main(void)
46
{
47
  int i, j, k;
48
  i = j = k = 0;
49
 
50
  while (c++ < 10) {
51
    j = fun1(gk, k + 1, k + 2, k + 3, k + 4, k + 5, k + 6);
52
    printf ("%i\n", gk);
53
    if(j > 40)
54
      gk = j - 20;
55
    else
56
      gk = j;
57
  }
58
  report (gk);
59
  if (gk == 20)
60
    report(0xdeaddead);
61
  return (gk != 20);
62
}

powered by: WebSVN 2.1.0

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