Debian Codegraph @

gcc/testsuite/gm2/cse/pass/testcse17.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 testcse17 ;
18
19
20 TYPE
21 r = RECORD
22 a, b, c: CARDINAL ;
23 array : ARRAY [0..10] OF CARDINAL ;
24 END ;
25
26
27 PROCEDURE testcase (i: CARDINAL) : CARDINAL ;
28 BEGIN
29 WITH t[i] DO
30 CASE i OF
31
32 1: a := i ; b := i ; c := i |
33 2: a := i ; b := i ; c := i |
34 3: a := i ; b := i ; c := i |
35 4: a := i ; b := i ; c := i |
36 5: a := i ; b := i ; c := i
37
38 END ;
39 RETURN( t[i].a )
40 END
41 END testcase ;
42
43
44
45 VAR
46 t: ARRAY [1..10] OF r ;
47 i: CARDINAL ;
48 BEGIN
49 FOR i := 1 TO 5 DO
50 IF testcase(i)#i
51 THEN
52 HALT
53 END
54 END
55 END testcse17.