Debian Codegraph @

gcc/testsuite/gm2/dynamic/pass/testparam2.mod

raw
1 (* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. *)
2 (* This file is part of GNU Modula-2.
3
4 GNU Modula-2 is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8
9 GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with gm2; see the file COPYING. If not, write to the Free Software
16 Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *)
17 MODULE testparam2 ;
18
19
20 TYPE
21 RegisterList = RECORD
22 state : (free, used, etc) ;
23 Reg : CARDINAL ;
24 CleanAlias: CARDINAL ;
25 DirtyAlias: CARDINAL ;
26 END ;
27
28 PROCEDURE DuplicateList (i: CARDINAL) : CARDINAL ;
29 BEGIN
30 RETURN( i )
31 END DuplicateList ;
32
33
34 PROCEDURE GetRegisterAssociate (reg: CARDINAL; VAR clean, dirty: CARDINAL) ;
35 VAR
36 i: CARDINAL ;
37 BEGIN
38 i := InitRegisterPtr ;
39 WHILE i>0 DO
40 IF ListOfRegisters[i-1].Reg=reg
41 THEN
42 clean := DuplicateList(ListOfRegisters[i-1].CleanAlias) ;
43 dirty := DuplicateList(ListOfRegisters[i-1].DirtyAlias) ;
44 RETURN
45 ELSE
46 DEC(i)
47 END
48 END
49 END GetRegisterAssociate ;
50
51
52 VAR
53 c, d: CARDINAL ;
54 ListOfRegisters: ARRAY [0..10] OF RegisterList ;
55 InitRegisterPtr: CARDINAL ;
56 BEGIN
57 GetRegisterAssociate(1, c, d)
58 END testparam2.