summaryrefslogtreecommitdiff
path: root/idlc/test/parser/constant.tests
blob: 49183d4d1c18b1341556bb4639e3b9a99e062340 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license notice:
#
#   Licensed to the Apache Software Foundation (ASF) under one or more
#   contributor license agreements. See the NOTICE file distributed
#   with this work for additional information regarding copyright
#   ownership. The ASF licenses this file to you under the Apache
#   License, Version 2.0 (the "License"); you may not use this file
#   except in compliance with the License. You may obtain a copy of
#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
#

EXPECT SUCCESS "constant.tests 1":
constants C {
    const boolean C1 = FALSE;
    const byte C2 = 0;
    const short C3 = 0;
    const unsigned short C4 = 0;
    const long C5 = 0;
    const unsigned long C6 = 0;
    const hyper C7 = 0;
    const unsigned hyper C8 = 0;
    const float C9 = 0.0;
    const double C10 = 0.0;
};


EXPECT FAILURE "constant.tests 2":
module m {
    const boolean C1 = FALSE;
    const byte C2 = 0;
    const short C3 = 0;
    const unsigned short C4 = 0;
    const long C5 = 0;
    const unsigned long C6 = 0;
    const hyper C7 = 0;
    const unsigned hyper C8 = 0;
    const float C9 = 0.0;
    const double C10 = 0.0;
};


EXPECT FAILURE "constant.tests 3":
constants C {
    const char C1 = 'A';
};


EXPECT FAILURE "constant.tests 4":
module m {
    const char C1 = 'A';
};


EXPECT FAILURE "constant.tests 5":
constants C {
    const string C1 = "";
};


EXPECT FAILURE "constant.tests 6":
module m {
    const string C1 = "";
};


EXPECT SUCCESS "constant.tests 7":
constants C {};


EXPECT SUCCESS "constant.tests 8":
constants C {
    const byte C1 = -128;
    const byte C2 = -0200;
    const byte C3 = -0x80;
    const byte C4 = 127;
    const byte C5 = 0177;
    const byte C6 = 0x7F;
    const short C7 = -32768;
    const short C8 = -0100000;
    const short C9 = -0x8000;
    const short C10 = 32767;
    const short C11 = 077777;
    const short C12 = 0x7FFF;
    const unsigned short C13 = 0;
    const unsigned short C14 = 0x0;
    const unsigned short C15 = 65535;
    const unsigned short C16 = 0177777;
    const unsigned short C17 = 0xFFFF;
    const long C18 = -2147483648;
    const long C19 = -020000000000;
    const long C20 = -0x80000000;
    const long C21 = 2147483647;
    const long C22 = 017777777777;
    const long C23 = 0x7FFFFFFF;
    const unsigned long C24 = 0;
    const unsigned long C25 = 0x0;
    const unsigned long C26 = 4294967295;
    const unsigned long C27 = 037777777777;
	const unsigned long C28 = 0xFFFFFFFF;
	const hyper C29 = -9223372036854775808;
    const hyper C30 = -01000000000000000000000;
    const hyper C31 = -0x8000000000000000;
	const hyper C32 = 9223372036854775807;
    const hyper C33 = 0777777777777777777777;
    const hyper C34 = 0x7FFFFFFFFFFFFFFF;
    const unsigned hyper C35 = 0;
    const unsigned hyper C36 = 0x0;
    const unsigned hyper C37 = 18446744073709551615;
    const unsigned hyper C38 = 01777777777777777777777;
    const unsigned hyper C39 = 0xFFFFFFFFFFFFFFFF;
};


EXPECT NEW-FAILURE "constant.tests 8a":
constants C {
    const byte C4 = 255;
    const byte C5 = 0377;
    const byte C6 = 0xFF;
};


EXPECT FAILURE "constant.tests 9":
constants C { const byte C1 = -129; };


EXPECT FAILURE "constant.tests 10":
constants C { const byte C1 = -0201; };


EXPECT FAILURE "constant.tests 11":
constants C { const byte C1 = -0x81; };


EXPECT FAILURE "constant.tests 12":
constants C { const byte C1 = 256; };


EXPECT FAILURE "constant.tests 13":
constants C { const byte C1 = 0400; };


EXPECT FAILURE "constant.tests 14":
constants C { const byte C1 = 0x100; };


EXPECT FAILURE "constant.tests 15":
constants C { const short C1 = -32769; };


EXPECT FAILURE "constant.tests 16":
constants C { const short C1 = -0100001; };


EXPECT FAILURE "constant.tests 17":
constants C { const short C1 = -0x8001; };


EXPECT FAILURE "constant.tests 18":
constants C { const short C1 = 32768; };


EXPECT FAILURE "constant.tests 19":
constants C { const short C1 = 0100000; };


EXPECT FAILURE "constant.tests 20":
constants C { const short C1 = 0x8000; };


EXPECT FAILURE "constant.tests 21":
constants C { const unsigned short C1 = -1; };


EXPECT FAILURE "constant.tests 22":
constants C { const unsigned short C1 = -01; };


EXPECT FAILURE "constant.tests 23":
constants C { const unsigned short C1 = -0x1; };


EXPECT FAILURE "constant.tests 24":
constants C { const unsigned short C1 = 65536; };


EXPECT FAILURE "constant.tests 25":
constants C { const unsigned short C1 = 0200000; };


EXPECT FAILURE "constant.tests 26":
constants C { const unsigned short C1 = 0x10000; };


EXPECT FAILURE "constant.tests 27":
constants C { const long C1 = -2147483649; };


EXPECT FAILURE "constant.tests 28":
constants C { const long C1 = -020000000001; };


EXPECT FAILURE "constant.tests 29":
constants C { const long C1 = -0x80000001; };


EXPECT FAILURE "constant.tests 30":
constants C { const long C1 = 2147483648; };


EXPECT FAILURE "constant.tests 31":
constants C { const long C1 = 020000000000; };


EXPECT FAILURE "constant.tests 32":
constants C { const long C1 = 0x80000000; };


EXPECT FAILURE "constant.tests 33":
constants C { const unsigned long C1 = -1; };


EXPECT FAILURE "constant.tests 34":
constants C { const unsigned long C1 = -01; };


EXPECT FAILURE "constant.tests 35":
constants C { const unsigned long C1 = -0x1; };


EXPECT FAILURE "constant.tests 36":
constants C { const unsigned long C1 = 4294967296; };


EXPECT FAILURE "constant.tests 37":
constants C { const unsigned long C1 = 040000000000; };


EXPECT FAILURE "constant.tests 38":
constants C { const unsigned long C1 = 0x100000000; };


EXPECT FAILURE "constant.tests 39":
constants C { const hyper C1 = -9223372036854775809; };


EXPECT FAILURE "constant.tests 40":
constants C { const hyper C1 = -01000000000000000000001; };


EXPECT FAILURE "constant.tests 41":
constants C { const hyper C1 = -0x8000000000000001; };


EXPECT FAILURE "constant.tests 42":
constants C { const hyper C1 = 9223372036854775808; };


EXPECT FAILURE "constant.tests 43":
constants C { const hyper C1 = 01000000000000000000000; };


EXPECT FAILURE "constant.tests 44":
constants C { const hyper C1 = 0x8000000000000000; };


EXPECT FAILURE "constant.tests 45":
constants C { const unsigned hyper C1 = -1; };


EXPECT FAILURE "constant.tests 46":
constants C { const unsigned hyper C1 = -01; };


EXPECT FAILURE "constant.tests 47":
constants C { const unsigned hyper C1 = -0x1; };


EXPECT FAILURE "constant.tests 48":
constants C { const unsigned hyper C1 = 18446744073709551616; };


EXPECT FAILURE "constant.tests 49":
constants C { const unsigned hyper C1 = 02000000000000000000000; };


EXPECT FAILURE "constant.tests 50":
constants C { const unsigned hyper C1 = 0x10000000000000000; };