]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gm2/dynamic/pass/testmin.mod
Merge modula-2 front end onto gcc.
[thirdparty/gcc.git] / gcc / testsuite / gm2 / dynamic / pass / testmin.mod
1 (* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
2 Free Software Foundation, Inc. *)
3 (* This file is part of GNU Modula-2.
4
5 GNU Modula-2 is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version.
9
10 GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with gm2; see the file COPYING. If not, write to the Free Software
17 Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *)
18
19 MODULE testmin ;
20
21
22 FROM SYSTEM IMPORT TSIZE ;
23 FROM StrIO IMPORT WriteString, WriteLn ;
24 FROM NumberIO IMPORT WriteCard, WriteInt ;
25
26 TYPE
27 barfoo = CARDINAL ;
28 foobar = barfoo ;
29 ColourCodes = (black, brown, red, orange) ;
30
31 VAR
32 i: INTEGER ;
33 b: BOOLEAN ;
34 c: CARDINAL ;
35 s: BITSET ;
36 t: ColourCodes ;
37 BEGIN
38 WriteString('INTEGER ') ; WriteCard(TSIZE(INTEGER), 8) ; WriteLn ;
39 WriteString('INTEGER ') ; WriteInt(MAX(INTEGER), 12) ; WriteInt(MIN(INTEGER), 12) ; WriteLn ;
40 WriteString('CARDINAL ') ; WriteCard(MAX(CARDINAL), 12) ; WriteCard(MIN(CARDINAL), 12) ; WriteLn ;
41 WriteString('BOOLEAN ') ; WriteCard(VAL(CARDINAL, MAX(BOOLEAN)), 12) ; WriteCard(VAL(CARDINAL, MIN(BOOLEAN)), 12) ; WriteLn ;
42 WriteString('BITSET ') ; WriteCard(MAX(BITSET), 12) ; WriteCard(MIN(BITSET), 12) ; WriteLn ;
43 FOR t := MIN(ColourCodes) TO MAX(ColourCodes) DO
44
45 END
46 END testmin.