Commit | Line | Data |
---|---|---|
c906108c SS |
1 | -- Copyright (C) 1992 Free Software Foundation, Inc. |
2 | ||
3 | -- This program is free software; you can redistribute it and/or modify | |
4 | -- it under the terms of the GNU General Public License as published by | |
5 | -- the Free Software Foundation; either version 2 of the License, or | |
6 | -- (at your option) any later version. | |
7 | -- | |
8 | -- This program is distributed in the hope that it will be useful, | |
9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | -- GNU General Public License for more details. | |
12 | -- | |
13 | -- You should have received a copy of the GNU General Public License | |
14 | -- along with this program; if not, write to the Free Software | |
7a292a7a | 15 | -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
c906108c SS |
16 | |
17 | -- Please email any bugs, comments, and/or additions to this file to: | |
18 | -- bug-gdb@prep.ai.mit.edu | |
19 | ||
20 | -- | |
21 | -- test program 2 (refer to tests2.exp) | |
22 | -- | |
23 | ||
24 | tests2: module; | |
25 | ||
26 | -- testpattern | |
27 | syn pat1 ulong = H'aaaaaaaa; | |
28 | syn pat2 ulong = H'55555555; | |
29 | ||
30 | -- discrete modes | |
31 | newmode bytem = struct ( | |
32 | p1 ulong, | |
33 | m byte, | |
34 | p2 ulong); | |
35 | newmode ubytem = struct ( | |
36 | p1 ulong, | |
37 | m ubyte, | |
38 | p2 ulong); | |
39 | newmode intm = struct ( | |
40 | p1 ulong, | |
41 | m int, | |
42 | p2 ulong); | |
43 | newmode uintm = struct ( | |
44 | p1 ulong, | |
45 | m uint, | |
46 | p2 ulong); | |
47 | newmode longm = struct ( | |
48 | p1 ulong, | |
49 | m long, | |
50 | p2 ulong); | |
51 | newmode ulongm = struct ( | |
52 | p1 ulong, | |
53 | m ulong, | |
54 | p2 ulong); | |
55 | newmode boolm = struct ( | |
56 | p1 ulong, | |
57 | m bool, | |
58 | p2 ulong); | |
59 | newmode charm1 = struct ( | |
60 | p1 ulong, | |
61 | m char(4), | |
62 | p2 ulong); | |
63 | newmode charm2 = struct ( | |
64 | p1 ulong, | |
65 | m char(7), | |
66 | p2 ulong); | |
67 | newmode charm3 = struct ( | |
68 | p1 ulong, | |
69 | m char(8) varying, | |
70 | p2 ulong); | |
71 | newmode charm4 = struct ( | |
72 | p1 ulong, | |
73 | m char, | |
74 | p2 ulong); | |
75 | newmode bitm1 = struct ( | |
76 | p1 ulong, | |
77 | m bit(8), | |
78 | p2 ulong); | |
79 | newmode bitm2 = struct ( | |
80 | p1 ulong, | |
81 | m bit(10), | |
82 | p2 ulong); | |
83 | newmode setm1 = struct ( | |
84 | p1 ulong, | |
85 | m set (a, b, c, d, e, f, g, h), | |
86 | p2 ulong); | |
87 | newmode nset1 = struct ( | |
88 | p1 ulong, | |
89 | m set (na = 2147483648, nb = 1024, nc = 4294967295), | |
90 | p2 ulong); | |
91 | newmode rm1 = struct ( | |
92 | p1 ulong, | |
93 | m range (lower(byte):upper(byte)), | |
94 | p2 ulong); | |
95 | newmode rm2 = struct ( | |
96 | p1 ulong, | |
97 | m range (lower(int):upper(int)), | |
98 | p2 ulong); | |
99 | newmode rm3 = struct ( | |
100 | p1 ulong, | |
101 | m range (lower(long):upper(long)), | |
102 | p2 ulong); | |
103 | newmode pm1 = struct ( | |
104 | p1 ulong, | |
105 | m powerset set (pa, pb, pc, pd, pe, pf, pg, ph), | |
106 | p2 ulong); | |
107 | newmode pm2 = struct ( | |
108 | p1 ulong, | |
109 | m powerset int (1:32), | |
110 | p2 ulong); | |
111 | -- this should be rejected by the gnuchill compiler ! | |
112 | newmode pm3 = struct ( | |
113 | p1 ulong, | |
114 | -- m powerset long (lower(long): upper(long)), | |
115 | p2 ulong); | |
116 | newmode refm1 = struct ( | |
117 | p1 ulong, | |
118 | m ptr, | |
119 | p2 ulong); | |
120 | newmode refm2 = struct ( | |
121 | p1 ulong, | |
122 | m ref bytem, | |
123 | p2 ulong); | |
124 | newmode prm1 = struct ( | |
125 | p1 ulong, | |
126 | m proc (), | |
127 | p2 ulong); | |
128 | newmode tim1 = struct ( | |
129 | p1 ulong, | |
130 | m time, | |
131 | p2 ulong); | |
132 | newmode tim2 = struct ( | |
133 | p1 ulong, | |
134 | m duration, | |
135 | p2 ulong); | |
136 | newmode rem1 = struct ( | |
137 | p1 ulong, | |
138 | m real, | |
139 | p2 ulong); | |
140 | newmode rem2 = struct ( | |
141 | p1 ulong, | |
142 | m long_real, | |
143 | p2 ulong); | |
144 | newmode arrm1 = struct ( | |
145 | p1 ulong, | |
146 | m array(1:3, 1:2) int, | |
147 | p2 ulong); | |
148 | newmode strum1 = struct ( | |
149 | p1 ulong, | |
150 | m struct (a, b int, ch char(4)), | |
151 | p2 ulong); | |
152 | ||
153 | ||
154 | -- dummyfunction for breakpoints | |
155 | dummyfunc: proc(); | |
156 | end dummyfunc; | |
157 | ||
158 | ||
159 | dcl b1 bytem init := [pat1, -128, pat2]; | |
160 | dcl ub1 ubytem init := [pat1, 0, pat2]; | |
161 | dcl i1 intm init := [pat1, -32768, pat2]; | |
162 | dcl ui1 uintm init := [pat1, 0, pat2]; | |
163 | dcl l1 longm init := [pat1, -2147483648, pat2]; | |
164 | dcl ul1 ulongm init := [pat1, 0, pat2]; | |
165 | dcl bo1 boolm init := [pat1, true, pat2]; | |
166 | dcl c1 charm1 init := [pat1, "1234", pat2]; | |
167 | dcl c2 charm2 init := [pat1, "1234567", pat2]; | |
168 | dcl c3 charm3 init := [pat1, "12345678", pat2]; | |
169 | dcl c4 charm4 init := [pat1, C'00', pat2]; | |
170 | dcl bi1 bitm1 init := [pat1, B'01011010', pat2]; | |
171 | dcl bi2 bitm2 init := [pat1, B'1010110101', pat2]; | |
172 | dcl se1 setm1 init := [pat1, a, pat2]; | |
173 | dcl nse1 nset1 init := [pat1, na, pat2]; | |
174 | dcl r1 rm1 init := [pat1, -128, pat2]; | |
175 | dcl r2 rm2 init := [pat1, -32768, pat2]; | |
176 | dcl r3 rm3 init := [pat1, -2147483648, pat2]; | |
177 | dcl p1 pm1 init := [pat1, [pa], pat2]; | |
178 | dcl p2 pm2 init := [pat1, [1], pat2]; | |
179 | -- dcl p3 pm3 init := [pat1, [-1], pat2]; -- FIXME: bug in gnuchill | |
180 | dcl ref1 refm1 init := [pat1, null, pat2]; | |
181 | dcl ref2 refm2 init := [pat1, null, pat2]; | |
182 | dcl pr1 prm1; | |
183 | dcl ti1 tim1 init := [pat1, 0, pat2]; | |
184 | dcl ti2 tim2 init := [pat1, 0, pat2]; | |
185 | dcl re1 rem1 init := [pat1, 0.0, pat2]; | |
186 | dcl re2 rem2 init := [pat1, 0.0, pat2]; | |
187 | dcl arrl1 arrm1 init:=[pat1, [(1:3): [0,0]], pat2]; | |
188 | dcl strul1 strum1 init := [pat1, [.a: 0, .b: 0, .ch: "0000"], pat2]; | |
189 | ||
190 | pr1 := [pat1, dummyfunc, pat2]; | |
191 | dummyfunc(); | |
192 | ||
193 | end tests2; |