2 // RUN: %clang_cc1 -objcmt-migrate-literals -objcmt-migrate-subscripting -mt-migrate-directory %t %s -x objective-c++
3 // RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
4 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c++ %s.result
9 typedef long NSInteger;
10 typedef unsigned long NSUInteger;
11 typedef signed char BOOL;
12 #define nil ((void*) 0)
18 @interface NSNumber : NSObject
21 @interface NSNumber (NSNumberCreation)
22 - (id)initWithChar:(char)value;
23 - (id)initWithUnsignedChar:(unsigned char)value;
24 - (id)initWithShort:(short)value;
25 - (id)initWithUnsignedShort:(unsigned short)value;
26 - (id)initWithInt:(int)value;
27 - (id)initWithUnsignedInt:(unsigned int)value;
28 - (id)initWithLong:(long)value;
29 - (id)initWithUnsignedLong:(unsigned long)value;
30 - (id)initWithLongLong:(long long)value;
31 - (id)initWithUnsignedLongLong:(unsigned long long)value;
32 - (id)initWithFloat:(float)value;
33 - (id)initWithDouble:(double)value;
34 - (id)initWithBool:(BOOL)value;
35 - (id)initWithInteger:(NSInteger)value;
36 - (id)initWithUnsignedInteger:(NSUInteger)value;
38 + (NSNumber *)numberWithChar:(char)value;
39 + (NSNumber *)numberWithUnsignedChar:(unsigned char)value;
40 + (NSNumber *)numberWithShort:(short)value;
41 + (NSNumber *)numberWithUnsignedShort:(unsigned short)value;
42 + (NSNumber *)numberWithInt:(int)value;
43 + (NSNumber *)numberWithUnsignedInt:(unsigned int)value;
44 + (NSNumber *)numberWithLong:(long)value;
45 + (NSNumber *)numberWithUnsignedLong:(unsigned long)value;
46 + (NSNumber *)numberWithLongLong:(long long)value;
47 + (NSNumber *)numberWithUnsignedLongLong:(unsigned long long)value;
48 + (NSNumber *)numberWithFloat:(float)value;
49 + (NSNumber *)numberWithDouble:(double)value;
50 + (NSNumber *)numberWithBool:(BOOL)value;
51 + (NSNumber *)numberWithInteger:(NSInteger)value;
52 + (NSNumber *)numberWithUnsignedInteger:(NSUInteger)value;
61 [NSNumber numberWithChar:L'a'];
62 [NSNumber numberWithChar:2];
63 [NSNumber numberWithChar:2U];
64 [NSNumber numberWithChar:2u];
65 [NSNumber numberWithChar:2L];
66 [NSNumber numberWithChar:2l];
67 [NSNumber numberWithChar:2LL];
68 [NSNumber numberWithChar:2ll];
69 [NSNumber numberWithChar:2ul];
70 [NSNumber numberWithChar:2lu];
71 [NSNumber numberWithChar:2ull];
72 [NSNumber numberWithChar:2llu];
73 [NSNumber numberWithChar:2.0];
74 [NSNumber numberWithChar:2.0f];
75 [NSNumber numberWithChar:2.0F];
76 [NSNumber numberWithChar:2.0l];
77 [NSNumber numberWithChar:2.0L];
78 [NSNumber numberWithChar:0x2f];
79 [NSNumber numberWithChar:04];
80 [NSNumber numberWithChar:0];
81 [NSNumber numberWithChar:0.0];
82 [NSNumber numberWithChar:YES];
83 [NSNumber numberWithChar:NO];
84 [NSNumber numberWithChar:true];
85 [NSNumber numberWithChar:false];
86 [NSNumber numberWithChar:VAL_INT];
87 [NSNumber numberWithChar:VAL_UINT];
90 [NSNumber numberWithUnsignedChar:'a'];
91 [NSNumber numberWithUnsignedChar:L'a'];
92 [NSNumber numberWithUnsignedChar:2];
93 [NSNumber numberWithUnsignedChar:2U];
94 [NSNumber numberWithUnsignedChar:2u];
95 [NSNumber numberWithUnsignedChar:2L];
96 [NSNumber numberWithUnsignedChar:2l];
97 [NSNumber numberWithUnsignedChar:2LL];
98 [NSNumber numberWithUnsignedChar:2ll];
99 [NSNumber numberWithUnsignedChar:2ul];
100 [NSNumber numberWithUnsignedChar:2lu];
101 [NSNumber numberWithUnsignedChar:2ull];
102 [NSNumber numberWithUnsignedChar:2llu];
103 [NSNumber numberWithUnsignedChar:2.0];
104 [NSNumber numberWithUnsignedChar:2.0f];
105 [NSNumber numberWithUnsignedChar:2.0F];
106 [NSNumber numberWithUnsignedChar:2.0l];
107 [NSNumber numberWithUnsignedChar:2.0L];
108 [NSNumber numberWithUnsignedChar:0x2f];
109 [NSNumber numberWithUnsignedChar:04];
110 [NSNumber numberWithUnsignedChar:0];
111 [NSNumber numberWithUnsignedChar:0.0];
112 [NSNumber numberWithUnsignedChar:YES];
113 [NSNumber numberWithUnsignedChar:NO];
114 [NSNumber numberWithUnsignedChar:true];
115 [NSNumber numberWithUnsignedChar:false];
116 [NSNumber numberWithUnsignedChar:VAL_INT];
117 [NSNumber numberWithUnsignedChar:VAL_UINT];
118 [NSNumber numberWithUnsignedChar:VAL_CHAR];
120 [NSNumber numberWithShort:'a'];
121 [NSNumber numberWithShort:L'a'];
122 [NSNumber numberWithShort:2];
123 [NSNumber numberWithShort:2U];
124 [NSNumber numberWithShort:2u];
125 [NSNumber numberWithShort:2L];
126 [NSNumber numberWithShort:2l];
127 [NSNumber numberWithShort:2LL];
128 [NSNumber numberWithShort:2ll];
129 [NSNumber numberWithShort:2ul];
130 [NSNumber numberWithShort:2lu];
131 [NSNumber numberWithShort:2ull];
132 [NSNumber numberWithShort:2llu];
133 [NSNumber numberWithShort:2.0];
134 [NSNumber numberWithShort:2.0f];
135 [NSNumber numberWithShort:2.0F];
136 [NSNumber numberWithShort:2.0l];
137 [NSNumber numberWithShort:2.0L];
138 [NSNumber numberWithShort:0x2f];
139 [NSNumber numberWithShort:04];
140 [NSNumber numberWithShort:0];
141 [NSNumber numberWithShort:0.0];
142 [NSNumber numberWithShort:YES];
143 [NSNumber numberWithShort:NO];
144 [NSNumber numberWithShort:true];
145 [NSNumber numberWithShort:false];
146 [NSNumber numberWithShort:VAL_INT];
147 [NSNumber numberWithShort:VAL_UINT];
149 [NSNumber numberWithUnsignedShort:'a'];
150 [NSNumber numberWithUnsignedShort:L'a'];
151 [NSNumber numberWithUnsignedShort:2];
152 [NSNumber numberWithUnsignedShort:2U];
153 [NSNumber numberWithUnsignedShort:2u];
154 [NSNumber numberWithUnsignedShort:2L];
155 [NSNumber numberWithUnsignedShort:2l];
156 [NSNumber numberWithUnsignedShort:2LL];
157 [NSNumber numberWithUnsignedShort:2ll];
158 [NSNumber numberWithUnsignedShort:2ul];
159 [NSNumber numberWithUnsignedShort:2lu];
160 [NSNumber numberWithUnsignedShort:2ull];
161 [NSNumber numberWithUnsignedShort:2llu];
162 [NSNumber numberWithUnsignedShort:2.0];
163 [NSNumber numberWithUnsignedShort:2.0f];
164 [NSNumber numberWithUnsignedShort:2.0F];
165 [NSNumber numberWithUnsignedShort:2.0l];
166 [NSNumber numberWithUnsignedShort:2.0L];
167 [NSNumber numberWithUnsignedShort:0x2f];
168 [NSNumber numberWithUnsignedShort:04];
169 [NSNumber numberWithUnsignedShort:0];
170 [NSNumber numberWithUnsignedShort:0.0];
171 [NSNumber numberWithUnsignedShort:YES];
172 [NSNumber numberWithUnsignedShort:NO];
173 [NSNumber numberWithUnsignedShort:true];
174 [NSNumber numberWithUnsignedShort:false];
175 [NSNumber numberWithUnsignedShort:VAL_INT];
176 [NSNumber numberWithUnsignedShort:VAL_UINT];
178 [NSNumber numberWithInt:'a'];
179 [NSNumber numberWithInt:L'a'];
191 [NSNumber numberWithInt:2.0];
192 [NSNumber numberWithInt:2.0f];
193 [NSNumber numberWithInt:2.0F];
194 [NSNumber numberWithInt:2.0l];
195 [NSNumber numberWithInt:2.0L];
199 [NSNumber numberWithInt:0.0];
200 [NSNumber numberWithInt:YES];
201 [NSNumber numberWithInt:NO];
202 [NSNumber numberWithInt:true];
203 [NSNumber numberWithInt:false];
205 [NSNumber numberWithInt:VAL_UINT];
207 (void)[[NSNumber alloc] initWithInt:2];
208 (void)[[NSNumber alloc] initWithInt:2U];
213 [NSNumber numberWithUnsignedInt:'a'];
214 [NSNumber numberWithUnsignedInt:L'a'];
226 [NSNumber numberWithUnsignedInt:2.0];
227 [NSNumber numberWithUnsignedInt:2.0f];
228 [NSNumber numberWithUnsignedInt:2.0F];
229 [NSNumber numberWithUnsignedInt:2.0l];
230 [NSNumber numberWithUnsignedInt:2.0L];
234 [NSNumber numberWithUnsignedInt:0.0];
235 [NSNumber numberWithUnsignedInt:YES];
236 [NSNumber numberWithUnsignedInt:NO];
237 [NSNumber numberWithUnsignedInt:true];
238 [NSNumber numberWithUnsignedInt:false];
239 [NSNumber numberWithUnsignedInt:VAL_INT];
242 [NSNumber numberWithLong:'a'];
243 [NSNumber numberWithLong:L'a'];
255 [NSNumber numberWithLong:2.0];
256 [NSNumber numberWithLong:2.0f];
257 [NSNumber numberWithLong:2.0F];
258 [NSNumber numberWithLong:2.0l];
259 [NSNumber numberWithLong:2.0L];
263 [NSNumber numberWithLong:0.0];
264 [NSNumber numberWithLong:YES];
265 [NSNumber numberWithLong:NO];
266 [NSNumber numberWithLong:true];
267 [NSNumber numberWithLong:false];
268 [NSNumber numberWithLong:VAL_INT];
269 [NSNumber numberWithLong:VAL_UINT];
271 [NSNumber numberWithUnsignedLong:'a'];
272 [NSNumber numberWithUnsignedLong:L'a'];
284 [NSNumber numberWithUnsignedLong:2.0];
285 [NSNumber numberWithUnsignedLong:2.0f];
286 [NSNumber numberWithUnsignedLong:2.0F];
287 [NSNumber numberWithUnsignedLong:2.0l];
288 [NSNumber numberWithUnsignedLong:2.0L];
292 [NSNumber numberWithUnsignedLong:0.0];
293 [NSNumber numberWithUnsignedLong:YES];
294 [NSNumber numberWithUnsignedLong:NO];
295 [NSNumber numberWithUnsignedLong:true];
296 [NSNumber numberWithUnsignedLong:false];
297 [NSNumber numberWithUnsignedLong:VAL_INT];
298 [NSNumber numberWithUnsignedLong:VAL_UINT];
300 [NSNumber numberWithLongLong:'a'];
301 [NSNumber numberWithLongLong:L'a'];
313 [NSNumber numberWithLongLong:2.0];
314 [NSNumber numberWithLongLong:2.0f];
315 [NSNumber numberWithLongLong:2.0F];
316 [NSNumber numberWithLongLong:2.0l];
317 [NSNumber numberWithLongLong:2.0L];
321 [NSNumber numberWithLongLong:0.0];
322 [NSNumber numberWithLongLong:YES];
323 [NSNumber numberWithLongLong:NO];
324 [NSNumber numberWithLongLong:true];
325 [NSNumber numberWithLongLong:false];
326 [NSNumber numberWithLongLong:VAL_INT];
327 [NSNumber numberWithLongLong:VAL_UINT];
329 [NSNumber numberWithUnsignedLongLong:'a'];
330 [NSNumber numberWithUnsignedLongLong:L'a'];
342 [NSNumber numberWithUnsignedLongLong:2.0];
343 [NSNumber numberWithUnsignedLongLong:2.0f];
344 [NSNumber numberWithUnsignedLongLong:2.0F];
345 [NSNumber numberWithUnsignedLongLong:2.0l];
346 [NSNumber numberWithUnsignedLongLong:2.0L];
350 [NSNumber numberWithUnsignedLongLong:0.0];
351 [NSNumber numberWithUnsignedLongLong:YES];
352 [NSNumber numberWithUnsignedLongLong:NO];
353 [NSNumber numberWithUnsignedLongLong:true];
354 [NSNumber numberWithUnsignedLongLong:false];
355 [NSNumber numberWithUnsignedLongLong:VAL_INT];
356 [NSNumber numberWithUnsignedLongLong:VAL_UINT];
358 [NSNumber numberWithFloat:'a'];
359 [NSNumber numberWithFloat:L'a'];
376 [NSNumber numberWithFloat:0x2f];
377 [NSNumber numberWithFloat:04];
380 [NSNumber numberWithFloat:YES];
381 [NSNumber numberWithFloat:NO];
382 [NSNumber numberWithFloat:true];
383 [NSNumber numberWithFloat:false];
384 [NSNumber numberWithFloat:VAL_INT];
385 [NSNumber numberWithFloat:VAL_UINT];
387 [NSNumber numberWithDouble:'a'];
388 [NSNumber numberWithDouble:L'a'];
405 [NSNumber numberWithDouble:0x2f];
406 [NSNumber numberWithDouble:04];
409 [NSNumber numberWithDouble:YES];
410 [NSNumber numberWithDouble:NO];
411 [NSNumber numberWithDouble:true];
412 [NSNumber numberWithDouble:false];
413 [NSNumber numberWithDouble:VAL_INT];
414 [NSNumber numberWithDouble:VAL_UINT];
416 [NSNumber numberWithBool:'a'];
417 [NSNumber numberWithBool:L'a'];
418 [NSNumber numberWithBool:2];
419 [NSNumber numberWithBool:2U];
420 [NSNumber numberWithBool:2u];
421 [NSNumber numberWithBool:2L];
422 [NSNumber numberWithBool:2l];
423 [NSNumber numberWithBool:2LL];
424 [NSNumber numberWithBool:2ll];
425 [NSNumber numberWithBool:2ul];
426 [NSNumber numberWithBool:2lu];
427 [NSNumber numberWithBool:2ull];
428 [NSNumber numberWithBool:2llu];
429 [NSNumber numberWithBool:2.0];
430 [NSNumber numberWithBool:2.0f];
431 [NSNumber numberWithBool:2.0F];
432 [NSNumber numberWithBool:2.0l];
433 [NSNumber numberWithBool:2.0L];
434 [NSNumber numberWithBool:0x2f];
435 [NSNumber numberWithBool:04];
436 [NSNumber numberWithBool:0];
437 [NSNumber numberWithBool:0.0];
442 [NSNumber numberWithBool:VAL_INT];
443 [NSNumber numberWithBool:VAL_UINT];
445 [NSNumber numberWithInteger:'a'];
446 [NSNumber numberWithInteger:L'a'];
458 [NSNumber numberWithInteger:2.0];
459 [NSNumber numberWithInteger:2.0f];
460 [NSNumber numberWithInteger:2.0F];
461 [NSNumber numberWithInteger:2.0l];
462 [NSNumber numberWithInteger:2.0L];
466 [NSNumber numberWithInteger:0.0];
467 [NSNumber numberWithInteger:YES];
468 [NSNumber numberWithInteger:NO];
469 [NSNumber numberWithInteger:true];
470 [NSNumber numberWithInteger:false];
472 [NSNumber numberWithInteger:VAL_UINT];
474 [NSNumber numberWithUnsignedInteger:'a'];
475 [NSNumber numberWithUnsignedInteger:L'a'];
487 [NSNumber numberWithUnsignedInteger:2.0];
488 [NSNumber numberWithUnsignedInteger:2.0f];
489 [NSNumber numberWithUnsignedInteger:2.0F];
490 [NSNumber numberWithUnsignedInteger:2.0l];
491 [NSNumber numberWithUnsignedInteger:2.0L];
495 [NSNumber numberWithUnsignedInteger:0.0];
496 [NSNumber numberWithUnsignedInteger:YES];
497 [NSNumber numberWithUnsignedInteger:NO];
498 [NSNumber numberWithUnsignedInteger:true];
499 [NSNumber numberWithUnsignedInteger:false];
500 [NSNumber numberWithUnsignedInteger:VAL_INT];