Debian Codegraph @

gcc/testsuite/gm2/pim/pass/typeequiv3.mod

raw
1 (* Copyright (C) 2015 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 3, 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,
17 Boston, MA 02110-1301, USA. *)
18
19 MODULE typeequiv3 ;
20
21
22 FROM SYSTEM IMPORT ADDRESS;
23
24 TYPE
25 functionType = PROCEDURE (ADDRESS, ADDRESS) : INTEGER ;
26
27
28 PROCEDURE realFunc (a, b: ADDRESS) : INTEGER ;
29 BEGIN
30 IF a = b
31 THEN
32 RETURN 1
33 ELSE
34 RETURN 0
35 END
36 END realFunc ;
37
38
39 PROCEDURE realGet (a, b: ADDRESS) : functionType ;
40 BEGIN
41 RETURN realFunc
42 END realGet ;
43
44
45 VAR
46 compare: functionType;
47 a, b : ADDRESS ;
48 BEGIN
49 compare := realGet (a, b)
50 END typeequiv3.