summaryrefslogtreecommitdiff
path: root/testsuite/vests/vhdl-93/billowitch/compliant/tc2964.vhd
blob: d6311ecc3d2ddc5593a5cf7ed187a597b0289ca6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184

-- Copyright (C) 2001 Bill Billowitch.

-- Some of the work to develop this test suite was done with Air Force
-- support.  The Air Force and Bill Billowitch assume no
-- responsibilities for this software.

-- This file is part of VESTs (Vhdl tESTs).

-- VESTs 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 Software Foundation; either version 2 of the License, or (at
-- your option) any later version. 

-- VESTs is distributed in the hope that it will be useful, but WITHOUT
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-- for more details. 

-- You should have received a copy of the GNU General Public License
-- along with VESTs; if not, write to the Free Software Foundation,
-- Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 

-- ---------------------------------------------------------------------
--
-- $Id: tc2964.vhd,v 1.2 2001-10-26 16:29:50 paw Exp $
-- $Revision: 1.2 $
--
-- ---------------------------------------------------------------------

ENTITY c02s03b00x00p03n01i02964ent IS
END c02s03b00x00p03n01i02964ent;

ARCHITECTURE c02s03b00x00p03n01i02964arch OF c02s03b00x00p03n01i02964ent IS
  function f1a(constant c1 : in integer) return integer is
  begin
    return 12;
  end;
  function f1a(constant c1,c2 : in integer) return integer is
  begin
    return 25;
  end;
  function f2b(constant c1 : in integer) return integer is
  begin
    return 22;
  end;
  function f2b(constant c1 : in real) return integer is
  begin
    return 28;
  end;
  function f3c(constant c0:integer; constant c1:real) return integer is
  begin
    return 32;
  end;
  function f3c(constant c1:real; constant c0:integer) return integer is
  begin
    return 38;
  end;
  function f4d(constant c1 : in integer) return integer is
  begin
    return 42;
  end;
  function f4d(constant c1 : in integer) return real is
  begin
    return 48.0;
  end;
  function f5e(constant c1 : in integer) return integer is
  begin
    return 52;
  end;
  procedure f5e(constant c1 : in integer) is
  begin
    return;
  end;
  function f6f(constant c0 : in real;constant c1 : in integer) return integer is
  begin
    return 62;
  end;
  function f6f(constant c2 : in integer;constant c3 : in real) return integer is
  begin
    return 68;
  end;
BEGIN
  TESTING: PROCESS
    variable i1 : integer;
    variable r1 : real;
    variable k  : integer := 0;
  BEGIN
    i1 := 8;
    if (i1 /= 8) then
      k := 1;
    end if;
    assert (i1=8)
      report "Error in initial conditions detected"
      severity failure;
    i1:= f1a(4);
    if (i1 /= 12) then
      k := 1;
    end if;
    assert (i1=12)
      report "Error differentiating overloaded subprog by number of formals"
      severity failure;
    i1:=f1a(16,23);
    if (i1 /= 25) then
      k := 1;
    end if;
    assert (i1=25)
      report "Error differentiating overloaded subprog by number of formals"
      severity failure;
    i1:= f2b(4);
    if (i1 /= 22) then
      k := 1;
    end if;
    assert (i1=22)
      report "Error differentiating overloaded subprog by type of formals"
      severity failure;
    i1:=f2b(4.0);
    if (i1 /= 28) then
      k := 1;
    end if;
    assert (i1=28)
      report "Error differentiating overloaded subprog by type of formals"
      severity failure;
    i1:= f3c(4,4.0);
    if (i1 /= 32) then
      k := 1;
    end if;
    assert (i1=32)
      report "Error differentiating overloaded subprog by order of formals"
      severity failure;
    i1:= f3c(4.0,4);
    if (i1 /= 38) then
      k := 1;
    end if;
    assert (i1=38)
      report "Error differentiating overloaded subprog by order of formals"
      severity failure;
    i1:= f4d(4);
    if (i1 /= 42) then
      k := 1;
    end if;
    assert (i1=42)
      report "Error differentiating overloaded subprog by return type"
      severity failure;

    r1:= f4d(4);
    if (r1 /= 48.0) then
      k := 1;
    end if;
    assert (r1=48.0)
      report "Error differentiating overloaded subprog by return type"
      severity failure;
    i1:= f5e(4);
    if (i1 /= 52) then
      k := 1;
    end if;
    assert (i1=52)
      report "Error differentiating overloaded subprog by having a return"
      severity failure;
    i1:= f6f(c1 => 4, c0 => 4.4);
    if (i1 /= 62) then
      k := 1;
    end if;
    assert (i1=62)
      report "Error differentiating overloaded subprog by name of formals"
      severity failure;
    i1:= f6f(c3 => 4.4, c2 => 4);
    if (i1 /= 68) then
      k := 1;
    end if;
    assert (i1=68)
      report "Error differentiating overloaded subprog by name of formals"
      severity failure;
    wait for 5 ns;
    assert NOT( k=0 )
      report "***PASSED TEST: c02s03b00x00p03n01i02964"
      severity NOTE;
    assert ( k=0 )
      report "***FAILED TEST: c02s03b00x00p03n01i02964 - Overload subprogram call test failed."
      severity ERROR;
    wait;
  END PROCESS TESTING;

END c02s03b00x00p03n01i02964arch;