[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Rewriter / rewrite-modern-container-literal.mm
blob8a52791a1df2b35b4632139d2a517c1985b11be2
1 // RUN: %clang_cc1 -x objective-c++ -fms-extensions -rewrite-objc %s -o %t-rw.cpp
2 // RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
3 // rdar://10803676
5 void *sel_registerName(const char *);
6 typedef unsigned long NSUInteger;
7 typedef long NSInteger;
8 typedef bool BOOL;
10 @interface NSNumber
11 + (NSNumber *)numberWithChar:(char)value;
12 + (NSNumber *)numberWithUnsignedChar:(unsigned char)value;
13 + (NSNumber *)numberWithShort:(short)value;
14 + (NSNumber *)numberWithUnsignedShort:(unsigned short)value;
15 + (NSNumber *)numberWithInt:(int)value;
16 + (NSNumber *)numberWithUnsignedInt:(unsigned int)value;
17 + (NSNumber *)numberWithLong:(long)value;
18 + (NSNumber *)numberWithUnsignedLong:(unsigned long)value;
19 + (NSNumber *)numberWithLongLong:(long long)value;
20 + (NSNumber *)numberWithUnsignedLongLong:(unsigned long long)value;
21 + (NSNumber *)numberWithFloat:(float)value;
22 + (NSNumber *)numberWithDouble:(double)value;
23 + (NSNumber *)numberWithBool:(BOOL)value;
24 + (NSNumber *)numberWithInteger:(NSInteger)value ;
25 + (NSNumber *)numberWithUnsignedInteger:(NSUInteger)value ;
26 @end
28 @protocol NSCopying @end
30 @interface NSDictionary
31 + (id)dictionaryWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(NSUInteger)cnt;
32 @end
34 @interface NSArray 
35 + (id)arrayWithObjects:(const id [])objects count:(NSUInteger)cnt;
36 @end
38 @interface NSString<NSCopying>
39 @end
41 id NSUserName();
43 @interface NSDate
44 + (id)date;
45 @end
47 int main() {
48 NSArray *array = @[ @"Hello", NSUserName(), [NSDate date], [NSNumber numberWithInt:42]];
50 NSDictionary *dictionary = @{ @"name" : NSUserName(), @"date" : [NSDate date], @"process" : @"processInfo"};
52 NSDictionary *dict = @{ @"name":@666, @"man":@__objc_yes, @"date":@1.3 };