OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [gdb/] [testsuite/] [gdb.chill/] [tests1.ch] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
-- Copyright 1992, 1995, 1996 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
15
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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 1 (refer to tests1.exp)
22
--
23
 
24
/* These functions are defined in libchill.a */
25
 
26
runtime: SPEC MODULE
27
DCL chill_argc long;
28
DCL chill_argv REF ARRAY (0:1000) REF CHARS (1000) VARYING;
29
__print_event: PROC (arg0 ptr,
30
       arg1 ptr) END;
31
__print_buffer: PROC (arg0 ptr,
32
       arg1 ptr) END;
33
GRANT ALL;
34
END;
35
 
36
tests1: module;
37
 
38
seize   __print_event,
39
        __print_buffer;
40
 
41
newmode set1 = set(aaa, bbb, ccc);
42
newmode nset1 = set(na = 1, nb = 34, nc = 20);
43
newmode r11 = range (0 : upper(ubyte));
44
newmode r12 = range (0 : upper(uint));
45
--newmode r13 = range (0 : upper(ulong)); -- bug in gnuchill
46
newmode r14 = range (lower(byte) : upper(byte));
47
newmode r15 = range (lower(int) : upper(int));
48
newmode r16 = range (lower(long): upper(long));
49
newmode r2 = set1(bbb : ccc);
50
newmode r3 = nset1(na : na);
51
newmode r4 = nset1(nc : nb);
52
newmode r5 = nset1(lower(nset1) : upper(nset1));
53
 
54
newmode pm1 = powerset set(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
55
newmode pm2 = powerset byte (1:8);
56
newmode pm3 = powerset int (-32768:32767);
57
newmode pm4 = powerset long (-32768:32768);
58
newmode pm5 = powerset long (lower(long):upper(long));
59
newmode ref1 = ref pm1;
60
newmode ref2 = ref byte;
61
newmode ref3 = ptr;
62
synmode ref4 = ptr;
63
synmode syn_int = int;
64
 
65
newmode prm1 = proc ();
66
newmode prm2 = proc (bool in, int out, long inout) returns (char);
67
newmode prm3 = proc (pm1, ref1 loc) returns (ref3);
68
newmode prm4 = proc () exceptions(ex1, ex2, ex3);
69
newmode prm5 = proc (r11, r16 inout, r5 out) returns (r2) exceptions (ex1);
70
 
71
newmode ev1m = event;
72
newmode ev2m = event (42);
73
 
74
newmode bu1m = buffer ref1;
75
newmode bu2m = buffer (42) ubyte;
76
 
77
newmode strm1 = char (5);
78
synmode strm2 = char (7) varying;
79
 
80
synmode bstr1 = bit(20);
81
--newmode bstr2 = bit(10) varying;
82
 
83
newmode arr1m = array(1:100) set1;
84
newmode arr2m = array(1:100, 1:100) set1;
85
newmode arr3m = array(r11, r12, r14) set1;
86
newmode arr4m = array(r2) array (r3) array (r4, r5) pm1;
87
newmode arr5m = array(1:10) int;
88
newmode arr6m = array(1:5, 1:3, 1:2) long;
89
 
90
newmode stru1m = struct (a, b long,
91
                         case b of
92
                           (42): ch1 chars(20),
93
                           (52): ch2 chars(10)
94
                           else  ch3 chars(1)
95
                         esac);
96
 
97
newmode stru2m = struct (f set1,
98
                         case f of
99
                            (aaa): ch1 char(20),
100
                            (bbb): ch2 char(10) varying
101
                         else   ch3 char(0) varying
102
                         esac);
103
newmode stru3m = struct (f r3,
104
                         case f of
105
                            (na): ch1 char(20)
106
                         esac);
107
newmode stru4m = struct (i long,
108
                         case of
109
                           : i1, i11 int,
110
                             b1 bool,
111
                             c1 char,
112
                           : i2, i22 long,
113
                             bs2 bools (10),
114
                           :
115
                             s3 struct (i3 int,
116
                                        case of
117
                                          : foo long
118
                                          else bar char
119
                                        esac)
120
                           else
121
                             x stru2m
122
                         esac,
123
                         y stru3m);
124
 
125
synmode m_xyzmode = struct (next ref m_xyzmode,
126
                            i long);
127
 
128
-- set mode locations
129
dcl s1l set1 := ccc;
130
dcl s2l nset1 := nb;
131
 
132
-- range mode locations
133
dcl rl1 r11 := 3;
134
dcl rl2 r11 := lower(r11);
135
dcl rl3 r11 := upper(r11);
136
 
137
dcl rl5 r12 := 65530;
138
dcl rl6 r12 := lower(r12);
139
dcl rl7 r12 := upper(r12);
140
 
141
--dcl rl9 r13 := 128;
142
--dcl rl10 r13 := lower(r13);
143
--dcl rl11 r13 := upper(r13);
144
 
145
dcl rl13 r14 := -121;
146
dcl rl14 r14 := lower(r14);
147
dcl rl15 r14 := upper(r14);
148
 
149
dcl rl17 r15 := -32720;
150
dcl rl18 r15 := lower(r15);
151
dcl rl19 r15 := upper(r15);
152
 
153
dcl rl21 r16 := 2147483643;
154
dcl rl22 r16 := lower(r16);
155
dcl rl23 r16 := upper(r16);
156
 
157
-- powerset mode locations
158
dcl pl1 pm1 := [p1:p10];
159
dcl pl2 pm1 := [];
160
dcl pl3 pm1 := [p1, p10];
161
dcl pl4 pm1 := [p1:p2, p4:p6, p8:p10];
162
dcl pl5 pm1 := [p1:p4, p6, p8:p10];
163
dcl pl6 pm1 := [p1, p3:p8, p10];
164
 
165
dcl pl7 pm2 := [1:8];
166
dcl pl8 pm3 := [-32768:32767];
167
--dcl pl9 pm5 := [-2147483648:2147483647];
168
 
169
-- reference mode locations
170
dcl ref3l ref3;
171
dcl ref4l ref4;
172
dcl ref5l, ref6l, ref7l, ref8l ptr;
173
dcl syn_intl1 syn_int := 42;
174
dcl intl1 int := -42;
175
 
176
-- synchronization mode locations
177
dcl ev1l ev1m;
178
dcl ev2l ev2m;
179
dcl bu1l bu1m;
180
dcl bu2l bu2m;
181
 
182
-- timing mode locations
183
dcl til1 time;
184
 
185
-- string mode locations
186
dcl strl1, strl2 strm2;
187
dcl bstrl1 bstr1 := B'10101010101010101010';
188
 
189
-- array mode locations
190
dcl arrl1 arr1m;
191
dcl arrl2 arr5m := [1, -1, 32767, -32768, 0, 10, 11, 12, 13, 42];
192
dcl arrl3 arr6m := [(1:5): [(1:3): [(1:2): -2147483648]]];
193
dcl arrl4 arr6m := [(1:2): [(1:3): [(1:2): -2147483648]],
194
                      (3): [(1:3): [(1:2): 100]],
195
                    (4:5): [(1:3): [(1:2): -2147483648]]];
196
dcl arrl5 array(1:10) nset1;
197
 
198
-- structure mode locations
199
dcl strul1 stru1m := [-2147483648, 42, "12345678900987654321"];
200
 
201
dummyfunc: proc();
202
end dummyfunc;
203
 
204
ref3l:=->pl1;           -- newmode ref
205
ref4l:=->pl1;           -- synmode ref
206
ref5l:=->pl1;           -- ptr
207
 
208
ref6l:=->syn_intl1;     -- ref to synmode
209
ref7l:=->intl1;         -- ref to predefined mode
210
ref8l:=->pl1;           -- ref to newmode
211
 
212
strl1 := "ha" // C'6e' // "s" // "i" // C'00';
213
strl2 := C'00' // "ope";
214
 
215
__print_event(addr(ev1l), addr("ev1l"));
216
__print_event(addr(ev2l), addr("ev2l"));
217
__print_buffer(addr(bu1l), addr("bu1m"));
218
__print_buffer(addr(bu2l), addr("bu2m"));
219
 
220
til1 := abstime(1970, 3, 12, 10, 43, 0);
221
writetext(stdout, "lower(pm3) = %C; upper(pm3) = %C%..%/",
222
                  lower(pm3), upper(pm3));
223
writetext(stdout, "lower(pm5) = %C; upper(pm5) = %C%..%/",
224
                  lower(pm5), upper(pm5));
225
--writetext(stdout, "lower(pl9) = %C; upper(pl9) = %C%..%/",
226
--                lower(pl9), upper(pl9));
227
writetext(stdout, "date = %C%..%/", til1);
228
 
229
writetext(stdout, "slice1 = %C%..%/", strl1(3 : 5));
230
writetext(stdout, "slice2 = %C%..%/", strl2(0 : 3));
231
--writetext(stdout, "slice3 = %C%..%/", strl1(0 up 20));
232
writetext(stdout, "slice4 = %C%..%/", bstrl1(0));
233
--writetext(stdout, "slice5 = %C%..%/", arrl3(1:5));
234
 
235
 
236
writetext(stdout, "done.%/");
237
 
238
dummyfunc();
239
 
240
end tests1;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.