Debian Codegraph @

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

raw
1 (* Copyright (C) 2019 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
18 MODULE danglingelse ; (*!m2pim*)
19
20 VAR
21 result: CARDINAL ;
22
23
24 PROCEDURE Open (first, second, third: BOOLEAN) ;
25 BEGIN
26 IF third
27 THEN
28 result := 1
29 END ;
30 IF second
31 THEN
32 IF first
33 THEN
34 IF third
35 THEN
36 result := 2
37 END
38 ELSE
39 result := 3
40 END
41 ELSE
42 IF first
43 THEN
44 IF third
45 THEN
46 result := 4
47 END
48 ELSE
49 result := 5
50 END
51 END ;
52 IF (NOT second) AND first
53 THEN
54 result := 6 ;
55 IF third
56 THEN
57 result := 7
58 ELSE
59 result := 8 ;
60 result := 9 ;
61 END
62 ELSE
63 result := 10 ;
64 IF second
65 THEN
66 IF first
67 THEN
68 IF third
69 THEN
70 result := 11
71 END ;
72 IF first
73 THEN
74 (* nothing *)
75 ELSE
76 result := 12 ;
77 result := 13
78 END
79 ELSE
80 IF third
81 THEN
82 result := 14
83 END
84 END
85 ELSE
86 IF first
87 THEN
88 IF third
89 THEN
90 result := 15
91 END ;
92 IF second
93 THEN
94 (* nothing *)
95 ELSE
96 result := 16 ;
97 result := 17
98 END
99 ELSE
100 IF third
101 THEN
102 result := 18
103 END
104 END
105 END ;
106 result := 19 ;
107 result := 20
108 END
109 END Open ;
110
111
112 BEGIN
113 Open (TRUE, TRUE, TRUE)
114 END danglingelse.